All of the sprite rendering has been deferred down to the level of
the tile drawing. Sprites are no longer drawn/erased, but instead
a sprite sheet is generated in AddSprite and referenced by the
renderer.
Because there is no longer a single off-screen buffer that holds
a copy of all the rendered sprites, the TileStore size must be
expanded to hold a reference to the sprite data address fo each
tile. This increase in data structure size require the TileStore
to be put into its own bank and appropriate code restructuring.
The benefits to the rewrite are significant:
1. Sprites are never drawn/erased off-screen. They are only
ever drawn directly to the screen or play field.
2. The concept of "damaged" sprites is gone. Every dirty tile
automatically renders just to portion of a sprite that it
intersects.
These two properties result in a substantial increase in throughput.
There is enough room in the 32-byte exception handler to inline the
9-byte epilogue when generating the code sequence for mixed BG1/BG0
rendering.
This code sequence is generated once and run for as many frames as the
word appear on screen, so saving an uncondition branch (3 cycles) at the
cost of 60 cycles is probably worth it.
* Moved V-flag handling outside of the 32-byte exception handler
* Switched relative branches to JMP to save a cycle per word
* Updated macros to create a full code snippet instead of assuming
certain values exist in the exception handler buffer
* Tiled tile animations read from TSX files
* Hooks for initialization generated by the tiled export tool
* Animated tiles implements with dynamic tiles backed by 2KB of direct
page space in Bank 00
* Animation resolution limited to 1/60th incremenents
TODO
* Fix crasher in the _DoScriptSequ timer callback
* Fix single-line of garbage on the top line of the dynamic tiles
The core data tables were reworked to pre-reverse all of the
entries to directly match the right-to-left ordering of the code
fields. This simplified some code but was required for register
reuse in the masked tile renderer.
Also fixed several offset calculation issues in the masked tile
renderer.
Need to have the called provide a copy of the base line address to the
masked drawing code and need to verify that the JTable entries are
ordered the same way as the byte offset so the same register can be used
to load the JMP addresses and patch in the LDA (DP),y instructions.