Almost done

This commit is contained in:
Ethan Roseman 2020-03-23 17:33:12 -04:00
parent 2f3f556bfb
commit 4ab558d628
16 changed files with 175 additions and 318 deletions

View File

@ -1,19 +0,0 @@
glabel BgSpot09Obj_Destroy
/* 0035C 808B1E3C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00360 808B1E40 AFBF0014 */ sw $ra, 0x0014($sp)
/* 00364 808B1E44 AFA40018 */ sw $a0, 0x0018($sp)
/* 00368 808B1E48 848F001C */ lh $t7, 0x001C($a0) ## 0000001C
/* 0036C 808B1E4C 00807025 */ or $t6, $a0, $zero ## $t6 = 00000000
/* 00370 808B1E50 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 00374 808B1E54 11E00003 */ beq $t7, $zero, .L808B1E64
/* 00378 808B1E58 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810
/* 0037C 808B1E5C 0C00FB56 */ jal DynaPolyInfo_Free
## DynaPolyInfo_delReserve
/* 00380 808B1E60 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C
.L808B1E64:
/* 00384 808B1E64 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00388 808B1E68 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 0038C 808B1E6C 03E00008 */ jr $ra
/* 00390 808B1E70 00000000 */ nop

View File

@ -1,3 +1,21 @@
.rdata
glabel D_808B207C
.asciz "../z_bg_spot09_obj.c"
.balign 4
glabel D_808B2094
.asciz "../z_bg_spot09_obj.c"
.balign 4
glabel D_808B20AC
.asciz "../z_bg_spot09_obj.c"
.balign 4
.text
glabel BgSpot09Obj_Draw
/* 003A0 808B1E80 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0
/* 003A4 808B1E84 AFB00014 */ sw $s0, 0x0014($sp)

View File

@ -1,57 +0,0 @@
glabel BgSpot09Obj_Init
/* 002A4 808B1D84 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 002A8 808B1D88 AFB00018 */ sw $s0, 0x0018($sp)
/* 002AC 808B1D8C 3C068016 */ lui $a2, 0x8016 ## $a2 = 80160000
/* 002B0 808B1D90 94C6F546 */ lhu $a2, -0x0ABA($a2) ## 8015F546
/* 002B4 808B1D94 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 002B8 808B1D98 AFBF001C */ sw $ra, 0x001C($sp)
/* 002BC 808B1D9C AFA50024 */ sw $a1, 0x0024($sp)
/* 002C0 808B1DA0 3C04808B */ lui $a0, %hi(D_808B1FE0) ## $a0 = 808B0000
/* 002C4 808B1DA4 24841FE0 */ addiu $a0, $a0, %lo(D_808B1FE0) ## $a0 = 808B1FE0
/* 002C8 808B1DA8 8605001C */ lh $a1, 0x001C($s0) ## 0000001C
/* 002CC 808B1DAC 0C00084C */ jal osSyncPrintf
/* 002D0 808B1DB0 30C6000F */ andi $a2, $a2, 0x000F ## $a2 = 00000000
/* 002D4 808B1DB4 860E001C */ lh $t6, 0x001C($s0) ## 0000001C
/* 002D8 808B1DB8 3C04808B */ lui $a0, %hi(D_808B2018) ## $a0 = 808B0000
/* 002DC 808B1DBC 3C05808B */ lui $a1, %hi(D_808B2064) ## $a1 = 808B0000
/* 002E0 808B1DC0 31CF00FF */ andi $t7, $t6, 0x00FF ## $t7 = 00000000
/* 002E4 808B1DC4 A60F001C */ sh $t7, 0x001C($s0) ## 0000001C
/* 002E8 808B1DC8 8607001C */ lh $a3, 0x001C($s0) ## 0000001C
/* 002EC 808B1DCC 24A52064 */ addiu $a1, $a1, %lo(D_808B2064) ## $a1 = 808B2064
/* 002F0 808B1DD0 24842018 */ addiu $a0, $a0, %lo(D_808B2018) ## $a0 = 808B2018
/* 002F4 808B1DD4 04E00003 */ bltz $a3, .L808B1DE4
/* 002F8 808B1DD8 28E10005 */ slti $at, $a3, 0x0005
/* 002FC 808B1DDC 54200004 */ bnel $at, $zero, .L808B1DF0
/* 00300 808B1DE0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
.L808B1DE4:
/* 00304 808B1DE4 0C00084C */ jal osSyncPrintf
/* 00308 808B1DE8 24060142 */ addiu $a2, $zero, 0x0142 ## $a2 = 00000142
/* 0030C 808B1DEC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
.L808B1DF0:
/* 00310 808B1DF0 0C22C71C */ jal func_808B1C70
/* 00314 808B1DF4 8FA50024 */ lw $a1, 0x0024($sp)
/* 00318 808B1DF8 14400005 */ bne $v0, $zero, .L808B1E10
/* 0031C 808B1DFC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00320 808B1E00 0C00B55C */ jal Actor_Kill
/* 00324 808B1E04 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00328 808B1E08 10000008 */ beq $zero, $zero, .L808B1E2C
/* 0032C 808B1E0C 8FBF001C */ lw $ra, 0x001C($sp)
.L808B1E10:
/* 00330 808B1E10 0C22C751 */ jal func_808B1D44
/* 00334 808B1E14 8FA50024 */ lw $a1, 0x0024($sp)
/* 00338 808B1E18 54400004 */ bnel $v0, $zero, .L808B1E2C
/* 0033C 808B1E1C 8FBF001C */ lw $ra, 0x001C($sp)
/* 00340 808B1E20 0C00B55C */ jal Actor_Kill
/* 00344 808B1E24 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00348 808B1E28 8FBF001C */ lw $ra, 0x001C($sp)
.L808B1E2C:
/* 0034C 808B1E2C 8FB00018 */ lw $s0, 0x0018($sp)
/* 00350 808B1E30 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 00354 808B1E34 03E00008 */ jr $ra
/* 00358 808B1E38 00000000 */ nop

