DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
CMemoryCardAccess Class Reference

#include <memorycardaccess.hpp>

Public Member Functions

void Initialize ()
 
int InitForMC ()
 
void SetBuff (char *buffer)
 
void SetIconData (MC_ICON_DATA *icon)
 
void MakeMcIconSysInfo ()
 
void SetFuncNo (int func_no)
 
int GetFuncNo ()
 
int Step ()
 
void SetVersion (char *version)
 
char * GetVersion ()
 
int SearchMcType ()
 
int GetDir ()
 
int LoadSysConfig ()
 
int SaveSysConfig ()
 
int Write ()
 
int Convert ()
 
int MakeDir ()
 
int GetSaveFileInfoFromMc (int file_no)
 
int GetAllSaveFileInfo ()
 
int CheckFileNo (int file_no)
 
int SaveToMc (int file_no)
 
int LoadFromMc (int file_no)
 
int FormatForMc ()
 
int DeleteFile (int file_no)
 
int GetMsgNo (int msg_no)
 
int McError (int result)
 
void DmySync ()
 
int McUnFormatForDebug ()
 

Public Attributes

s32 port
 
s32 file_no
 
MC_ERROR_INFO error
 
char version [0x20]
 
char dir_name [0x20]
 
char file_name [0x20]
 
char current_dir [0x40]
 
s32 func_no
 
u8 unk_C0 [4]
 
s32 step
 
s32 fd
 
MC_DIR_ENTRY * dir_table
 
CSaveData * save_buffer
 
char * check_sum
 
char * load_buffer
 
char * read_buffer
 
s32 idle_code
 
s32 transferred
 
s32 transfer_size
 
sceMcIconSys icon_sys
 
MC_ICON_DATA icon
 
MC_CARD_INFO card [MC_CARD_MAX]
 
SAVEDATA_INFO file_info [MC_SAVE_FILE_MAX]
 
u8 unk_7BC [4]
 

Detailed Description

Runs the memory card operations of the game one step at a time.

Definition at line 145 of file memorycardaccess.hpp.

Member Function Documentation

◆ Initialize()

void CMemoryCardAccess::Initialize ( )

Fills the class with its starting values and names the save directory after the menu language.

Mangled name:
Initialize__17CMemoryCardAccessFv
Address:
0x2135D0
Size:
0x17C

Definition at line 33 of file memorycardaccess.cpp.

◆ InitForMC()

int CMemoryCardAccess::InitForMC ( )

Starts the memory card library and the class, and returns one if the library fails to start.

Mangled name:
InitForMC__17CMemoryCardAccessFv
Address:
0x213750
Size:
0xF4

Definition at line 76 of file memorycardaccess.cpp.

◆ SetBuff()

void CMemoryCardAccess::SetBuff ( char *  buffer)

Builds the save image in the given buffer out of the save data, the version string and one checksum byte for every 64 bytes of save data.

Mangled name:
SetBuff__17CMemoryCardAccessFPc
Address:
0x213850
Size:
0x138

Definition at line 105 of file memorycardaccess.cpp.

◆ SetIconData()

void CMemoryCardAccess::SetIconData ( MC_ICON_DATA *  icon)

Sets the file descriptors for the save directory's browser icons.

Mangled name:
SetIconData__17CMemoryCardAccessFP12MC_ICON_DATA
Address:
0x213990
Size:
0x68

Definition at line 136 of file memorycardaccess.cpp.

◆ MakeMcIconSysInfo()

void CMemoryCardAccess::MakeMcIconSysInfo ( )

Fills the icon.sys image that MakeDir writes into the save directory.

Mangled name:
MakeMcIconSysInfo__17CMemoryCardAccessFv
Address:
0x213A00
Size:
0x188

Definition at line 142 of file memorycardaccess.cpp.

◆ SetFuncNo()

void CMemoryCardAccess::SetFuncNo ( int  func_no)

Starts the given operation from its first step and polls the memory card library once.

Mangled name:
SetFuncNo__17CMemoryCardAccessFi
Address:
0x213B90
Size:
0x48

Definition at line 178 of file memorycardaccess.cpp.

◆ GetFuncNo()

int CMemoryCardAccess::GetFuncNo ( )

Returns the operation that the class is running.

Mangled name:
GetFuncNo__17CMemoryCardAccessFv
Address:
0x213BE0
Size:
0xC

Definition at line 189 of file memorycardaccess.cpp.

◆ Step()

int CMemoryCardAccess::Step ( )

Runs one step of the current operation and returns its result.

Mangled name:
Step__17CMemoryCardAccessFv
Address:
0x213BF0
Size:
0x1C0

Definition at line 193 of file memorycardaccess.cpp.

◆ SetVersion()

void CMemoryCardAccess::SetVersion ( char *  version)

Copies the given version string into the class.

Mangled name:
SetVersion__17CMemoryCardAccessFPc
Address:
0x213DB0
Size:
0x24

Definition at line 257 of file memorycardaccess.cpp.

◆ GetVersion()

char * CMemoryCardAccess::GetVersion ( )

