+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Rebuild a PSX iso (or expand a file)
Pages: [1]
Author Topic: Rebuild a PSX iso (or expand a file)  (Read 1 times)
esperknight
Guest
« on: September 18, 2011, 04:42:50 pm »

I've been looking around but haven't really found anything on rebuilding a PSX image.  I've been using CDMage to reinsert the file but now I've exceeded the original's length plus there's no room to expand it with the TOC changer found here.  I've done a bit of searching around but really haven't found a good way to do it.  I was thinking of moving the file itself to tail end of the CD but wasn't sure what to update to do this.  Any suggestions or guides out there?  Thanks!
Gemini
Guest
« Reply #1 on: September 18, 2011, 07:43:45 pm »

Most important question: does the game have a virtual file system to access the files?
esperknight
Guest
« Reply #2 on: September 18, 2011, 10:17:01 pm »

The game is Moon RPG Remix and it does use a virtual file system for it's scenario files.  It's the moon.dat file.  I can successfully recompile it fine with a few translated scripts and have it run not a problem (so far that is Smiley ).  When inserting everything though it's way too large to fit in the same space now.
Gemini
Guest
« Reply #3 on: September 18, 2011, 10:48:01 pm »

If the VFS indexes are relative to MOON.DAT (instead of absolute to the ISO) you can simply move said file at the end of the ISO and it should work fine, unless the TOC is actually unused and the game has other means to determine where MOON.DAT is stored.
esperknight
Guest
« Reply #4 on: September 19, 2011, 06:20:36 pm »

Yup, far as I can tell all the VFS indexes are relative to MOON.DAT.  For moving the file, do I just move it and that's it?  If I do how does the PSX know then where to find it?  Thanks!
Auryn
Guest
« Reply #5 on: September 19, 2011, 11:33:20 pm »

Every CD has a TOC (table of contenent) and that is how normally the files are found.
You naturally need to change the LBA of the moon.dat file to be the last on the cd.
Gemini
Guest
« Reply #6 on: September 20, 2011, 04:11:44 am »

Quote from: esperknight on September 19, 2011, 06:20:36 pm
For moving the file, do I just move it and that's it?
Move it and update the LBA/size couple to reflect the new position.

Quote
If I do how does the PSX know then where to find it?  Thanks!
The game probably uses the function CdSearchFile() to detect the file absolute position on the ISO, which means it is reading from the standard TOC for an absolute pointer (which then it adds the relative pointers to). Otherwise, it could store the LBA as a static value somewhere in memory but I'd say it's a rather uncommon scenario.
gadesx
Guest
« Reply #7 on: September 20, 2011, 06:59:55 am »

Try to use this tool by CUE,
http://romxhack.esforos.com/post1254#1254

use:
psx-mode2 ISO \\old_file new_file

http://dl.dropbox.com/u/22524283/CUE%20psx-mode2.rar
esperknight
Guest
« Reply #8 on: September 20, 2011, 07:23:08 pm »

Thanks gadesx, I'll check that out.  I'd still like to do it by hand just to learn though but awesome find Cheesy

And thanks Gemini.  I thought I'd have to update something but never know Cheesy  Never worked with a CD structure that actually contained files (except for one Sega Saturn game except that was cakewalk to rebuild luckily).  Is the TOC I need to update where it references the filename?  Also, what's the structure of it or a doc that lists it?  I'm guessing the ISO standard for CDs but I haven't found good documentation on it yet.

Also, I took a look back my lua code for cd-tools and I feel like a complete idiot... I had the code that would set the XA file (MOON.STR) correctly instead doing it to all the other files... and yeah I feel like an idiot...

Still would like to do it by hand in case that tool doesn't work though.

Thanks!
Gemini
Guest
« Reply #9 on: September 20, 2011, 07:33:59 pm »

Quote from: esperknight on September 20, 2011, 07:23:08 pm
Is the TOC I need to update where it references the filename?  Also, what's the structure of it or a doc that lists it?  I'm guessing the ISO standard for CDs but I haven't found good documentation on it yet.
Grab the PDF here, it contains the whole toc structure. Check the chapted about File and Directory Descriptors.
esperknight
Guest
« Reply #10 on: September 20, 2011, 07:37:10 pm »

Thanks!  When googling I tried looking for ISO9660 TOC structure but didn't didn't help much.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC