Repository navigation
API Reference
The library is organized under the root namespace PSXMCL. Below is a detailed breakdown of the main modules, record types, and functions.
Handles low-level PlayStation memory card files.
-
MemoryCard(Record)-
HeaderValid: bool— Checks for the ASCIIMCsignature and valid checksum in Block 0. -
Directory: DirectoryEntry[]— The 15 directory entries. -
BrokenSectors: BrokenSector[]— Records identifying damaged sectors to exclude. -
Files: SaveFile[]— Extracted save files. -
RawData: byte[]— The raw 128 KB card image bytes.
-
-
SaveFile(Record)-
BlockIndices: int[]— Indices of the physical blocks occupied by the file. -
DirectoryEntry: DirectoryEntry— Directory information for the file. -
TitleFrame: TitleFrame option— Optional title and icon details. -
IconFrames: IconFrame[]— Extracted animated icon frame bitmaps (16x16, 4-bpp). -
Data: byte[]— Concatenated raw payload bytes.
-
-
DirectoryEntry(Record)-
State: BlockAllocationState— Current block allocation state (e.g., in use, free, deleted). -
FileSize: uint32— File size in bytes. -
NextBlock: uint16— Link to the next block in the chain (0xFFFF= end of chain). -
FileName: string— ASCII file name on the card. -
IsValid: bool— True if directory entry checksum validates.
-
-
TitleFrame(Record)-
IconDisplayFlag: IconDisplayFlag— Decides how many icon frames are present and how they animate. -
BlockNumber: byte— Block index of this file (1 to 15). -
Title: string— Shift-JIS decoded title string. -
Palette: uint16[]— 16-color CLUT palette used to draw icons. -
RawTitle: byte[]— Raw bytes of the title buffer.
-
-
read/Read-
F#:
val read: path: string -> MemoryCard -
C#/VB:
public static MemoryCard Read(string path) - Reads a 128 KB memory card file from the file system.
-
F#:
-
readFromBytes/ReadFromBytes-
F#:
val readFromBytes: data: byte[] -> MemoryCard -
C#/VB:
public static MemoryCard ReadFromBytes(byte[] data) - Parses a memory card image directly from a byte array.
-
F#:
-
withFileData/WithFileData-
F#:
val withFileData: saveFile: SaveFile -> mc: MemoryCard -> MemoryCard -
C#/VB:
public static MemoryCard WithFileData(SaveFile saveFile, MemoryCard mc) - Returns a copy of the memory card where a save file has been updated or written back.
-
F#:
-
write/Write-
F#:
val write: path: string -> mc: MemoryCard -> unit -
C#/VB:
public static void Write(string path, MemoryCard mc) - Writes a memory card representation to the file system.
-
F#:
Parses and packages Final Fantasy Tactics save payloads.
-
FftSaveData(Record)-
MainCharName: byte[]— Raw name array (17 bytes). -
MainCharJob: byte— Current job ID of the main character. -
MainCharLevel: byte— Current level. -
SaveDate: byte * byte— Tuple representing the save date(month, day). -
MapPosition: byte— Party's coordinate/location on the world map. -
GameTime: uint32— Total play time counter. -
Units: UnitStats[]— Array of 20 unit records. -
PlayerInventory: byte[]— Quantities of player inventory indexed by item ID (256 bytes). -
FurShopInventory: byte[]— Quantities of fur-shop items (256 bytes). -
PlayerOptions: byte[]— 4 bytes of player configuration toggles. -
RawData: byte[]— Clean copy of the original payload for round-tripping.
-
-
UnitStats(Record)-
CharacterIdentity: byte— Special character ID or generic category flag (e.g.,0x80for male,0x81for female). -
PartyId: byte— Roster block placement (0xFFindicates off-formation). -
JobId: byte— Current active job ID. -
Palette: byte— Costume palette color. -
GenderFlags: byte— Gender, monster, egg, and joining attributes. -
Birthday: uint16— Birth date encoded as day-of-year. -
Zodiac: ZodiacSign— Zodiac sign. -
SecondarySkillset: byte— Secondary action ability set. -
ReactionAbility / SupportAbility / MovementAbility: uint16— Equipped passive slots. -
Head / Body / Accessory / RightHandWeapon / RightHandShield / LeftHandWeapon / LeftHandShield: byte— Equipment slots. -
Experience / Level / Brave / Faith: byte— Progression stats. -
RawHp / RawMp / RawSp / RawPa / RawMa: uint32— Unscaled baseline attributes. -
JobJp / TotalJobJp: uint16[]— Active and accumulated JP arrays (20 jobs). -
Nickname: byte[]— Name buffer (16 bytes).
-
-
ZodiacSign(Discriminated Union)-
Aries|Taurus|Gemini|Cancer|Leo|Virgo|Libra|Scorpio|Sagittarius|Capricorn|Aquarius|Pisces|Serpentarius|UnknownZodiac of byte
-
-
load/Load-
F#:
val load: saveFile: SaveFile -> FftSaveData -
C#/VB:
public static FftSaveData Load(SaveFile saveFile) - Parses a
SaveFilepayload into a fully structured FFT save representation.
-
F#:
-
toSaveFile/ToSaveFile-
F#:
val toSaveFile: fft: FftSaveData -> saveFile: SaveFile -> SaveFile -
C#/VB:
public static SaveFile ToSaveFile(FftSaveData fft, SaveFile saveFile) - Re-serializes modified FFT save data back into a
SaveFileobject.
-
F#:
Exposes enums, masks, and safe modifier utilities.
-
CharacterIdentity: Common values (e.g.,Ramza = 0x01uy,Delita = 0x04uy,Agrias = 0x1Euy,GenericMale = 0x80uy, etc.). -
Palette:Default = 0uy,Hokuten = 1uy,Nanten = 2uy,DeathCorps = 3uy,GlabadosChurch = 4uy. -
GenderFlags(Flags):Male = 0x80uy,Female = 0x40uy,Monster = 0x20uy,JoinAfterEvent = 0x10uy,LoadFormation = 0x08uy,IsEgg = 0x04uy,SaveFormation = 0x01uy. -
EquipmentSlot:Head,Body,Accessory,RightHandWeapon,RightHandShield,LeftHandWeapon,LeftHandShield. -
AbilitySlot:Reaction,Support,Movement.
-
hasGenderFlaghasGenderFlag (flag: GenderFlags) (value: byte) : bool- Checks whether a specific gender/roster flag bit is set.
-
setGenderFlagsetGenderFlag (flag: GenderFlags) (enabled: bool) (value: byte) : byte- Sets or clears a specific flag bit on the raw gender byte.
-
getEquipmentgetEquipment (slot: EquipmentSlot) (unit: UnitStats) : ItemId- Reads the item ID for the selected equipment slot on a unit.
-
setEquipmentsetEquipment (slot: EquipmentSlot) (itemId: ItemId) (unit: UnitStats) : UnitStats- Returns a copy of the unit record with the selected equipment slot updated.
-
getAbilitygetAbility (slot: AbilitySlot) (unit: UnitStats) : AbilityId- Reads the ability ID for the selected passive/reaction/movement slot on a unit.
-
setAbilitysetAbility (slot: AbilitySlot) (abilityId: AbilityId) (unit: UnitStats) : UnitStats- Returns a copy of the unit record with the selected ability slot updated.
Encodes/decodes ASCII name fields and formats display texts.
-
getMainCharacterNamegetMainCharacterName (nameBytes: byte[]) : string- Decodes the main character's raw name bytes into a string.
-
encodeMainCharacterNameencodeMainCharacterName (name: string) : byte[]- Encodes a string name into a fixed 17-byte buffer with null padding.
-
getUnitNicknamegetUnitNickname (nicknameBytes: byte[]) : string- Decodes a unit's raw nickname bytes into a string.
-
encodeUnitNicknameencodeUnitNickname (nickname: string) : byte[]- Encodes a string nickname into a fixed 16-byte buffer with null padding.
-
getItemNamegetItemName (itemId: byte) : string- Translates a raw item ID into its English in-game display name.
-
getJobNamegetJobName (jobId: byte) : string- Translates a raw job ID into its English in-game display name (including monsters).
-
formatItemStackformatItemStack (itemId: byte) (quantity: byte) : string- Formats an inventory slot nicely as
Name xQuantity(or justNameif quantity is zero).
-
formatUnitSummaryformatUnitSummary (unit: UnitStats) : string- Produces a readable description of a unit in the format
CharacterName - ActiveJob.