Skip to content

0.4.8

Choose a tag to compare

@YuutaTsubasa YuutaTsubasa released this 21 Oct 18:42
· 31 commits to main since this release

This release lays the groundwork for replacing the 32X's graphics: the characters, the HUD, objects and the title screen (Issue #35). Nothing changes in play yet. The next step is replacing sprites with PNG files.

  • Sprite drawing is recorded. The 32X layer is drawn in software by the master SH-2, through three blitter routines: unscaled, scaled, and the sine-warped one behind the waving SEGA logo. New record-only hooks in those routines log every sprite drawn each frame:

    • which graphic it is (bank and frame in the game's sprite table, which stays the same across levels);
    • where it is drawn, its flips, scale and colour offset.

    The hooks read the machine and change nothing in it. The recompiled code and the interpreter call them at the same points, so lockstep validation is unaffected. They are not installed during normal play.

  • The 32X layer can be redrawn exactly. The program can rebuild the 32X sprites from those records and the graphics' own data, reproducing the three blitters exactly, flips, scaling rounding and clipping included. Without replacements, the rebuild equals what the game drew, byte for byte:

    • checked in Botanic Base, Speed Slider, Amazing Arena, Techno Tower, Marina Madness, the hub, the bonus stage, the special stages, the title and menus, and the attract demo, with random input, in widescreen and 4:3;
    • also checked against the game's own blitter code with 20,000 random calls.

    Replacing a graphic will go through this same rebuild.

  • For modders and developers: chaotix_headless has new options:

    • --sprites-log FRAME,... lists each sprite drawn in those frames (bank, frame, position, flags, scale);
    • --sprites-check runs the comparison every frame;
    • --sprites-oracle runs the random-call check.

    How the 32X layer is drawn, now verified by the rebuild: docs/SPRITES_32X.md.

Found along the way, not fixed yet: in a widened level, a fill starting at a line's first column also clears that line's widescreen margins, so in Marina Madness it can erase sprite pixels already drawn in the margins.

Validation:

  • Windows: all 40 CTest cases pass, 9 of them new. They cover the recorder and rebuild in six scenes, the random-call check, and two lockstep runs with the recorder on both machines.
  • Lockstep: 33 lockstep runs with random input (every special stage, levels, the bonus stage, the hub) are bit-identical. So are runs with the recorder and the comparison active.
  • Speed: no measurable cost with the recorder off (as in normal play), and about 2% with it on.
  • Linux: all 37 Linux CTest cases pass.
  • Packages: the packaged Windows and Linux builds pass the startup tests.
  • Android: the APKs have not been tested on a device for this release.

Downloads: the Windows x64 zip, the Linux x64 tar.gz, and two Android APKs: arm64-v8a/x86_64 (the usual one) and armeabi-v7a (32-bit ARM). Both APKs use version code 21 and the same signing certificate as 0.4.7, so they update in place.

You must supply your own Knuckles' Chaotix (Japan, USA) ROM. No ROM image or game assets are included.