Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: ShadowOne333 on February 24, 2021, 03:35:06 pm

Title: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on February 24, 2021, 03:35:06 pm
Good day.
Lately I've been playing a hack of Resident Evil Director's Cut Dual Shock, called Resident Evil Ultimate Director's Cut Dual Shock, which can be found here:
https://nobelgas.blogspot.com/2019/02/resident-evil-ultimate-directors-cut.html

I did some runs of the game, and it's quite good the amount of stuff that is restored and uncensored for this hack. However, there's two things specifically that I'm not fond of to make this the ultimate way to experience the original Resident Evil Director's Cut on console:

So, given those two things, I wanted to attempt removing those two things, and putting back all of the uncensored stuff into RE DC DS (movies, music, and keep Ultimate's Arranged costumes for Chris, Jill & Rebecca).

The list of modified files from the Ultimate hack are as follows:
Spoiler:
PROG2/
LOGO.EXE

DATA/
GWARNIN1.TIM
TITLE.PIX
TMOJI.TIM

Models for Chris, Jill & Rebecca:
ENEMY/
EM1032.EMD
EM1033.EMD
EM1035.EMD
EM1040.EMD
EM1041.EMD
EM1043.EMD
EM104C.EMD

Music and sound files:
All files after SEP00.HSB
SOUND/
SEP00.HSB -> SEP36.HSB

ZMOVIE/
CAPCOM.STR
DM3.STR
DM4.STR
DM6.STR
DMB.STR
DMC.STR
ED1.STR
ED2.STR
ED3.STR
ED4.STR
ED5.STR
ED6.STR
ED7.STR
PJ.STR
STFR.STR

And huge amount of files/rooms from the several "STAGEX" folders (most likely the Arranged mode rooms)

I tried modifying the Track 1 BIN file from Ultimate and the official one, putting all of the sounds, movies and 3D models from Ultimate into Dual Shock, but I couldn't find a way to make the modified Track 1 BIN work with any emulator.

So with that said, I wanted to ask how would I go about properly doing this?
I have already listed the modified files, and the only ones I'd like to port over from the Ultimate DCDS hack into normal DCDS are the new costumes for Jill, Chris and & Rebecca (inside the ENEMY folder), the new music (inside the SOUND folder), and the uncensored FMVs (inside the ZMOVIE folder).

If anyone has any suggestions or knows how to properly do this, please let me know!
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: niuus on February 24, 2021, 07:10:03 pm
Good day.
Lately I've been playing a hack of Resident Evil Director's Cut Dual Shock, called Resident Evil Ultimate Director's Cut Dual Shock, which can be found here:
https://nobelgas.blogspot.com/2019/02/resident-evil-ultimate-directors-cut.html

I did some runs of the game, and it's quite good the amount of stuff that is restored and uncensored for this hack. However, there's two things specifically that I'm not fond of to make this the ultimate way to experience the original Resident Evil Director's Cut on console:
  • The modified graphics for the Warning Screen, Logo, title screen, etc.
  • The new "Deranged" mode. Feels really weird and weirdly put together.

So, given those two things, I wanted to attempt removing those two things, and putting back all of the uncensored stuff into RE DC DS (movies, music, and keep Ultimate's Arranged costumes for Chris, Jill & Rebecca).

The list of modified files from the Ultimate hack are as follows:
Spoiler:
PROG2/
LOGO.EXE

DATA/
GWARNIN1.TIM
TITLE.PIX
TMOJI.TIM

Models for Chris, Jill & Rebecca:
ENEMY/
EM1032.EMD
EM1033.EMD
EM1035.EMD
EM1040.EMD
EM1041.EMD
EM1043.EMD
EM104C.EMD

Music and sound files:
All files after SEP00.HSB
SOUND/
SEP00.HSB -> SEP36.HSB

ZMOVIE/
CAPCOM.STR
DM3.STR
DM4.STR
DM6.STR
DMB.STR
DMC.STR
ED1.STR
ED2.STR
ED3.STR
ED4.STR
ED5.STR
ED6.STR
ED7.STR
PJ.STR
STFR.STR

And huge amount of files/rooms from the several "STAGEX" folders (most likely the Arranged mode rooms)

I tried modifying the Track 1 BIN file from Ultimate and the official one, putting all of the sounds, movies and 3D models from Ultimate into Dual Shock, but I couldn't find a way to make the modified Track 1 BIN work with any emulator.

So with that said, I wanted to ask how would I go about properly doing this?
I have already listed the modified files, and the only ones I'd like to port over from the Ultimate DCDS hack into normal DCDS are the new costumes for Jill, Chris and & Rebecca (inside the ENEMY folder), the new music (inside the SOUND folder), and the uncensored FMVs (inside the ZMOVIE folder).

If anyone has any suggestions or knows how to properly do this, please let me know!
Did you try rebuilding and reauthoring the ISO?
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on February 24, 2021, 07:14:21 pm
Did you try rebuilding and reauthoring the ISO?

How can I do that?
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: Asaki on February 24, 2021, 10:11:45 pm
Did you try rebuilding and reauthoring the ISO?

Doesn't work, there's a copy protection (CRC check?) on the game that must be bypassed.
I tried adding the color intro video back into the game once-upon-a-time, but gave up when I was told about it.
Obviously someone somewhere knows how to bypass it ;) Just not me.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on February 25, 2021, 03:46:45 pm
Doesn't work, there's a copy protection (CRC check?) on the game that must be bypassed.
I tried adding the color intro video back into the game once-upon-a-time, but gave up when I was told about it.
Obviously someone somewhere knows how to bypass it ;) Just not me.

