1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-12 16:34:34 +00:00

Decompile code_8008E6A0.c / Add CHECK_PAD macro (#156)

* Decompile code_8008E6A0.c

* Delete "counter" file
This commit is contained in:
Random 2020-05-22 14:33:10 +02:00 committed by GitHub
parent 9a478a96ec
commit 89b0977e39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 88 additions and 111 deletions

View file

@ -1,61 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purposee registers
.section .text
.align 4
glabel func_8008E6A0
/* B05840 8008E6A0 AC800004 */ sw $zero, 4($a0)
/* B05844 8008E6A4 03E00008 */ jr $ra
/* B05848 8008E6A8 AC800000 */ sw $zero, ($a0)
glabel func_8008E6AC
/* B0584C 8008E6AC 94AE0000 */ lhu $t6, ($a1)
/* B05850 8008E6B0 2403FFEF */ li $v1, -17
/* B05854 8008E6B4 01C37827 */ nor $t7, $t6, $v1
/* B05858 8008E6B8 55E0000A */ bnezl $t7, .L8008E6E4
/* B0585C 8008E6BC 8C880000 */ lw $t0, ($a0)
/* B05860 8008E6C0 94B8000C */ lhu $t8, 0xc($a1)
/* B05864 8008E6C4 2401FBFF */ li $at, -1025
/* B05868 8008E6C8 0301C827 */ nor $t9, $t8, $at
/* B0586C 8008E6CC 57200005 */ bnezl $t9, .L8008E6E4
/* B05870 8008E6D0 8C880000 */ lw $t0, ($a0)
/* B05874 8008E6D4 8C820000 */ lw $v0, ($a0)
/* B05878 8008E6D8 2C420001 */ sltiu $v0, $v0, 1
/* B0587C 8008E6DC AC820000 */ sw $v0, ($a0)
/* B05880 8008E6E0 8C880000 */ lw $t0, ($a0)
.L8008E6E4:
/* B05884 8008E6E4 51000013 */ beql $t0, $zero, .L8008E734
/* B05888 8008E6E8 AC800004 */ sw $zero, 4($a0)
/* B0588C 8008E6EC 94A20000 */ lhu $v0, ($a1)
/* B05890 8008E6F0 2401DFFF */ li $at, -8193
/* B05894 8008E6F4 00414827 */ nor $t1, $v0, $at
/* B05898 8008E6F8 55200011 */ bnezl $t1, .L8008E740
/* B0589C 8008E6FC 00001025 */ move $v0, $zero
/* B058A0 8008E700 94AA000C */ lhu $t2, 0xc($a1)
/* B058A4 8008E704 00436027 */ nor $t4, $v0, $v1
/* B058A8 8008E708 01435827 */ nor $t3, $t2, $v1
/* B058AC 8008E70C 51600009 */ beql $t3, $zero, .L8008E734
/* B058B0 8008E710 AC800004 */ sw $zero, 4($a0)
/* B058B4 8008E714 5580000A */ bnezl $t4, .L8008E740
/* B058B8 8008E718 00001025 */ move $v0, $zero
/* B058BC 8008E71C 8C8D0004 */ lw $t5, 4($a0)
/* B058C0 8008E720 25AE0001 */ addiu $t6, $t5, 1
/* B058C4 8008E724 29C10009 */ slti $at, $t6, 9
/* B058C8 8008E728 14200004 */ bnez $at, .L8008E73C
/* B058CC 8008E72C AC8E0004 */ sw $t6, 4($a0)
/* B058D0 8008E730 AC800004 */ sw $zero, 4($a0)
.L8008E734:
/* B058D4 8008E734 03E00008 */ jr $ra
/* B058D8 8008E738 24020001 */ li $v0, 1
.L8008E73C:
/* B058DC 8008E73C 00001025 */ move $v0, $zero
.L8008E740:
/* B058E0 8008E740 03E00008 */ jr $ra
/* B058E4 8008E744 00000000 */ nop

View file

@ -77,4 +77,6 @@
viewport.topY = ty; \ viewport.topY = ty; \
viewport.leftX = lx; viewport.leftX = lx;
#define CHECK_PAD(state, combo) (~(state.in.button | ~(combo)) == 0)
#endif #endif

View file

@ -448,8 +448,8 @@ typedef struct {
} SoundContext; // size = 0x4 } SoundContext; // size = 0x4
typedef struct { typedef struct {
/* 0x00 */ s32 unk_0; /* 0x00 */ u32 toggle;
/* 0x04 */ char unk_4[0x4]; /* 0x04 */ s32 counter;
} SubGlobalContext7B8; // size = 0x8 } SubGlobalContext7B8; // size = 0x8
typedef struct { typedef struct {

2
spec
View file

@ -343,7 +343,7 @@ beginseg
include "build/data/z_map_data.data.o" include "build/data/z_map_data.data.o"
include "build/src/code/z_parameter.o" include "build/src/code/z_parameter.o"
include "build/src/code/z_path.o" include "build/src/code/z_path.o"
include "build/asm/code_8008E6A0.o" include "build/src/code//code_8008E6A0.o"
include "build/src/code/z_player_lib.o" include "build/src/code/z_player_lib.o"
include "build/data/z_player_lib.data.o" include "build/data/z_player_lib.data.o"
include "build/data/z_player_lib.bss.o" include "build/data/z_player_lib.bss.o"

38
src/code/code_8008E6A0.c Normal file
View file

@ -0,0 +1,38 @@
#include <global.h>
void func_8008E6A0(SubGlobalContext7B8* this) {
this->counter = 0;
this->toggle = false;
}
u32 func_8008E6AC(SubGlobalContext7B8* this, Input* input) {
if (CHECK_PAD(input->cur, R_TRIG) && CHECK_PAD(input->press, D_JPAD)) {
this->toggle = !this->toggle;
}
if (!this->toggle) {
goto ret_true;
}
if (CHECK_PAD(input->cur, Z_TRIG)) {
if (CHECK_PAD(input->press, R_TRIG)) {
goto ret_true;
}
if (CHECK_PAD(input->cur, R_TRIG)) {
this->counter++;
if (this->counter >= 9) {
goto ret_true;
}
}
}
goto ret_false;
ret_true:
this->counter = 0;
return true;
ret_false:
return false;
}

View file

@ -583,7 +583,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) {
count--; count--;
Fault_Sleep(0x10); Fault_Sleep(0x10);
Fault_UpdatePadImpl(); Fault_UpdatePadImpl();
if (!~(curInput->press.in.button | ~L_TRIG)) { if (CHECK_PAD(curInput->press, L_TRIG)) {
sFaultStructPtr->faultActive = false; sFaultStructPtr->faultActive = false;
} }
} }
@ -593,40 +593,40 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) {
Fault_UpdatePadImpl(); Fault_UpdatePadImpl();
} while (curInput->press.in.button == 0); } while (curInput->press.in.button == 0);
if (!~(curInput->press.in.button | ~START_BUTTON)) { if (CHECK_PAD(curInput->press, START_BUTTON)) {
return; return;
} }
if (!~(curInput->cur.in.button | ~A_BUTTON)) { if (CHECK_PAD(curInput->cur, A_BUTTON)) {
return; return;
} }
off = 0x10; off = 0x10;
if (!~(curInput->cur.in.button | ~Z_TRIG)) { if (CHECK_PAD(curInput->cur, Z_TRIG)) {
off = 0x100; off = 0x100;
} }
if (!~(curInput->cur.in.button | ~B_BUTTON)) { if (CHECK_PAD(curInput->cur, B_BUTTON)) {
off <<= 8; off <<= 8;
} }
if (!~(curInput->cur.in.button | ~U_JPAD)) { if (CHECK_PAD(curInput->cur, U_JPAD)) {
addr -= off; addr -= off;
} }
if (!~(curInput->cur.in.button | ~D_JPAD)) { if (CHECK_PAD(curInput->cur, D_JPAD)) {
addr += off; addr += off;
} }
if (!~(curInput->cur.in.button | ~U_CBUTTONS)) { if (CHECK_PAD(curInput->cur, U_CBUTTONS)) {
addr = pc; addr = pc;
} }
if (!~(curInput->cur.in.button | ~D_CBUTTONS)) { if (CHECK_PAD(curInput->cur, D_CBUTTONS)) {
addr = sp; addr = sp;
} }
if (!~(curInput->cur.in.button | ~L_CBUTTONS)) { if (CHECK_PAD(curInput->cur, L_CBUTTONS)) {
addr = unk0; addr = unk0;
} }
if (!~(curInput->cur.in.button | ~R_CBUTTONS)) { if (CHECK_PAD(curInput->cur, R_CBUTTONS)) {
addr = unk1; addr = unk1;
} }
if (!~(curInput->cur.in.button | ~L_TRIG)) { if (CHECK_PAD(curInput->cur, L_TRIG)) {
break; break;
} }
} }

