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

Author Topic: Rebuild a PSX iso (or expand a file)  (Read 8499 times)

esperknight

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Rebuild a PSX iso (or expand a file)
« on: September 18, 2011, 05: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

  • Hero Member
  • *****
  • Posts: 2026
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: Rebuild a PSX iso (or expand a file)
« Reply #1 on: September 18, 2011, 08:43:45 pm »
Most important question: does the game have a virtual file system to access the files?
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

esperknight

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: Rebuild a PSX iso (or expand a file)
« Reply #2 on: September 18, 2011, 11: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 :) ).  When inserting everything though it's way too large to fit in the same space now.

Gemini

  • Hero Member
  • *****
  • Posts: 2026
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: Rebuild a PSX iso (or expand a file)
« Reply #3 on: September 18, 2011, 11: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.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

esperknight

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: Rebuild a PSX iso (or expand a file)
« Reply #4 on: September 19, 2011, 07: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

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Rebuild a PSX iso (or expand a file)
« Reply #5 on: September 20, 2011, 12:33:20 am »
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

  • Hero Member
  • *****
  • Posts: 2026
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: Rebuild a PSX iso (or expand a file)
« Reply #6 on: September 20, 2011, 05:11:44 am »
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.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

gadesx

  • Sr. Member
  • ****
  • Posts: 276
    • View Profile
    • Gadesx scene
Re: Rebuild a PSX iso (or expand a file)
« Reply #7 on: September 20, 2011, 07: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

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: Rebuild a PSX iso (or expand a file)
« Reply #8 on: September 20, 2011, 08: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 :D

And thanks Gemini.  I thought I'd have to update something but never know :D  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

  • Hero Member
  • *****
  • Posts: 2026
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: Rebuild a PSX iso (or expand a file)
« Reply #9 on: September 20, 2011, 08:33:59 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.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

esperknight

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: Rebuild a PSX iso (or expand a file)
« Reply #10 on: September 20, 2011, 08:37:10 pm »
Thanks!  When googling I tried looking for ISO9660 TOC structure but didn't didn't help much.