From 8a309a4e19c3015530b4519ee66fe1184bae5df6 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Wed, 22 Jul 2020 20:15:56 -0400 Subject: [PATCH] Finished ovl_Demo_Go (#287) * Finished ovl_Demo_Go * renaming arg --- .../actors/ovl_Demo_Go/func_8097CDB0.s | 26 ------------------- data/overlays/actors/z_demo_go.reloc.s | 13 ---------- spec | 4 --- src/overlays/actors/ovl_Demo_Go/z_demo_go.c | 17 +++++------- 4 files changed, 6 insertions(+), 54 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Go/func_8097CDB0.s delete mode 100644 data/overlays/actors/z_demo_go.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Go/func_8097CDB0.s b/asm/non_matchings/overlays/actors/ovl_Demo_Go/func_8097CDB0.s deleted file mode 100644 index 640df68c23..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Go/func_8097CDB0.s +++ /dev/null @@ -1,26 +0,0 @@ -glabel func_8097CDB0 -/* 00540 8097CDB0 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00544 8097CDB4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00548 8097CDB8 AFA5001C */ sw $a1, 0x001C($sp) -/* 0054C 8097CDBC 0C25F21C */ jal func_8097C870 -/* 00550 8097CDC0 AFA60020 */ sw $a2, 0x0020($sp) -/* 00554 8097CDC4 8FA3001C */ lw $v1, 0x001C($sp) -/* 00558 8097CDC8 00027880 */ sll $t7, $v0, 2 -/* 0055C 8097CDCC 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 00560 8097CDD0 906E1D6C */ lbu $t6, 0x1D6C($v1) ## 00001D6C -/* 00564 8097CDD4 24631D64 */ addiu $v1, $v1, 0x1D64 ## $v1 = 00001D64 -/* 00568 8097CDD8 006FC021 */ addu $t8, $v1, $t7 -/* 0056C 8097CDDC 11C0000A */ beq $t6, $zero, .L8097CE08 -/* 00570 8097CDE0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00574 8097CDE4 8F040028 */ lw $a0, 0x0028($t8) ## 00000028 -/* 00578 8097CDE8 97B90022 */ lhu $t9, 0x0022($sp) -/* 0057C 8097CDEC 10800006 */ beq $a0, $zero, .L8097CE08 -/* 00580 8097CDF0 00000000 */ nop -/* 00584 8097CDF4 94880000 */ lhu $t0, 0x0000($a0) ## 00000000 -/* 00588 8097CDF8 17280003 */ bne $t9, $t0, .L8097CE08 -/* 0058C 8097CDFC 00000000 */ nop -/* 00590 8097CE00 10000001 */ beq $zero, $zero, .L8097CE08 -/* 00594 8097CE04 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L8097CE08: -/* 00598 8097CE08 03E00008 */ jr $ra -/* 0059C 8097CE0C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/data/overlays/actors/z_demo_go.reloc.s b/data/overlays/actors/z_demo_go.reloc.s deleted file mode 100644 index af767502ad..0000000000 --- a/data/overlays/actors/z_demo_go.reloc.s +++ /dev/null @@ -1,13 +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 purpose registers - -.section .rodata - -.balign 16 - -glabel D_8097D540 - .incbin "baserom/ovl_Demo_Go", 0xCD0, 0x00000130 diff --git a/spec b/spec index ddd55a0b42..884cdc2045 100644 --- a/spec +++ b/spec @@ -1598,11 +1598,7 @@ endseg beginseg name "ovl_Demo_Go" include "build/src/overlays/actors/ovl_Demo_Go/z_demo_go.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_Demo_Go/ovl_Demo_Go_reloc.o" -#else - include "build/data/overlays/actors/z_demo_go.reloc.o" -#endif endseg beginseg diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index 7cdcd5f94e..2a7fc90a70 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -200,21 +200,16 @@ UNK_TYPE DemoGo_FrameUpdateMatrix(DemoGo* this) { return SkelAnime_FrameUpdateMatrix(&this->skelAnime); } -#ifdef NON_MATCHING -// return value isn't produced in the same way -s32 func_8097CDB0(DemoGo* this, GlobalContext* globalCtx, u16 csCmdNPCAction) { +s32 func_8097CDB0(DemoGo* this, GlobalContext* globalCtx, u16 npcAction) { CutsceneContext* csCtx = &globalCtx->csCtx; - CsCmdActorAction* npcAction = csCtx->npcActions[func_8097C870(this)]; - if (csCtx->state != 0) { - if (npcAction != NULL && npcAction->action == csCmdNPCAction) { - return 1; - } + s32 actionIdx = func_8097C870(this); + + if ((csCtx->state != 0) && (csCtx->npcActions[actionIdx] != NULL) && + (csCtx->npcActions[actionIdx]->action == npcAction)) { + return 1; } return 0; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Go/func_8097CDB0.s") -#endif void func_8097CE10(DemoGo* this, GlobalContext* globalCtx) { this->action = 1;