View File

@ -1,6 +0,0 @@
glabel BgSpot09Obj_Update
/* 00394 808B1E74 AFA40000 */ sw $a0, 0x0000($sp)
/* 00398 808B1E78 03E00008 */ jr $ra
/* 0039C 808B1E7C AFA50004 */ sw $a1, 0x0004($sp)

View File

@ -1,26 +0,0 @@
glabel func_808B1BA0
/* 000C0 808B1BA0 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 000C4 808B1BA4 AFBF0014 */ sw $ra, 0x0014($sp)
/* 000C8 808B1BA8 AFA5001C */ sw $a1, 0x001C($sp)
/* 000CC 808B1BAC 848E001C */ lh $t6, 0x001C($a0) ## 0000001C
/* 000D0 808B1BB0 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003
/* 000D4 808B1BB4 3C053DCC */ lui $a1, 0x3DCC ## $a1 = 3DCC0000
/* 000D8 808B1BB8 15C10005 */ bne $t6, $at, .L808B1BD0
/* 000DC 808B1BBC 00000000 */ nop
/* 000E0 808B1BC0 0C00B58B */ jal Actor_SetScale
/* 000E4 808B1BC4 34A5CCCD */ ori $a1, $a1, 0xCCCD ## $a1 = 3DCCCCCD
/* 000E8 808B1BC8 10000004 */ beq $zero, $zero, .L808B1BDC
/* 000EC 808B1BCC 8FBF0014 */ lw $ra, 0x0014($sp)
.L808B1BD0:
/* 000F0 808B1BD0 0C00B58B */ jal Actor_SetScale
/* 000F4 808B1BD4 3C053F80 */ lui $a1, 0x3F80 ## $a1 = 3F800000
/* 000F8 808B1BD8 8FBF0014 */ lw $ra, 0x0014($sp)
.L808B1BDC:
/* 000FC 808B1BDC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00100 808B1BE0 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001
/* 00104 808B1BE4 03E00008 */ jr $ra
/* 00108 808B1BE8 00000000 */ nop

View File