So it's due to a CRC thing then?
I wish there were some clearer instructions on how to actually build a working PSX ISO/BIN, or make it work after changing stuff in it.

I mean, I even managed to open the 3D models of the game and the logos, but fixing the BIN to boot on an emulator is where I bumped ito a wall lol

I already have everything ready for testing, all the files I want imported and all, but booting the modified BIN is as far as I get.
Any kind of help will be greatly appreciated.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director\'s Cut DualShock?
Post by: PhOeNiX on February 25, 2021, 03:53:18 pm
The CRC thing is not a general PSX image issue. It is specific to this game. If you first don't remove this CRC check, any modification you apply to the game data will result in a black screen.

February 25, 2021, 04:35:24 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
This is where the game checks for the CRC in the french version of the game:
(https://i.imgur.com/F5vdfhG.png)
Title: Re: How can I modify files within PSX ISO for a hack of RE Director\'s Cut DualShock?
Post by: ShadowOne333 on February 25, 2021, 10:05:43 pm
The CRC thing is not a general PSX image issue. It is specific to this game. If you first don't remove this CRC check, any modification you apply to the game data will result in a black screen.

February 25, 2021, 04:35:24 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
This is where the game checks for the CRC in the french version of the game:
(https://i.imgur.com/F5vdfhG.png)

Oh that's a great starting place!
Do you happen to have the Hex bytes that represent that BNE and/or the location?
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: PhOeNiX on February 26, 2021, 02:42:19 am
In the main EXE (the SLUS) of the USA version of RE DC you should see the sequence
Code: [Select]
0300A614

at address 0x5534. That sequence is your bne, just nop it with 00000000.

There is one more place where the game checks for a CRC, but it seems the game works already with the change I suggested.
In case you need to also change this additional check, in the SLUS of the USA version of RE DC, you should see the sequence
Code: [Select]
F5FF4010at address 0x8100. Replace also this with 00000000.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: dukemagus on February 26, 2021, 12:19:59 pm
The resident evil modding community is currently a mess: old forums with a lot of info are either gone or abandoned and full of broken links and images

But if you want to play around with resident evil, check this link (https://github.com/pmandin/reevengi-tools/wiki/Resident-Evil-1-file-formats) for some basic information on how to deal with the files.

Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on February 26, 2021, 01:46:14 pm
In the main EXE (the SLUS) of the USA version of RE DC you should see the sequence
Code: [Select]
0300A614

at address 0x5534. That sequence is your bne, just nop it with 00000000.

There is one more place where the game checks for a CRC, but it seems the game works already with the change I suggested.
In case you need to also change this additional check, in the SLUS of the USA version of RE DC, you should see the sequence
Code: [Select]
F5FF4010at address 0x8100. Replace also this with 00000000.

Found both addresses, and NOP'd both of them with 00 00 00 00
However, it seems the modified .BIN still refuses to boot properly once I put the modified assets into it.
Am I still missing something else?
Are the files inside the BIN also CRC verified perhaps?
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: PhOeNiX on February 26, 2021, 06:09:52 pm
Then there is something wrong with your modified data. I would insert the new data incrementally, to see what works and what not.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: niuus on February 26, 2021, 10:38:23 pm
Doesn't work, there's a copy protection (CRC check?) on the game that must be bypassed.
I tried adding the color intro video back into the game once-upon-a-time, but gave up when I was told about it.
Obviously someone somewhere knows how to bypass it ;) Just not me.
That's curious. Not even when i erased the videos in FF9 was a title that much protective.  :banghead:
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: PhOeNiX on February 27, 2021, 04:12:23 am
Then there is something wrong with your modified data. I would insert the new data incrementally, to see what works and what not.

What are you using to replace the files, btw?
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on February 27, 2021, 11:45:41 am
What are you using to replace the files, btw?
Right now I'm using PowerISO to replace the files.
Do you recommend another software to do so?

I tried replacing only the modified SLUS executable with the changed bytes, and even with just that file it fails to boot, so I must be doing it wrong.



EDIT #1:
I think I found a way to import them properly.
Just imported the modified SLUS with this new method, and it boots.
Now I'm importing all the modified files manually (one by one).
Once that's done, I'll test and let you guys know how it went...



EDIT #2:
Failure.
While the ISO does boot now into the WARNING screen, whenever I try to import any other file aside from the SLUS one, the game just stays at a black screen when the CAPCOM movie is supposed to play.
Doesn't matter if I just import one of the new Chris models, and leave everything else untouched, it always crashes right after the warning screen.

I'm using PSX-MODE2-EN, for reference:
https://www.romhacking.net/utilities/1417/
Title: Re: How can I modify files within PSX ISO for a hack of RE Director\'s Cut DualShock?
Post by: acediez on February 27, 2021, 02:37:54 pm
I've used "mkpsxiso" by LameGuy64 to rebuild PS1 discs from scratch on several projects (Mega Man 8/X4/X5, and now a Ganbare Goemon game)
https://www.romhacking.net/utilities/1573/

Edit: I just found out after writing this post that LameGuy64 recently released an "isodumper"
http://www.romhacking.net/utilities/1574/
This should make creating a base set of files and working mkpsxiso XML a lot easier, and will probably be a quicker to extract STR/XA files correctly.

mkpsxiso works pretty much out of the box, as long as you...
- Use the right licence file (I use the ones provided in the PSYQ SDK)
- You list the disc files in the XML in the right order by LBA (you can check the order on IsoBuster)
- ... and if the game doesn't use a custom table of contents format (like Mega Man 8/X4 do) or custom file checksums (like the Goemon games I'm currently working on do).

If you did everything right up to this point and the game still doesn't boot, it's probably because of one of those issues, in which case you'll need to debug and figure out what it is. If it's a table of contents, you'll just have to find it and understand it so you can update it with your file changes (sizes, addresses). If it's a file checksum integrity check, you'll have to either skip it (probably not a good idea if you plan to make it work on actual hardware and fragile CDs?), or reverse engineer it so you can update them as well.

Out of 6 PS1 games I've worked on, only Mega Man X5/X6 didn't have either... but they DID have a custom file pack format that did involve a custom table of contents anyway.

This is why I don't think we'll ever have a comprehensive PS1 disc building guide for romhacking. There certainly are for homebrew, but when it comes to romhacking, there's many different game-specific hurdles to take care of. I've been learning how to do it by pure trial and error. That said, I have made several threads along the way, and I always make sure I come back and edit my post with the solution in case someone else finds it useful. I'm gonna list them here, as well as other useful threads I've found.

General:
Tools I use #1: https://www.romhacking.net/forum/index.php?topic=26202
Tools I use #2: http://www.romhacking.net/forum/index.php?topic=26255.0 (MM8/X4 Undub thread, at the bottom of my first post)
ECC/EDC Checksum: https://www.romhacking.net/forum/index.php?topic=26257
Mode2 File (STR/XA) Extraction: http://www.romhacking.net/forum/index.php?topic=21811.msg304778 (LameGuy64's isodumper exists now, so I'd try that first)

Game-specific:
Custom disc table of content example (Mega Man X4): https://web.archive.org/web/20180819002900/http://romxhack.esforos.com/viewtopic.php?f=4&t=816 (Spanish)
Custom packed file format example (Mega Man X4, ARC files): https://www.romhacking.net/forum/index.php?topic=21714.msg303268
Handling DA Audio Tracks (Mega Man 8 ): https://www.romhacking.net/forum/index.php?topic=26343
Handling Mode2/Form2 Data Files (Goemon Ooedo Daikaiten/Shin Sedai Shuumei): https://www.romhacking.net/forum/index.php?topic=31247
Custom file checksum example (Goemon Ooedo Daikaiten/Shin Sedai Shuumei): https://www.romhacking.net/forum/index.php?topic=31325

February 27, 2021, 02:58:15 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
EDIT #2:
Failure.
While the ISO does boot now into the WARNING screen, whenever I try to import any other file aside from the SLUS one, the game just stays at a black screen when the CAPCOM movie is supposed to play.
Doesn't matter if I just import one of the new Chris models, and leave everything else untouched, it always crashes right after the warning screen.

Sounds to me like there's a custom tile of contents. By loading that other file, you're probably shifting the file start location of everything else that comes after (check the disc contents on IsoBuster and arrange them by LBA order to see what I mean).

Time to debug and find that table  :laugh: ☕☕☕
Try searching for the original LBA values on the game executable, but as little endian.
Example: LBA 13.975 (decimal) -> 00003697 (hexadecimal big endian) -> 97360000 (hexadecimal little endian)
You may be lucky enough to find it this way...
But more often than that, I've had to locate the file loading subroutine in-game and work from there.

By the way, isn't Resident Evil like one of the most modded PS1 series ever? You sure all of this isn't documented somewhere already?
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: PhOeNiX on February 28, 2021, 02:24:47 am
I was assuming the modified files were imported with cdmage and that they were of the same size of the originals. If you import larger files, and change the lba's of the files in the bin, this is likely to break the game, if it uses a custom lbs/size table to locate files from the disc (which this game actually does).
Some games use the standard SDK cdSearchFile function to locate files by name, and thus do not care at which specific offset they are on disc. Some other games, for efficiency reasons ignore completely this, and compile a custom list of addresses, that of not changed to the new ones will of course break the game.

Btw, if you are going to use isodump by lameguy (the latest version uploaded here on rhdn, then you should use the latest mkpsxiso version also here on rhdn. Lameguy's GitHub has still old binaries of mkpsxiso that are not compatible with the latest version of isodump uploaded here at rhdn. (These tools have some changes I made and pull requested that fixed some serious bugs. Lameguy merged the changes but did not release new binaries yet).
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: acediez on February 28, 2021, 08:21:30 pm
Lameguy's GitHub has still old binaries of mkpsxiso that are not compatible with the latest version of isodump uploaded here at rhdn. (These tools have some changes I made and pull requested that fixed some serious bugs. Lameguy merged the changes but did not release new binaries yet).
Nice, thanks for your work, and for the heads up! I haven't had any issues since I updated to 1.23, and only ever checked the releases page on GitHub. I didn't realize there were newer versions here.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: vivify93 on February 28, 2021, 09:43:38 pm
pardon me.

this is my favorite way to play re1 original (not counting remake) so i've taken notes on ultimate director's cut. the game is almost perfect except for a couple of issues

1. There is one small bug that was never fixed: on Jill’s route, if you get poisoned by the Yawn, a cutscene triggers of her waking up in the infirmary save room. Should this happen, a small room with candles you have to use the Lighter on will instead warp you inside the Garden’s shed without needing to collect any Crests. As the candle room doesn’t have any plot significant items, it can be safely ignored if the Yawn poisons Jill. This is a direct result of Deranged Mode's inclusion; this room takes you to the Garden in Deranged. Triggering the cutscene of Jill being carried to the infirmary seems to trigger the Deranged exception for this one room and this one room alone on any version.

2. there's an issue with the opening. instead of chris narrating, "there are only 3 stars members left now: captain wesker, jill, and myself. we don't know where barry is," it cuts off after he says "left now" and the audio seems to glitch out. imo this is less of an issue because it makes it fit better with both the chris and jill campaigns.


i admit i haven't read the thread thoroughly yet, but if any progress at all was made on this i thought it would be prudent to point out these issues.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: PhOeNiX on March 01, 2021, 02:58:04 am
Nice, thanks for your work, and for the heads up! I haven't had any issues since I updated to 1.23, and only ever checked the releases page on GitHub. I didn't realize there were newer versions here.
Thanks! Among the changes, I let isodump also dump the license from the game bin, so there is no need to look for an illegal SDK copy online. The extracted data is self-contained to recreate the game bin with mkpsxiso.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on March 01, 2021, 06:18:48 pm
Thank you acediez and Phoenix for your feedback!

It seems like what acediez mentioned is what's happening with RE1.
I tried using isodump/mkpsxiso today, rebuilding the BIN by restoring the files from the Ultimate DS hack, but I get the same result. A black screen right after the "Warning" image.

So, according to what acediez mentioned, it might be that the game could be using a custom table of contents, or file checksums.

I downloaded IsoBuster, and looked at the LBA starting offsets of some of the files, and then did a search in the SLUS file. For example, I looked at the CAPCOM.STR file's starting LBA, which is 141,652.
Converted it to Hex, 0x022954, and then changed endianess of it, ending with 54 29 02
I got a match inside the SLUS_007.47 file at 0x089450, which [54 29 02 FF].
I tracked down the whole table, and I think the beginning of it is at location 0x087650 within the SLUS file.
I am still not sure what the 4th byte of each entry in the table seems to be, as it tends to change between files a lot.

(https://i.imgur.com/REC3VRl.png)

That's progress for sure, but I am still not sure how I can go about manually modifying the whole table itself AFTER the BIN has been created. Doing it manually might be somewhat painful, as the very first modified file is within the ENEMY folder, and that would most likely shift the entire files afterwards. Do you know how can such process of modifying the table be made easier to deal with, acediez?

I assume that I'd need to create a dummy BIN first with all the files in place, so I can grab the LBA final offsets, then modify the SLUS, and then recompile the BIN to create the final one. Am I correct?



Aside from that, user SCD brought to my attention that another user, @SeiyaKOu, managed to restore the bloody message on the wall. Seems to be Room 207, but I am not sure if it's either the standalone ROOM207.BSS file, or if also the two ROOM2070.RDT & ROOM2071.RDT files as well (or one and not the other):
https://www.youtube.com/watch?v=HCA7RbnOkRY
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: acediez on March 01, 2021, 08:04:20 pm
Congrats!

It looks very similar to Mega Man X4's table! Which was something like...

Code: [Select]
[00 00 00 00] [00 00 00 00] [00 00 00 00]
     LBA           SIZE      FILE TYPE ID

Yours are probably in a different order though.
Size can wither mean the exact number of bytes, or the number of disc sectors (round up filesize/2048).
As for the file type ID (if you have something like that), just keep the one already on the table.

I assume that I'd need to create a dummy BIN first with all the files in place, so I can grab the LBA final offsets, then modify the SLUS, and then recompile the BIN to create the final one. Am I correct?
That's exactly what I did for X4 and 8. I wrote a "makefile" script that does all that:

1. Build the disc with mkpsxiso
2. Extract the file list with LBA and sizes from it to a text file using IsoBuster. There's a command line parameter for that.
This is what I used, took it straight from some documentation: isobuster.exe "inputfile.bin" "/tree:all:outputfile.txt>?<`%RELPATH>`,<`%LBA>`,<`%BYTES>" /c
3. Read and sort the text file data and modify the PS-EXE file with the results
4. Repeat step 1 (rebuild the disc with the modified PS-EXE)

It's probably more practical to simply calculate the LBAs based on file sizes and file types, so you only build the disc once. It's the approach I would try to take if I were to do it from scratch now.
If you do manage to calculate them correctly without rebuilding, you could even try injecting your modified files and the modified PS-EXE using PSX-MODE2 instead of ever rebuilding the disc.

I won't offer my scripts as examples because they're hard to read even for me... they were the very first things I ever scripted, and I haven't maintained them in years, not sure they'll even work on a different machine. Tt's better if you write them yourself. When dealing with PS1 games, you will likely run into more situations that need scripting anyway.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: PhOeNiX on March 02, 2021, 05:55:11 am
mkpsxiso can  output to txt the LBA's of the files in the output iso without building the iso at all. So, the idea is to let mkpsxiso calculatethe LBAs in the txt file, and with some custom tool, parse the txt, update the LBA + size values in the SLUS. Then, you can actually build the iso with mkpsxiso.
Be sure that XA data and the dummy .DA file are at the end of the disk (i.e., with the highest LBA with the .DA file being the latest).
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: acediez on March 02, 2021, 08:02:13 am
mkpsxiso can  output to txt the LBA's of the files in the output iso without building the iso at all.

I somehow missed that 😅 Could it be done in 2018? lol
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: PhOeNiX on March 02, 2021, 09:53:31 am
I somehow missed that 😅 Could it be done in 2018? lol
I think so. At least, in v1.23 (dated Dec 20, 2018), which is the latest binary Lameguy has uploaded on github.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on March 02, 2021, 07:44:47 pm
What Phoenix said is true, you can output a TXT file with the LBA table.
I believe it's something like:

Code: [Select]
mkpsxiso.exe -lba lba.txt -noisogen resident.xml
That should output a file called "lba.txt" with the information from the compiled ISO.
I screwed around with the SLUS again today, manually changing each address from the LBA table (yep, manually converting each LBA offset to Hex, then input the Hex address into the SLUS file through a Hex editor, no script. Dumb, I know), and I managed to get further than the Warning screen now.

The uncensored movie plays when starting a new game.
However, there's two drawbacks:

1) All of the movies (even the original Capcom movie) seem to not have any sound now.
2) The game doesn't start. Instead, it freezes on the intro text.
Normal mode freezes at the words "where they thought it was safe", while Arrange freezes at the word "Yet". The 3 dots after it don't appear. Tried with both Jill and Chris' scenarios, and they both refuse to start. Not sure if it might be related to the audio tracks ported over from Director's Cut trying to play that it crashes it.

That's as far as I got today.
If anyone has any insight on why the movies don't have any sound and/or why the actual game refuses to boot, please let me know!
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: acediez on March 02, 2021, 08:23:09 pm
1) I've had intanced of STR audio not playing, it was either because I extracted them incorrectly, or they were modified and encoded with the wrong parameters. Maybe you didn't extract the STR files correctly? I'm sure LameGuy64's tool would handle that correctly, but if you haven't tried yet, I'd rip the files using XtrActor. That works for me every time.

