What I have here is a version of Sonic 2 that doesn't use the vertical interrupt at all. It instead relies entirely on the horizontal interrupt to do both page and line code.
Here's the source code and ROM:
http://uploading.com...4f1c1/s2hint.7z
I have an issue with the horizontal interrupt timing though. I have battled with this for a while now, and I cannot for the life of me figure out what is going on. I've read every VDP document known to man, many times over. I've debugged the heck out of my ROM.
In Regen, set a breakpoint for a write to address FFF520. Go to Aquatic Ruin 1. When the debug window pops up, you can use this guide to see what's going on:
D0 = current VH pos
D2 = previous line interrupt VH pos
D4 = previous page interrupt VH pos
D5 = interrupt count
D6 = Hint_counter_reserve value
D7 = interrupt type (0 = first page, 2 = page, 3 = line)
The interrupt count (D5) will tally up how many times an interrupt has occurred when the Hint flag (Hint_enable) is on. Take a look at when D5 is equal to 0x5E:
D0 = DF17 (this interrupt has occurred on line DF)
D2 = DF79 (previous line interrupt occurred on line DF)
D4 = DF76 (previous page interrupt occurred on line DF)
D5 = 005E (interrupt number 5E)
D6 = 8ADF (reserve DF)
D7 = 0002 (do a page interrupt)
Now take a look at when D5 is equal to 0x5F:
D0 = E6A6 (this interrupt has occurred on line E6)
D2 = DF79 (previous line interrupt occurred on line DF)
D4 = DF77 (previous page interrupt occurred on line DF)
D5 = 005F (interrupt number 5E)
D6 = 8ADF (reserve DF)
D7 = 0002 (do a page interrupt)
The problem here is the 5F interrupt is occuring when the VH pos (D0) is E6xx. It should never be anything higher than DFxx. Everything is working up until this frame. But when you look at the Hint_counter_reserve (D6), it still says 8ADF.
Naturally, I begin to think that somewhere else in my code register 10 is getting changed. However, I can't figure out where. I can't figure out how. Unfortunately, Regen can't trace writes to the VDP registers which would probably be the key to this whole thing. All I can figure out so far is having an interrupt at E6xx is wrong!
Here's what the problem looks like in the game:
If the H-int timing gets thrown off as demonstrated earlier, then the game will do what it's doing in the video.
I've been trying to fix this for a month now. Is anyone out there willing to take on the challenge and see if they can get the H-int timing working properly? I know it's a challenge, but I'm hoping some of you will like the challenge and what to take a crack at getting the H-int to handle everything as intended.
Here's the source code and ROM:
http://uploading.com...4f1c1/s2hint.7z
I have an issue with the horizontal interrupt timing though. I have battled with this for a while now, and I cannot for the life of me figure out what is going on. I've read every VDP document known to man, many times over. I've debugged the heck out of my ROM.
In Regen, set a breakpoint for a write to address FFF520. Go to Aquatic Ruin 1. When the debug window pops up, you can use this guide to see what's going on:
D0 = current VH pos
D2 = previous line interrupt VH pos
D4 = previous page interrupt VH pos
D5 = interrupt count
D6 = Hint_counter_reserve value
D7 = interrupt type (0 = first page, 2 = page, 3 = line)
The interrupt count (D5) will tally up how many times an interrupt has occurred when the Hint flag (Hint_enable) is on. Take a look at when D5 is equal to 0x5E:
D0 = DF17 (this interrupt has occurred on line DF)
D2 = DF79 (previous line interrupt occurred on line DF)
D4 = DF76 (previous page interrupt occurred on line DF)
D5 = 005E (interrupt number 5E)
D6 = 8ADF (reserve DF)
D7 = 0002 (do a page interrupt)
Now take a look at when D5 is equal to 0x5F:
D0 = E6A6 (this interrupt has occurred on line E6)
D2 = DF79 (previous line interrupt occurred on line DF)
D4 = DF77 (previous page interrupt occurred on line DF)
D5 = 005F (interrupt number 5E)
D6 = 8ADF (reserve DF)
D7 = 0002 (do a page interrupt)
The problem here is the 5F interrupt is occuring when the VH pos (D0) is E6xx. It should never be anything higher than DFxx. Everything is working up until this frame. But when you look at the Hint_counter_reserve (D6), it still says 8ADF.
Naturally, I begin to think that somewhere else in my code register 10 is getting changed. However, I can't figure out where. I can't figure out how. Unfortunately, Regen can't trace writes to the VDP registers which would probably be the key to this whole thing. All I can figure out so far is having an interrupt at E6xx is wrong!
Here's what the problem looks like in the game:
If the H-int timing gets thrown off as demonstrated earlier, then the game will do what it's doing in the video.
I've been trying to fix this for a month now. Is anyone out there willing to take on the challenge and see if they can get the H-int timing working properly? I know it's a challenge, but I'm hoping some of you will like the challenge and what to take a crack at getting the H-int to handle everything as intended.
This post has been edited by saxman: 15 November 2012 - 02:39 PM


00