removed uneccessary global vars

This commit is contained in:
Jdog 2020-08-12 21:10:41 -07:00
parent d0c65a6e14
commit 9b60b24cb7
3 changed files with 41 additions and 15 deletions

View File

@ -23,9 +23,6 @@ extern s16 D_800A0944;
extern s16 D_80151308;
extern s16 D_8010F304[]; // Key Items
extern s16 D_8010F444[]; // Items
extern s32 D_8009A650[1];
extern s16 gCurrentDoorSoundsSet;

View File

@ -91,18 +91,18 @@ INCLUDE_ASM(code_fa4c0_len_3bf0, PlaySoundAtF);
s32 RemoveKeyItemAt(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
s32 index = get_variable(script, *ptrReadPos++);
s16* ptrTemp = D_8010F304;
s16* ptrKeyItems = &gPlayerData.keyItems;
ptrTemp[index] = 0;
ptrKeyItems[index] = 0;
return 2;
}
s32 RemoveItemAt(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
s32 index = get_variable(script, *ptrReadPos++);
s16* ptrTemp = D_8010F444;
s16* ptrInvItems = &gPlayerData.invItems;
ptrTemp[index] = 0;
ptrInvItems[index] = 0;
sort_items();
return 2;
}
@ -255,6 +255,28 @@ s32 AddStarPieces(script_context* script, s32 initialCall) {
}
INCLUDE_ASM(code_fa4c0_len_3bf0, GetItemPower);
/*
s32 GetItemPower(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
s32* ptrNextPos = *ptrReadPos++;
s32 temp_a1;
s32 temp_s0_2;
s32 temp_s1;
void *temp_s0;
temp_s0 = arg0->unkC;
temp_a1 = *temp_s0;
temp_s0 = temp_s0 + 4;
temp_s1 = (get_variable(temp_a1) << 5) + 0x800878E0;
temp_s0_2 = temp_s0->unk4;
set_variable(arg0, temp_s0->unk0, temp_s1->unk1B);
set_variable(arg0, temp_s0_2, temp_s1->unk1C);
return 2;
}
*/
INCLUDE_ASM(code_fa4c0_len_3bf0, ShowGotItem);
@ -264,6 +286,7 @@ INCLUDE_ASM(code_fa4c0_len_3bf0, func_802D74C0);
INCLUDE_ASM(code_fa4c0_len_3bf0, ShowEmote);
INCLUDE_ASM(code_fa4c0_len_3bf0, RemoveEffect);
/*
s32 RemoveEffect(script_context* script, s32 initialCall) {
@ -275,26 +298,34 @@ s32 RemoveEffect(script_context* script, s32 initialCall) {
s32 func_802D7B10(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
s32 ptrValue = get_variable(script, *ptrReadPos++);
*ptrValue = (*ptrValue | 0x10);
s32* ptrValue = get_variable(script, *ptrReadPos++);
*ptrValue |= 0x10;
return 2;
}
s32 func_802D7B44(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
s32 ptrValue = get_variable(script, *ptrReadPos++);
*((ptrValue + 0xC) + 0x14) = 10;
s32* ptrValue = get_variable(script, *ptrReadPos++);
s32* ptrTemp = ptrValue[3];
ptrTemp[5] = 10;
return 2;
}
s32 func_802D7B74(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
s32 ptrValue = get_variable(script, *ptrReadPos++);
*((ptrValue + 0xC) + 0x30) = 5;
s32* ptrValue = get_variable(script, *ptrReadPos++);
s32* ptrTemp = ptrValue[3];
ptrTemp[11] = 5;
return 2;
}
// More functions still in RemoveEffect.s but the ones above are matching properly
*/
INCLUDE_ASM(code_fa4c0_len_3bf0, ShowSleepBubble);
INCLUDE_ASM(code_fa4c0_len_3bf0, PlayEffect);

View File

@ -36,8 +36,6 @@ D_8009A650 = 0x8009A650;
D_800A0900 = 0x800A0900;
D_800DC500 = 0x800DC500;
D_8010F6D0 = 0x8010F6D0;
D_8010F304 = 0x8010F304;
D_8010F444 = 0x8010F444;
D_802C3000 = 0x802C3000;
D_802DBD40 = 0x802DBD40;
D_802E0D90 = 0x802E0D90;