11 March 2016 - Forum Rules
Started by yugisokubodai, May 12, 2023, 11:58:33 PM
- BIT $4212 BVC -
Quote from: Everything on May 23, 2023, 03:10:07 PMHere are a couple of ideas, just comparing your code to IRQ handlers in a couple of other commercial games. I don't have real hardware to test on so I'm not sure if any of these will solve the problem but maybe something here will help. I don't understand your code completely, so I apologize if I'm on the wrong track.Try moving LDA $4211 from clear_irq to just before the line JSR frame_color_setting. It seems like it's good to reset the IRQ timer as early as possible in the IRQ handler.Just before LDA $2137 (or maybe before JSR frame_color_setting), try waiting for hblank by insertingCode Select Expand- BIT $4212 BVC -I think this ensures that you're not modifying any hardware registers mid-scanline. Based on comments in the Zelda 3 source code, it looks like it might also avoid conflicts with HDMA.You may want to try a different approach where you set $4209 during each IRQ to set the scanline when the next IRQ takes place. In this way you can trigger several IRQs per frame at specific scanlines and modify the color window settings appropriately during each one. Inside your IRQ handler you can read $213D to determine which scanline you are currently at.
Page created in 0.057 seconds with 19 queries.