RetroKoH / S1Fixed

A successor to ReadySonic (Bugfixes, Optimizations, Changes)
13 stars 3 forks source link

FindNearestTile LUT Non Functional when ChunksInROM is disabled #41

Closed IsoKilo closed 1 month ago

IsoKilo commented 1 month ago

When ChunksInROM is set to 0, collision fails. The issue stems from the lookup table. I'm unsure of why, but a dirty fix is to simply use vanilla Sonic 1's method of getting tile IDs:

Path: _incObj/sub FindNearestTile.asm
    if ChunksInROM=1    ; Mercury Chunks in ROM
        add.w   d1,d1
        move.w  word_1E5D0(pc,d1.w),d1
    else
        andi.w  #$FF,d1             ; MJ: keep within FF
        lsl.w   #7,d1               ; MJ: multiply by 80
    endif

This, as the comments of the subroutine mentions, is unoptimal though.

RetroKoH commented 1 month ago

Thank you for that catch. I tried convierting directly to Sonic 2's system like I did in my old build but it didn't work here. I've got some work to do in this area.