@ -1,40 +0,0 @@
glabel func_808B1BEC
/* 0010C 808B1BEC 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0
/* 00110 808B1BF0 AFBF001C */ sw $ra, 0x001C($sp)
/* 00114 808B1BF4 AFB00018 */ sw $s0, 0x0018($sp)
/* 00118 808B1BF8 AFA50034 */ sw $a1, 0x0034($sp)
/* 0011C 808B1BFC AFA00028 */ sw $zero, 0x0028($sp)
/* 00120 808B1C00 848E001C */ lh $t6, 0x001C($a0) ## 0000001C
/* 00124 808B1C04 3C18808B */ lui $t8, %hi(D_808B1F90) ## $t8 = 808B0000
/* 00128 808B1C08 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 0012C 808B1C0C 000E7880 */ sll $t7, $t6, 2
/* 00130 808B1C10 030FC021 */ addu $t8, $t8, $t7
/* 00134 808B1C14 8F181F90 */ lw $t8, %lo(D_808B1F90)($t8)
/* 00138 808B1C18 53000011 */ beql $t8, $zero, .L808B1C60
/* 0013C 808B1C1C 8FBF001C */ lw $ra, 0x001C($sp)
/* 00140 808B1C20 0C010D20 */ jal DynaPolyInfo_SetActorMove
/* 00144 808B1C24 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000
/* 00148 808B1C28 8619001C */ lh $t9, 0x001C($s0) ## 0000001C
/* 0014C 808B1C2C 3C04808B */ lui $a0, %hi(D_808B1F90) ## $a0 = 808B0000
/* 00150 808B1C30 27A50028 */ addiu $a1, $sp, 0x0028 ## $a1 = FFFFFFF8
/* 00154 808B1C34 00194080 */ sll $t0, $t9, 2
/* 00158 808B1C38 00882021 */ addu $a0, $a0, $t0
/* 0015C 808B1C3C 0C010620 */ jal DynaPolyInfo_Alloc
/* 00160 808B1C40 8C841F90 */ lw $a0, %lo(D_808B1F90)($a0)
/* 00164 808B1C44 8FA40034 */ lw $a0, 0x0034($sp)
/* 00168 808B1C48 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000
/* 0016C 808B1C4C 8FA70028 */ lw $a3, 0x0028($sp)
/* 00170 808B1C50 0C00FA9D */ jal DynaPolyInfo_RegisterActor
## DynaPolyInfo_setActor
/* 00174 808B1C54 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810
/* 00178 808B1C58 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C
/* 0017C 808B1C5C 8FBF001C */ lw $ra, 0x001C($sp)
.L808B1C60:
/* 00180 808B1C60 8FB00018 */ lw $s0, 0x0018($sp)
/* 00184 808B1C64 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000
/* 00188 808B1C68 03E00008 */ jr $ra
/* 0018C 808B1C6C 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001

View File

@ -1,37 +0,0 @@
glabel func_808B1C70
/* 00190 808B1C70 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8
/* 00194 808B1C74 AFB30020 */ sw $s3, 0x0020($sp)
/* 00198 808B1C78 AFB00014 */ sw $s0, 0x0014($sp)
/* 0019C 808B1C7C AFB2001C */ sw $s2, 0x001C($sp)
/* 001A0 808B1C80 AFB10018 */ sw $s1, 0x0018($sp)
/* 001A4 808B1C84 3C10808B */ lui $s0, %hi(D_808B1FA4) ## $s0 = 808B0000
/* 001A8 808B1C88 3C13808B */ lui $s3, %hi(D_808B1FB0) ## $s3 = 808B0000
/* 001AC 808B1C8C 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000
/* 001B0 808B1C90 00A09025 */ or $s2, $a1, $zero ## $s2 = 00000000
/* 001B4 808B1C94 AFBF0024 */ sw $ra, 0x0024($sp)
/* 001B8 808B1C98 26731FB0 */ addiu $s3, $s3, %lo(D_808B1FB0) ## $s3 = 808B1FB0
/* 001BC 808B1C9C 26101FA4 */ addiu $s0, $s0, %lo(D_808B1FA4) ## $s0 = 808B1FA4
/* 001C0 808B1CA0 8E190000 */ lw $t9, 0x0000($s0) ## 808B1FA4
.L808B1CA4:
/* 001C4 808B1CA4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000
/* 001C8 808B1CA8 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000
/* 001CC 808B1CAC 0320F809 */ jalr $ra, $t9
/* 001D0 808B1CB0 00000000 */ nop
/* 001D4 808B1CB4 14400003 */ bne $v0, $zero, .L808B1CC4
/* 001D8 808B1CB8 26100004 */ addiu $s0, $s0, 0x0004 ## $s0 = 808B1FA8
/* 001DC 808B1CBC 10000004 */ beq $zero, $zero, .L808B1CD0
/* 001E0 808B1CC0 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000
.L808B1CC4:
/* 001E4 808B1CC4 5613FFF7 */ bnel $s0, $s3, .L808B1CA4
/* 001E8 808B1CC8 8E190000 */ lw $t9, 0x0000($s0) ## 808B1FA8
/* 001EC 808B1CCC 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001
.L808B1CD0:
/* 001F0 808B1CD0 8FBF0024 */ lw $ra, 0x0024($sp)
/* 001F4 808B1CD4 8FB00014 */ lw $s0, 0x0014($sp)
/* 001F8 808B1CD8 8FB10018 */ lw $s1, 0x0018($sp)
/* 001FC 808B1CDC 8FB2001C */ lw $s2, 0x001C($sp)
/* 00200 808B1CE0 8FB30020 */ lw $s3, 0x0020($sp)
/* 00204 808B1CE4 03E00008 */ jr $ra
/* 00208 808B1CE8 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000

View File

@ -1,15 +0,0 @@
glabel func_808B1CEC
/* 0020C 808B1CEC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00210 808B1CF0 AFA5001C */ sw $a1, 0x001C($sp)
/* 00214 808B1CF4 AFBF0014 */ sw $ra, 0x0014($sp)
/* 00218 808B1CF8 3C05808B */ lui $a1, %hi(D_808B1FB0) ## $a1 = 808B0000
/* 0021C 808B1CFC 0C01E037 */ jal Actor_ProcessInitChain
/* 00220 808B1D00 24A51FB0 */ addiu $a1, $a1, %lo(D_808B1FB0) ## $a1 = 808B1FB0
/* 00224 808B1D04 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00228 808B1D08 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 0022C 808B1D0C 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001
/* 00230 808B1D10 03E00008 */ jr $ra
/* 00234 808B1D14 00000000 */ nop

