News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Chrono Trigger Bugfix and Uncensoring Patch  (Read 82398 times)

KIL913

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #320 on: August 23, 2019, 10:06:45 pm »
The ones I didn't just add, of course. :P

That's the one I thought you told me about?  I see no other line other than the talk about the Black Omen?

I'm doing my second playthrough with the new update. I'll keep you posted my dude!

Cthulhu88

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #321 on: August 24, 2019, 07:40:03 pm »
Turns out the code I've been working with was DarkShock's. qwertymodo merely included his code together with the anime intro code.

This explains why even after rewriting the whole thing I am still having issues with it. I was planning to release today and get it done with, but now I am losing my mind trying to fix the fade in and fade out code.
Not sure whether I should continue to bother or just drop it, and this is just at the very beginning of the game.

While the orchestral OST surely is nice, I don't think it's worth working 2 weeks almost non-stop. It seems qwertymodo has been working on it for almost 3 years and he still has issues with MSU-1.
I'll probably just release what I've done so far. It works, the patched ROM will load with any variation of this patch and the music plays. There are issues though, like sound echoes, issues with fade ins/fade outs (I'd managed to solve most of these by simply ignoring fade ins and just ad-hoc my way to fade outs), some songs playing for a fraction of a second before being properly muted, etc.

KIL913

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #322 on: August 25, 2019, 04:08:15 am »
What are your opinions on changing:

Dark Ages > Antiquity
Badge of Courage > Hero's Badge

?

Chronosplit

  • Hero Member
  • *****
  • Posts: 1363
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #323 on: August 25, 2019, 10:56:03 am »
What are your opinions on changing:

Dark Ages > Antiquity
Badge of Courage > Hero's Badge

?
Dark Ages: It doesn't really appear that often, but Antiquity is correct.  At the same time you do eventually see why it's named the Dark Ages later on, but it's probably for the best.   
Badge of Courage: If it's still there (I remember leaving a blurb aobut it in "stuff not changed," but it doesn't appear to be there anymore), it's harmless unlike the misspelled word I fixed in there.  I honestly don't think Woolsey typo'd.  I see it as a Zelda reference to the Medal of Courage.

Turns out the code I've been working with was DarkShock's. qwertymodo merely included his code together with the anime intro code.

This explains why even after rewriting the whole thing I am still having issues with it. I was planning to release today and get it done with, but now I am losing my mind trying to fix the fade in and fade out code.
Not sure whether I should continue to bother or just drop it, and this is just at the very beginning of the game.

