pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

add zso support

Open orcutt989 opened this issue 3 years ago • 9 comments

Description of Changes

Adds ability to play ZSO files.

Rationale behind Changes

This is a popular format that has been in development and many people are switching to this format over CSO and ISO. https://github.com/PCSX2/pcsx2/issues/6585 https://github.com/PCSX2/pcsx2/issues/6055 https://github.com/PCSX2/pcsx2/issues/6050

Suggested Testing Steps

Build and run Or try this compiled build https://www.mediafire.com/file/vl0zc6g6886s63m/pcsx2-with-zso-support.7z/file

Notes

Used @JoseAaronLopezGarcia's CPP file here https://github.com/PCSX2/pcsx2/issues/6050#issuecomment-1126741880 and made it work.

Used https://wiki.pcsx2.net/PCSX2_Documentation/Compiling_on_Windows only to find out the NIS files had been removed and ended up using CMAKE.

orcutt989 avatar Jul 09 '22 08:07 orcutt989

@JoseAaronLopezGarcia I fixed up your CPP file and struggled with Visual Studio, and got a working build, but when I load a ZSO file it just does nothing.

Here is the build - https://file.io/wsPRz35mv4M3

orcutt989 avatar Jul 09 '22 08:07 orcutt989

@JoseAaronLopezGarcia I fixed up your CPP file and struggled with Visual Studio, and got a working build, but when I load a ZSO file it just does nothing.

Here is the build - https://file.io/wsPRz35mv4M3

How are you generating ZSO files?

It's best to use this script: https://github.com/ps2homebrew/Open-PS2-Loader/blob/master/pc/ziso.py (requires python3 and pip install lz4)

JoseAaronLopezGarcia avatar Jul 09 '22 11:07 JoseAaronLopezGarcia

@JoseAaronLopezGarcia I fixed up your CPP file and struggled with Visual Studio, and got a working build, but when I load a ZSO file it just does nothing. Here is the build - https://file.io/wsPRz35mv4M3

How are you generating ZSO files?

It's best to use this script: https://github.com/ps2homebrew/Open-PS2-Loader/blob/master/pc/ziso.py (requires python3 and pip install lz4)

alt. "ziso" CLI tool https://www.psx-place.com/resources/psxiso-compression-tool.1258/

or maxcso https://github.com/unknownbrackets/maxcso#features

AhayriSG avatar Jul 09 '22 12:07 AhayriSG

@JoseAaronLopezGarcia @AhayriSG I used the python script, but I'll double check if the files work on a PS2.

Last time I checked- they did, and I used the python script before with the new build of OPL with ZSO support.

Did you try the build? Did it work for you all?

orcutt989 avatar Jul 09 '22 15:07 orcutt989

@JoseAaronLopezGarcia @AhayriSG I used the python script, but I'll double check if the files work on a PS2.

Last time I checked- they did, and I used the python script before with the new build of OPL with ZSO support.

Did you try the build? Did it work for you all?

NVM it works! Cleaning up PR and adding menu support atm.

orcutt989 avatar Jul 09 '22 18:07 orcutt989

Can you tidy up the project files please when dealing with the formatting errors you have still not fixed. You will also need to update the pcsx2core project and the solution for Qt.

refractionpcsx2 avatar Jul 10 '22 16:07 refractionpcsx2

One important note. The CSO reader in PCSX2 can read CSO (and ZSO) files with arbitrary block sizes. Having higher block sizes results in better compression. On PS2 however, we only support 2048 blocks due to memory constraint (ZSO decompression runs on the IOP :P ). So for standarization purposes, and to make sure your ZSO files will work on both real hardware and emulator, make sure you use blocks of 2048 bytes in size.

The python script already uses this block size, and doesn't really let you change it, but maxcso will by default use arbitrary block sizes, and this causes the PS2 (OPL) to not read them. You can specify the block size in the parameters to maxcso.

JoseAaronLopezGarcia avatar Jul 11 '22 01:07 JoseAaronLopezGarcia

Formatting still needs to be fixed.

Thanks I havent addressed it yet. Once its fixed I will resolve your comments.

I read through the formatting guide and I'm not sure what specifically is wrong with the formatting. Could you please be more specific?

Do you all have some sort of plugin that can automate the formatting?

orcutt989 avatar Jul 11 '22 13:07 orcutt989

I read through the formatting guide and I'm not sure what specifically is wrong with the formatting. Could you please be more specific?

newlines before {s

Do you all have some sort of plugin that can automate the formatting?

If you have clang-format installed, you can run git clang-format HEAD~4 to format everything Though I'd much prefer it if you squashed formatting changes onto each commit, in which case you should git rebase -i master, choose edit for the four commits, and git clang-format HEAD~ after each one.

TellowKrinkle avatar Jul 11 '22 20:07 TellowKrinkle

What's the status on this? Also need a rebase.

refractionpcsx2 avatar Oct 19 '22 09:10 refractionpcsx2

@refractionpcsx2 Is it really not possible to merge this PR? ZSO is the only compressed format supported by PS2's OPL and having it on PCSX2 as well would be really great since you wouldn't need to keep different files for the same game.

ElGranSmokio avatar May 21 '23 22:05 ElGranSmokio

Is it really not possible to merge this PR? ZSO is the only compressed format supported by PS2's OPL and having it on PCSX2 as well would be really great since you wouldn't need to keep different files for the same game.

OP decided to close this pr, not pcsx2 team. It needs massive rebase and lz4 lib clean.

AKuHAK avatar May 24 '23 13:05 AKuHAK