View File

@ -1,15 +0,0 @@
glabel func_808B1D18
/* 00238 808B1D18 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 0023C 808B1D1C AFA5001C */ sw $a1, 0x001C($sp)
/* 00240 808B1D20 AFBF0014 */ sw $ra, 0x0014($sp)
/* 00244 808B1D24 3C05808B */ lui $a1, %hi(D_808B1FBC) ## $a1 = 808B0000
/* 00248 808B1D28 0C01E037 */ jal Actor_ProcessInitChain
/* 0024C 808B1D2C 24A51FBC */ addiu $a1, $a1, %lo(D_808B1FBC) ## $a1 = 808B1FBC
/* 00250 808B1D30 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00254 808B1D34 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00258 808B1D38 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001
/* 0025C 808B1D3C 03E00008 */ jr $ra
/* 00260 808B1D40 00000000 */ nop

View File

@ -1,21 +0,0 @@
glabel func_808B1D44
/* 00264 808B1D44 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00268 808B1D48 AFBF0014 */ sw $ra, 0x0014($sp)
/* 0026C 808B1D4C 848E001C */ lh $t6, 0x001C($a0) ## 0000001C
/* 00270 808B1D50 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003
/* 00274 808B1D54 15C10005 */ bne $t6, $at, .L808B1D6C
/* 00278 808B1D58 00000000 */ nop
/* 0027C 808B1D5C 0C22C746 */ jal func_808B1D18
/* 00280 808B1D60 00000000 */ nop
/* 00284 808B1D64 10000004 */ beq $zero, $zero, .L808B1D78
/* 00288 808B1D68 8FBF0014 */ lw $ra, 0x0014($sp)
.L808B1D6C:
/* 0028C 808B1D6C 0C22C73B */ jal func_808B1CEC
/* 00290 808B1D70 00000000 */ nop
/* 00294 808B1D74 8FBF0014 */ lw $ra, 0x0014($sp)
.L808B1D78:
/* 00298 808B1D78 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 0029C 808B1D7C 03E00008 */ jr $ra
/* 002A0 808B1D80 00000000 */ nop

View File

