sweet! thanks for your constribute to the ps2 scene.
sweet! thanks for your constribute to the ps2 scene.
And then the're still people saying the ps2 scene is dead. Nice one romz. Can't wait to test it out.
While the PS2 Memory Card dumping module is on its way to the public, I just want to share some information on MCMAN module. Maybe someone will find this useful for his low-level programming efforts.
Desription for MCMAN's library interface:
MCMAN module version 0x222
MCMAN library version 0x207
MCMAN Entry | Official entry name | Description
mcman_4 | ? | Dummy entry
mcman_5 | ? | Probes a memory card
mcman_6 | sceMcOpen | Opens a file on the memory card
mcman_7 | sceMcClose | Closes an opened file
mcman_8 | sceMcRead | Reads from an opened file
mcman_9 | sceMcWrite | Writes to an opened file
mcman_10 | sceMcSeek | Moves file pointer for an opened file
mcman_11 | sceMcFormat | Formats the memory card
mcman_12 | sceMcGetDir | Get file list from the memory card
mcman_13 | sceMcDelete | Deletes a file on the memory card
mcman_14 | sceMcFlush | Immediately writes a file cache to the memory card
mcman_15 | sceMcChdir | Changes current directory (gets current directory)
mcman_16 | sceMcSetFileInfo | Updates a file information
mcman_17 | ? | Erases a block of pages on the PS2 memory card (and calculates ECC for a new data-block)
mcman_18 | ? | Reads a data-page from the PS2 memory card [___McReadPage]
mcman_19 | ? | Write a data-page to the PS2 memory card
mcman_20 | ? | Calculates a ECC (3 bytes for 128 bytes of data)
mcman_21 | ? | Detects a memory card (PS1, PS2, PDA) [___McDetectCard]
mcman_22 | ? | Returns the memory card format flag (set on card detection) [__McGetFormat]
mcman_23 | sceMcGetEntSpace | Checks free space in entry information storage area
mcman_24 | ? | ? (Flushes cache buffers and so on ?)
mcman_25 | ? | Closes all the opened file on memory cards [___McCloseAll]
mcman_26 | sceMcGetSlotMax | Get number of slots (for multitap)
mcman_27 | ? | Dummy entry
mcman_28 | ? | Dummy entry
mcman_29 | ? | ? (Reads from PS1/PDA cards ?)
mcman_30 | ? | ? (Writes to PS1/PDA cards ?)
mcman_31 | ? | Dummy entry
mcman_32 | ? | Dummy entry
mcman_33 | ? | Dummy entry
mcman_34 | ? | Dummy entry
mcman_35 | ? | Dummy entry
mcman_36 | sceMcUnformat | Erases the memory card formatting
mcman_37 | ? | ? (Always returns zero)
mcman_38 | ? | Returns number of free clusters for the memory card
mcman_39 | ? | Returns the memory card type (set on card detection) [___McGetType]
mcman_40 | ? | Dummy entry (controls PS1-card access flag in the special MCMAN modules)
mcman_41 | ? | Dummy entry
mcman_42 | ? | Returns address of the MCMAN's ModuleInfo (___McGetModuleInfo)
mcman_43 | ? | Retrieves the memory card spec (page size, block size, card size, flags) [___McGetCardSpec]
mcman_44 | ? | ?
mcman_45 | ? | Validates a data-block on the memory card (by erasing, writing and reading data)
mcman_46 | ? | ?
mcman_47 | ? | ? (reads FS entry into cache-buffer)
mcman_48 | ? | ? (sets "dirty flag" for "top" cache-buffer)
mcman_49 | ? | ? (makes a new FS directory entry ?)
mcman_50 | ? | ? (gets cache-buffer I/O)
mcman_51 | ? | Flushes I/O cache buffers
mcman_52 | ? | ?
mcman_53 | ? | Gets MCMAN's I/O Sema [___McGetIoSema]
mcman_54 | ? | ? (card check by reading data-page ?)
mcman_55 | sceMcUdCheckNewCard | ? (Get a memory card detection-related flag)
mcman_56 | ? | Always returns zero (?)
mcman_57 | ? | Always returns zero (?)
mcman_58 | ? | Always returns zero (?)
mcman_59 | ? | Always returns zero (?)
mcman_60 | ? | Detects a PS2 memory card [___McDetectCard2]
mcman_61 | ? | Dummy entry
MCDUMP v1.1 Utility IRX is out. That program copies a memory card for PlayStation 2 to the specified file (on a PFS partition, for example) as an "image". I use such memory card images for the memory card emulation.
The memory card image file is similar to the files produced by PCSX2 (PlayStation 2 emulator for PC) however the image doesn't contain so called "spare data" with error-correction codes. A typical memory card is NAND memory with additional chip and the memory is divided into small pages (several pages forms a block). One page contain 528 bytes of data (I believe there are cards with a different page size, probably 1056.) while first 512 bytes is a "user-data" and other 16 extra bytes is a "spare-data" (according the MCMAN internal logic the size of spare data should be 1/32 of user data size). The spare data is supposed to be used as a storage for error correction codes for the user data and MCMAN works in the same way. It stores all the user data (filesystem, file contens and so on) in the first 512 bytes of a memory card page and calculates error correction codes (3 bytes for every 128 bytes of user data) to store it in the rest of page (16 bytes). That error correction codes is a system-level part of memory card's error detection/correction scheme. MCMAN's interface allows to read the user data so the MCDUMP reads and save it to a file (while PCSX2 stores all the 528 bytes of data to its files). However my memory card emulator uses only the user data (this is a convenient way to read/write data because the size of user data is equal to HDD sector size) and generates error correction codes on the fly.
Unfortunatelly, the current version of MCDUMP utility may not work with a MCMAN module from BIOS ("rom0:MCMAN") while McReadPage calls will return error. I continue to investigate the source of problem while the utility works fine with modern MCMAN.IRX modules from games.
MCDUMP v1.1 can be downloaded here:
Thankyou SOO MUCH!! Romz you have done soo much work its fantastic.
Now...how do we run these files and where do we put them?
Just for curiosity :)
How to you plan to include the MCDump tool into the final product. When the player hits the save button and game data is saved to MC the MCDumper is called automatically after that ? So you will have a MC Dump Image for every game Game on the HD? I mean is it possible to work this way ?
Oh btw.. every time I recheck this thread I am amazed about the progression of the project. Thumbs up :)
Its not too difficult to include memory card emulator into the final product. Basic memory card emulation is quite simple (that's why I began to write the emulator right now) - the emulator intercepts certain calls from MCMAN to SIO2MAN and responds to them (it redirection DMA-request to SIO2 device to file I/O operation on a PFS partition). The mcdump is just a tool to allow users to create a copy of their memory cards on a hard drive or somewhere else. The emulator doesn't require an actual memory card inserted in a console, it just reports to MCMAN that a memory card exists.Quote:
How to you plan to include the MCDump tool into the final product. When the player hits the save button and game data is saved to MC the MCDumper is called automatically after that ?