So I've been digging around lately into attempting to swap the EU/UK voice acting/packs into the NTSC version of Ape Escape as it runs noticeably better. I played Ape Escape a lot as a kid, and the value of swapping these voice-packs over is entirely based on nostalgia. This may sound ridiculous or a waste of time, but I'm self-aware and it's definitely a waste of time

This has been a learning adventure so far as to how psx games work in general, how their data is packed, and how to reverse engineer bits and pieces of the game.
I made a simple but possibly naive attempt to repack the US bin with just the STR files I located from the EU source bin using ultraiso. Booting this resulted in the forbidden boot image/logo, so I can only assume it did not repack as it should have.
From here I've moved on to use fisgon as I learned about the various issues of repacking psx bin files and Ape Escape is in mode2. Repacking the STR files using this did allow the game to boot normally again, however, the voice lines simply did not play. Onto the next thing.
I started wondering, are these really the files I need to be moving, do they play correctly through an STR player, etc. They do not, turns out they're XA files and place fine when opened with something that handles XA files (such as XA Audio Converter, wish there was source for this, wanted to port it to Rust). Great, this tool allows you to repack the XA files with WAV and be a bit more preserving, I tried doing this with a single voice line and repacking it into the bin to see if Ape Escape would pick this up. No luck.
The STR folder contents:
Code: Select all
STR $ ls
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 6/05/1999 5:36 PM 283336 END_TEST.ALL
-a---- 6/05/1999 5:37 PM 482204 END_TEST.STR
-a---- 7/05/1999 2:13 PM 4026668 GOV1.STR
-a---- 7/05/1999 2:13 PM 4026668 GOV2.STR
-a---- 7/05/1999 2:13 PM 2333228 LAB.STR
-a---- 7/05/1999 2:13 PM 21600812 STEXP.STR
-a---- 7/05/1999 2:13 PM 2370860 TALK.STR
-a---- 7/05/1999 2:14 PM 12757292 WEPGET.STR
Code: Select all
LAB_80011d10 XREF[1]: 80011d18(j)
80011d10 38 98 00 0c jal CdSearchFile undefined4 CdSearchFile(undefine
80011d14 d0 40 05 26 _addiu a1=>s_\KKIIDDZZ.HED;1_800a40d0,s0,0x40d0 = "\\KKIIDDZZ.HED;1"
Code: Select all
do {
iVar1 = CdSearchFile(aCStack56,"\\KKIIDDZZ.HED;1");
} while (iVar1 == 0);
From here I revisited the function I decompiled earlier and found that these differences occur in this data loading function between the EU and US versions of the game:

Where the first mismatch is:
Code: Select all
do {
iVar2 = CdRead(1,&DAT_800b7e50,0x80);
} while (iVar2 == 0);
CdReadSync(0,auStack24);
iVar2 = 0;
puVar4 = &DAT_800b7e50;
Code: Select all
LAB_80011d4c XREF[1]: 80011d58(j)
80011d4c 50 7e 25 26 addiu a1=>DAT_800b7e50,s1,0x7e50 = ??
80011d50 bc 9f 00 0c jal CdRead int CdRead(undefined4 param_1, u
80011d54 80 00 06 24 _li a2,0x80
80011d58 fc ff 40 10 beq v0,zero,LAB_80011d4c
80011d5c 01 00 04 24 _li a0,0x1
80011d60 21 20 00 00 clear a0
80011d64 23 a0 00 0c jal CdReadSync int CdReadSync(int mode, u_char
80011d68 30 00 a5 27 _addiu a1,sp,0x30
80011d6c 21 20 00 00 clear a0
80011d70 0f 00 06 3c lui a2,0xf
80011d74 ff ff c6 34 ori a2,a2,0xffff
80011d78 f0 ff 07 3c lui a3,0xfff0
80011d7c 0b 80 02 3c lui v0,0x800b
80011d80 50 7e 45 24 addiu a1,v0,0x7e50
From what I can tell in the cue, the STR folder does exist in the file system for the disk, but are these files referenced by their addresses as opposed to using the file system to search for the files?
Have I gone completely off track and this is actually a trivial problem?
Does anyone have any advice on where I should go from here? (Aside from give up lol)
I can probably update the addresses in a hex editor once I've located them in Ghidra, from what I can tell I can edit the instruction assembly in Ghidra and then use the new hex to patch the old. But I'm concerned about how do I know what the new correct address is with repacking the BIN file? Any recommendations here on how I can solve this particular issue?
I'm trying to catch up on domain knowledge here but it's very difficult, however, the information in this community has been incredible and I'm extremely thankful for this. This has been a lot of fun, and has motivated me to look into porting some of the tools that I can to rust or similar to keep them alive. Was hoping to do that XA converter I've been using but the source isn't available and decompiling / importing delphi c++ apps has been more difficult than Ape Escape so far haha