Returns the version string that every save file carries after its data.

Mangled name:
GetVersion__17CMemoryCardAccessFv
Address:
0x213DE0
Size:
0xC

Definition at line 261 of file memorycardaccess.cpp.

◆ SearchMcType()

int CMemoryCardAccess::SearchMcType ( )

Reads the type, the free space and the format of the card in the current port.

Mangled name:
SearchMcType__17CMemoryCardAccessFv
Address:
0x213DF0
Size:
0x29C

Definition at line 265 of file memorycardaccess.cpp.

◆ GetDir()

int CMemoryCardAccess::GetDir ( )

Enters the save directory of the card and reads its entries into the directory table.

Mangled name:
GetDir__17CMemoryCardAccessFv
Address:
0x214090
Size:
0x294

Definition at line 358 of file memorycardaccess.cpp.

◆ LoadSysConfig()

int CMemoryCardAccess::LoadSysConfig ( )

Reads the configuration file of the save directory and applies it to the save data.

Mangled name:
LoadSysConfig__17CMemoryCardAccessFv
Address:
0x214330
Size:
0x298

Definition at line 436 of file memorycardaccess.cpp.

◆ SaveSysConfig()

int CMemoryCardAccess::SaveSysConfig ( )

Writes the configuration of the save data to the configuration file of the save directory.

Mangled name:
SaveSysConfig__17CMemoryCardAccessFv
Address:
0x2145D0
Size:
0x310

Definition at line 517 of file memorycardaccess.cpp.

◆ Write()

int CMemoryCardAccess::Write ( )

Writes a test file of 0x76F800 bytes into the root directory of the card.

Mangled name:
Write__17CMemoryCardAccessFv
Address:
0x2148E0
Size:
0x100

Definition at line 612 of file memorycardaccess.cpp.

◆ Convert()

int CMemoryCardAccess::Convert ( )

Creates the save directory and copies the save files of the BASCUS-97112dkcloud directory into it.

Mangled name:
Convert__17CMemoryCardAccessFv
Address:
0x2149E0
Size:
0x340

Definition at line 632 of file memorycardaccess.cpp.

◆ MakeDir()

int CMemoryCardAccess::MakeDir ( )

Creates the save directory and writes a default configuration file, icon.sys and the icon files into it.

Mangled name:
MakeDir__17CMemoryCardAccessFv
Address:
0x214D20
Size:
0x778

Definition at line 703 of file memorycardaccess.cpp.

◆ GetSaveFileInfoFromMc()

int CMemoryCardAccess::GetSaveFileInfoFromMc ( int  file_no)

Reads the save file with the given number and fills its entry of the save file table from it.

Mangled name:
GetSaveFileInfoFromMc__17CMemoryCardAccessFi
Address:
0x2154A0
Size:
0x584

Definition at line 943 of file memorycardaccess.cpp.

◆ GetAllSaveFileInfo()

int CMemoryCardAccess::GetAllSaveFileInfo ( )

Reads the twelve save files of the card in turn into the save file table.

Mangled name:
GetAllSaveFileInfo__17CMemoryCardAccessFv
Address:
0x215A30
Size:
0xD8

Definition at line 1104 of file memorycardaccess.cpp.

◆ CheckFileNo()

int CMemoryCardAccess::CheckFileNo ( int  file_no)

Returns one when the directory table already holds the save file with the given number.

Mangled name:
CheckFileNo__17CMemoryCardAccessFi
Address:
0x215B10
Size:
0x80

Definition at line 1135 of file memorycardaccess.cpp.

◆ SaveToMc()

int CMemoryCardAccess::SaveToMc ( int  file_no)

Writes the save image to the save file with the given number and the configuration to the configuration file.

Mangled name:
SaveToMc__17CMemoryCardAccessFi
Address:
0x215B90
Size:
0x6B0

Definition at line 1148 of file memorycardaccess.cpp.

◆ LoadFromMc()

int CMemoryCardAccess::LoadFromMc ( int  file_no)

Reads the save file with the given number into the save data.

Mangled name:
LoadFromMc__17CMemoryCardAccessFi
Address:
0x216240
Size:
0x410

Definition at line 1361 of file memorycardaccess.cpp.

◆ FormatForMc()

int CMemoryCardAccess::FormatForMc ( )

Formats the card in the current port.

Mangled name:
FormatForMc__17CMemoryCardAccessFv
Address:
0x216650
Size:
0x1D0

Definition at line 1482 of file memorycardaccess.cpp.

◆ DeleteFile()

int CMemoryCardAccess::DeleteFile ( int  file_no)

Deletes the save file with the given number.

Mangled name:
DeleteFile__17CMemoryCardAccessFi
Address:
0x216820
Size:
0x160

Definition at line 1548 of file memorycardaccess.cpp.

◆ GetMsgNo()

int CMemoryCardAccess::GetMsgNo ( int  msg_no)

Returns the message of the operation that the class is running, counted from the given message number.

Mangled name:
GetMsgNo__17CMemoryCardAccessFi
Address:
0x216980
Size:
0xC8

