1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-17 05:15:16 +00:00

Decompile z_play.c and Match/Document some of z_view.c (#74)

* Decompile z_play.c and Match/Document some of z_view.c

Also fix the last non matching in z_sample.c and update some game state functions.

* Suggestions from PR #74

* Fix undefined reference to Gameplay_DrawOverlay

* Suggestion from PR #74 (2)

* Fix a fake argument in func_800BC450
This commit is contained in:
Roman971 2020-04-16 23:36:12 +02:00 committed by GitHub
parent 9ac1f8130d
commit 262f6c507c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
278 changed files with 5139 additions and 5939 deletions

View file

@ -3,22 +3,22 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008E750.s")
UNK_TYPE func_8008E8DC(GlobalContext* globalCtx, Player* player) {
s32 func_8008E8DC(GlobalContext* globalCtx, Player* player) {
return (player->stateFlags1 & 0x20000080 || player->action || globalCtx->sceneLoadFlag == 0x14 ||
player->stateFlags1 & 1 || player->unk_692 & 0x80 ||
gSaveContext.unk_13F0 && func_8008F0D8(player, player->unk_154) >= 0);
(gSaveContext.unk_13F0 && func_8008F0D8(player, player->unk_154) >= 0));
}
UNK_TYPE func_8008E988(GlobalContext* globalCtx) {
s32 func_8008E988(GlobalContext* globalCtx) {
Player* player = PLAYER;
return func_8008E8DC(globalCtx, player) || player->unk_6AD == 4;
}
UNK_TYPE func_8008E9C4(Player* player) {
s32 func_8008E9C4(Player* player) {
return player->stateFlags1 & 0x10;
}
UNK_TYPE func_8008E9D0(Player* player) {
s32 func_8008E9D0(Player* player) {
return LINK_IS_CHILD && player->currentShield == 2;
}
@ -38,7 +38,7 @@ void func_8008EC70(Player* player) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008ECAC.s")
void func_8008ED9C(GlobalContext* globalCtx, Player* player, UNK_TYPE item, UNK_TYPE arg2) {
void func_8008ED9C(GlobalContext* globalCtx, Player* player, s32 item, s32 arg2) {
Inventory_UpdateBottleItem(globalCtx, item, player->unk_150);
if (item != ITEM_BOTTLE) {
player->unk_152 = item;
@ -56,7 +56,7 @@ void func_8008EDF0(Player* player) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008EEAC.s")
UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1) {
s32 func_8008EF44(GlobalContext* globalCtx, s32 arg1) {
globalCtx->unk_11E5C = (arg1 + 1);
return 1;
}
@ -75,17 +75,17 @@ void func_8008F08C(GlobalContext* globalCtx) {
player->currentMask = 0;
}
UNK_TYPE func_8008F098(GlobalContext* globalCtx) {
s32 func_8008F098(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->currentShield == 3;
}
UNK_TYPE func_8008F0AC(GlobalContext* globalCtx) {
s32 func_8008F0AC(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->unk_15D == 0xa && player->currentShield == 3;
}
s32 func_8008F0D8(Player* player, UNK_TYPE arg1) {
s32 func_8008F0D8(Player* player, s32 arg1) {
s32 temp_v0 = arg1 - 0x15;
if (temp_v0 >= 0 && temp_v0 < 6) {
return temp_v0;
@ -93,15 +93,15 @@ s32 func_8008F0D8(Player* player, UNK_TYPE arg1) {
return -1;
}
UNK_TYPE func_8008F104(Player* player) {
s32 func_8008F104(Player* player) {
return player->unk_151 == 0x10 || player->unk_151 == 0x11;
}
UNK_TYPE func_8008F128(Player* player) {
s32 func_8008F128(Player* player) {
return func_8008F104(player) && player->heldActor == NULL;
}
s32 func_8008F158(UNK_TYPE arg0) {
s32 func_8008F158(s32 arg0) {
s32 temp_v0 = arg0 - 2;
if (temp_v0 > 0 && temp_v0 < 6) {
return temp_v0;
@ -113,7 +113,7 @@ void func_8008F180(Player* player) {
func_8008F158(player->unk_151);
}
UNK_TYPE func_8008F1A0(Player* player) {
s32 func_8008F1A0(Player* player) {
if (player->unk_151 >= 5 && player->unk_151 < 8) {
return 1;
}
@ -122,7 +122,7 @@ UNK_TYPE func_8008F1A0(Player* player) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008F1CC.s")
s32 func_8008F224(Player* player, UNK_TYPE arg1) {
s32 func_8008F224(Player* player, s32 arg1) {
s32 temp_v0 = arg1 - 0x1E;
if (temp_v0 >= 0 && temp_v0 < 0xD) {
return temp_v0;
@ -134,7 +134,7 @@ void func_8008F250(Player* player) {
func_8008F224(player, player->unk_151);
}
s32 func_8008F270(Player* player, UNK_TYPE arg1) {
s32 func_8008F270(Player* player, s32 arg1) {
s32 temp_v0 = arg1 - 0x12;
if (temp_v0 >= 0 && temp_v0 < 2) {
return temp_v0;