[PSX] I want to learn how to compressed a rom

Started by Witchester, June 15, 2022, 04:46:42 AM

Previous topic - Next topic

Witchester

As the title mention, I want to learn how to compressed a rom, to put it on my phone which is almost out of storage
I've try to extract and convert the avi (I still don't know the correct format of PSX AVI/MOV)
Please help me list the tool i need to make this possible
thank you

FAST6191

That will depend upon the emulator you are using.

If it is a CD audio game then you for many emulators you are able to substitute CD tracks for MP3s or some similar audio format.

ISOs can often be put into zip files, usually called CISO at this point, but there are other methods that work better with some setups.

You can compress files internally to the ISO as per standard ROM hacking methods -- the game needs to know how to handle it so hopefully it already knows what goes.
You can do what was classically known as ROM ripping. Here you pull apart the ISO and delete files that are unnecessary to the game or your desires with it (delete multiplayer if you only care about single, if you only want a bonus mode, if you only want one level...)

Redoing video is not necessarily as easy as the audio stuff. What you sounded like you were trying in the earlier thread is having the PS1 as it were decode it which is unlikely to get you many places -- the PS1 is not powerful enough for modern big boy compressions so you are left with methods for low power decoding around the time. There might be an emulator out there which will play an externally rendered video but whether such functionality is available for a phone I would be more dubious about. You might get lucky and find the audio is some large wave file or something that can be compressed down but that is not going to save much. As noted in that earlier thread then as part of ripping then rather than figuring out what is a valid format/encoding many will find smaller files from within the same game (or same system) and replace accordingly with the smallest one that works (if this it the showpiece intro you are replacing it might be a different resolution to 10 second game cutscene and that can cause issues -- either figure out what is different and causing the issue and fix that, or make it expect a different format*). Utter cowboy method is depending upon how the video is set up** you might be able to delete the end off and skip it in game (might even come to the end and stop itself) or blank out the latter parts of the file such that it compresses for the CISO stuff above better.

*granted if you can do that you can probably tell it to skip the video in code.

**AVI is short for audio video interleave. This means you get a chunk of video and a chunk of audio and then another chunk of video and a chunk of audio... as opposed to full video and then full audio, which will make the laser dance around for its keep (see random reads) as it fetches the relevant parts of the file and thus not done if the dev is good and also allows for possibilities to chop the file down (maybe changing things like file size/section lengths in the header if necessary).
Whether it is actually AVI (possible but unlikely as patents and such usually meant custom work) though is just an extension is a different matter. Even if it is AVI you have a thousand settings before you even get to codecs (which each have a thousand of their own fun and games) to consider that might be troubling things. Hopefully https://www.videohelp.com/software/GSpot or a similar tool tells you what versions things are such that you can start replicating things.

Witchester

Hi, thank you for your reply

The current problem I'm facing is that when I'm ripping data from BIN file and convert + delete some file, then rebuild the BIN file, the game crashed
I've read that you need some index file to edit, but i don't see any index file in the ripped data

EDIT: I use pcsx_rearmed core

FAST6191

Two main choices there (don't think your emulator is going to be requiring a specific setup like some arcade stuff -- I don't have a mobile phone and don't play with mobile phone emulators, though is that retroarch or something which I also tend not to pay attention to).

The files you are removing are essential in some way (some games will do various checks or operations on apparently useless files).

The method you are using to unpack/rebuild the ISO is flawed.

Easy enough to isolate that -- unpack and rebuild the ISO without altering any files. If that works then you can move forward and figure out what/how to delete or relink* things.

*seen more for PSP games with umdgen having such functionality. Anyway idea is if you have say 10 files. You change whatever files you like to all say point at file 2 rather than having several copies of small files which further reduces the file size/increases compressibility (pretend it is 0-1000,1000-2000,2000-3000... if files 2 through 10 all now point at 2000-3000 you have 3000 through able to blanked which compresses down to basically nothing or removed for a bit more effort)  and can do fun things like character swaps and level swaps but that I will leave for another day.

The trouble with PS1 ISOs is that there are so many of them.
You have the Scene stuff from back in the day, not really much in the way of standards either during this.
You have whatever the kids/non Scene was doing -- all the CD writing software of the time (mostly nero, clonecd, cdrwin, discjuggler and a few others) was in an unofficial contest to support PS1 games, plus the Scene crowd often varied between formats as needs required.
Modern stuff that aims to be as exact a copy as it can be with standard formats. This will likely be the bin+cue+possibly audio tracks.
Modern stuff that someone has tweaked for their purposes (the mp3 audio being a popular one, though there are a thousand other takes on what you should do with PS1 isos).

This is why a lot of PS1 hackers will have a copy of the "we support every iso format" tools and why either multiple patches or means to unpack isos, patch individual files (which should be identical between things) and repack are the dominant method here.

Still
https://github.com/Lameguy64/isodump should hopefully dump things.
https://github.com/Lameguy64/mkpsxiso for fiddling with files/isos.

As far as index files...
Games that came on ROM carts (most things older than the DS) rather than floppy discs or optical media tended to have the whole ROM be one big blob with no means to break it up into files. This gets untenable when you get to several hundred megabytes of CD so the files are handled individually. The section of data that notes names, sizes and locations get called an index. There will be one for the overall iso (the PS1 mostly using a limited version of a format called iso9660, or that plus a tweak for some Square Enix stuff) but there might be others for either archive files contained within or at more subtle levels (rare but not unheard of). The tools you use to unpack and repack should handle the basic ISO stuff. What goes beyond that will go on a game by game basis.

Jorpho

Quote from: Witchester on June 15, 2022, 04:46:42 AMto put it on my phone which is almost out of storage
Have you considered that the easiest solution by far would be to buy more storage for your phone..?

You may consider using an external USB drive via a USB OTG cable.
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

Witchester

yeah, i plan on buying a new phone soon, but i want to try and do it, tbh this seem fun