2) If you did it all manually, I'd start by double cheking your table editing :P

After that, one simple way of finding the cause: remove one of the changes one by one, rebuild the disc each time. (That's why I suggest scripts when dealing with PS1 games. Not that the tasks are hard, it's just that doing them manually every time you need to test a small change will kill you. At the very least you could save some time parsing numbers, converting to-from hexadecimal, endian swapping, etc, using Excel/Google Sheets and some formulas, if you haven't already.)

There's also the chance that your game has a separate table dedicated to audio tracks (with a similar start offset/file size structure). I've dealt with a couple of those, both on Mega Man X5 and Goemon Shinsedai Shuumei (though they were XA audio tracks).

I think so. At least, in v1.23 (dated Dec 20, 2018), which is the latest binary Lameguy has uploaded on github.

Should've read the documentation more throughly! It would've cut my waiting time for each test build significately. Thanks, I'll definitely use it next time  :laugh:
Title: Re: How can I modify files within PSX ISO for a hack of RE Director\'s Cut DualShock?
Post by: PhOeNiX on March 03, 2021, 02:38:35 am
Isodump definitely supports extracting the str with xa audio. So, it should work if you extracted the bin with isodump (the most recent version here at rhdn).

-EDIT-
I just tried dumping the clean USA bin with the latest version of isodump and then rebuilt it with mkpsxiso, and the game works perfectly with also XA audio. So, if anything wrong, it has to do with how you change the files. STR files are extracted correctly, and mkpsxiso even rebuilds the bin following the same lba's of the original BIN (if no changes are applied).

March 03, 2021, 04:39:02 am - (Auto Merged - Double Posts are not allowed before 7 days.)

I tracked down the whole table, and I think the beginning of it is at location 0x087650 within the SLUS file.
I am still not sure what the 4th byte of each entry in the table seems to be, as it tends to change between files a lot.


The table actually starts at 0x087654, and each file has 8 bytes info. The first 4 bytes are a 4-bytes integer denoting the size of the file in bytes. Then, there is a 3-bytes integer denoting the LBA. The last byte is the actual CRC of the file that the game checks when loading the file in memory. Since you disabled the check completely, you can ignore this byte.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on March 04, 2021, 01:22:48 pm
How exactly are you dumping and rebuilding the ISO with isodump/mkpsxiso, Phoenix?
I don't remember well, but I think either isodump or mkpsxiso, but I recall getting a message about the ZNULL.DAT (or whatever the name is of the DAT at the root) file not matching entirely or something like that. And also RE DC DS has two bins in it.

From the information given, I believe I didn't really take into account the first 4 byte integer for the size into account when I was modifying the SLUS file. I only changed the LBA table addresses, not those 4-bytes.
Could the issue about the audio not playing be related to that?

I will try making a script today to make things easier for when editing the SLUS file.
It might take longer since it'll be my first time actually dealing with byte/Hex editing through script handling, but I'll do my best.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: PhOeNiX on March 04, 2021, 02:51:42 pm
You can ignore the warning isodump is throwing. It simply said that the znull file points to an audio track that is not included in the bin file (indeed it is on a separate bin). So isodump writes a dummy audio in it. However this track is dummy anyway in the original game, so when rebuilding the iso, you will not loose anything.

So whatever is wrong, it has to do with the lba table or the modified files.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: tomidelizia on March 07, 2021, 06:16:25 pm
Hi, I'm getting into modding RE1 PSX too. I'd advise you to read this little article I wrote, I think it might help you:
http://re123.bplaced.net/board/viewtopic.php?f=10&t=1296
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: tomidelizia on March 07, 2021, 06:28:07 pm
The thing is I want to do a Director's Cut mod too, but without the issues of UDC and maybe some extras too. The guy who made UDC, Wes67, also created a rebuilder for RE1 which removes the checksum verification, it works pretty well for replacing the awful DualShock soundtrack, room files, etc. However, if you replace a cutscene that is longer than the original, it will cut playback before it should. So I've kinda fixed that, as I've detailed in my post above, but there are still some issues to fix. Also, I'd love to restore the original Japanese background for the files, missing in every US PS1 version. If anyone's interested, my Discord is #6203.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on March 07, 2021, 10:32:02 pm
I finally finished making a script that makes a copy of the SLUS file and patches the proper bytes in place.
I renamed the bin to the Track 1 name, loaded the original .cue for the game into ePSXe, and it now boots with audio and all.

However, I am STILL getting stuck at the messages that are supposed to appear right after the intro movie (which plays fine now).
After the coloured intro finishes, now the message that is supposed to appear before starting the game just doesn't appear.

I tried looking if I did something wrong with the patching, but I am not sure.
I am running out of ideas on what I could be doing wrong, if anyone has a suggestion on what to try next, please let me know.

Here's the patching script I made, alongside the LBA table of the project, and an IPS to patch the SLUS for anyone who wants to try out:

https://www.dropbox.com/s/81z6vigrg8vf9ht/REPatch.zip?dl=0

Remember the files carried over from the Ultimate Director's Cut hack are:
Spoiler:
Models for Chris, Jill & Rebecca:
ENEMY/
EM1032.EMD
EM1033.EMD
EM1035.EMD
EM1040.EMD
EM1041.EMD
EM1043.EMD
EM104C.EMD

Music and sound files:
All files after SEP00.HSB
SOUND/
SEP00.HSB -> SEP36.HSB

ZMOVIE/
DM3.STR
DM4.STR
DM6.STR
DMB.STR
DMC.STR
ED1.STR
ED2.STR
ED3.STR
ED4.STR
ED5.STR
ED6.STR
ED7.STR
PJ.STR
STFR.STR

STAGE2/
STAGE207.BSS
STAGE2070.RDT
STAGE2071.RDT

With those files copied over from Ultimate Director's Cut, and the SLUS patched with the IPS or the script, it should give the same result as the build I'm having.

Any suggestion would be greatly appreciated!
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: PhOeNiX on March 08, 2021, 01:57:05 pm
Did you check that with the original files, your script does not change anything on the lba table? If this is the case, did you try rebuilding the iso without the stage files (these are the ones containing text, textures etc. of the different sections of the game).
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on March 08, 2021, 04:09:55 pm
Did you check that with the original files, your script does not change anything on the lba table? If this is the case, did you try rebuilding the iso without the stage files (these are the ones containing text, textures etc. of the different sections of the game).

Haven't build the original files, but I'll give it a try and see what happens.
Out of that, I completely missed the posts made by @tomidelizia yesterday.
In his posts, he mentions doing something very similar in scope to what I am attempting.

Not only that, but he brought up to my attention a tool by Wes67 which apparently allows for rebuilding the ISO without having to worry about the LBA table, as it seems that you can replace files just fine and the tool handles that. The tool in question is "RE1 Rebuilder" by Wes67, which can be found here:
https://www.tapatalk.com/groups/residentevil123/re1_rebuilder-t2390.html

Maybe with this tool I can make a build and be sure that the LBA is correct, and it's not a screw up on my part lol



EDIT:
I got in touch with @tomidelizia these past couple of days, and from what he's told me and teached me, he managed to pretty much cover all I wanted to do (which is put the uncensored FMVs, the 3D models for characters and the DC OST from Ultimate Director's Cut), but with so much more stuff planned under his belt.

