PlayStation 2 memory card filesystem library written in Haskell.
Note that this library isn't exactly "finished" or fully-featured. I was mostly just curious about the PS2 memory card filesystem and, also, I thought it'd be cool to explore PCSX2 *.ps2
images in Haskell.
Reading the memory card filesystem:
import PlayStation2.MemoryCard
( Filesystem (..)
, ReadFilesystemError
, readFilesystem
)
import Prelude
import System.IO.MMap (mmapFileByteString)
f :: IO (Either ReadFilesystemError Filesystem)
f = do
bs <- mmapFileByteString "./memcard.ps2" Nothing
pure (readFilesystem bs)
From there, you could list the contents of a directory (e.g. the root directory which is available via the fRootDirectoryEntry
field of Filesystem
):
listDirectoryContents fs (fRootDirectoryEntry fs)
... or build a Tree
of directory contents:
buildDirectoryTree fs (fRootDirectoryEntry fs)
... or read a specific file, given a reference to it:
readFile fs someFileReference
Building with cabal
:
cabal build ps2-memory-card
- Ross Ridge (
mymc
and PlayStation 2 Memory Card File System ) - Florian Märkl (
mymcplus
) - caol64 (
ps2mc-browser
and Analysis of the PS2 Memory Card Storage Format)