Skip to content

Commit 47c7e0a

Browse files
committed
memcard progress
1 parent 5abca7b commit 47c7e0a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

decompile/General/MEMCARD/MEMCARD_22_IsFile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ int DECOMP_MEMCARD_IsFile(int slotIdx, char *save_name)
88

99
// 0x8002, in sys/fcntl.h
1010
// 0x8000 = FASYNC, for asynchronous I/O
11-
// 0x0001 = FWRITE, for writing
12-
sdata->memcard_fd = open(name, 0x8002);
11+
// 0x0002 = FWRITE, for writing
12+
sdata->memcard_fd = open(name, FASYNC|FWRITE);
1313

1414
if (sdata->memcard_fd == -1)
1515
return MC_RETURN_NODATA;

decompile/WorkInProgress/src/MEMCARD/MEMCARD_Save.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ uint8_t MEMCARD_Save(int slotIdx, char *name,
5555

5656
// Search for "MEMCARD_SET_SIZE_BYTE3"
5757
sdata->memcard_fd = open(sdata->s_bu00_BASCUS_94426_slots,
58-
(unsigned int)*((uint8_t *)(data.memcardIcon_PsyqHand) + 3) << 0x10 | 0x200);
58+
(unsigned int)*((uint8_t *)(data.memcardIcon_PsyqHand) + 3) << 0x10 | FCREATE);
5959

6060
if (sdata->memcard_fd != -1)
6161
{
@@ -65,7 +65,7 @@ uint8_t MEMCARD_Save(int slotIdx, char *name,
6565

6666
// 0x8002, in sys/fcntl.h
6767
// 0x8000 = FASYNC, for asynchronous I/O
68-
// 0x0001 = FWRITE, for writing
68+
// 0x0002 = FWRITE, for writing
6969

7070
sdata->memcard_fd = open(sdata->s_bu00_BASCUS_94426_slots, 0x8002);
7171

ghidra/MEMCARD.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,8 +1099,7 @@ undefined4 FUN_8003e344(undefined4 param_1,undefined4 param_2,
10991099

11001100
// 0x8002, in sys/fcntl.h
11011101
// 0x8000 = FASYNC, for asynchronous I/O
1102-
// 0x0001 = FWRITE, for writing
1103-
1102+
// 0x0002 = FWRITE, for writing
11041103
DAT_8008d40c = open(&DAT_800990a4,0x8002);
11051104

11061105
if (DAT_8008d40c != -1) {
@@ -1183,7 +1182,7 @@ undefined4 FUN_8003e59c(undefined4 param_1,undefined4 param_2)
11831182

11841183
// 0x8002, in sys/fcntl.h
11851184
// 0x8000 = FASYNC, for asynchronous I/O
1186-
// 0x0001 = FWRITE, for writing
1185+
// 0x0002 = FWRITE, for writing
11871186
DAT_8008d40c = open(acStack72,0x8002);
11881187

11891188
if (DAT_8008d40c == -1)

0 commit comments

Comments
 (0)