Disabled __sector_erase() check when raw restoring as some unofficial cards seem to have problems with it.

Corrected typo in buffer checking in raw.c

Note: not updating debug version because the changes don't affect its code
This commit is contained in:
sulokutdcmago 2014-01-05 20:15:24 +00:00
parent 5c04c9a076
commit 2493ec609d
4 changed files with 20 additions and 8 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name>GCMM</name>
<coder>Suloku</coder>
<version>1.4b</version>
<release_date>20130903000000</release_date>
<version>1.4c</version>
<release_date>20140105000000</release_date>
<short_description>Memory Card Manager</short_description>
<long_description>A memory card manager for Wii/GC.

View File

@ -1,5 +1,5 @@
×—–­—–­—–­—–­ –­—–­—–­—–­—–­—–­—–­—–­—–­—–­— ­—–­—–­—–­—–­—–­—–­—–­—-­—–­-–•¬
|0O×řoˇ GCMM 1.4b by suloku ˇoř×O0|
|0O×øo· GCMM 1.4c by suloku ·oø×O0|
| http://code.google.com/p/gcmm |
| (Under GPL License) |
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
@ -29,11 +29,14 @@ I (suloku) have updated the code to newest libraries to port it to the Wii syste
×—–­—–­—–­—–­ –­—–­—–­—–­—–­—–­—–­—–­—–­—–­— ­—–­—–­—–­—–­—–­—–­—–­—-­—–­-–•¬
|0O×øo· UPDATE HISTORY ·oø×O0|
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
[What's New 1.4c - january 05, 2014 - By suloku]
* Disabled __sector_erase() check when raw restoring as some unofficial cards seem to have problems with it.
[What's New 1.4b - september 03, 2013 - By suloku]
* Card initialization was wrong all the way, wich lead to savegames of the same game of different region or those that shared similar filenames (Twilight Princess and WindWaker) to not work properly. Thanks to antidote.crk for noticing. (read considerations sections for more info)
* Added version display
[What's New 1.4a - october 18, 2012 - By suloku]
* Fixed SD Gecko when inserted/swapped at slot selection screen in GameCube mode.
* FLash ID display was missing a byte

View File

@ -38,7 +38,7 @@
//Comment FLASHIDCHECK to allow writing any image to any mc. This will corrupt official cards.
#define FLASHIDCHECK
const char appversion[] = "v1.4b";
const char appversion[] = "v1.4c";
int mode;
int cancel;
int doall;

View File

@ -376,7 +376,7 @@ s8 RestoreRawImage( s32 slot, char *sdfilename, s32 *bytes_writen )
return -1;
}
EraseCheckBuffer = (u8*)memalign(32,SectorSize);
if(CheckBuffer == NULL)
if(EraseCheckBuffer == NULL)
{
mem_free(CardBuffer);
mem_free(CheckBuffer);
@ -486,6 +486,13 @@ s8 RestoreRawImage( s32 slot, char *sdfilename, s32 *bytes_writen )
usleep(1*1000); //sleep untill the erase is done which sadly takes alot longer then read
__card_sync(slot);
#ifdef DEBUGRAW
//Check if the sector was erased (all set to 0).
//Some unofficial memory cards apparently don't erase sectors when using __card_sectorerase(),
//instead they can directly properly store the data calling just __card_write(),
//so the following check will always fail, preventing restore for those cards, so I'm disabling
//it and relying only on the __card_read() check done after writing the data.
/*
memset(CheckBuffer,0,write_len);
DCInvalidateRange(CheckBuffer,write_len);
read_data = 0;
@ -529,7 +536,8 @@ s8 RestoreRawImage( s32 slot, char *sdfilename, s32 *bytes_writen )
CARD_Unmount(slot);
return -1;
}
#endif
*/
#endif
}else
{
fclose(dumpFd);
@ -539,7 +547,7 @@ s8 RestoreRawImage( s32 slot, char *sdfilename, s32 *bytes_writen )
mem_free(EraseCheckBuffer);
#endif
//printf("\nerror writing data(%d) Memory card could be corrupt now!!!\n",err);
sprintf(msg, "error erasing sector(%d) Memory card could be corrupt now!!!",err);
sprintf(msg, "error erasing sector(%d). Memory card could be corrupt now!!!",err);
WaitPrompt (msg);
CARD_Unmount(slot);
return -1;
@ -554,6 +562,7 @@ s8 RestoreRawImage( s32 slot, char *sdfilename, s32 *bytes_writen )
__card_sync(slot);
#ifdef DEBUGRAW
//Check the written data against the buffer
memset(CheckBuffer,0,write_len);
DCInvalidateRange(CheckBuffer,write_len);
read_data = 0;