With that said, right now the top priorities are to find how to restore the background images used for files obtained from the Japanese version, restoring/editing the bloody wall text for Arrange mode, and restore the credits video from the ending FMV that's not just a plain black background.
If anyone knows (for starters) how to text edit message for the game, that'd be helpful for the bloody wall text.

Aside from that, here's the checklist that tomidelizia wants to cover for a release of his hack:

- Restore all the uncut FMVs:
    - DM3.STR: First Zombie (DONE).
    - PJ.STR: Intro (ALMOST DONE).
    - ED1.STR: Chris' Bad Ending (DONE).
    - STFZ.STR: Japanese Gory Ending after using the Rocket Launcher. Requires restoring the credits text
      (the JP version has English text, except for the Opening and Ending themes credits).
      https://www.youtube.com/watch?v=BS9NlHyFQAY&ab_channel=pyramid
- Restore Original BGM (if using DualShock Ver.) (DONE).
- Restore Background of the different files throughout the game as in the Japanese versions.
- Restore the text that labels Jill and Chris a Easy and Hard respectively (use DualShock Japanese version for this!!).
- Restore message written in blood in Mansion East Stairway 2F (possibly needs a translation) from Demo Version. The text translates to the following:
  "Something is written on the wall...
   I... can't breathe... (Breathing is painful...)
   Save me from this pain... (Someone stop this suffering)"
