Skip to content

Commit c404be7

Browse files
committed
memcard progress
1 parent da5ac8d commit c404be7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

decompile/WorkInProgress/src/MEMCARD/MEMCARD_17_HandleEvent.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ int DECOMP_MEMCARD_HandleEvent(void)
159159
sdata->memcard_remainingAttempts--;
160160
extra = MC_EXTRA_READ_ICON;
161161
break;
162-
162+
163+
// LOAD Data
163164
case 4:
164165
case 6:
165166

@@ -205,6 +206,7 @@ int DECOMP_MEMCARD_HandleEvent(void)
205206

206207
// at this point, assume checksum succeeded (return 1)
207208

209+
// THIS WILL NEVER HAPPEN
208210
if (((sdata->memcardStatusFlags & 4) == 0) && (sdata->memcard_stage < 7))
209211
{
210212
sdata->memcard_stage++;
@@ -213,7 +215,8 @@ int DECOMP_MEMCARD_HandleEvent(void)
213215
}
214216

215217
return event;
216-
218+
219+
// SAVE Data
217220
case 9:
218221
case 10:
219222
case 11:

decompile/WorkInProgress/src/MEMCARD/MEMCARD_20_Save.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ uint8_t MEMCARD_Save(int slotIdx, char *name,
1717

1818
// Search for "MEMCARD_SET_SIZE_BYTE3"
1919

20-
// NOTE: Commented out because param6 always 0, will always eval to false
20+
// ALWAYS USED,
21+
// param_6 is always zero, (used to determine 1-block or 2-block)
22+
// fileSize*2 is always 2 blocks, rigged to make sure this path happens
2123
if (((param6 & 1) == 0) && (1 < sdata->memcardIconSize + fileSize * 2 + 0x1fff >> 0xd))
2224
{
2325
sdata->memcardStatusFlags = sdata->memcardStatusFlags | 4;
2426
*((uint8_t *)(data.memcardIcon_PsyqHand) + 3) = ((sdata->memcardIconSize + fileSize * 1 + 0x1fff) >> 0xd);
2527
}
28+
29+
// UNUSED
30+
// This is likely from a time when "fileSize" was "blockSize",
31+
// then this path would be used to write a 2-block file
2632
else
2733
{
2834
sdata->memcardStatusFlags = sdata->memcardStatusFlags & 0xfffffffb;

0 commit comments

Comments
 (0)