|
DevelopmentSega Master System / Mark III / Game Gear |
Home - Forums - Games - Scans - Maps - Cheats - Credits |
Slot 2 Mapping Flat Code in $00000 - $05db9 [1] RAM Code
The interrupt handle looks like this:
This is about as fast as you can dispatch a line interrupt; the only faster thing would be to always dispatch it, even for VBlanks.
The code at $de80 is copied there from $07f0 by some code at $00cc. Once in RAM, it looks like this:
This is a bit faster than performing a lookup via a register.
The game sets an HScroll on every line from $7f (or higher, when moving the horizon) to $bf. During the VBlank, it sets the line interrupt register to the start line number (as stored at ROM address $c191), then polls waiting for line $b7. One that is hit (in the following frame), it sets the line interrupt register to zero, causing the next line interrupt to happen at the desired line, then on every line after that. It spends a lot of its time in the line counter polling.
The game loads a large quantity of tiles while the game is running - notably, at the start, it only has tiles for a straight road as it is using a lot of space for the START banner, so it loads the necessary tiles over the course of several seconds while on the initial straight. These seem to be decompressed incrementally, updating a small amount of data during each VBlank.