- Restore footsteps scene when you enter the Mansion Storeroom, following a Zombie appearing when you exit the room, from Demo Version.
- Restore unknown music track from the scene when Jill first re-encounters with Barry in the Hallway Stairs ("especially against living things" scene) from 01/31/1996 beta.
- Restore ability of the root to kill in the Guardhouse Entry (if possible, only in Arrange mode) from 01/31/1996 beta.
- Restore Beretta Ammo in Bathtub in the Mansion's bathroom from 01/31/1996 beta.
- Restore Heliport and Battery SFX from 01/31/1996 beta.
- Restore Boulder activating when you approach from 01/31/1996 beta (if possible, only in Arrange mode).
- Alter Naked zombies location in the lab.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: ShadowOne333 on March 23, 2021, 08:11:31 pm
Continuing over with this discussion, @Deli managed to get a lot of the planned stuff on his end working, and released an initial version of the restoration hack:
http://www.romhacking.net/hacks/5837/

To anyone interested, be sure to check it out.
According to the release page, and the post above, he might work on other things to make this the definitive way to play the original cheesy RE1!
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: niuus on March 24, 2021, 04:30:29 pm
Continuing over with this discussion, @Deli managed to get a lot of the planned stuff on his end working, and released an initial version of the restoration hack:
http://www.romhacking.net/hacks/5837/

