03-09-2012,09:41 PM

Originally Posted by
pspgeek
thanks took a look and finally understood the cmd 58 but don't understand the second byte sent by memcard in 52 and 57. Something about it being 0,8(returns some kind of error) and other value(access denied). Is it related to the last write or something like that?
Hmm... after doing a quick survey of McReadPS1PDACard() and McWritePS1PDACard(), a document on the Playstation and SIO.c from the PCSX emulator, I've reached this conclusion:
mcman_sio2inbufs_PS1PDA[0] - 0x81 (0x81 for Memory Card, 0x01 is for the gamepad)
mcman_sio2inbufs_PS1PDA[1] - SIO2 command (0x52 or 0x57, for READ or WRITE operations respectively).
mcman_sio2inbufs_PS1PDA[2] - (Returned) Unknown (0x5A).
mcman_sio2inbufs_PS1PDA[3] - (Returned) Unknown (0x5D).
mcman_sio2inbufs_PS1PDA[4] - Upper 8 bits of the page number (On return, 0x00).
mcman_sio2inbufs_PS1PDA[5] - Lower 8 bits of the page number.
mcman_sio2inbufs_PS1PDA[6] - (Returned) Unknown (0x5C). Seems to be returned by the Playstation's SIO.
mcman_sio2inbufs_PS1PDA[7] - (Returned) Unknown (0x5D). Seems to be returned by the Playstation's SIO.
mcman_sio2inbufs_PS1PDA[8+] - (Returned) Payload (Note: The real data seems to begin at offset 10 instead of 8. I believe that the leading 2 bytes are copies of bytes 4 and 5, sent back via the SIO from the MC, since the PCSX emulator suggests that).
mcman_sio2inbufs_PS1PDA[135] - (Returned) Unknown (0x5C). Seems to be returned by the Playstation's SIO. This byte is present for responses to the WRITE command.
mcman_sio2inbufs_PS1PDA[136] - (Returned) Unknown (0x5D). Seems to be returned by the Playstation's SIO. This byte is present for responses to the WRITE command.
mcman_sio2inbufs_PS1PDA[138] - (Returned) (Sony Memory Card) EDC data, only present when a READ command is used.
mcman_sio2inbufs_PS1PDA[139 for the READ command and 137 for the WRITE command] - (Returned) Unknown (0x47).... seems to be a terminator for the packet.
The "Unknown" values are the values expected by MCMAN. It is probably best to set those values in their expected locations, since they seem to indicate that the read/write operation was a success.
The 0x5C and 0x5D byte sequences seem to be the "OK" response code for Playstation memory cards, and the 0x47 byte seems to be a terminator for the end of the SIO packet.
It seems like an original Playstation SIO packet is encapsulated within a PS2 SIO2 packet.
So... the Playstation SIO stuff are sent over the SIO2 interface with encapsulation used... interesting.
Last edited by SP193; 03-09-2012 at 10:03 PM.
Reason: Added more information
Unmodified SCPH-77006 with SM 3.6
SCPH-39006 with M-chip modchip, SCPH-10281 NA and refurb Seagate 80GB HDD
SCPH-10000 v1.00 with SCPH-10190 PCMCIA NA and SCPH-20400 HDD unit

PS2ESDL v0.823B
やっほー 汗がひかる♪