enable GC mem card saves, finalize 2.0.2

This commit is contained in:
dborth 2008-10-06 19:59:39 +00:00
parent b3f62d23f8
commit dca0298714
7 changed files with 111 additions and 152 deletions

View File

@ -26,7 +26,7 @@ INCLUDES := source/vba source/ngc
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) \ CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) \
-DNGC -DWII_DVD -DWORDS_BIGENDIAN -DC_CORE -DFINAL_VERSION \ -DNGC -DWII_DVD -DWORDS_BIGENDIAN -DC_CORE -D__ppc__ -DFINAL_VERSION \
-DSDL -DNO_PNG -DHAVE_ZUTIL_H -DSDL -DNO_PNG -DHAVE_ZUTIL_H
CXXFLAGS = $(CFLAGS) CXXFLAGS = $(CFLAGS)
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map -Wl,--cref LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map -Wl,--cref

View File

@ -420,11 +420,11 @@ bool SwitchDVDFolder(char origdir[])
/**************************************************************************** /****************************************************************************
* LoadDVDFile * LoadDVDFile
* This function will load a file from DVD, in BIN, SMD or ZIP format. * This function will load a file from DVD
* The values for offset and length are inherited from dvddir and * The values for offset and length are inherited from dvddir and
* dvddirlength. * dvddirlength.
* *
* The buffer parameter should re-use the initial ROM buffer. * The buffer parameter should re-use the initial ROM buffer
***************************************************************************/ ***************************************************************************/
int int
@ -442,7 +442,7 @@ LoadDVDFile (unsigned char *buffer, int length)
discoffset = dvddir; discoffset = dvddir;
ShowAction ((char*) "Loading..."); ShowAction ((char*) "Loading...");
if(length > 0) if(length > 0) // do a partial read (eg: to check file header)
{ {
dvd_read (buffer, length, discoffset); dvd_read (buffer, length, discoffset);
} }

View File