@ -1,28 +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 .data
glabel Bg_Spot09_Obj_InitVars
.word 0x00B80100, 0x00000000, 0x00AE0000, 0x00000168
.word BgSpot09Obj_Init
.word BgSpot09Obj_Destroy
.word BgSpot09Obj_Update
.word BgSpot09Obj_Draw
glabel D_808B1F90
.word 0x00000000, 0x06005520, 0x0600283C, 0x06008458, 0x06007580
glabel D_808B1FA4
.word func_808B1BEC
.word func_808B1AE0
.word func_808B1BA0
glabel D_808B1FB0
.word 0xB0F41C20, 0xB0F80BB8, 0x30FC1C20
glabel D_808B1FBC
.word 0xB0F41C20, 0xB0F80320, 0x30FC05DC
glabel D_808B1FC8
.word 0x06000100, 0x06003970, 0x06001120, 0x06007D40, 0x06006210, 0x00000000

View File

@ -1,38 +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 .rodata
glabel D_808B1FE0
.asciz "Spot09 Object [arg_data : 0x%04x]( 0x%x)\n"
.balign 4
glabel D_808B2018
.asciz "Error : Spot 09 object arg_data (%s %d)(arg_data 0x%04x)\n"
.balign 4
glabel D_808B2064
.asciz "../z_bg_spot09_obj.c"
.balign 4
glabel D_808B207C
.asciz "../z_bg_spot09_obj.c"
.balign 4
glabel D_808B2094
.asciz "../z_bg_spot09_obj.c"
.balign 4
glabel D_808B20AC
.word 0x2E2E2F7A, 0x5F62675F, 0x73706F74, 0x30395F6F, 0x626A2E63, 0x00000000, 0x00000000, 0x00000000, 0x00000000

2
spec
View File

@ -1458,8 +1458,6 @@ endseg
beginseg
name "ovl_Bg_Spot09_Obj"
include "build/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.o"
include "build/data/overlays/actors/z_bg_spot09_obj.data.o"
include "build/data/overlays/actors/z_bg_spot09_obj.rodata.o"
include "build/data/overlays/actors/z_bg_spot09_obj.reloc.o"
endseg

View File

