Missed Interrupts with DI+IM2 in assembly

The place for codemasters or beginners to talk about programming any language for the Spectrum.
krt17
Berk
Posts: 7
Joined: Wed Nov 22, 2017 6:54 pm

Re: Missed Interrupts with DI+IM2 in assembly

Post by krt17 » Sun Nov 26, 2017 12:51 pm

Method 2
The basic idea is to store the checksums for all the blocks in which the reading through the stack is used. The interrupt routine considers the block checksum (add as a rule) and restores the value on the stack. Requires a little more memory (for checksums) and spends more tacts (~1400) in each interrupt. Usually blocks of 128 bytes are used. If it's not clear I can write a sample code.
0 x

Ralf
Microbot
Posts: 121
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Missed Interrupts with DI+IM2 in assembly

Post by Ralf » Sun Nov 26, 2017 1:07 pm

And I'd like to add one more, maybe obvious thing - you don't have to play music in interrupt routine :)

You can do it anywhere in your code, just do it during each frame. Some purists may say that if you call music player sometimes at frame beginning and sometimes at frame end then there would be loss of music quality. But I did it in my games before and nobody noticed and complained ;)
0 x

User avatar
1024MAK
Berk
Posts: 49
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Missed Interrupts with DI+IM2 in assembly

Post by 1024MAK » Sun Nov 26, 2017 7:12 pm

Ast A. Moore wrote:
Sun Nov 26, 2017 12:46 pm
1024MAK wrote:
Sun Nov 26, 2017 12:27 pm
The Z80 CPU will only detect a maskable (normal) interrupt when it samples the /INT pin at the end of an instruction (assuming that /RESET, /BUSRQ and /NMI are all inactive
Tut-tut. Use the Force (of BBCode), Mark. It’s INT, RESET, BUSRQ, and NMI. :D
Yeah, I know :?
But I composed this post off-line in a text editer. Then had to post in a rush, as channel 4's formula 1 coverage was about to start and I had a few other things to do before sitting down to watch it and eat lunch...

Mark
0 x

User avatar
Ast A. Moore
Dizzy
Posts: 70
Joined: Mon Nov 13, 2017 3:16 pm

Re: Missed Interrupts with DI+IM2 in assembly

Post by Ast A. Moore » Sun Nov 26, 2017 7:53 pm

1024MAK wrote:
Sun Nov 26, 2017 7:12 pm
Ast A. Moore wrote:
Sun Nov 26, 2017 12:46 pm
1024MAK wrote:
Sun Nov 26, 2017 12:27 pm
The Z80 CPU will only detect a maskable (normal) interrupt when it samples the /INT pin at the end of an instruction (assuming that /RESET, /BUSRQ and /NMI are all inactive
Tut-tut. Use the Force (of BBCode), Mark. It’s INT, RESET, BUSRQ, and NMI. :D
Yeah, I know :?
But I composed this post off-line in a text editer. Then had to post in a rush, as channel 4's formula 1 coverage was about to start and I had a few other things to do before sitting down to watch it and eat lunch...

Mark
You humans are so weird. You watch TV and each lunch. So bizarre.
0 x
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.

User avatar
keith56
Berk
Posts: 6
Joined: Mon Nov 13, 2017 9:23 pm

Re: Missed Interrupts with DI+IM2 in assembly

Post by keith56 » Sun Nov 26, 2017 9:55 pm

Thanks for everyone's feedback - it saves me searching spectrum documentation for a solution that does not exist!

I will look at rewriting my code to reduce the number of DI's required, and force the music to update if has not been updated recently to get it playing as consistently as I can.
0 x
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter for CPC - http://www.chibiakumas.com
「チビ悪魔」可笑しいゴシックSTG: http://www.chibiakuma.com
Chibi Akumas Episode 2:Confrontation for CPC ...Out Now!

Post Reply