@ -5,135 +5,71 @@
#ifndef _IMGSAVEICON_ #ifndef _IMGSAVEICON_
#define _IMGSAVEICON_ #define _IMGSAVEICON_
const unsigned short saveicon[1024] = { const unsigned long saveicon[32*32] = {
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753, 0x579A5753,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852, 0x589B5852,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x599B5951, 0x599B5951, 0x599B5951, 0x599B5951, 0x599B5951, 0x599B5951, 0x599B5951, 0x599B5951,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x599B5951, 0x599B5951, 0x599B5951, 0x599B5951, 0x5A9B5951, 0x599B5951, 0x599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 0x00800080, 0x1F8F4765, 0x5F9D5F4F, 0x5A93275E, 0x00800080, 0x26914D62, 0x5F9D5F4E, 0x5F9D5F4E,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xA11E, 0x843C, 0x8439, 0x9CF7, 0x60952C5B, 0x6551C69C, 0xCD631B91, 0x53974658, 0x3761D091, 0xA766468F, 0xD658D898, 0xD85AD897,
0x801F, 0x801F, 0x801C, 0x8018, 0x801F, 0x801F, 0x801C, 0x8018, 0xD755D399, 0x89741F81, 0x549B6051, 0x337C6179, 0xD454D49A, 0x7B77267F, 0x609D604E, 0x609D604E,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xEB5C, 0xFFFF, 0xFFFF, 0xFFFF, 0x609A4654, 0x2F53BB9B, 0xC5595197, 0x3A903363, 0x5E58C998, 0x5D69428D, 0xCA4ACBA0, 0xCC4CCC9F,
0x800F, 0xB9D3, 0xFFFF, 0xFFFF, 0x8013, 0x8008, 0xDAD7, 0xFFFF, 0xCB49C7A1, 0xC554699A, 0x2D95615B, 0x136EA387, 0xD050D09C, 0xBB67068D, 0x609E604E, 0x619D604E,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x629D624D, 0x0D5E9891, 0xBC4D779F, 0x27881370, 0x9E4AC1A1, 0x326B3E8C, 0xBA3ABBAA, 0x25790084,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0062A292, 0xBC459AA4, 0x138F5465, 0x1A60C893, 0xBE4DCC9E, 0xC4583198, 0x48996254, 0x629D624D,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x639E624D, 0x276A6386, 0xB03CA4A9, 0x0D7D197F, 0xBE3F9EA7, 0x0D733985, 0xAF31B3B0, 0x24780084,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00609E93, 0xB94C589F, 0x34903564, 0x5851BF9C, 0x7350B49D, 0xBB466BA3, 0x2795625C, 0x629E634D,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x639E634C, 0x427B3578, 0xA42BB1B4, 0x3167498E, 0xB13E66A8, 0x2776367F, 0xA426A7B7, 0xAC2DAFB2,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xAF30B1B0, 0x786C2186, 0x5E921A60, 0x853EB2A8, 0x2E5D6A94, 0xAE3293AF, 0x0D916363, 0x639E634C,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x659F644C, 0x65900664, 0x9529A3B7, 0x4E4D6F9F, 0xA34041A7, 0x3C7A347A, 0x9F26A0B9, 0xA126A2B9,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xA225A3B8, 0xA74050A6, 0x2F811776, 0xAA2A9AB4, 0x006E418B, 0xA425A4B8, 0x20825070, 0x649F654C,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x659E654C, 0x65931B5F, 0x73349EB2, 0x753695B0, 0x94570799, 0x437B3478, 0x9D289EBB, 0x1F770085,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x005F7595, 0xA12998B7, 0x076B4B8B, 0xA1269FB9, 0x9E289EBB, 0x9E27A0B9, 0x4B73357F, 0x659E654C,
0xFFFF, 0x801F, 0x801F, 0x885F, 0xFFFF, 0x98D6, 0x801F, 0x801F, 0x659F654C, 0x65983C56, 0x3D439AAA, 0x9A299ABC, 0x70641B8F, 0x437C3378, 0x9B299CBB, 0x1F770085,
0xFFFF, 0xFFFF, 0xFFFF, 0x843C, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00626993, 0x9E2B93B9, 0x07617393, 0x992A97BC, 0x962C96BD, 0x982A9BBC, 0x7E5F1492, 0x659F654C,
0xFBDF, 0x801E, 0x801B, 0x8017, 0x801E, 0x801B, 0x8018, 0x8015, 0x679F674B, 0x669D594E, 0x144F97A2, 0x962C96BD, 0x46743680, 0x447B3278, 0x972B97BD, 0x972B97BD,
0x801A, 0x8018, 0x8015, 0x8011, 0x8016, 0x8014, 0x8011, 0x800D, 0x972B97BD, 0x983965B2, 0x0A558D9E, 0x8A560A9F, 0x00800080, 0x454197AD, 0x9A4E14A2, 0x599D674E,
0x8012, 0x800B, 0x8848, 0xFFFF, 0x8010, 0x8009, 0x8003, 0xFFFF, 0x679F674A, 0x679F674A, 0x14617793, 0x932D93BF, 0x14875A6C, 0x447C3178, 0x932D92BF, 0x922D92BF,
0x800C, 0x8007, 0x8006, 0xFFFF, 0x8008, 0x8005, 0xA52E, 0xFFFF, 0x922D92BF, 0x586C228A, 0x444393AE, 0x6B651B8F, 0x679C534F, 0x1D4D95A5, 0x974148AC, 0x37976756,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x68A0674A, 0x68A0684A, 0x3F8C146A, 0x00800080, 0x2A966859, 0x68962A59, 0x00800080, 0x00800080,
0xFFFF, 0xFFFF, 0xFBBD, 0xF1EF, 0xFFFF, 0xF508, 0xF000, 0xEC00, 0x00800080, 0x2A93545F, 0x2A860075, 0x1B8E4766, 0x68A0674A, 0x2A860075, 0x00862A74, 0x639F674B,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x699F684A, 0x699F694A, 0x699F684A, 0x699F694A, 0x699F694A, 0x699F694A, 0x699F694A, 0x699F694A,
0xE56B, 0xE16B, 0xE673, 0xFFFF, 0xE800, 0xDC00, 0xCC00, 0xB400, 0x699F694A, 0x699F694A, 0x699F694A, 0x699F694A, 0x699F694A, 0x699F694A, 0x699F694A, 0x699F694A,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x6AA06949, 0x69A0694A, 0x69A06A49, 0x69A06A49, 0x6AA06949, 0x69A0694A, 0x69A0694A, 0x69A0694A,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xDE94, 0xFFFF, 0xFFFF, 0xFFFF, 0x6AA06949, 0x69A06A49, 0x69A06A49, 0x69A0694A, 0x69A0694A, 0x6AA06949, 0x69A0694A, 0x69A0694A,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x6BA06A49, 0x6AA06A49, 0x6BA06B49, 0x6AA06B49, 0x6AA06B49, 0x6BA06B49, 0x6AA06B49, 0x6BA06B49,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xEBBA, 0x6BA06B49, 0x6BA06A49, 0x6BA06A49, 0x6AA06B49, 0x6BA06B49, 0x6BA06A49, 0x6AA06B49, 0x6BA06B49,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x6CA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48,
0xFFFF, 0xFFFF, 0xEFBA, 0xE378, 0xB2EB, 0x9AA4, 0x9AA5, 0x9AA5, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48, 0x6BA16B48,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48,
0xE778, 0xF3BC, 0xFFFF, 0xFFFF, 0x9A84, 0x9623, 0x91E3, 0xB66C, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48, 0x6CA16C48,
0xD6BB, 0x800E, 0x800C, 0x8008, 0xFFFF, 0x8C6A, 0x8004, 0x8004, 0x6DA16C48, 0x6DA16D48, 0x6DA16D48, 0x6DA16D48, 0x6DA16C48, 0x6CA16D48, 0x6CA16D48, 0x6DA16D48,
0xFFFF, 0xFFFF, 0xB191, 0xDAD8, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x6DA16D48, 0x6DA16D48, 0x6CA16D48, 0x6DA16D48, 0x6DA16D48, 0x6DA16D48, 0x6CA16D48, 0x6DA16D48,
0x8006, 0x8004, 0xFFFF, 0xFFFF, 0x8006, 0xF39D, 0xFFFF, 0xFA94, 0x6EA16E47, 0x6DA16D47, 0x6DA16D47, 0x6DA16D47, 0x6DA16D47, 0x6EA16D47, 0x6DA16D47, 0x6DA16E47,
0xFFFF, 0xFFFF, 0xFFFF, 0xEC21, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x6DA16D47, 0x6DA16D47, 0x6DA16E47, 0x6DA16D47, 0x6DA16D47, 0x6EA16D47, 0x6DA16D47, 0x6DA16D47,
0xF484, 0xF800, 0xF800, 0xF000, 0xF800, 0xF800, 0xFD6B, 0xF8C6, 0x6EA16E46, 0x6EA16E46, 0x6EA16E47, 0x6EA16E46, 0x6EA16E46, 0x6EA16E46, 0x6EA16E46, 0x6EA16E47,
0xF400, 0xF400, 0xFDEF, 0xF4A5, 0xFF18, 0xEC63, 0xE400, 0xE000, 0x6EA16E46, 0x6EA16E47, 0x6EA16E46, 0x6EA16E46, 0x6EA16E47, 0x6EA16E46, 0x6EA16E46, 0x6EA16E46,
0xE800, 0xE000, 0xD400, 0xC400, 0xE400, 0xE000, 0xD000, 0xC400, 0x6FA26F47, 0x6FA16E46, 0x6FA16E46, 0x6FA26F47, 0x6FA26F47, 0x6FA26F47, 0x6FA26F47, 0x6FA26F47,
0xE000, 0xD800, 0xCC00, 0xC000, 0xD800, 0xD000, 0xC400, 0xB800, 0x6FA26F47, 0x6FA26F47, 0x6FA26F47, 0x6FA26F47, 0x6FA26F47, 0x6FA26F47, 0x6FA26F47, 0x6FA26F47,
0xA400, 0xD673, 0xFFFF, 0xFFFF, 0xB400, 0x9000, 0xFFFF, 0xFFFF, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046,
0xB000, 0x9000, 0xFFFF, 0xFFFF, 0xA800, 0x9000, 0xFFFF, 0xFFFF, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046, 0x70A27046,
0xFFFF, 0xFFFF, 0xDB75, 0x9AE4, 0xFFFF, 0xFFFF, 0x9A84, 0xA6E7,
0xFFFF, 0xFFFF, 0xA1E7, 0x9604, 0xFFFF, 0xFFFF, 0xFFFF, 0x8D03,
0xA707, 0xA708, 0xAF2A, 0xAF2A, 0xA6E7, 0xA2C7, 0xBF4E, 0xCB71,
0x9E46, 0x9E26, 0x9A25, 0x9604, 0x80E0, 0x8922, 0x8D22, 0x8D22,
0xA2C7, 0xA2A7, 0x9E66, 0x95E4, 0xA2A6, 0x9E46, 0x9E25, 0x95C4,
0x99E5, 0x95C4, 0x9163, 0x8D02, 0x88E2, 0x84A1, 0x8060, 0x8020,
0x8500, 0xF7BD, 0xFFFF, 0xFFFF, 0x8901, 0xA148, 0xFFFF, 0xFFFF,
0x8040, 0xB9ED, 0xFFFF, 0xFFFF, 0x9926, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0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FFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
}; };
#endif #endif

