mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-25 20:16:53 +01:00
fix mem card write verify bug
This commit is contained in:
parent
d9c9fc15a7
commit
00e80c3f32
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
static u8 * SysArea = NULL;
|
static u8 * SysArea = NULL;
|
||||||
static char savecomments[2][32];
|
static char savecomments[2][32];
|
||||||
|
static u8 * verifybuffer = NULL;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* MountMC
|
* MountMC
|
||||||
@ -151,14 +152,14 @@ static int
|
|||||||
VerifyMCFile (char *buf, int slot, char *filename, int datasize)
|
VerifyMCFile (char *buf, int slot, char *filename, int datasize)
|
||||||
{
|
{
|
||||||
card_file CardFile;
|
card_file CardFile;
|
||||||
unsigned char verifybuffer[65536] ATTRIBUTE_ALIGN (32);
|
|
||||||
int CardError;
|
int CardError;
|
||||||
unsigned int blocks;
|
unsigned int blocks;
|
||||||
unsigned int SectorSize;
|
unsigned int SectorSize;
|
||||||
int bytesleft = 0;
|
int bytesleft = 0;
|
||||||
int bytesread = 0;
|
int bytesread = 0;
|
||||||
|
|
||||||
memset (verifybuffer, 0, 65536);
|
verifybuffer = (u8 *)memalign(32, 262144);
|
||||||
|
memset (verifybuffer, 0, 262144);
|
||||||
|
|
||||||
// Get Sector Size
|
// Get Sector Size
|
||||||
CARD_GetSectorSize (slot, &SectorSize);
|
CARD_GetSectorSize (slot, &SectorSize);
|
||||||
@ -202,6 +203,7 @@ VerifyMCFile (char *buf, int slot, char *filename, int datasize)
|
|||||||
CARD_Close (&CardFile);
|
CARD_Close (&CardFile);
|
||||||
CancelAction();
|
CancelAction();
|
||||||
}
|
}
|
||||||
|
free(verifybuffer);
|
||||||
return bytesread;
|
return bytesread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user