[SNES] Chrono Trigger Patches

Europia79

New Challenger
Level 0
29%
Joined
Jan 8, 2025
Messages
7
Level up in
17 posts
Reaction score
12
Points
2
I have literally patched thousands upon thousands of romhacks & translations and there is always a few "problem patches" with various kinds of issues. Probably the most common issue I think is simply that RHDN &/or the documentation has incorrect information & patching instructions. And I think that's possibly what I'm dealing with here.


I'm trying to patch Chrono Trigger Impossible for the SNES, and I want an exact byte-for-byte copy of what the author intended. So, these SNES patches sometimes require a 512 byte Header, and sometimes they do not. Most of the time, I can simply patch BOTH and see which ones doesn't work. However, in this case, they BOTH work, so I'm at a loss as to which one is actually correct here ?

The ips patch is 4415 bytes. The Headered version produces a difference of 1120 bytes with CRC-32 9892127E (header removed after patching), while the Headerless version has a difference of 1742 bytes with a CRC-32 of 31F48D0A. And between them, there's a 2715 byte difference.

Anyways, this question is both specifically referring to the Impossible mod, as well as all of Chrono Trigger hacks in general (since it's likely that I'm going to encounter this same issue with other CT patches).

Since I've noticed that CDRomance has prepatched ROMs, I was hoping someone here had the technical expertise to help out ?

Otherwise, it looks like I'll be forced to reference the IPS file format and write my own parser that counts the number of writes (in bytes) it's making and compare that with the above differences ?

Thanks,
Euro
Post automatically merged:

Based on https://zerosoft.zophar.net/ips.php

And:
Bash:
#!/bin/bash
file="patch.ips";
eof="454F46";

declare -i index=5;
declare -i count=0;
while true
do
    offset=$(xxd -ps -s ${index} -l 3 "${file}");
    index+=3;
    size=$(xxd -ps -s ${index} -l 2 "${file}");
    index+=2;
    data=$(xxd -ps -s ${index} -l 0x${size} "${file}");
    index+=0x${size};
    count+=0x${size};
    
    echo "--------------------";
    printf "index: '%x'\n" ${index};
    printf "offset: '%x'\n" 0x${offset};
    printf "size: '%x'\n" 0x${size};
    echo "data: '${data}'";
    echo "count: '${count}'";
    
    if [ -z "$data" ]; then break; fi;
done
echo "--------------------";
echo "count: '${count}'";
exit 0;

I'm guessing that the Unheadered ROM is the correct one to use ?
Despite the patching instructions saying to use a Headered ROM ?
 
Last edited:
Okay, I modified my approach and things quickly become readily apparent & crystal clear:

Bash:
#!/bin/bash
# cmp 'parent_baserom' 'hack' | wc -l
# smc_diff=1120;
# sfc_diff=1742;
ips_file="patch.ips";
sfc_file="Chrono Trigger (USA).sfc";
smc_file="Chrono Trigger (USA).smc";
eof="454F46";

declare -i index=5;
declare -i count=0;
declare -i sfc=0;
declare -i smc=0;
while true
do
    offset=$(xxd -ps -s ${index} -l 3 "${ips_file}");
    index+=3;
    size=$(xxd -ps -s ${index} -l 2 "${ips_file}");
    index+=2;
    data=$(xxd -ps -s ${index} -l 0x${size} "${ips_file}");
    index+=0x${size};
    count+=0x${size};
    
    if [ -z "$data" ]; then break; fi;
    
    sfc_string="";
    sfc_data=$(xxd -ps -s 0x${offset} -l 0x${size} "${sfc_file}");
    for (( n=0; n < (( 0x${size} * 2 )); n+=2 ))
    do
        if [[ "${sfc_data:$n:2}" == "${data:$n:2}" ]]
        then
            sfc+=1;
            sfc_string="${sfc_string}${sfc_data:$n:2}";
        else
            sfc_string="${sfc_string}--";
        fi
    done
    
    smc_string="";
    smc_data=$(xxd -ps -s 0x${offset} -l 0x${size} "${smc_file}");
    for (( n=0; n < (( 0x${size} * 2 )); n+=2 ))
    do
        if [[ "${smc_data:$n:2}" == "${data:$n:2}" ]]
        then
            smc+=1;
            smc_string="${smc_string}${smc_data:$n:2}";
        else
            smc_string="${smc_string}--";
        fi
    done
    
    echo "--------------------";
    printf "index: '%x'\n" ${index};
    printf "offset: '%x'\n" 0x${offset};
    printf "size: '%x'\n" 0x${size};
    echo "data: '${data}'";
    echo " sfc: '${sfc_string}'";
    echo " smc: '${smc_string}'";
    echo "count: '${count}'";
    
done
echo "--------------------";
echo "count: '${count}'";
echo "sfc: '${sfc}'";
echo "smc: '${smc}'";
exit 0;
 

Attachments

The patch might strip the header or account for it. The header doesn't change anything except memory addresses. If it's byte for byte, then it's byte for byte.
 
Beware: There have been no replies in this thread for 90 days.
Keep that in mind when expecting a reply from the people on it,
You can also start a new thread instead. This is just a heads-up, bumping is allowed in this forum.

Users who are viewing this thread

Connect with us

Support this Site

RGT relies on you to stay afloat. Help covering the site costs and get some pretty Level 7 perks too.

Latest Threads

FREE Games

"Don't Waste $80. These Amazing Games Were Free!"
Some Free Games for you:
Read more

Who would’ve thought that one tiny update would enrage many people.

Yeah Im talking about the recent update for Mario Kart World. And I think people are just highly...
Read more

What Game

On the 32X you think was impossible on any other system at the time? like couldn't have been...
Read more

Bad games that became iconic (in a good way)

Sometimes a bad game becomes iconic despite its flaws. Maybe because of nostalgia or because...
Read more

Easiest console to emulate through Android/Best kinds of games for touch controls

Since getting my galaxy, it seems Android has more console specific emulators than Apple does...
Read more

Phantasy Star 4 situation is crazy

I just found out Phantasy Star 4 cost like a hundred bucks on release. Imagine this guys. Any of...
Read more

Ever used the "Boycott Advance" emulator?

Boycott-Advance-GBC-Emulator-GBA-Emulator-Pic-04.jpg

The year was 2005 (I'm fairly sure) and I had just finished Pokemon Crystal...
Read more

Super Sentai fan thread

Welcome to Super Sentai Fan Thread!
Read more

Online statistics

Members online
129
Guests online
150
Total visitors
279

Forum statistics

Threads
9,660
Messages
239,033
Members
761,544
Latest member
Kryphen

Advertisers

Back
Top