While the orchestral OST surely is nice, I don't think it's worth working 2 weeks almost non-stop. It seems qwertymodo has been working on it for almost 3 years and he still has issues with MSU-1.
I'll probably just release what I've done so far. It works, the patched ROM will load with any variation of this patch and the music plays. There are issues though, like sound echoes, issues with fade ins/fade outs (I'd managed to solve most of these by simply ignoring fade ins and just ad-hoc my way to fade outs), some songs playing for a fraction of a second before being properly muted, etc.
I see.  In my opinion, this is a point when you need to ask yourself whether or not it's worth re-inventing the wheel so to speak.  Even poor qwertymodo seems to be getting a bit of a burnout over this.  Honestly it's no wonder that CT is such a big project for MSU1, in it's own weird way it's kind of a testament to how important the music is in this game! :laugh:

Anyway, if you want to throw in the towel at this point I completely understand.

Cthulhu88

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #324 on: August 25, 2019, 11:21:37 am »
As promised, here is the code.

You can cross-assemble into this patch with BASS 1.4 or 1.5.

make.bat:
Code: [Select]
@echo off

set INPUT="Chrono Trigger (USA).sfc"
set SOURCE="chrono_msu1_music.asm"
set OUTPUT="chrono_msu1.sfc"

set DEFINE="BUGFIX_UNCENSOR"

if not exist %INPUT% (
    echo [ERROR] ROM not found!
    goto exit
)

if not exist %SOURCE% (
    echo [ERROR] Source code not found!
    goto exit
)

:assemble
echo [*] Copying ROM...
copy /Y %INPUT% %OUTPUT% > nul

echo [*] Assembling...

if defined DEFINE (
    bass -d %DEFINE% -o %OUTPUT% %SOURCE%
) else (
    bass -o %OUTPUT% %SOURCE%
)

:exit
echo.
pause

August 25, 2019, 11:32:42 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I see.  In my opinion, this is a point when you need to ask yourself whether or not it's worth re-inventing the wheel so to speak.  Even poor qwertymodo seems to be getting a bit of a burnout over this.  Honestly it's no wonder that CT is such a big project for MSU1, in it's own weird way it's kind of a testament to how important the music is in this game! :laugh:

Anyway, if you want to throw in the towel at this point I completely understand.

It will work on your patch as well as DarkShock's patch on vanilla, in some cases it will run even better.
However, it won't run as well as qwertymodo's latest patch.

I'll start debugging and disassembling his patch to see what he did differently for the issues that I am finding too much of a pain to fix and I'll see whether I'll continue with this or not.

My working code is up above though, if you are interested. It will fallback to vanilla music if MSU-1 is not supported or if the MSU-1 track is not present.

August 25, 2019, 02:36:24 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Just to see how much of a pain it's to compare my code against qwertymodo's without the source code:

Code: [Select]
------------------------------
[TOTAL] 18 block(s)
[SIZE]  1093 byte(s)
------------------------------

------------------------------
[BIGGEST]  443 byte(s)
[SMALLEST] 1 byte(s)
------------------------------

A ROM patched with your patch vs a ROM patched with your patch plus my MSU-1 code.

Code: [Select]
------------------------------
[TOTAL] 2025 block(s)
[SIZE]  27440 byte(s)
------------------------------

------------------------------
[BIGGEST]  1351 byte(s)
[SMALLEST] 1 byte(s)
------------------------------

A ROM patched with qwertymodo's MSU-1 patch against the original ROM.

Script I'd written to do the comparison: https://pastebin.com/mFznBz12
« Last Edit: August 25, 2019, 02:47:32 pm by Cthulhu88 »

Chronosplit

  • Hero Member
  • *****
  • Posts: 1363
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #325 on: August 26, 2019, 08:10:38 pm »
Heck, I get exactly what you mean by pain looking at those results.  Reminds me exactly of many a time I took comparing between IPS files for FFVI stuff, I only had Patch Checker at the time and looked at similar stuff.  But that's another time.

For a while I'll be looking at this.  This is honestly my first time using BASS too, so this will take some time before I can say anything one way or another.  Give me a holler if you do plan on continuing though, honestly at this point it looks like CT bugs are dwindling to... only the Dark Ages rename.  So I am in a position to set up betas of this for everyone to test.

Cthulhu88

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #326 on: August 26, 2019, 08:26:44 pm »
Heck, I get exactly what you mean by pain looking at those results.  Reminds me exactly of many a time I took comparing between IPS files for FFVI stuff, I only had Patch Checker at the time and looked at similar stuff.  But that's another time.

For a while I'll be looking at this.  This is honestly my first time using BASS too, so this will take some time before I can say anything one way or another.  Give me a holler if you do plan on continuing though, honestly at this point it looks like CT bugs are dwindling to... only the Dark Ages rename.  So I am in a position to set up betas of this for everyone to test.

I'd disassembled qwertymodo's fade in/out code last night and was in the process of reverse engineering it back into my code.
Most of the reverse engineering was done, but I needed to re-write some parts of my code to implement it in (his fade in/out code keeps jumping around addresses like the killer bunny from Monty Python).

However, I did send him a PM last night and today we talked a bit in private and he allowed me to take a look at his code. Currently I am analyzing his code and implementing some of his stuff back into mine (the NMI hook is pretty much done, which is where most of the fade in/out magic happens).

I also had implemented last night support for MSU-1 revision 2, which allows for audio resuming.
DarkShock's patch had it, but the code was kind of meh and conflicted in several ways with his fade in/out code, which is why I left resume support out of my code.

KIL913

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #327 on: August 27, 2019, 11:42:44 pm »
Replayed a second time. Sky+Dark Only still retains the mystic mentions at Ozzie's Fort. But it's just this one version.

Chronosplit

  • Hero Member
  • *****
  • Posts: 1363
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #328 on: August 28, 2019, 11:15:47 am »
Replayed a second time. Sky+Dark Only still retains the mystic mentions at Ozzie's Fort. But it's just this one version.
Wait what?  I could've sworn I had done all of them.  I apologize if you needed to go through all six versions just to verify that, I'll have that rectified ASAP.  That probably means Melchior was also unaltered.

Did you go through any of the endings?  If so, is The Oath working alright?  I don't have too much information on that one outside of my own, and editing that is a little weird so I wanted to make sure.

EDIT: Hotfix done, seems that Melchior was edited but not Ozzie's lines in that one specific version.  That was why I didn't catch it.  Also went ahead and did the Antiquity thing as it was done earlier.  Uploading to RHDN now.
« Last Edit: August 28, 2019, 12:09:51 pm by Chronosplit »

KIL913

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #329 on: August 28, 2019, 10:53:16 pm »
Wait what?  I could've sworn I had done all of them.  I apologize if you needed to go through all six versions just to verify that, I'll have that rectified ASAP.  That probably means Melchior was also unaltered.

Did you go through any of the endings?  If so, is The Oath working alright?  I don't have too much information on that one outside of my own, and editing that is a little weird so I wanted to make sure.

EDIT: Hotfix done, seems that Melchior was edited but not Ozzie's lines in that one specific version.  That was why I didn't catch it.  Also went ahead and did the Antiquity thing as it was done earlier.  Uploading to RHDN now.


Melchior is fine but the Ozzie's Fort one was still retained. I'm actually learning how to use TF so I can help out. I'll start checking on the Oath.

Chronosplit

  • Hero Member
  • *****
  • Posts: 1363
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #330 on: August 29, 2019, 10:32:47 pm »
Melchior is fine but the Ozzie's Fort one was still retained. I'm actually learning how to use TF so I can help out. I'll start checking on the Oath.
I'm sorry to deflate you a bit because I love your enthusiasm, but the thing is text-wise outside of double-checking The Oath's stability I don't think there's much left to be done at all here.  At least nothing major.  And I could be wrong, I mean I thought that before version 7.  And I'll be going on another playthrough to confirm.  But from my POV all that's left is updating Canoe (can't update that with TF at all, yeah it's partially why it's not done yet), a new HP-to-1 fix, and MSU1.

There's still the 600 AD NPC rewrite (I still need a title for that), but that's separate from all these patches (aside using one as a base).  I haven't written anything about that lately.  Mostly because I need to start fresh after the slew of text changes in 600 AD in v7.  But that will be a singular patch with a couple of addons instead, so the editing's lighter most times.
« Last Edit: August 31, 2019, 01:11:22 pm by Chronosplit »

Cthulhu88

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #331 on: September 01, 2019, 10:41:35 am »
Thanks to qwertymodo's source code I was able to implement his fade in/out and SPC muting algorithms. Result?

  • Fade in and out now work much better.
  • Better SPC muting.
  • Support for resuming tracks after combat (MSU-1 revision 2 required).

Below is the download link with the BPS and source code. The BPS was created against Bugfix+SkyDark and Name Liberties+Aerdan Item Names, but should work in any version, just run flips with --ignore-checksum if it bothers you when patching.
You can also cross-assemble it by running make.bat. Make sure bass.exe (v14) is in the same folder and also make sure your ROM (patched or not) is named "Chrono Trigger (USA).sfc".

I've also included a checksum calculator and fixer in both PowerShell and C++. I'd started with PowerShell so it could be included directly into make.bat, but even when multi-threading, PowerShell is really slow (about 10-15 seconds to patch the checksum).
Both of them are multi-threaded and support 32, 40, 48, 56 and 64 MBits HiROMs and ExHiROMs.
Source code for the C++ one is included in the checksum folder and the source code for the PowerShell one is included within make.bat.

Please, let me know of any issues. I've only tested it at early game.

You can follow the same instructions from here to convert the tracks to PCM.

Download

UPDATED: 03/09/2019
UPDATED: 14/09/2019
UPDATED: 15/09/2019
« Last Edit: September 15, 2019, 10:47:55 am by Cthulhu88 »

Chronosplit

  • Hero Member
  • *****
  • Posts: 1363
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #332 on: September 01, 2019, 10:38:44 pm »
Alright, thanks so much for your diligence Cthulhu88!  No matter what happens you've just made a huge contribution to these patches, that much I can promise you.

Calling all bugtesters, we're going to need all the help we can get!  Especially with the versions that aren't the one it's specifically made for.  I will not be adding this to the downloads just yet, but I will mirror it when needed like I did previously with Canoe.  When all looks smooth and fully documented, you'll see it in what I will call version 8 (with credit properly given, of course).

As for how this is going to be implemented and what happens after, I'll talk about that closer to time.
« Last Edit: September 01, 2019, 10:48:05 pm by Chronosplit »

Cthulhu88

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #333 on: September 02, 2019, 12:08:24 am »
Especially with the versions that aren't the one it's specifically made for.

It's made for all versions. The address spaces used are uninitialized spaces in all versions.

0x0D5D14 (85 out of 449 bytes used) = Contains the play type array (play or loop) for all tracks.
0x0DF9C8 (1054 out of 1607 bytes used) = Contains the MSU-1 code.

The reason I only did one BPS file is because I am kinda lazy ;D. You can safely patch this BPS into any other version, and if flips says this patch wasn't made for this ROM, just run it with --ignore-checksum or cross-assemble with bass.

NOTE: The only version it should not work with is Canoe. I just did a quick check and most addresses hooked by this patch have different data.

Chronosplit

  • Hero Member
  • *****
  • Posts: 1363
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #334 on: September 02, 2019, 01:44:03 am »
It's made for all versions. The address spaces used are uninitialized spaces in all versions.

0x0D5D14 (85 out of 449 bytes used) = Contains the play type array (play or loop) for all tracks.
0x0DF9C8 (1054 out of 1607 bytes used) = Contains the MSU-1 code.

The reason I only did one BPS file is because I am kinda lazy ;D. You can safely patch this BPS into any other version, and if flips says this patch wasn't made for this ROM, just run it with --ignore-checksum or cross-assemble with bass.

NOTE: The only version it should not work with is Canoe. I just did a quick check and most addresses hooked by this patch have different data.
Ah, got it!

I'm not worried about Canoe getting this at all.  The SNES Classic has no way to use the functions in native (and outside of native there's no need to use Canoe at all), so there'd be honestly no point.

Cthulhu88

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #335 on: September 02, 2019, 05:26:25 am »
Ah, got it!

I'm not worried about Canoe getting this at all.  The SNES Classic has no way to use the functions in native (and outside of native there's no need to use Canoe at all), so there'd be honestly no point.

Can't you run MSU-1 on the SNES Classic with SD2SNES? I know you can on the original SNES.

EDIT: Nevermind. Finally decided to take a close look at the SNES Classic and it doesn't even have a cartridge port.  :banghead:

September 03, 2019, 10:32:06 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Updated post with a new version.

Besides some minor improvements, I've fixed the seek macro for ExHiROM.
Lunar Address had given me the information that both 00-3F:8000-FFFF and 80-BF:8000-FFFF are shadows for the ExHiROM section, but according to bsnes' manifest, 80-BF:8000-FFFF is a shadow for the HiROM section (C0-FF:0000-FFFFFF).
As such, seek on ExHiROM works as follow now:

00-3F:8000-FFFF -> Shadow for ExHiROM banks 40 to 7D.
40-7D:0000-FFFF -> ExHiROM section.
80-BF:8000-FFFF -> Shadow for HiROM banks C0 to FF.
C0-FF:0000-FFFF -> HiROM section.

Again, let me know of any issues.
« Last Edit: September 03, 2019, 10:34:42 am by Cthulhu88 »

Chronosplit

  • Hero Member
  • *****
  • Posts: 1363
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #336 on: September 03, 2019, 04:53:07 pm »
I'm currently doing a playthrough with MSU1 but without PCM files, so someone's testing it with the original music (I do need to know how it behaves without any new sound to ensure that it's all optional, it's great with the PCM files though).  So far no bugs to report, but I'm still in 600 AD. :thumbsup:

Speaking of which, I noticed a typo in only the Bugfix+Name Liberties patches.  So we may or may not have one last hotfix patch before v8.

EDIT: Sorry, but we're also reverting Dark Ages.  I didn't quite realize that changing the string in Ages wouldn't change the time selection on the Epoch, so until such a time as that is done Antiquity is going back into the can.  I'll be looking into this for v8, it shouldn't be a problem space wise but next is finding out how.

Anyway, 7d is submitted.
« Last Edit: September 03, 2019, 09:28:52 pm by Chronosplit »

Mauron

  • Hero Member
  • *****
  • Posts: 524
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #337 on: September 03, 2019, 10:20:23 pm »
I've helped with an antiquity name change before. Let me know if you need anything else.
Mauron wuz here.

Cthulhu88

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #338 on: September 04, 2019, 05:29:12 am »
I'm currently doing a playthrough with MSU1 but without PCM files, so someone's testing it with the original music (I do need to know how it behaves without any new sound to ensure that it's all optional, it's great with the PCM files though).  So far no bugs to report, but I'm still in 600 AD. :thumbsup:

You will very likely find nothing in this regard.
All the hooks have fallbacks for MSU-1 not being supported (either the system doesn't support it or the .msu file is not found) and missing tracks. In both cases, it just executes the original code.
Only one hook doesn't have this check in place, but all the hook does is set a flag for the game's attract, which isn't used at all by the original game.

NOTE: If you want the Lavos' Theme with the "The Last Day of the World" bit like the DS version, remove track 13 and rename track 85 to 13. The SNES version only plays this version in two places, Arris Dome (recording of the Day of Lavos) and flightless Epoch pre-battle Lavos.
I've found the offsets for those two already, but haven't added code for them yet because:
1) It requires for me to restructure a part of the code for ad-hoc'ing this in.
2) The offsets change position from HiROM to ExHiROM, thus requiring ad-hoc'ing the ad-hoc.
3) I find it pretty pointless. Either choose the incomplete or complete versions as to your liking. I myself prefer the full version everywhere.
« Last Edit: September 04, 2019, 05:39:15 am by Cthulhu88 »

