mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
Fixes issue 1255.
(wxString / char * conversion) Move CopySJISToString to WxUtils. Add ability to view sjis name and comment for japanese memcards Add ability to format sjis memcards CopySJISToString needs work on linux git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3945 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -71,7 +71,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
fail = false;
|
||||
if (!mcd)
|
||||
{
|
||||
if (!PanicYesNo("\"%s\" does not exist.\n Create a new 16MB Memcard?", filename))
|
||||
if (!AskYesNo("\"%s\" does not exist.\n Create a new 16MB Memcard?", filename))
|
||||
{
|
||||
fail = true;
|
||||
return;
|
||||
@ -83,7 +83,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
return;
|
||||
}
|
||||
mcdFile = mcd;
|
||||
Format();
|
||||
Format(!AskYesNo("Format as ascii (NTSC\\PAL)?\nChoose no for sjis (NTSC-J)", filename));
|
||||
fclose(mcd);
|
||||
mcd = fopen(filename, "r+b");
|
||||
}
|
||||
@ -232,6 +232,11 @@ bool GCMemcard::IsOpen()
|
||||
return (mcdFile!=NULL);
|
||||
}
|
||||
|
||||
bool GCMemcard::IsAsciiEncoding()
|
||||
{
|
||||
return hdr.Encoding[1] == 0;
|
||||
}
|
||||
|
||||
bool GCMemcard::Save()
|
||||
{
|
||||
bool completeWrite = true;
|
||||
@ -769,17 +774,17 @@ u32 GCMemcard::CopyFrom(GCMemcard& source, u8 index)
|
||||
}
|
||||
}
|
||||
|
||||
u32 GCMemcard::ImportGci(const char *fileName, std::string fileName2)
|
||||
u32 GCMemcard::ImportGci(const char *inputFile, std::string outputFile)
|
||||
{
|
||||
if (fileName2.empty() && !mcdFile) return OPENFAIL;
|
||||
if (outputFile.empty() && !mcdFile) return OPENFAIL;
|
||||
|
||||
FILE *gci = fopen(fileName, "rb");
|
||||
FILE *gci = fopen(inputFile, "rb");
|
||||
if (!gci) return OPENFAIL;
|
||||
|
||||
int offset;
|
||||
char * tmp = new char[0xD];
|
||||
std::string fileType;
|
||||
SplitPath(fileName, NULL, NULL, &fileType);
|
||||
SplitPath(inputFile, NULL, NULL, &fileType);
|
||||
|
||||
if( !strcasecmp(fileType.c_str(), ".gci"))
|
||||
offset = GCI;
|
||||
@ -837,9 +842,9 @@ u32 GCMemcard::ImportGci(const char *fileName, std::string fileName2)
|
||||
fread(tempSaveData, 1, size, gci);
|
||||
fclose(gci);
|
||||
u32 ret;
|
||||
if(!fileName2.empty())
|
||||
if(!outputFile.empty())
|
||||
{
|
||||
FILE * gci2 = fopen(fileName2.c_str(), "wb");
|
||||
FILE * gci2 = fopen(outputFile.c_str(), "wb");
|
||||
bool completeWrite = true;
|
||||
if (!gci2) return OPENFAIL;
|
||||
fseek(gci2, 0, SEEK_SET);
|
||||
@ -1132,7 +1137,7 @@ u32 GCMemcard::ReadAnimRGBA8(u8 index, u32* buffer, u8 *delays)
|
||||
return frames;
|
||||
}
|
||||
|
||||
bool GCMemcard::Format(bool New, int slot, u16 SizeMb, bool sjis, bool hdrOnly)
|
||||
bool GCMemcard::Format(bool sjis, bool New, int slot, u16 SizeMb, bool hdrOnly)
|
||||
{
|
||||
//Currently only formats cards for slot A
|
||||
u32 data_size = BLOCK_SIZE * (SizeMb * MBIT_TO_BLOCKS - MC_FST_BLOCKS);
|
||||
|
@ -174,8 +174,9 @@ public:
|
||||
~GCMemcard();
|
||||
|
||||
bool IsOpen();
|
||||
bool IsAsciiEncoding();
|
||||
bool Save();
|
||||
bool Format(bool New = true, int slot = 0, u16 SizeMb = MemCard2043Mb, bool sjis = false, bool hdrOnly = false);
|
||||
bool Format(bool sjis = false, bool New = true, int slot = 0, u16 SizeMb = MemCard2043Mb, bool hdrOnly = false);
|
||||
|
||||
void calc_checksumsBE(u16 *buf, u32 num, u16 *c1, u16 *c2);
|
||||
u32 TestChecksums();
|
||||
@ -238,7 +239,7 @@ public:
|
||||
u32 CopyFrom(GCMemcard& source, u8 index);
|
||||
|
||||
// reads a .gci/.gcs/.sav file and calls ImportFile or saves out a gci file
|
||||
u32 ImportGci(const char* fileName, std::string fileName2);
|
||||
u32 ImportGci(const char* inputFile, std::string outputFile);
|
||||
|
||||
// writes a .gci file to disk containing index
|
||||
u32 ExportGci(u8 index, const char* fileName, std::string* fileName2);
|
||||
|
Reference in New Issue
Block a user