mirror of
https://github.com/pret/pmd-red.git
synced 2024-10-07 02:23:24 +00:00
Script var buffer save/restore functions
This commit is contained in:
parent
0abc6f4c89
commit
dcc7bd7115
@ -78,8 +78,8 @@ u8 sub_8002658(s16 param_1);
|
||||
s16 sub_8002694(u8 param_1);
|
||||
bool8 sub_80026CC(s16 r0);
|
||||
void sub_80026E8(s16 r0, bool8 r1);
|
||||
bool8 sub_8002700(void *r0);
|
||||
bool8 sub_8002718(u8 *r0);
|
||||
bool8 SaveGlobalScriptVars(void *r0);
|
||||
bool8 RestoreGlobalScriptVars(u8 *r0);
|
||||
void sub_8002758(s32 r0);
|
||||
u8 sub_800276C(void);
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
s/gGroundEnterLookupTable/gGroundEnterLookupTable/g
|
||||
s/sub_80022F8/JudgeVarWithImmediate/g
|
||||
s/sub_8002318/JudgeVarWithVar/g
|
||||
s/sub_8002700/SaveGlobalScriptVars/g
|
||||
s/sub_8002718/RestoreGlobalScriptVars/g
|
||||
|
||||
|
@ -604,13 +604,13 @@ void sub_80026E8(s16 r0, bool8 r1)
|
||||
UnlockFriendArea(sub_8002658(r0));
|
||||
}
|
||||
|
||||
bool8 sub_8002700(void *r0)
|
||||
bool8 SaveGlobalScriptVars(void *r0)
|
||||
{
|
||||
MemoryCopy8(r0, gScriptVarBuffer, 0x400);
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool8 sub_8002718(u8 *r0)
|
||||
bool8 RestoreGlobalScriptVars(u8 *r0)
|
||||
{
|
||||
struct ScriptVarPtr temp;
|
||||
GetScriptVarRef(&temp, 0, 0);
|
||||
|
@ -218,7 +218,7 @@ u32 ReadSaveFromPak(u32 *a)
|
||||
if (!saveStatus)
|
||||
{
|
||||
if (gUnknown_203B184 == NULL) {
|
||||
if (!sub_8002718(playerSave->unk004)) {
|
||||
if (!RestoreGlobalScriptVars(playerSave->unk004)) {
|
||||
saveStatus = 4;
|
||||
}
|
||||
}
|
||||
@ -343,7 +343,7 @@ u32 WriteSavetoPak(s32 *param_1, u32 param_2)
|
||||
gameName = GetGameInternalName();
|
||||
strncpy(playerSave->gameInternalName,gameName, ARRAY_COUNT(playerSave->gameInternalName));
|
||||
if (gUnknown_203B184 == NULL) {
|
||||
sub_8002700(playerSave->unk004);
|
||||
SaveGlobalScriptVars(playerSave->unk004);
|
||||
}
|
||||
else {
|
||||
MemoryCopy8(playerSave->unk004,gUnknown_203B184->unk04C,ARRAY_COUNT(playerSave->unk004));
|
||||
|
@ -4,7 +4,7 @@
|
||||
gUnknown_2000A80: /* 2000A80 (GameLoop) */
|
||||
.space 0x8
|
||||
|
||||
gScriptVarBuffer: /* 2000A88 (ThoroughlyResetScriptVars - sub_8002718) */
|
||||
gScriptVarBuffer: /* 2000A88 (ThoroughlyResetScriptVars - RestoreGlobalScriptVars) */
|
||||
.space 0x400
|
||||
|
||||
.include "src/memory.o"
|
||||
|
Loading…
Reference in New Issue
Block a user