Skip to content

Commit 1182846

Browse files
committed
memcard progress
1 parent a08debc commit 1182846

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

decompile/WorkInProgress/src/MEMCARD/MEMCARD_17_HandleEvent.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,13 @@ int DECOMP_MEMCARD_HandleEvent(void)
131131

132132
// Search for "MEMCARD_SET_SIZE_BYTE3"
133133
if (
134+
// if a ghost file (2x) is larger than 1 memcard block file
135+
// if the number of blocks in this save, is more than 1 block
134136
// ((sdata->memcardIconSize + sdata->memcardFileSize * 2 + 0x1fff >> 0xd) > 1) &&
135-
((sdata->memcardIconSize + sdata->memcardFileSize * 1 + 0x1fff >> 0xd) < ((int)(unsigned char)sdata->memcard_ptrStart[3]))
137+
// ((sdata->memcardIconSize + sdata->memcardFileSize * 1 + 0x1fff >> 0xd) < ((int)(unsigned char)sdata->memcard_ptrStart[3]))
138+
139+
// if 2 blocks in the file
140+
((int)(unsigned char)sdata->memcard_ptrStart[3]) == 2
136141
)
137142
{
138143
// 1-slot file

decompile/WorkInProgress/src/MEMCARD/MEMCARD_19_Load.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ uint8_t MEMCARD_Load(int slotIdx, char *name, uint8_t *ptrMemcard, int memcardFi
2121
}
2222
else
2323
{
24+
// use ASYNC checksum load (ALWAYS)
2425
if ((param5 & 2) == 0)
2526
{
26-
// dont process crc16 to the end of memory,
27-
// just the next 0x200 bytes (async)
27+
// Process 0x200 bytes per frame
2828
sdata->memcardStatusFlags = sdata->memcardStatusFlags & 0xfffffff7;
2929
}
30+
31+
// skip ASYNC and use the check the full card (UNUSED)
3032
else
3133
{
3234
// process crc16 to the end of memory

decompile/WorkInProgress/src/MEMCARD/MEMCARD_20_Save.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ uint8_t MEMCARD_Save(int slotIdx, char *name,
2020
// NOTE: Commented out because param6 always 0, will always eval to false
2121
if (((param6 & 1) == 0) && (1 < sdata->memcardIconSize + fileSize * 2 + 0x1fff >> 0xd))
2222
{
23-
DAT_800857a3 = (byte)(sdata->memcardIconSize + fileSize + 0x1fff >> 0xd);
2423
sdata->memcardStatusFlags = sdata->memcardStatusFlags | 4;
24+
*((uint8_t *)(data.memcardIcon_PsyqHand) + 3) = ((sdata->memcardIconSize + fileSize * 1 + 0x1fff) >> 0xd);
2525
}
2626
else
2727
{
2828
sdata->memcardStatusFlags = sdata->memcardStatusFlags & 0xfffffffb;
29-
*((uint8_t *)(data.memcardIcon_PsyqHand) + 3) = ((sdata->memcardIconSize + fileSize * 2 + 0x1fff) >> 0xd) & 0xFF;
29+
*((uint8_t *)(data.memcardIcon_PsyqHand) + 3) = ((sdata->memcardIconSize + fileSize * 2 + 0x1fff) >> 0xd);
3030
}
3131

3232
uint8_t *memcardIconPtr = (uint8_t *)data.memcardIcon_PsyqHand[1];

0 commit comments

Comments
 (0)