Definition at line 1593 of file memorycardaccess.cpp.

◆ McError()

int CMemoryCardAccess::McError ( int  result)

Records the kind of the given error and the operation, file and step that it stopped.

Mangled name:
McError__17CMemoryCardAccessFi
Address:
0x216A50
Size:
0x19C

Definition at line 1631 of file memorycardaccess.cpp.

◆ DmySync()

void CMemoryCardAccess::DmySync ( )

Waits until the memory card library has no command left to finish.

Mangled name:
DmySync__17CMemoryCardAccessFv
Address:
0x216BF0
Size:
0x44

Definition at line 1672 of file memorycardaccess.cpp.

◆ McUnFormatForDebug()

int CMemoryCardAccess::McUnFormatForDebug ( )

Unformats the card in the current port.

Mangled name:
McUnFormatForDebug__17CMemoryCardAccessFv
Address:
0x216C40
Size:
0x110

Definition at line 1684 of file memorycardaccess.cpp.

Member Data Documentation

◆ port

s32 CMemoryCardAccess::port

Port that every command of the class names.

Definition at line 147 of file memorycardaccess.hpp.

◆ file_no

s32 CMemoryCardAccess::file_no

Save file that the current operation works on.

Definition at line 148 of file memorycardaccess.hpp.

◆ error

MC_ERROR_INFO CMemoryCardAccess::error

What stopped the last operation.

Definition at line 149 of file memorycardaccess.hpp.

◆ version

char CMemoryCardAccess::version[0x20]

Version string that every save file carries after its data.

Definition at line 150 of file memorycardaccess.hpp.

◆ dir_name

char CMemoryCardAccess::dir_name[0x20]

Name of the save directory on the card.

Definition at line 151 of file memorycardaccess.hpp.

◆ file_name

char CMemoryCardAccess::file_name[0x20]

Name that every save file of the game starts with.

Definition at line 152 of file memorycardaccess.hpp.

◆ current_dir

char CMemoryCardAccess::current_dir[0x40]

Directory that sceMcChdir writes back.

Definition at line 153 of file memorycardaccess.hpp.

◆ func_no

s32 CMemoryCardAccess::func_no

Operation that the class is running.

Definition at line 154 of file memorycardaccess.hpp.

◆ unk_C0

u8 CMemoryCardAccess::unk_C0[4]

Definition at line 155 of file memorycardaccess.hpp.

◆ step

s32 CMemoryCardAccess::step

Step that the current operation has reached.

Definition at line 156 of file memorycardaccess.hpp.

◆ fd

s32 CMemoryCardAccess::fd

File that the last sceMcOpen returned, -1 until one does.

Definition at line 157 of file memorycardaccess.hpp.

◆ dir_table

MC_DIR_ENTRY* CMemoryCardAccess::dir_table

Table that GetDir fills with the entries of the save directory.

Definition at line 158 of file memorycardaccess.hpp.

◆ save_buffer

CSaveData* CMemoryCardAccess::save_buffer

Save data at the start of the save image.

Definition at line 159 of file memorycardaccess.hpp.

◆ check_sum

char* CMemoryCardAccess::check_sum

Checksum bytes of the save image, one for every 64 bytes of the save data.

Definition at line 160 of file memorycardaccess.hpp.

◆ load_buffer

char* CMemoryCardAccess::load_buffer

Area behind the save image that a load or a conversion reads a whole save file into.

Definition at line 161 of file memorycardaccess.hpp.

◆ read_buffer

char* CMemoryCardAccess::read_buffer

Area behind the save image that a read fills.

Definition at line 162 of file memorycardaccess.hpp.

◆ idle_code

s32 CMemoryCardAccess::idle_code

Set to 61 whenever the class goes idle.

Definition at line 163 of file memorycardaccess.hpp.

◆ transferred

s32 CMemoryCardAccess::transferred

Bytes that the current read or write has moved.

Definition at line 164 of file memorycardaccess.hpp.

◆ transfer_size

s32 CMemoryCardAccess::transfer_size

Bytes that the current read or write is to move.

Definition at line 165 of file memorycardaccess.hpp.

◆ icon_sys

sceMcIconSys CMemoryCardAccess::icon_sys

icon.sys image that MakeDir writes into the save directory.

Definition at line 166 of file memorycardaccess.hpp.

◆ icon

MC_ICON_DATA CMemoryCardAccess::icon

Icon files that the save directory is to carry.

Definition at line 167 of file memorycardaccess.hpp.

◆ card

MC_CARD_INFO CMemoryCardAccess::card[MC_CARD_MAX]

What the class found out about the card in each port.

Definition at line 168 of file memorycardaccess.hpp.

◆ file_info

SAVEDATA_INFO CMemoryCardAccess::file_info[MC_SAVE_FILE_MAX]

Save files of the card, as the menus show them.

Definition at line 169 of file memorycardaccess.hpp.

◆ unk_7BC

u8 CMemoryCardAccess::unk_7BC[4]

Definition at line 170 of file memorycardaccess.hpp.