View File

@ -67,7 +67,7 @@ bool TestCard(int slot, bool silent)
/*** Initialize Card System ***/ /*** Initialize Card System ***/
memset (SysArea, 0, CARD_WORKAREA); memset (SysArea, 0, CARD_WORKAREA);
CARD_Init ("SNES", "00"); CARD_Init ("VBA0", "00");
/*** Try to mount the card ***/ /*** Try to mount the card ***/
if (MountCard(slot, silent) == 0) if (MountCard(slot, silent) == 0)
@ -135,7 +135,7 @@ VerifyMCFile (unsigned char *buf, int slot, char *filename, int datasize)
/*** Initialize Card System ***/ /*** Initialize Card System ***/
memset (SysArea, 0, CARD_WORKAREA); memset (SysArea, 0, CARD_WORKAREA);
CARD_Init ("SNES", "00"); CARD_Init ("VBA0", "00");
/*** Try to mount the card ***/ /*** Try to mount the card ***/
CardError = MountCard(slot, NOTSILENT); CardError = MountCard(slot, NOTSILENT);
@ -214,7 +214,7 @@ LoadBufferFromMC (unsigned char *buf, int slot, char *filename, bool silent)
/*** Initialize Card System ***/ /*** Initialize Card System ***/
memset (SysArea, 0, CARD_WORKAREA); memset (SysArea, 0, CARD_WORKAREA);
CARD_Init ("SNES", "00"); CARD_Init ("VBA0", "00");
/*** Try to mount the card ***/ /*** Try to mount the card ***/
CardError = MountCard(slot, NOTSILENT); CardError = MountCard(slot, NOTSILENT);
@ -278,7 +278,7 @@ SaveBufferToMC (unsigned char *buf, int slot, char *filename, int datasize, bool
/*** Initialize Card System ***/ /*** Initialize Card System ***/
memset (SysArea, 0, CARD_WORKAREA); memset (SysArea, 0, CARD_WORKAREA);
CARD_Init ("SNES", "00"); CARD_Init ("VBA0", "00");
/*** Try to mount the card ***/ /*** Try to mount the card ***/
CardError = MountCard(slot, NOTSILENT); CardError = MountCard(slot, NOTSILENT);

View File

@ -122,14 +122,6 @@ PreferencesMenu ()
// some load/save methods are not implemented - here's where we skip them // some load/save methods are not implemented - here's where we skip them
// they need to be skipped in the order they were enumerated in vba.h // they need to be skipped in the order they were enumerated in vba.h
// skip
if(GCSettings.SaveMethod == METHOD_MC_SLOTA)
GCSettings.SaveMethod++;
if(GCSettings.SaveMethod == METHOD_MC_SLOTB)
GCSettings.SaveMethod++;
prefmenu[6][0] = '\0'; // MC saving not implemented
// no USB ports on GameCube // no USB ports on GameCube
#ifndef HW_RVL #ifndef HW_RVL
if(GCSettings.LoadMethod == METHOD_USB) if(GCSettings.LoadMethod == METHOD_USB)

View File

@ -317,7 +317,7 @@ LoadBufferFromSMB (char * sbuffer, char *filepath, int length, bool silent)
return 0; return 0;
} }
if(length > 0) if(length > 0) // do a partial read (eg: to check file header)
{ {
boffset = SMB_ReadFile (sbuffer, length, 0, smbfile); boffset = SMB_ReadFile (sbuffer, length, 0, smbfile);
} }

