Romhacking.net

Romhacking => Newcomer's Board => Topic started by: Almagest on October 22, 2013, 03:05:46 pm

Title: About creating patches for multi-disc PSX games
Post by: Almagest 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.
Title: Re: About creating patches for multi-disc PSX games
Post by: Gemini 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.
Title: Re: About creating patches for multi-disc PSX games
Post by: Almagest on October 22, 2013, 03:21:03 pm
So my FF7 retranslation will need only one patch?
Title: Re: About creating patches for multi-disc PSX games
Post by: Gemini 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.
Title: Re: About creating patches for multi-disc PSX games
Post by: Almagest 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.
Title: Re: About creating patches for multi-disc PSX games
Post by: Gemini 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.
Title: Re: About creating patches for multi-disc PSX games
Post by: Bregalad 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.
Title: Re: About creating patches for multi-disc PSX games
Post by: Almagest 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?
Title: Re: About creating patches for multi-disc PSX games
Post by: FAST6191 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.
Title: Re: About creating patches for multi-disc PSX games
Post by: Bregalad 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.
Title: Re: About creating patches for multi-disc PSX games
Post by: Cyberman 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 (http://wiki.qhimm.com/view/FF7/Field_Module#PSX_DAT_Format). 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
Title: Re: About creating patches for multi-disc PSX games
Post by: MarkGrass 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.