Horizontal Interruption Mystery

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Horizontal Interruption Mystery

Post by greatkreator » Mon Jan 03, 2022 6:24 pm

After trying to dig a bit deeper into VDP's horizontal interruption I found an interesting thing: when you enable horizontal interruption in the reg #0 one interrupt is fired immediately after that and another interrupt happens as expected with the delay set in the reg #10. Does anyone have any ideas what can it be?

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: Horizontal Interruption Mystery

Post by Mask of Destiny » Mon Jan 03, 2022 9:20 pm

Both horizontal and vertical interrupts have an interrupt pending flag. This flag gets set if the necessary condition (hint counter expiring/end of frame) is hit even if the corresponding interrupt is disabled. If the interrupt is enabled when the pending flag is already set, it will fire almost immediately. Short of switching to Mode 4 and reading the status port, there is no way to manually clear these flags once set.

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Re: Horizontal Interruption Mystery

Post by greatkreator » Tue Jan 04, 2022 11:53 am

Thanks for the interesting information!

Post Reply