Chrono Compendium

Kajar Laboratories - Fan Works and Submissions => Chrono Cross Modification => Topic started by: prizvel on November 09, 2017, 02:12:15 pm

Title: Tutorial for itoikenza: how to delete music from battle
Post by: prizvel on November 09, 2017, 02:12:15 pm
video tutorial: https://youtu.be/iR5AWE-AovE (https://youtu.be/iR5AWE-AovE)
all you need on this site:
Purple Cat Tools 0.3: https://www.chronocompendium.com/Term/Utilities_(PSX).html
ccScript.rar https://www.chronocompendium.com/Term/Utilities_(PSX).html
lzss.exe http://chronofan.com/Black/Other/utunnels_utils.zip
decpt cpt: https://www.chronocompendium.com/Forums/index.php?topic=10927.msg224113#msg224113
isobuster: https://www.google.ru/search?q=isobuster&oq=isobuster&aqs=chrome.0.0l6.3255j0j7&sourceid=chrome&ie=UTF-8
Fieldscript_Notes: https://www.chronocompendium.com/Term/Chrono_Cross_Fieldscript_Notes.html
Locations number: https://www.chronocompendium.com/Term/Chrono_Cross_Location_Files_and_General_Notes.html

Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 13, 2017, 09:23:48 pm
prizvel. can this be done to Danetta's Single.bin? i think there will be a conflict with disk 2 battles...
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: prizvel on November 14, 2017, 03:03:24 am
prizvel. can this be done to Danetta's Single.bin?
Yes, if you have tablefile from single.bin. In the PurpleCatTool folder is a table of the original disks. For mod disks need a new table.
i think there will be a conflict with disk 2 battles...
There will be no conflict. Just this procedure should be done for each disk separately
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 14, 2017, 06:17:32 am
Is it easy to make a table file? Can i just look at the locations in an unmodded version? In a hex editor? Compare. Then change accordingly? btw, i don't have any free time to attempt this till friday... my day off from work!
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: prizvel on November 14, 2017, 11:54:13 am
Quote
TOC
The Table of Contents (hereafter TOC) is literally the most important file to work with for purposes of Chrono Cross modification. It is essentially a giant pointer table that the game engine uses to determine where every file begins and ends, and occupies 12 sectors beginning at sector 24 (offset 0xc000 in an ISO, offset 0xdcc8 in a BIN).
The TOC entries have a four byte stride and can be presented thus:
SS SS FS BB
Where...
S = "Logical Sector"; 2.5-byte little-endian pointer indicating the sector boundary on which the file begins.
F = "Flag"; the first bit of this nybble will be set if and only if this TOC entry is a duplicate of the next real record.
BB = Number of zeroed buffer bytes between the end of the file and the next sector boundary, divided by 8.
For instance, the entry for file 0001 is 4E 01 00 F7. To find the starting location of this file in a CD image, we first reverse the first 2.5 bytes (yielding 0x0014e) then multiply the result by 2048 for an ISO image (= 0xa7000) or by 2354 for a BIN (= 0xbff3c, then add an additional 24 to account for the sector header, giving a final total of 0xbff54).
It is possible to write a program, but I'm not a programmer
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: alfadorredux on November 15, 2017, 08:25:57 pm
The Purple Cat Tools table files aren't complicated. The tables for version 0.3 are just lists of [filename],[location in ISO]. For instance, let's look at the entry for file 0001:

0001.boot.cfg,0x000A7000

That tells us that the file is named "0001.boot.cfg", and it starts at byte 0x000A7000 in an ISO image of the game disc. The passage prizvel quotes above explains how to derive the 0x000A7000 from the disc's TOC, and where to find the TOC in a disc image. Creating a new disc table just requires a hex editor to view the TOC, a calculator that understands hex, and a lot of patience.  (I seem to remember that utunnels once managed to dump a disc for an entirely different Squaresoft PSX game using Purple Cat Tools and a custom table, a very long time ago.)