To anyone interested, be sure to check it out.
According to the release page, and the post above, he might work on other things to make this the definitive way to play the original cheesy RE1!
This is super cool, i'll be playing it shortly. Hopefully a version with the orchestrated OST becomes available too, would be nice having both options.

Not only that, but he brought up to my attention a tool by Wes67 which apparently allows for rebuilding the ISO without having to worry about the LBA table, as it seems that you can replace files just fine and the tool handles that. The tool in question is "RE1 Rebuilder" by Wes67, which can be found here:
https://www.tapatalk.com/groups/residentevil123/re1_rebuilder-t2390.html

Maybe with this tool I can make a build and be sure that the LBA is correct, and it's not a screw up on my part lol
There is a link to a file called cdtools, but seems to be dead. Do you happen to have a mirror?
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: SCD on March 26, 2021, 11:42:31 am
I found this link for CDTools in another thread: https://web.archive.org/web/20151214231026/http://www.tales-cless.org/util/CDTools.zip
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: niuus on March 28, 2021, 12:39:23 pm
I found this link for CDTools in another thread: https://web.archive.org/web/20151214231026/http://www.tales-cless.org/util/CDTools.zip
Thanks!
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: SCD on March 29, 2021, 10:24:00 am
You're welcome.
Title: Re: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?
Post by: caikelm on April 02, 2021, 06:58:47 am
So a long time ago I found a hack for Resident Evil DC Dualshock that replaced the laughable remade soundtrack with the classic one

I believe there's probably a ton of hacks that do that but this specific one did something very very interesting

It replaced the composer's name in the credits with the actual composers of the classic soundtrack

Now that's a nice detail I don't think everybody pays attention to
And since I've been looking for this hack for years now without luck (I downloaded it but lost the files) I think it would be fantastic if you guys did it in this one too, having the correct credits for Masami Ueda and the rest of the gang for the classic soundtrack and maybe even keeping Takashi Niigaki if you made a version with the dualshock ost for those who for some reason prefer it

Please please please at least consider it
And thanks for the efforts! :)