PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.62k stars 1.6k forks source link

[Feature Request]: Added ZSO support with 16-sector cropping! #6050

Closed INDRAPhilip closed 2 years ago

INDRAPhilip commented 2 years ago

Description

Add support for 16-sector crop zso format!

Reason

As many know ps2 is limited so it is not possible to add chd, cso and jso and now that you will have a ZSO file option in Open-PS2-Loader I think it would be interesting to have the same compression function available in this emulator and it would be relatively simple to implement now because pcsx2 already supports cso and lz4/lz5!

Examples

how to demonstrate usage brings more space to the devices and a speed improvement that would not be so noticeable in the emulator, but would help those who use Open-PS2-Loader to have a single file type on their devices! Examples:

iso: https://drive.google.com/file/d/1O7EGH1cO09SexxgyfadjHJrUvIR0kkAu/view

zso: https://drive.google.com/file/d/15E_9sWO_eNHl52XDjOpBIueADcZ9_ZwY/view

GitHub from the project: https://github.com/JoseAaronLopezGarcia/Open-PS2-Loader-ZSO/releases/tag/r111

weirdbeardgame commented 2 years ago

Pcsx2 already supports all of the other formats. I don't know if there'd be a benefit to adding another reader file type like that. Does it offer a bit more compression or anything like that over cso or chd?

INDRAPhilip commented 2 years ago

O Pcsx2 já suporta todos os outros formatos. Eu não sei se haveria um benefício para adicionar outro tipo de arquivo leitor como esse. Ele oferece um pouco mais de compressão ou algo assim sobre cso ou chd?

Actually, in some cases, zso is better than cso, but chd is better than all, but the main thing is to have more format options and so it also helps Open-PS2-Loader developers to solve future bugs when possibly implementing

lightningterror commented 2 years ago

Really low priority since we already support several formats, if someone wants to add it then they're free to do so.

JoseAaronLopezGarcia commented 2 years ago

It really isn't that hard to implement so if you want I can go ahead and do it myself. Neither CSO nor CHD can ever run on PS2, while ZSO runs even on USB and at full speed on many games, so it's bound to become the de facto standard for PS2 USB drives. Users will benefit from being able to have all games on just one compressed format that will work on both PS2 and PCSX2.

F0bes commented 2 years ago

Sure, we aren't opposed to it.

refractionpcsx2 commented 2 years ago

Okay, but we're not trying to run on a PS2.

From our perspective there's no real benefit to us, the only benefit is PS2 loader users don't need to recompress their ISO's. For PCSX2 is basically brings nothing to the table, since we have formats that are equivalent or better already.

If you wish you implement it and PR it yourself, you are welcome to, but we won't be doing it ourselves.

TnA-Plastic commented 2 years ago

Okay, but we're not trying to run on a PS2.

From our perspective there's no real benefit to us, the only benefit is PS2 loader users don't need to recompress their ISO's. For PCSX2 is basically brings nothing to the table, since we have formats that are equivalent or better already.

If you wish you implement it and PR it yourself, you are welcome to, but we won't be doing it ourselves.

It's rather about avoiding redundancy (using one compressed image everywhere), whilst being easy to add! Maybe 85% (not exactly) of the CSO-code stays the same, so adding ZSO support should be trivial indeed!

refractionpcsx2 commented 2 years ago

Jose has already said they will PR an implementation, so we're happy for them to go ahead and do that.

RedDevilus commented 2 years ago

Okay, but we're not trying to run on a PS2. From our perspective there's no real benefit to us, the only benefit is PS2 loader users don't need to recompress their ISO's. For PCSX2 is basically brings nothing to the table, since we have formats that are equivalent or better already. If you wish you implement it and PR it yourself, you are welcome to, but we won't be doing it ourselves.

It's rather about avoiding redundancy (using one compressed image everywhere), whilst being easy to add! Maybe 85% (not exactly) of the CSO-code stays the same, so adding ZSO support should be trivial indeed!

I get what you mean but with that mindset we could add all compression standards but not limited to: https://en.wikipedia.org/wiki/List_of_archive_formats

Either way if they want to add it themselves, no big deal.

JoseAaronLopezGarcia commented 2 years ago

Jose has already said they will PR an implementation, so we're happy for them to go ahead and do that.

I couldn't compile it, but this should work (it's very simple to get done): https://github.com/JoseAaronLopezGarcia/pcsx2-zso/blob/master/pcsx2/CDVD/CsoFileReader.cpp

Maybe clean it up to use external LZ4 lib instead of bundled and you're good to go.

orcutt989 commented 2 years ago

as already said they will PR an impl

@JoseAaronLopezGarcia can we get a build?

JoseAaronLopezGarcia commented 2 years ago

I can't compile PCSX2 (haven't really tried much anyways). All I know is you only have to change like 3 lines of code in the CISO Reader of PCSX2. CsoFileReader.cpp.txt

You only need to link the LZ4 library with this code and you're done. Should work out of the box.

ZSO is the exact same structure/format as CSO, only changes the magic number (CISO to ZISO) and blocks being compressed with LZ4 instead of DEFLATE.