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

Author Topic: About creating patches for multi-disc PSX games  (Read 4333 times)

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
About creating patches for multi-disc PSX games
« on: October 22, 2013, 03:05:46 pm »
There's something I'd like to know about creating patches for multi-disc PSX games. When I create a patch, do I have to create one patch for each disc, or only one patch for all discs? I'm quite curious about this.

Gemini

  • Hero Member
  • *****
  • Posts: 2026
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: About creating patches for multi-disc PSX games
« Reply #1 on: October 22, 2013, 03:14:56 pm »
It depends entirely on file relocation and actual data contents. For example, if you were to move nothing in FF7 just one patch would be enough, like my fix for the M-Def bug.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
Re: About creating patches for multi-disc PSX games
« Reply #2 on: October 22, 2013, 03:21:03 pm »
So my FF7 retranslation will need only one patch?

Gemini

  • Hero Member
  • *****
  • Posts: 2026
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: About creating patches for multi-disc PSX games
« Reply #3 on: October 22, 2013, 04:06:39 pm »
It depends really on what you do to the FIELD folder. Most likely you'll need to create 3 individual xdelta patches due to all file relocation required to fit the new data.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
Re: About creating patches for multi-disc PSX games
« Reply #4 on: October 22, 2013, 04:18:32 pm »
It depends really on what you do to the FIELD folder. Most likely you'll need to create 3 individual xdelta patches due to all file relocation required to fit the new data.
But don't all 3 discs have the same number of files in that folder, and the same texts in each of them? I saw texts from Disc 1 in Disc 3, and vice versa. I saw the same texts in Disc 2 too.
« Last Edit: October 22, 2013, 04:32:30 pm by Thisguyaresick2 »

Gemini

  • Hero Member
  • *****
  • Posts: 2026
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: About creating patches for multi-disc PSX games
« Reply #5 on: October 22, 2013, 05:23:46 pm »
Most files are definitively placed in the same exact spot of the ISO, but a few exclusive files (I think the supernova on disk 3) and movies are relocated for each disk.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Bregalad

  • Hero Member
  • *****
  • Posts: 2755
    • View Profile
Re: About creating patches for multi-disc PSX games
« Reply #6 on: October 23, 2013, 06:26:43 am »
As far I know the only difference between the discs in FF7 is the movies. It's possible to swap discs during gameplay and nothing special happends, exept when you get a movie to play where it will either crash or play a wrong movie.

If you're only altering text I think you'll need only one patch. But this is very specific to FF7 though.

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
Re: About creating patches for multi-disc PSX games
« Reply #7 on: October 23, 2013, 01:19:47 pm »
As far I know the only difference between the discs in FF7 is the movies. It's possible to swap discs during gameplay and nothing special happends, exept when you get a movie to play where it will either crash or play a wrong movie.

If you're only altering text I think you'll need only one patch. But this is very specific to FF7 though.
Well, that's what I was thinking. But what about other multi-disc PSX games? Like Valkyrie Profile, or Parasite Eve?

FAST6191

  • Hero Member
  • *****
  • Posts: 3054
    • View Profile
Re: About creating patches for multi-disc PSX games
« Reply #8 on: October 23, 2013, 01:47:01 pm »
In that case you get to take it on a game by game basis also depending upon what you are patching in a game as I am not sure of anybody doing a case by case assessment of the multi disc games (it is not something you would probably have to do like that for emulation purposes. Generally speaking unlike some newer consoles the later discs will not be DLC installers and such like but from there it could be many things -- I have seen games get you to swap there and then, return to disc one and then swap when loading a save, there is probably something for rebooting the console and then it checks the save and acts accordingly, there are possibly instances where games will get you to swap back and forth depending upon the player's choices.... There may be some regulations on what devs could do (though PS1 era was still pretty unregulated) but it could still play out in a variety of different ways.

Redoing the ultimate file allocation on a disc/ROM is nothing new and sticks around to this day but generally speaking when dealing with multi disc/cart games you take it on a game by game basis. All that said though I doubt FF7 is unique and in some ways it is not very notable I would not expect a FF7 a like setup going in to something new.

Bregalad

  • Hero Member
  • *****
  • Posts: 2755
    • View Profile
Re: About creating patches for multi-disc PSX games
« Reply #9 on: October 23, 2013, 05:14:58 pm »
Quote
Well, that's what I was thinking. But what about other multi-disc PSX games? Like Valkyrie Profile, or Parasite Eve?
There is no rule of thumb, everything is game specific.
I know for instance that what is true for FF7 is not for FF8 and FF9, you can't swap discs anytime with those.
As many locations are not acessible with the last disc of FF8 and FF9 respectively (this has been subject to critics), it's very likely the maps for those locations are not stored in the last disc at all, which needs a lot of space for ending movies.

I don't know about games you cited, but they could work either like FF7, like FF8/9 or something even yet competely different.

Cyberman

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: About creating patches for multi-disc PSX games
« Reply #10 on: October 29, 2013, 06:34:42 pm »
Well, that's what I was thinking. But what about other multi-disc PSX games? Like Valkyrie Profile, or Parasite Eve?
FF7 FF8 and FF9 use LBA tables to reference files and data. In FF7 this is encoded in \FEILD\FIELD.bin
The reason for this is it was better to do that than use the standard C/C++ libraries. Speed, access, and concurency could be supported by the low level iso9660 access functions much better than otherwise.
The big issue if you modify a chunk of data is this index table may need to be adjusted (if the file increased enough to offset the other files).
I believe sqaure had a tool that cimpiled field.bin from the file set. It's been a few months since I looked at this type of thing. I had restarted a iso indexing program, but RL got in the way (sad I know).

The field dialog/script is in the DAT files. In the field directory The Mode 2 disks used by the PSX were a bit annoying (UDF is more obvious about locations etc.) The importan thing too keep in mind is that although thier is a directory structure in FF7 it's NOT USED (except to load the game). What is used is field.bin's LBE index table. The script likely uses enumerated values in the script for loading and accessing data. That is what I would do. The script probably looked (and read) a LOT better than the script code does dumped that is for certain!

I worked on FF8 and FF9 for a bit as well. Too much intrusion by everything else these days. (sigh)
Cyb

MarkGrass

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: About creating patches for multi-disc PSX games
« Reply #11 on: October 29, 2013, 11:13:40 pm »
FF7 FF8 and FF9 use LBA tables to reference files and data.

The same can be said for basically all games from CAPCOM (the various Resident Evil games, MegaMan titles, etc). LBA tables are stored in the executable, however, using a very simple structure called "CdPos". On occasion (Resident Evil titles, specifically), simple checksum values for each file is stored with corresponding LBA entires.

It's much faster and fail-safe to access files this way, compared to the generic SDK functionality.

That said, as Bregalad mentioned, it's all very much game-specific. When modifying the contents of archives/files, sizes will obviously change, in which case you'll be obligated to patch each disc in order to correct the LBA table.