Version 0.4 of Purple Cat Tools doesn't even require the addresses, just a list of filenames, but I never really finished it, so some of the scripts are buggy.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 15, 2017, 08:56:49 pm
Wow, alfadorredux. i dismissed prizvel's post. Thanks. i have all day tomorrow to do this. Heck yeah! Sorry prizvel. you scared me when you said "not a programmer" Hex ediors and hex calculation is right up my alley. Look out for my "BattleThemeSameAsRoom.bin"!!!
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: prizvel on November 16, 2017, 05:33:38 am
In table ~5000 records. I do not thought that someone wants to do it manually. For my single disk, I used the script for Excel, but even with him it took me a long time
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 16, 2017, 06:52:38 am
Haha! Yeah! i am getting ready to do it right now! Should be done by end of today!
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: prizvel on November 16, 2017, 07:38:42 am
Haha! Yeah! i am getting ready to do it right now! Should be done by end of today!
You're crazy) but if so, please upload the result))
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 16, 2017, 08:20:46 am
Of Course. I will upload my mod. And Hey i know i am Crazy. But PurpleCatTools v0.3 is missing the .bat files. You used in the video.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: prizvel on November 16, 2017, 08:29:15 am
PurpleCatTools v0.3 is missing the .bat files. You used in the video.
Yes, I wrote them myself, so in the video I show what is written in them.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 16, 2017, 10:36:05 am
Ok but you don't use "builder.bat" what is that?

Nevermind. I see where you rebuilt the image with "builder.bat" in the video.

UPDATE: Damn! my .img from an emu site is eff'd up. it doesn't have all the Same TOCs. i tried to look at that .img in a hex editor from the last 5617.out. but 5613 is different in my .img... i gotta use iso buster to make a good image of CC myself. but i forgot how. This is gonna have to wait till i get another day off! IT CANNOT BE THANKSGIVING!!!
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: alfadorredux on November 16, 2017, 08:13:45 pm
Some thrashing around in disused corners of my hard drive found some old scripts that may be of use in TOC generation. In particular, the "test.pl" script inside the zip seems to be set up to generate a Purple Cat Tools 0.3 style TOC file from a .bin disc image. You'll need to replace the bit in line 3 that says [CD image file] with the actual name of your file, since I never set it up to take parameters. You may want to change the output filename in line 18 to something other than out_addrs_j.csv, too.

I don't even remember writing this, although I guess that isn't surprising after ~10 years. Good thing I'm a digital packrat, or it would have vanished a long time ago.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 18, 2017, 03:36:01 pm
How do i use this exactly? A v0.3 .bat?
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: alfadorredux on November 19, 2017, 09:53:35 pm
(mutter mumble Windows sigh)

The normal syntax for running a Perl program is "perl [filename].pl".  If you've been running Purple Cat Tools at all, you have Perl installed, since I released the software as raw scripts.  So in this case you would:

1. Unzip the files.
2. Make the changes I described to "test.pl" using a text editor (not a word processor).  If Notepad runs everything together on one line, try Notepad++ (https://notepad-plus-plus.org/) instead.
3. Open a command prompt in the directory holding test.pl, and type "perl test.pl".
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 20, 2017, 04:53:12 pm
i got "ActivePerl 5.24.2 Build 2403 (64-bit)" And thanks... i have today off but this project is time consuming! is there any way you can write a script? to automate this tedious hexediting process? Also utunnels' "unpackcpt.exe" doesn't unpack .weap at all!? i get a 1 sec "cmd.exe" prompt that says.... "not a cpt file...." "invalid number of sections...."
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: prizvel on November 22, 2017, 07:28:52 am
"not a cpt file...." "invalid number of sections...."
As long as I remember, the weap file has one null entry in the header. You can manualy edit heder, but I have not tested this
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 22, 2017, 06:02:18 pm
Is it the very first byte? Or what? If so, can i just delete it? And save the file, with one less byte?
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: prizvel on November 24, 2017, 03:59:14 pm
Is it the very first byte? Or what? If so, can i just delete it? And save the file, with one less byte?
I was unpacking weap manually, so don't know if decpt unpack any cpt except the rooms files
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on November 24, 2017, 04:16:38 pm
okay. i asked utunnels & alfadorredux. they'll eventually see our conversation...
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: alfadorredux on December 09, 2017, 05:47:16 pm
Apologies--the weather's started acting up again where I am, and I'm back to having constant migraines, which means less energy for doing things like offering advice here.

No idea what's happening with utunnels' program.  .weap files have a couple of junk subfiles (containing ASCII letters "www" and nothing else) at the end, but as far as I know, they're valid .cpts.  decpt.pl from the 0.4-alpha version of Purple Cat Tools unpacks them without any problems, although I can't guarantee that the output is correct.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on January 16, 2018, 02:13:41 pm
i completely forgot how i unpacked the .weap files. no idea how to repack, either. with your cpt.pl? plus i deleted my dump of the fieldscripts, did that again, but... it's tedious as heck to hex all those battles. all i want to do is give leena and radius masamune now, dunno if kid can have it too. i guess. help please!

update: i tried in vain to open the field scripts. same problem i got with weap files "Not a valid cpt." i keep getting... prizvel could you pm me, your copy of purplecat tools? or alfadorredux? it could be a win10 problem... Doubt it's universal. doubt you 2 ever had this error either, with field scripts?




Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: alfadorredux on January 20, 2018, 04:42:29 pm
If you mean the PC Leena, etc. you might just be able to overwrite their weapon files with the Masamune's. (Or not--I've never tried.)