View file

@ -88,8 +88,8 @@ void func_800C4344(GameState* gameState) {
HREG(89) = selectedInput->cur.in.x; HREG(89) = selectedInput->cur.in.x;
HREG(90) = selectedInput->cur.in.y; HREG(90) = selectedInput->cur.in.y;
HREG(93) = (selectedInput->cur.in.button == hReg82); HREG(93) = (selectedInput->cur.in.button == hReg82);
HREG(94) = (~(selectedInput->cur.in.button | ~hReg82) == 0); HREG(94) = CHECK_PAD(selectedInput->cur, hReg82);
HREG(95) = (~(selectedInput->press.in.button | ~hReg82) == 0); HREG(95) = CHECK_PAD(selectedInput->press, hReg82);
} }
if (D_8012DBC0 != 0) { if (D_8012DBC0 != 0) {

View file

@ -386,8 +386,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
} }
sGraphUpdateTime = time; sGraphUpdateTime = time;
if (D_8012DBC0 && (!~(gameState->input[0].press.in.button | ~Z_TRIG)) && if (D_8012DBC0 && CHECK_PAD(gameState->input[0].press, Z_TRIG) &&
(!~(gameState->input[0].cur.in.button | ~(L_TRIG | R_TRIG)))) { CHECK_PAD(gameState->input[0].cur, L_TRIG | R_TRIG)) {
gSaveContext.gameMode = 0; gSaveContext.gameMode = 0;
SET_NEXT_GAMESTATE(gameState, func_80801E44, char[0x240]); // TODO : SelectContext SET_NEXT_GAMESTATE(gameState, func_80801E44, char[0x240]); // TODO : SelectContext
gameState->running = false; gameState->running = false;

View file

@ -1360,19 +1360,19 @@ s32 func_80058D34(Camera* camera) {
if (D_8011D394 == 0) { if (D_8011D394 == 0) {
if (camera->globalCtx->activeCamera == 0) { if (camera->globalCtx->activeCamera == 0) {
if (~(D_8015BD7C->state.input[2].press.in.button | ~U_CBUTTONS) == 0) { if (CHECK_PAD(D_8015BD7C->state.input[2].press, U_CBUTTONS)) {
osSyncPrintf("attention sound URGENCY\n"); osSyncPrintf("attention sound URGENCY\n");
func_80078884(NA_SE_SY_ATTENTION_URGENCY); func_80078884(NA_SE_SY_ATTENTION_URGENCY);
} }
if (~(D_8015BD7C->state.input[2].press.in.button | ~D_CBUTTONS) == 0) { if (CHECK_PAD(D_8015BD7C->state.input[2].press, D_CBUTTONS)) {
osSyncPrintf("attention sound NORMAL\n"); osSyncPrintf("attention sound NORMAL\n");
func_80078884(NA_SE_SY_ATTENTION_ON); func_80078884(NA_SE_SY_ATTENTION_ON);
} }
if (~(D_8015BD7C->state.input[2].press.in.button | ~R_CBUTTONS) == 0) { if (CHECK_PAD(D_8015BD7C->state.input[2].press, R_CBUTTONS)) {
phi_a2 = 1; phi_a2 = 1;
} }
if (~(D_8015BD7C->state.input[2].press.in.button | ~L_CBUTTONS) == 0) { if (CHECK_PAD(D_8015BD7C->state.input[2].press, L_CBUTTONS)) {
phi_a2 = -1; phi_a2 = -1;
} }
if (phi_a2 != 0) { if (phi_a2 != 0) {

View file

@ -115,8 +115,7 @@ void func_8006390C(Input* input) {
regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE; regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
dpad = input->cur.in.button & (U_JPAD | L_JPAD | R_JPAD | D_JPAD); dpad = input->cur.in.button & (U_JPAD | L_JPAD | R_JPAD | D_JPAD);
if (!~(input->cur.in.button | ~L_TRIG) || !~(input->cur.in.button | ~R_TRIG) || if (CHECK_PAD(input->cur, L_TRIG) || CHECK_PAD(input->cur, R_TRIG) || CHECK_PAD(input->cur, START_BUTTON)) {
!~(input->cur.in.button | ~START_BUTTON)) {
input_combo = inputCombos; input_combo = inputCombos;
for (i = 0; i < REG_GROUPS; i++) { for (i = 0; i < REG_GROUPS; i++) {
if (~(~input_combo->push | input->cur.in.button) || ~(~input_combo->held | input->press.in.button)) { if (~(~input_combo->push | input->cur.in.button) || ~(~input_combo->held | input->press.in.button)) {
@ -157,16 +156,15 @@ void func_8006390C(Input* input) {
increment = increment =
(dpad & R_JPAD) (dpad & R_JPAD)
? (!~(input->cur.in.button | ~(A_BUTTON | B_BUTTON)) ? (CHECK_PAD(input->cur, A_BUTTON | B_BUTTON)
? 1000 ? 1000
: !~(input->cur.in.button | ~A_BUTTON) ? 100 : CHECK_PAD(input->cur, A_BUTTON) ? 100 : CHECK_PAD(input->cur, B_BUTTON) ? 10 : 1)
: !~(input->cur.in.button | ~B_BUTTON) ? 10 : 1) : (dpad & L_JPAD)
: (dpad & L_JPAD) ? (!~(input->cur.in.button | ~(A_BUTTON | B_BUTTON)) ? (CHECK_PAD(input->cur, A_BUTTON | B_BUTTON)
? -1000 ? -1000
: !~(input->cur.in.button | ~A_BUTTON) : CHECK_PAD(input->cur, A_BUTTON) ? -100
? -100 : CHECK_PAD(input->cur, B_BUTTON) ? -10 : -1)
: !~(input->cur.in.button | ~B_BUTTON) ? -10 : -1) : 0;
: 0;
gGameInfo->data[gGameInfo->regCur + regGroup] += increment; gGameInfo->data[gGameInfo->regCur + regGroup] += increment;
if (dpad & U_JPAD) { if (dpad & U_JPAD) {

View file

@ -99,13 +99,13 @@ void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx) {
void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) { void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
Input* pad1 = &globalCtx->state.input[0]; Input* pad1 = &globalCtx->state.input[0];
if (!~(pad1->press.in.button | ~L_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4)) { if (CHECK_PAD(pad1->press, L_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4)) {
D_8015FCC8 = 0; D_8015FCC8 = 0;
gSaveContext.cutsceneIndex = 0xFFFD; gSaveContext.cutsceneIndex = 0xFFFD;
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
} }
if (!~(pad1->press.in.button | ~U_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4) && if (CHECK_PAD(pad1->press, U_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4) &&
(D_8011D394 == 0)) { (D_8011D394 == 0)) {
D_8015FCC8 = 1; D_8015FCC8 = 1;
gSaveContext.cutsceneIndex = 0xFFFD; gSaveContext.cutsceneIndex = 0xFFFD;
@ -443,16 +443,15 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) && if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) &&
(csCtx->frames > 20) && (csCtx->frames > 20) &&
(!~(globalCtx->state.input[0].press.in.button | ~A_BUTTON) || (CHECK_PAD(globalCtx->state.input[0].press, A_BUTTON) || CHECK_PAD(globalCtx->state.input[0].press, B_BUTTON) ||
!~(globalCtx->state.input[0].press.in.button | ~B_BUTTON) || CHECK_PAD(globalCtx->state.input[0].press, START_BUTTON)) &&
!~(globalCtx->state.input[0].press.in.button | ~START_BUTTON)) &&
(gSaveContext.fileNum != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) { (gSaveContext.fileNum != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) {
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
temp = 1; temp = 1;
} }
if ((csCtx->frames == cmd->startFrame) || (temp != 0) || if ((csCtx->frames == cmd->startFrame) || (temp != 0) ||
((csCtx->frames > 20) && (!~(globalCtx->state.input[0].press.in.button | ~START_BUTTON)) && ((csCtx->frames > 20) && CHECK_PAD(globalCtx->state.input[0].press, START_BUTTON) &&
(gSaveContext.fileNum != 0xFEDC))) { (gSaveContext.fileNum != 0xFEDC))) {
csCtx->state = CS_STATE_UNSKIPPABLE_EXEC; csCtx->state = CS_STATE_UNSKIPPABLE_EXEC;
func_800F68BC(0); func_800F68BC(0);
@ -1524,7 +1523,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
return; return;
} }
if (!~(globalCtx->state.input[0].press.in.button | ~R_JPAD)) { if (CHECK_PAD(globalCtx->state.input[0].press, R_JPAD)) {
csCtx->state = CS_STATE_UNSKIPPABLE_INIT; csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
return; return;
} }

View file

@ -413,7 +413,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
} }
} }
if (!~(globalCtx->state.input[0].press.in.button | ~L_TRIG) && !Gameplay_InCsMode(globalCtx)) { if (CHECK_PAD(globalCtx->state.input[0].press, L_TRIG) && !Gameplay_InCsMode(globalCtx)) {
osSyncPrintf("Game_play_demo_mode_check=%d\n", Gameplay_InCsMode(globalCtx)); osSyncPrintf("Game_play_demo_mode_check=%d\n", Gameplay_InCsMode(globalCtx));
// clang-format off // clang-format off
if (!R_MINIMAP_TOGGLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, if (!R_MINIMAP_TOGGLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4,
@ -494,7 +494,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position
} }
if (!~(globalCtx->state.input[0].press.in.button | ~L_TRIG) && !Gameplay_InCsMode(globalCtx)) { if (CHECK_PAD(globalCtx->state.input[0].press, L_TRIG) && !Gameplay_InCsMode(globalCtx)) {
// clang-format off // clang-format off
if (!R_MINIMAP_TOGGLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, if (!R_MINIMAP_TOGGLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4,
&D_801333E0, &D_801333E0, &D_801333E8); } &D_801333E0, &D_801333E0, &D_801333E8); }

View file

@ -3979,13 +3979,13 @@ void Interface_Update(GlobalContext* globalCtx) {
u16 action; u16 action;
Input* input = &globalCtx->state.input[2]; Input* input = &globalCtx->state.input[2];
if (!~(input->press.in.button | ~L_JPAD)) { if (CHECK_PAD(input->press, L_JPAD)) {
gSaveContext.language = 0; gSaveContext.language = 0;
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
} else if (!~(input->press.in.button | ~U_JPAD)) { } else if (CHECK_PAD(input->press, U_JPAD)) {
gSaveContext.language = 1; gSaveContext.language = 1;
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
} else if (!~(input->press.in.button | ~R_JPAD)) { } else if (CHECK_PAD(input->press, R_JPAD)) {
gSaveContext.language = 2; gSaveContext.language = 2;
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
} }

View file

@ -924,7 +924,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
} }
if (globalCtx->unk_1242B != 0) { if (globalCtx->unk_1242B != 0) {
if (!~(input[0].press.in.button | ~8)) { if (CHECK_PAD(input[0].press, U_CBUTTONS)) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) { if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) {
// Translates to: "Changing viewpoint is prohibited due to the kaleidoscope" // Translates to: "Changing viewpoint is prohibited due to the kaleidoscope"
osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST); osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST);
@ -1823,7 +1823,7 @@ s32 func_800C0CB8(GlobalContext* globalCtx) {
} }
s32 func_800C0D28(GlobalContext* globalCtx) { s32 func_800C0D28(GlobalContext* globalCtx) {
return (globalCtx->sub_7B8.unk_0 != 0); return (globalCtx->sub_7B8.toggle != 0);
} }
s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) { s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) {

View file

@ -505,7 +505,8 @@ void func_800906D4(GlobalContext* globalCtx, Player* player, ColliderTrisItemDim
Matrix_MultVec3f(&D_801260BC, &sp44); Matrix_MultVec3f(&D_801260BC, &sp44);
if (func_80090480(globalCtx, NULL, &player->swordDimensions, &trisInit->vtx[0], &sp2C) != 0 && if (func_80090480(globalCtx, NULL, &player->swordDimensions, &trisInit->vtx[0], &sp2C) != 0 &&
(s32)(player->stateFlags1 << 9) >= 0) { (s32)(player->stateFlags1 << 9) >= 0) {
EffectBlure_AddVertex(Effect_GetByIndex(player->swordEffectId), &player->swordDimensions.tip, &player->swordDimensions.base); EffectBlure_AddVertex(Effect_GetByIndex(player->swordEffectId), &player->swordDimensions.tip,
&player->swordDimensions.base);
} }
if (player->swordState > 0 && ((player->swordAnimation < 0x18) || ((s32)(player->stateFlags2 << 0xE) < 0))) { if (player->swordState > 0 && ((player->swordAnimation < 0x18) || ((s32)(player->stateFlags2 << 0xE) < 0))) {
func_80090480(globalCtx, &player->unk_4E4, &player->unk_8D0, &trisInit->vtx[1], &sp38); func_80090480(globalCtx, &player->unk_4E4, &player->unk_8D0, &trisInit->vtx[1], &sp38);

View file

@ -3,7 +3,7 @@
#include <PR/os_cont.h> #include <PR/os_cont.h>
void Sample_HandleStateChange(SampleContext* this) { void Sample_HandleStateChange(SampleContext* this) {
if (!~(this->state.input[0].press.in.button | ~START_BUTTON)) { if (CHECK_PAD(this->state.input[0].press, START_BUTTON)) {
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext); SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
this->state.running = false; this->state.running = false;
} }