pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

[Feature Request]: CDVD: SCMD 0x36 Can do more things

Open AKuHAK opened this issue 3 years ago • 0 comments

Description

On Mechacons prior to v6 (FAT ps2), this SCMD returns 0x80, which means it is not supported. The only exception is FAT SCPH-50011 which has some limited behavior.

On slims it has different behavior: https://github.com/PCSX2/pcsx2/blob/291d32bd35cfb54de1ea8416106bc5d19ef91841/pcsx2/CDVD/CDVD.cpp#L295 in fact, it reads more bytes:

getNvmData(num, 0, 12, offsetof(NVMLayout, regparams));

How this can be checked? With Mechapwn support, you can restore modify NVRAM and replace zero bytes in regionparams NVRAM area. So for example on my SCPH-70003 I have EEengEE followed by 5 zero bytes. With Hex editor I replaced zero bytes with some test string (0x01 0x02 0x03 0x04 0x05). After restoring the NVRAM backup and running SCMD 0x36 ps2 returned that string: 00 04 00 45 45 65 6E 67 45 45 01 02 03 FF 05 That means that this area can be simplified: https://github.com/PCSX2/pcsx2/blob/master/pcsx2/CDVD/CDVD.cpp#L2568-L2572 to just

				cdvd.SCMDResult[13] = 0xFF; //0xFF - 77001

I have no idea what that 0xFF means, but this byte is replaced always in all test runs.

As about SCPH-50011 on this machine, SCMD 0x36 returns 3 bytes. These 3 bytes look the same as in slim models.

Reason

Improve accuracy and act closer to the real hardware

Examples

Real hardware

AKuHAK avatar Aug 30 '22 07:08 AKuHAK