Most current version of Purple Cat Tools is attached to the second message in the "Chrono Cross Toolsets" thread in this forum (https://www.chronocompendium.com/Forums/index.php?topic=10927.0 (https://www.chronocompendium.com/Forums/index.php?topic=10927.0), or scroll down). No changes have been made since those were posted. Doesn't include additional scripts created by prizvel or others.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on January 20, 2018, 04:52:16 pm
yeah. Playable folk. Guess who showed up on EFNet IRC? on #psxdev.

Danetta. not sure if it's truly her. i gave her a Mirc key i bought in 2016. username: Chrono Cross. Better be her! hehe.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: Danetta on January 22, 2018, 04:50:08 am
Good thing I'm a digital packrat, or it would have vanished a long time ago.
LOL. Love you.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on January 31, 2018, 05:03:43 pm
Good thing I'm a digital packrat, or it would have vanished a long time ago.
LOL. Love you.
would really love you alfadorredux, if you wrote a .pl that'd unpack, edit, repack! every single fieldscript!
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: alfadorredux on February 03, 2018, 11:27:46 am
At the time I wrote Purple Cat Tools, I wasn't coding for a living. Now that I'm back to doing that, I have very little energy or interest left over for writing additional code on the weekends. So little or nothing gets done.  :oops:
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on February 05, 2018, 06:22:59 pm
At the time I wrote Purple Cat Tools, I wasn't coding for a living. Now that I'm back to doing that, I have very little energy or interest left over for writing additional code on the weekends. So little or nothing gets done.  :oops:
i see... too bad! maybe Danetta can teach me... how to code. i swear i never ever will get tired of hacking Chrono Cross. playing? maybe. but learning to hack it. makes me wanna play it! A vicious cycle!
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on April 02, 2019, 12:24:54 pm
hmm... i get stuck at the unpack unpackcpt step... seems like it doesn't like Danetta's Single.bin... BUT! i was successful at unpacking the 5k+ ".out" thing-a'ma'bobs!
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on February 28, 2020, 05:43:31 pm
prizvel or alfadorredux, could the problem be that i need some kinda C runtime? that's keeping me from unpacking with  :picardno unpackcpt.exe? :picardno
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: kennedn on August 07, 2020, 02:02:58 pm
I'm aware this thread is quite old but I am currently trying to do exactly what is described in the tutorial, albeit approaching from a different angle. I really dislike the standard battle music and either wanted to replace it with another music file from the game or somehow stop it.

What i have tried is replacing:

2371.out   between_life_and_death.mseq
2372.out   between_life_and_death.minst
2277.out   between_life_and_death-variation.mseq
2278.out   between_life_and_death-variation.minst

With another mseq and minst. This doesn't have the desired effect though (normal battle music is still the same). The files list on the modifications page hints that some sound files may be embedded inside the battlefield files themselves, wondering if anyone has ever attempted this?

Is the simplest way just to hex edit the battle flags as is done in the video?
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on August 07, 2020, 02:10:35 pm
"between life and death" isn't the standard battle track... that's the boss battle music. it's "Gale". i sucessfully changed Gale to be a few other tracks, but with a nasty 7s delay before battles start... 1070C is the start of Gale in Danetta's Single.bin... 8 bytes long.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: kennedn on August 07, 2020, 03:39:44 pm
Thanks itoikenza, that's done it! I couldn't find a good reference to listen to what files were what so was just guessing.

The sectors it ended up being were 2414-2415. I've replaced them with dragon_knights (2307-2308) and it seems to be starting battles fine with the new music now.

...for future reference, is there a quicker way to convert to a bin other than using iso2bin.pl from purple cat? Takes near 20 mins a pop.
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on August 07, 2020, 03:55:48 pm
sorry i have no clue. does dragon knights have a 7 second delay before each battle starts?
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: kennedn on August 07, 2020, 04:22:18 pm
No seems to be fine, there's some audio artifacting on the transition but i think that's just my emulator.

This is the original game disc I have modified though, not the Danetta bin:

https://www.youtube.com/watch?v=Rjl4_gO2QrY
Title: Re: Tutorial for itoikenza: how to delete music from battle
Post by: itoikenza on October 18, 2020, 12:35:20 pm
Someone Help!