Skip to content

Commit eacbc71

Browse files
committed
memcard progress
1 parent f9f28ea commit eacbc71

File tree

3 files changed

+22
-40
lines changed

3 files changed

+22
-40
lines changed

decompile/WorkInProgress/src/MEMCARD/MEMCARD_19_Load.c

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,19 @@ uint8_t MEMCARD_Load(int slotIdx, char *name, uint8_t *ptrMemcard, int memcardFi
2121
}
2222
else
2323
{
24-
// NOTE: Commented out because param5 is always 0, Will always eval to false
25-
/*
2624
if ((param5 & 2) == 0)
27-
{
28-
// dont process crc16 to the end of memory,
29-
// just the next 0x200 bytes (async)
30-
sdata->memcardStatusFlags = sdata->memcardStatusFlags & 0xfffffff7;
31-
}
32-
else
33-
{
34-
*/
35-
// process crc16 to the end of memory
36-
sdata->memcardStatusFlags = sdata->memcardStatusFlags | 8;
25+
{
26+
// dont process crc16 to the end of memory,
27+
// just the next 0x200 bytes (async)
28+
sdata->memcardStatusFlags = sdata->memcardStatusFlags & 0xfffffff7;
29+
}
30+
else
31+
{
32+
// process crc16 to the end of memory
33+
sdata->memcardStatusFlags = sdata->memcardStatusFlags | 8;
34+
}
35+
3736
sdata->memcard_stage = MC_STAGE_LOAD_PART1_ICON;
38-
39-
// Read memory card
4037
return MEMCARD_ReadFile(0, 0x80);
41-
/*
42-
}
43-
*/
44-
}
38+
}
4539
}

decompile/WorkInProgress/src/MEMCARD/MEMCARD_20_Save.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,16 @@ uint8_t MEMCARD_Save(int slotIdx, char *name,
1818
// Search for "MEMCARD_SET_SIZE_BYTE3"
1919

2020
// NOTE: Commented out because param6 always 0, will always eval to false
21-
/*
2221
if (((param6 & 1) == 0) && (1 < sdata->memcardIconSize + fileSize * 2 + 0x1fff >> 0xd))
23-
{
24-
DAT_800857a3 = (byte)(sdata->memcardIconSize + fileSize + 0x1fff >> 0xd);
25-
sdata->memcardStatusFlags = sdata->memcardStatusFlags | 4;
26-
}
27-
else
28-
{
29-
*/
30-
sdata->memcardStatusFlags = sdata->memcardStatusFlags & 0xfffffffb;
31-
*((uint8_t *)(data.memcardIcon_PsyqHand) + 3) = ((sdata->memcardIconSize + fileSize * 2 + 0x1fff) >> 0xd) & 0xFF;
32-
/*
33-
}
34-
*/
22+
{
23+
DAT_800857a3 = (byte)(sdata->memcardIconSize + fileSize + 0x1fff >> 0xd);
24+
sdata->memcardStatusFlags = sdata->memcardStatusFlags | 4;
25+
}
26+
else
27+
{
28+
sdata->memcardStatusFlags = sdata->memcardStatusFlags & 0xfffffffb;
29+
*((uint8_t *)(data.memcardIcon_PsyqHand) + 3) = ((sdata->memcardIconSize + fileSize * 2 + 0x1fff) >> 0xd) & 0xFF;
30+
}
3531

3632
uint8_t *memcardIconPtr = (uint8_t *)data.memcardIcon_PsyqHand[1];
3733
for (int i = 0; i < 64; i += 2)

decompile/WorkInProgress/src/MEMCARD/MEMCARD_Unkown.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,7 @@ int FUN_8003ddac(void)
169169
sdata->crc16_checkpoint_byteIndex = 0;
170170
sdata->crc16_checkpoint_status = 0;
171171
sdata->memcard_stage++;
172-
173-
if ((sdata->memcardStatusFlags & 8) == 0)
174-
{
175-
return 7;
176-
}
177-
178-
// === Do NOT break, goto 5/7 ===
172+
return MC_RETURN_PENDING;
179173
}
180174
else
181175
{
@@ -189,8 +183,6 @@ int FUN_8003ddac(void)
189183
extra = MC_EXTRA_READ_FILE;
190184
break;
191185
}
192-
193-
// === Do NOT break, goto 5/7 ===
194186

195187
case 5:
196188
case 7:

0 commit comments

Comments
 (0)