@ -8,7 +8,10 @@ void BgSpot09Obj_Destroy(BgSpot09Obj* this, GlobalContext* globalCtx);
void BgSpot09Obj_Update(BgSpot09Obj* this, GlobalContext* globalCtx);
void BgSpot09Obj_Draw(BgSpot09Obj* this, GlobalContext* globalCtx);
/*
s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx);
s32 func_808B1BA0(BgSpot09Obj* this, GlobalContext* globalCtx);
s32 func_808B1BEC(BgSpot09Obj* this, GlobalContext* globalCtx);
const ActorInit Bg_Spot09_Obj_InitVars =
{
ACTOR_BG_SPOT09_OBJ,
@ -22,25 +25,162 @@ const ActorInit Bg_Spot09_Obj_InitVars =
(ActorFunc)BgSpot09Obj_Update,
(ActorFunc)BgSpot09Obj_Draw,
};
*/
u32 D_808B1F90[] = {
0x00000000, 0x06005520, 0x0600283C, 0x06008458, 0x06007580
};
typedef s32 (*ActorFuncRet)(struct Actor*, struct GlobalContext*);
ActorFuncRet D_808B1FA4[] = {
(ActorFuncRet)func_808B1BEC, (ActorFuncRet)func_808B1AE0, (ActorFuncRet)func_808B1BA0,
};
InitChainEntry initChain1[] = {
ICHAIN_F32(unk_F4, 7200, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 3000, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 7200, ICHAIN_STOP),
};
InitChainEntry initChain2[] = {
ICHAIN_F32(unk_F4, 7200, ICHAIN_CONTINUE),
ICHAIN_F32(unk_F8, 800, ICHAIN_CONTINUE),
ICHAIN_F32(unk_FC, 1500, ICHAIN_STOP),
};
u32 dists[] = {
0x06000100, 0x06003970, 0x06001120, 0x06007D40, 0x06006210,
};
extern UNK_TYPE D_06008010;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/func_808B1AE0.s")
/*void func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx) {
u16 temp_v1;
s32 phi_v0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/func_808B1BA0.s")
if (gSaveContext->unk1360 >= 4) {
return (u32) arg0->unk1C < 1U;
}
temp_v1 = (u32) ((gSaveContext->unkEE6 & 0xF) ^ 0xF) < 1U;
if (gSaveContext->unk4 != 0) {
phi_v0 = 5;
} else {
phi_v0 = 0x11;
}
if (phi_v0 == 0x11) {
if (arg0->unk1C == 0) {
return (u16)0;
}
if (arg0->unk1C == 1) {
return temp_v1 < 1U;
}
if (arg0->unk1C == 3) {
return (u16)1;
}
if (arg0->unk1C == 4) {
return temp_v1;
}
return (u16)0;
}
return (u32) (arg0->unk1C ^ 2) < 1U;
}*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/func_808B1BEC.s")
s32 func_808B1BA0(BgSpot09Obj *this, GlobalContext *globalCtx) {
Actor* thisx = &this->dyna.actor;
if (thisx->params == 3) {
Actor_SetScale(thisx, 0.1f);
} else {
Actor_SetScale(thisx, 1.0f);
}
return 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/func_808B1C70.s")
s32 func_808B1BEC(BgSpot09Obj *this, GlobalContext *globalCtx) {
Actor* thisx = &this->dyna.actor;
s32 localC = 0;
s32 pad[2];
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/func_808B1CEC.s")
if (D_808B1F90[thisx->params] != 0) {
DynaPolyInfo_SetActorMove(thisx, 0);
DynaPolyInfo_Alloc(D_808B1F90[thisx->params], &localC);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, localC);
}
return 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/func_808B1D18.s")
s32 func_808B1C70(BgSpot09Obj *this, GlobalContext *globalCtx) {
s32 i;
for (i = 0; i < ARRAY_COUNT(D_808B1FA4); i++) {
if (!D_808B1FA4[i](this, globalCtx)) {
return 0;
}
}
return 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/func_808B1D44.s")
s32 func_808B1CEC(BgSpot09Obj* this, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, &initChain1);
return 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/BgSpot09Obj_Init.s")
s32 func_808B1D18(BgSpot09Obj* this, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, &initChain2);
return 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/BgSpot09Obj_Destroy.s")
s32 func_808B1D44(BgSpot09Obj* this, GlobalContext* globalCtx) {
if (this->dyna.actor.params == 3) {
return func_808B1D18(this, globalCtx);
} else {
return func_808B1CEC(this, globalCtx);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/BgSpot09Obj_Update.s")
void BgSpot09Obj_Init(BgSpot09Obj* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot09_Obj/BgSpot09Obj_Draw.s")
osSyncPrintf("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", thisx->params,
gSaveContext.event_chk_inf[9] & 0xF);
thisx->params &= 0xFF;
if ((thisx->params < 0) || (thisx->params >= 5)) {
osSyncPrintf("Error : Spot 09 object の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n",
"../z_bg_spot09_obj.c", 322, thisx->params);
}
if (!func_808B1C70(this, globalCtx)) {
Actor_Kill(thisx);
} else if (!func_808B1D44(this, globalCtx)) {
Actor_Kill(thisx);
}
}
void BgSpot09Obj_Destroy(BgSpot09Obj* this, GlobalContext* globalCtx) {
DynaCollisionContext* dynaColCtx = &globalCtx->colCtx.dyna;
Actor* thisx = &this->dyna.actor;
if (thisx->params != 0) {
DynaPolyInfo_Free(globalCtx, dynaColCtx, this->dyna.dynaPolyId);
}
}
void BgSpot09Obj_Update(BgSpot09Obj* this, GlobalContext* globalCtx) {
}
void BgSpot09Obj_Draw(BgSpot09Obj* this, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[3];
Actor* thisx = &this->dyna.actor;
Draw_DListOpa(globalCtx, dists[thisx->params]);
if (thisx->params == 3) {
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 388);
func_80093D84(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 391),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_06008010);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 396);
}
}

View File

@ -5,8 +5,8 @@
#include <global.h>
typedef struct {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x1C];
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ char unk_164[0x04];
} BgSpot09Obj; // size = 0x0168
extern const ActorInit Bg_Spot09_Obj_InitVars;

View File

@ -149,6 +149,9 @@ DL_VASE = 0x06000000;
// z_door_toki
DOOR_TOKI_COLLISION_DATA = 0x06007888;
// z_bg_spot09_obj
D_06008010 = 0x06008010;
// z_bg_spot18_futa
DL_SPOT18_FUTA = 0x06000368;
DL_SPOT18_FUTA2 = 0x06000150;