Optimize rendering and add faster fixed-step walking
This commit is contained in:
1 parent
3f9244962b
commit
6f9e6b5ca5
3 files changed
+578
-33
No files matched your search
@@ -55,6 +55,12 @@ Those numbers mean red, green, and blue, each from 0 to 31. Try `RGB(29, 6, 6)`
|
||||
|
||||
Graphics are drawn into a RAM buffer first. Only the changed spans of each row are copied to the GBA screen during VBlank, so walking does not expose a half-erased character. Full map changes are copied while the display is temporarily blanked.
|
||||
|
||||
The active map's scenery is cached in a separate 76,800-byte RAM buffer. Walking and dialogue cleanup copy background rows from that cache instead of recalculating every pixel. The cache rebuilds when maps change; opening or closing an exterior door updates only its 13×18-pixel patch. Actors and UI are never stored in the scenery cache.
|
||||
|
||||
Sprite artwork is decoded once into cached palette indices. Character and creature bodies are drawn directly in clipped rows, with dirty-region tracking once per source row instead of a rectangle operation per opaque pixel. Mirroring, transparent pixels, dynamic palettes, and scaled battle sprites use the same renderer.
|
||||
|
||||
Movement has a separate 60 Hz fixed-step clock using cascaded GBA timers 2 and 3, independent of rendering. Walking is two pixels per tick (120 pixels/second), with normalized diagonal speed. Every pixel is collision-checked and recorded for Sprout and grass encounters, so faster movement does not skip walls or map exits or double the following distance. Missed updates can catch up by at most five ticks; older backlog is dropped after a long stall. Menus, conversations, battles, and map-loading time do not build up movement backlog. The existing footstep artwork is unchanged, with its phase now clocked by simulation ticks rather than rendered frames.
|
||||
|
||||
## Saving your partner and items
|
||||
|
||||
Receiving Sprout or Finn's Poké Balls automatically writes a small cartridge SRAM save, stored by mGBA alongside the ROM as `game.sav`. Keep that file to retain your partner and item count after reopening the game. Older Sprout-only saves remain compatible. Partner ownership, the ball count, and whether Finn's gift was claimed are saved, but your map and position are not. The golden-creature battle is a repeatable practice battle with two moves, health bars, victory, defeat, and running away. Sprout recovers afterward. Experience and catching creatures are not implemented yet.
|
||||
|
||||
Reference in new issue
Block a user