Chronosplit

  • Hero Member
  • *****
  • Posts: 1363
    • View Profile
Re: Chrono Trigger Bugfix and Uncensoring Patch
« Reply #339 on: September 04, 2019, 09:27:09 am »
I've helped with an antiquity name change before. Let me know if you need anything else.
Thanks a ton, you just saved me a lot of headache.  I'll shoot over a PM if I run into any trouble.

You will very likely find nothing in this regard.
All the hooks have fallbacks for MSU-1 not being supported (either the system doesn't support it or the .msu file is not found) and missing tracks. In both cases, it just executes the original code.
Only one hook doesn't have this check in place, but all the hook does is set a flag for the game's attract, which isn't used at all by the original game.
Got it, I think I've done enough without PCM to be satisfied anyway!  I trust it to be safe fallback, I just really needed to do a short round of testing it's ability to do that either way.  That means I have no real need to make this an optional addon when introduced to the patches.  Now to get started with the rigorous testing.

What this means for everyone just playing the game in the future: If you don't want to use MSU1, you can just ignore everything about it.  If you do want it, all you will need to do after applying the patch of your choice (or setting up softpatching) is to set up the PCM files, rename your patched file (for Higan there's more renaming), and make a blank msu file.  And of course, I will write up something in the readme about it.  I've got a handle on how to get this running on most options. :thumbsup:
« Last Edit: September 04, 2019, 09:33:18 am by Chronosplit »