IY and the interrupt

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: IY and the interrupt

Post by RMartins »

Yep, "weird" is the right choice of words.

It can surely baffle the casual or beginner ZX ASM programmer.

A "veteran" Z80 asm programmer will know that there is no instrution
INC (nn)
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: IY and the interrupt

Post by dfzx »

Here's the result of my aforementioned dicking around:

[youtube]https://youtu.be/DW1viKMx5T0[/youtube]

I think you'll all agree that's dead useful! :D

The interrupt routine which animates the coin is written in C, using z88dk. It currently needs a tweaked z88dk runtime library because the default one switches the interrupt back to IM1 when the C program exits. But I'm going to fix that and give AA a pull request. :)
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: IY and the interrupt

Post by R-Tape »

Very cool.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: IY and the interrupt

Post by Ast A. Moore »

Neat. I seem to remember a similar trick with a line of scrolling text made out of screen attributes. Was pretty jaw-dropping the first time I saw it.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: IY and the interrupt

Post by dfzx »

Ast A. Moore wrote: Thu Jan 04, 2018 8:03 pm Neat. I seem to remember a similar trick with a line of scrolling text made out of screen attributes. Was pretty jaw-dropping the first time I saw it.
Yeah, I saw that too! In fact, that's what I intend to try next! :)

And on that topic I need a new thread...
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: IY and the interrupt

Post by RMartins »

dfzx wrote: Thu Jan 04, 2018 7:27 pm ...
I think you'll all agree that's dead useful! :D

The interrupt routine which animates the coin is written in C, using z88dk. It currently needs a tweaked z88dk runtime library because the default one switches the interrupt back to IM1 when the C program exits. But I'm going to fix that and give AA a pull request. :)
I would suggest that you either use XOR for placing the sprite, or correctly mask the thing against the already existing image.
It will look way nicer :)

And if you are careful (check if the screen data changed between updates ) you can make it pixel correct, even if "someone" else is messing with the screen.
Post Reply