Focusing on offering RoSoDude’s ATB & CTB enhancement patches on top of an already assembled romhack of the game they’re coded for. The goal is to make them version-agnostic, even though the 2 patches are created for 2 different base files.
Changes made to the source code by the “Comprehensive ATB Enhancement”, v1.0 versus v1.1
Unexpectedly, the exact same number of bytes are changed in both patches, at the exact same locations. Whatever differences exist in the 2 versions of the base file, it must be expressed by the actual bytes that are edited.
Only 2 bytes are different between these patches. Only 2 bytes need to differ to align with whatever underlying differences exist in the 2 versions of the base file.
base file v1.0 | base file v1.1 | change location in base file |
---|---|---|
$3B | $38 | |
$69 | $66 | @ $01953F |
Upon further analysis, the first difference occurs in the header of the patch files (!) so this is not of interest to the task at hand— making the 2 versions of the base file agree after modification, so that only 1 version of this patch is needed.
Only the value at $01953F is discrepant between the 2 versions of this patch, which suggests that the 2 base files’ logic is somehow different in a routine at this location.
The author of this work clued me in to what’s happening, and helped me correct some errors in my initial analysis (hi, RoSoDude).
Here is the disassemly of the differences between the patches— I was wrong that the first byte occurs in the header, it’s actually an offset to a routine that varies between base files.
; for 1.0 US ROMs
; org $C1953B
; C1953B: JSL animationStart
; C1953F: BEQ $12
; C19541: JSR $9569 ; Execute Battle Script
; C19544: JSL animationStop
; for 1.1 US ROMs
org $C19538
C19538: JSL animationStart
C1953C: BEQ $12
C1953E: JSR $9566 ; Execute Battle Script
C19541: JSL animationStop
The 2nd byte that’s different is also a change of 3 (from $69 to $66, like from $3B to $38) so it seems like the v1.1 of the rom base file is shifted backwards by 3 bytes! I’m learning a lot about the Final Fantasy 6 SNES rom from comparing the versions of this hack.
Interestingly, RoSoDude has already adapted this patch to work with the modified base file. So I can also analyze this patch, and see how it differs from the first two that are intended for the original rom.
These offsets and totals of bytes changed at each look identical to the v1.1 of the original patch. Yet I know there’s a distinction in some of the content because this special version exists to prevent a bug that was reported when the original was used over a modified rom.