View File

@ -23,6 +23,7 @@
#include "Util.h" #include "Util.h"
#include "dmg/GB.h" #include "dmg/GB.h"
#include "dmg/gbGlobals.h" #include "dmg/gbGlobals.h"
#include "images/saveicon.h"
//#include "dmg/gbSound.h" //#include "dmg/gbSound.h"
#include "vba.h" #include "vba.h"
@ -314,6 +315,12 @@ bool LoadBatteryOrState(int method, int action, bool silent)
offset = LoadBufferFromMC (savebuffer, CARD_SLOTA, filepath, silent); offset = LoadBufferFromMC (savebuffer, CARD_SLOTA, filepath, silent);
else else
offset = LoadBufferFromMC (savebuffer, CARD_SLOTB, filepath, silent); offset = LoadBufferFromMC (savebuffer, CARD_SLOTB, filepath, silent);
// skip save icon and comments for Memory Card saves
int skip = sizeof (saveicon);
skip += 64; // sizeof savecomment
memmove(savebuffer, savebuffer+skip, offset-skip);
offset -= skip;
} }
// load savebuffer into VBA memory // load savebuffer into VBA memory
@ -365,15 +372,23 @@ bool LoadBatteryOrState(int method, int action, bool silent)
bool SaveBatteryOrState(int method, int action, bool silent) bool SaveBatteryOrState(int method, int action, bool silent)
{ {
char filepath[1024]; char filepath[1024];
char savecomment[2][32];
bool result = false; bool result = false;
int offset = 0; int offset = 0;
char ext[4]; char ext[4];
char savetype[10];
int datasize = 0; // we need the actual size of the data written int datasize = 0; // we need the actual size of the data written
if(action == 0) if(action == 0)
{
sprintf(ext, "sav"); sprintf(ext, "sav");
sprintf(savetype, "SRAM");
}
else else
{
sprintf(ext, "sgm"); sprintf(ext, "sgm");
sprintf(savetype, "Freeze");
}
ShowAction ((char*) "Saving..."); ShowAction ((char*) "Saving...");
@ -382,21 +397,37 @@ bool SaveBatteryOrState(int method, int action, bool silent)
AllocSaveBuffer(); AllocSaveBuffer();
// add save icon and comments for Memory Card saves
if(method == METHOD_MC_SLOTA || method == METHOD_MC_SLOTB)
{
offset = sizeof (saveicon);
// Copy in save icon
memcpy (savebuffer, saveicon, offset);
// And the comments
sprintf (savecomment[0], "%s %s", VERSIONSTR, savetype);
strncpy(savecomment[1], ROMFilename, 31); // truncate filename to 31 chars
savecomment[1][31] = 0; // make sure last char is null byte
memcpy (savebuffer + offset, savecomment, 64);
offset += 64;
}
// put VBA memory into savebuffer, sets datasize to size of memory written // put VBA memory into savebuffer, sets datasize to size of memory written
if(action == 0) if(action == 0)
{ {
if(cartridgeType == 1) if(cartridgeType == 1)
datasize = MemgbWriteBatteryFile((char *)savebuffer); datasize = MemgbWriteBatteryFile((char *)savebuffer+offset);
else else
datasize = MemCPUWriteBatteryFile((char *)savebuffer); datasize = MemCPUWriteBatteryFile((char *)savebuffer+offset);
} }
else else
{ {
bool written = emulator.emuWriteMemState((char *)savebuffer, SAVEBUFFERSIZE); bool written = emulator.emuWriteMemState((char *)savebuffer+offset, SAVEBUFFERSIZE-offset);
// we really should set datasize to the exact memory size written // we really should set datasize to the exact memory size written
// but instead we'll set it at 128K - although much of it will go unused // but instead we'll set it at 128K - although much of it will go unused
if(written) if(written)
datasize = (512*256); datasize = (1024*128);
} }
// write savebuffer into file // write savebuffer into file
@ -420,9 +451,9 @@ bool SaveBatteryOrState(int method, int action, bool silent)
sprintf (filepath, "%s.%s", ROMFilename, ext); sprintf (filepath, "%s.%s", ROMFilename, ext);
if(method == METHOD_MC_SLOTA) if(method == METHOD_MC_SLOTA)
offset = SaveBufferToMC (savebuffer, CARD_SLOTA, filepath, datasize, silent); offset = SaveBufferToMC (savebuffer, CARD_SLOTA, filepath, datasize+offset, silent);
else else
offset = SaveBufferToMC (savebuffer, CARD_SLOTB, filepath, datasize, silent); offset = SaveBufferToMC (savebuffer, CARD_SLOTB, filepath, datasize+offset, silent);
} }
if(offset > 0) if(offset > 0)