From 86c44726624cead111e64c488f464c8da81a0cd7 Mon Sep 17 00:00:00 2001 From: glank Date: Wed, 18 Mar 2020 20:42:43 +0100 Subject: [PATCH 01/33] ovl_En_Tk OK --- .../overlays/actors/ovl_En_Tk/EnTk_Destroy.s | 14 - .../overlays/actors/ovl_En_Tk/EnTk_Draw.s | 72 -- .../overlays/actors/ovl_En_Tk/EnTk_Init.s | 108 -- .../overlays/actors/ovl_En_Tk/EnTk_Update.s | 49 - .../overlays/actors/ovl_En_Tk/func_80B1B900.s | 46 - .../overlays/actors/ovl_En_Tk/func_80B1B9A4.s | 75 -- .../overlays/actors/ovl_En_Tk/func_80B1BAB0.s | 213 ---- .../overlays/actors/ovl_En_Tk/func_80B1BDDC.s | 50 - .../overlays/actors/ovl_En_Tk/func_80B1BE94.s | 38 - .../overlays/actors/ovl_En_Tk/func_80B1BF14.s | 36 - .../overlays/actors/ovl_En_Tk/func_80B1BF8C.s | 38 - .../overlays/actors/ovl_En_Tk/func_80B1C00C.s | 58 - .../overlays/actors/ovl_En_Tk/func_80B1C0D0.s | 40 - .../overlays/actors/ovl_En_Tk/func_80B1C154.s | 68 -- .../overlays/actors/ovl_En_Tk/func_80B1C23C.s | 35 - .../overlays/actors/ovl_En_Tk/func_80B1C2B4.s | 87 -- .../overlays/actors/ovl_En_Tk/func_80B1C3DC.s | 99 -- .../overlays/actors/ovl_En_Tk/func_80B1C54C.s | 26 - .../overlays/actors/ovl_En_Tk/func_80B1C5A0.s | 117 -- .../overlays/actors/ovl_En_Tk/func_80B1C738.s | 131 --- .../overlays/actors/ovl_En_Tk/func_80B1C8F0.s | 99 -- .../overlays/actors/ovl_En_Tk/func_80B1CC04.s | 152 --- .../overlays/actors/ovl_En_Tk/func_80B1CE28.s | 61 - .../overlays/actors/ovl_En_Tk/func_80B1CEF8.s | 168 --- .../overlays/actors/ovl_En_Tk/func_80B1D200.s | 33 - .../overlays/actors/ovl_En_Tk/func_80B1D278.s | 32 - .../overlays/actors/ovl_En_Tk/func_80B1D2E4.s | 50 - data/overlays/actors/z_en_tk.data.s | 42 - data/overlays/actors/z_en_tk.reloc.s | 11 - data/overlays/actors/z_en_tk.rodata.s | 70 -- include/functions.h | 14 +- include/macros.h | 1 + include/z64.h | 8 +- spec | 4 +- src/code/z_actor.c | 5 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 1020 ++++++++++++++++- src/overlays/actors/ovl_En_Tk/z_en_tk.h | 49 +- undefined_syms.txt | 21 + 38 files changed, 1067 insertions(+), 2173 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B900.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B9A4.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BAB0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BDDC.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BE94.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF14.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF8C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C00C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C0D0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C154.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C23C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C2B4.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C3DC.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C54C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C5A0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C738.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C8F0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CC04.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CE28.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CEF8.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D200.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D278.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D2E4.s delete mode 100644 data/overlays/actors/z_en_tk.data.s delete mode 100644 data/overlays/actors/z_en_tk.reloc.s delete mode 100644 data/overlays/actors/z_en_tk.rodata.s diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Destroy.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Destroy.s deleted file mode 100644 index 8a95e0d032..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Destroy.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel EnTk_Destroy -/* 012DC 80B1CBDC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 012E0 80B1CBE0 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 012E4 80B1CBE4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 012E8 80B1CBE8 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 012EC 80B1CBEC 0C0170EB */ jal ActorCollider_FreeCylinder - -/* 012F0 80B1CBF0 24C50194 */ addiu $a1, $a2, 0x0194 ## $a1 = 00000194 -/* 012F4 80B1CBF4 8FBF0014 */ lw $ra, 0x0014($sp) -/* 012F8 80B1CBF8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 012FC 80B1CBFC 03E00008 */ jr $ra -/* 01300 80B1CC00 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Draw.s deleted file mode 100644 index 8c38b27862..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Draw.s +++ /dev/null @@ -1,72 +0,0 @@ -glabel EnTk_Draw -/* 01A98 80B1D398 27BDFFB0 */ addiu $sp, $sp, 0xFFB0 ## $sp = FFFFFFB0 -/* 01A9C 80B1D39C AFBF002C */ sw $ra, 0x002C($sp) -/* 01AA0 80B1D3A0 AFB10028 */ sw $s1, 0x0028($sp) -/* 01AA4 80B1D3A4 AFB00024 */ sw $s0, 0x0024($sp) -/* 01AA8 80B1D3A8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01AAC 80B1D3AC 0C034213 */ jal Matrix_Push -/* 01AB0 80B1D3B0 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 01AB4 80B1D3B4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01AB8 80B1D3B8 0C2C6EAC */ jal func_80B1BAB0 -/* 01ABC 80B1D3BC 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 01AC0 80B1D3C0 0C034221 */ jal Matrix_Pull -/* 01AC4 80B1D3C4 00000000 */ nop -/* 01AC8 80B1D3C8 8E250000 */ lw $a1, 0x0000($s1) ## 00000000 -/* 01ACC 80B1D3CC 3C0680B2 */ lui $a2, %hi(D_80B1D60C) ## $a2 = 80B20000 -/* 01AD0 80B1D3D0 24C6D60C */ addiu $a2, $a2, %lo(D_80B1D60C) ## $a2 = 80B1D60C -/* 01AD4 80B1D3D4 27A40038 */ addiu $a0, $sp, 0x0038 ## $a0 = FFFFFFE8 -/* 01AD8 80B1D3D8 2407050E */ addiu $a3, $zero, 0x050E ## $a3 = 0000050E -/* 01ADC 80B1D3DC 0C031AB1 */ jal func_800C6AC4 -/* 01AE0 80B1D3E0 AFA50048 */ sw $a1, 0x0048($sp) -/* 01AE4 80B1D3E4 0C024F46 */ jal func_80093D18 -/* 01AE8 80B1D3E8 8E240000 */ lw $a0, 0x0000($s1) ## 00000000 -/* 01AEC 80B1D3EC 8FA50048 */ lw $a1, 0x0048($sp) -/* 01AF0 80B1D3F0 3C0FDB06 */ lui $t7, 0xDB06 ## $t7 = DB060000 -/* 01AF4 80B1D3F4 35EF0020 */ ori $t7, $t7, 0x0020 ## $t7 = DB060020 -/* 01AF8 80B1D3F8 8CA302C0 */ lw $v1, 0x02C0($a1) ## 000002C0 -/* 01AFC 80B1D3FC 3C0480B2 */ lui $a0, %hi(D_80B1D598) ## $a0 = 80B20000 -/* 01B00 80B1D400 3C0C8016 */ lui $t4, 0x8016 ## $t4 = 80160000 -/* 01B04 80B1D404 246E0008 */ addiu $t6, $v1, 0x0008 ## $t6 = 00000008 -/* 01B08 80B1D408 ACAE02C0 */ sw $t6, 0x02C0($a1) ## 000002C0 -/* 01B0C 80B1D40C AC6F0000 */ sw $t7, 0x0000($v1) ## 00000000 -/* 01B10 80B1D410 86180222 */ lh $t8, 0x0222($s0) ## 00000222 -/* 01B14 80B1D414 3C0100FF */ lui $at, 0x00FF ## $at = 00FF0000 -/* 01B18 80B1D418 3421FFFF */ ori $at, $at, 0xFFFF ## $at = 00FFFFFF -/* 01B1C 80B1D41C 0018C880 */ sll $t9, $t8, 2 -/* 01B20 80B1D420 00992021 */ addu $a0, $a0, $t9 -/* 01B24 80B1D424 8C84D598 */ lw $a0, %lo(D_80B1D598)($a0) -/* 01B28 80B1D428 3C1880B2 */ lui $t8, %hi(func_80B1D2E4) ## $t8 = 80B20000 -/* 01B2C 80B1D42C 3C0F80B2 */ lui $t7, %hi(func_80B1D278) ## $t7 = 80B20000 -/* 01B30 80B1D430 00044900 */ sll $t1, $a0, 4 -/* 01B34 80B1D434 00095702 */ srl $t2, $t1, 28 -/* 01B38 80B1D438 000A5880 */ sll $t3, $t2, 2 -/* 01B3C 80B1D43C 018B6021 */ addu $t4, $t4, $t3 -/* 01B40 80B1D440 8D8C6FA8 */ lw $t4, 0x6FA8($t4) ## 80166FA8 -/* 01B44 80B1D444 00814024 */ and $t0, $a0, $at -/* 01B48 80B1D448 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 01B4C 80B1D44C 010C6821 */ addu $t5, $t0, $t4 -/* 01B50 80B1D450 01A17021 */ addu $t6, $t5, $at -/* 01B54 80B1D454 AC6E0004 */ sw $t6, 0x0004($v1) ## 00000004 -/* 01B58 80B1D458 9207014E */ lbu $a3, 0x014E($s0) ## 0000014E -/* 01B5C 80B1D45C 8E06016C */ lw $a2, 0x016C($s0) ## 0000016C -/* 01B60 80B1D460 8E050150 */ lw $a1, 0x0150($s0) ## 00000150 -/* 01B64 80B1D464 25EFD278 */ addiu $t7, $t7, %lo(func_80B1D278) ## $t7 = 80B1D278 -/* 01B68 80B1D468 2718D2E4 */ addiu $t8, $t8, %lo(func_80B1D2E4) ## $t8 = 80B1D2E4 -/* 01B6C 80B1D46C AFB80014 */ sw $t8, 0x0014($sp) -/* 01B70 80B1D470 AFAF0010 */ sw $t7, 0x0010($sp) -/* 01B74 80B1D474 AFB00018 */ sw $s0, 0x0018($sp) -/* 01B78 80B1D478 0C0286B2 */ jal func_800A1AC8 -/* 01B7C 80B1D47C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 01B80 80B1D480 3C0680B2 */ lui $a2, %hi(D_80B1D61C) ## $a2 = 80B20000 -/* 01B84 80B1D484 24C6D61C */ addiu $a2, $a2, %lo(D_80B1D61C) ## $a2 = 80B1D61C -/* 01B88 80B1D488 27A40038 */ addiu $a0, $sp, 0x0038 ## $a0 = FFFFFFE8 -/* 01B8C 80B1D48C 8E250000 */ lw $a1, 0x0000($s1) ## 00000000 -/* 01B90 80B1D490 0C031AD5 */ jal func_800C6B54 -/* 01B94 80B1D494 24070520 */ addiu $a3, $zero, 0x0520 ## $a3 = 00000520 -/* 01B98 80B1D498 8FBF002C */ lw $ra, 0x002C($sp) -/* 01B9C 80B1D49C 8FB00024 */ lw $s0, 0x0024($sp) -/* 01BA0 80B1D4A0 8FB10028 */ lw $s1, 0x0028($sp) -/* 01BA4 80B1D4A4 03E00008 */ jr $ra -/* 01BA8 80B1D4A8 27BD0050 */ addiu $sp, $sp, 0x0050 ## $sp = 00000000 -/* 01BAC 80B1D4AC 00000000 */ nop - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Init.s deleted file mode 100644 index 8a9ac2398a..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Init.s +++ /dev/null @@ -1,108 +0,0 @@ -glabel EnTk_Init -/* 01160 80B1CA60 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 01164 80B1CA64 AFB00028 */ sw $s0, 0x0028($sp) -/* 01168 80B1CA68 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0116C 80B1CA6C AFBF002C */ sw $ra, 0x002C($sp) -/* 01170 80B1CA70 AFA50044 */ sw $a1, 0x0044($sp) -/* 01174 80B1CA74 3C068003 */ lui $a2, 0x8003 ## $a2 = 80030000 -/* 01178 80B1CA78 24C6B5EC */ addiu $a2, $a2, 0xB5EC ## $a2 = 8002B5EC -/* 0117C 80B1CA7C 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 -/* 01180 80B1CA80 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 -/* 01184 80B1CA84 0C00AC78 */ jal ActorShape_Init - -/* 01188 80B1CA88 3C0741C0 */ lui $a3, 0x41C0 ## $a3 = 41C00000 -/* 0118C 80B1CA8C 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C -/* 01190 80B1CA90 3C060601 */ lui $a2, 0x0601 ## $a2 = 06010000 -/* 01194 80B1CA94 260E022A */ addiu $t6, $s0, 0x022A ## $t6 = 0000022A -/* 01198 80B1CA98 260F0296 */ addiu $t7, $s0, 0x0296 ## $t7 = 00000296 -/* 0119C 80B1CA9C 24180012 */ addiu $t8, $zero, 0x0012 ## $t8 = 00000012 -/* 011A0 80B1CAA0 AFB80018 */ sw $t8, 0x0018($sp) -/* 011A4 80B1CAA4 AFAF0014 */ sw $t7, 0x0014($sp) -/* 011A8 80B1CAA8 AFAE0010 */ sw $t6, 0x0010($sp) -/* 011AC 80B1CAAC 24C6BE40 */ addiu $a2, $a2, 0xBE40 ## $a2 = 0600BE40 -/* 011B0 80B1CAB0 AFA50030 */ sw $a1, 0x0030($sp) -/* 011B4 80B1CAB4 8FA40044 */ lw $a0, 0x0044($sp) -/* 011B8 80B1CAB8 0C0291BE */ jal func_800A46F8 -/* 011BC 80B1CABC 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 011C0 80B1CAC0 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 011C4 80B1CAC4 0C028800 */ jal SkelAnime_GetFrameCount - -/* 011C8 80B1CAC8 24842F84 */ addiu $a0, $a0, 0x2F84 ## $a0 = 06002F84 -/* 011CC 80B1CACC 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00 -/* 011D0 80B1CAD0 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 011D4 80B1CAD4 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 011D8 80B1CAD8 468021A0 */ cvt.s.w $f6, $f4 -/* 011DC 80B1CADC 44070000 */ mfc1 $a3, $f0 -/* 011E0 80B1CAE0 24A52F84 */ addiu $a1, $a1, 0x2F84 ## $a1 = 06002F84 -/* 011E4 80B1CAE4 8FA40030 */ lw $a0, 0x0030($sp) -/* 011E8 80B1CAE8 3C063F80 */ lui $a2, 0x3F80 ## $a2 = 3F800000 -/* 011EC 80B1CAEC AFA00014 */ sw $zero, 0x0014($sp) -/* 011F0 80B1CAF0 E7A60010 */ swc1 $f6, 0x0010($sp) -/* 011F4 80B1CAF4 0C029468 */ jal SkelAnime_ChangeAnimation - -/* 011F8 80B1CAF8 E7A00018 */ swc1 $f0, 0x0018($sp) -/* 011FC 80B1CAFC 26050194 */ addiu $a1, $s0, 0x0194 ## $a1 = 00000194 -/* 01200 80B1CB00 AFA50030 */ sw $a1, 0x0030($sp) -/* 01204 80B1CB04 0C0170D9 */ jal ActorCollider_AllocCylinder - -/* 01208 80B1CB08 8FA40044 */ lw $a0, 0x0044($sp) -/* 0120C 80B1CB0C 3C0780B2 */ lui $a3, %hi(D_80B1D508) ## $a3 = 80B20000 -/* 01210 80B1CB10 8FA50030 */ lw $a1, 0x0030($sp) -/* 01214 80B1CB14 24E7D508 */ addiu $a3, $a3, %lo(D_80B1D508) ## $a3 = 80B1D508 -/* 01218 80B1CB18 8FA40044 */ lw $a0, 0x0044($sp) -/* 0121C 80B1CB1C 0C01712B */ jal ActorCollider_InitCylinder - -/* 01220 80B1CB20 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 01224 80B1CB24 3C0680B2 */ lui $a2, %hi(D_80B1D534) ## $a2 = 80B20000 -/* 01228 80B1CB28 24C6D534 */ addiu $a2, $a2, %lo(D_80B1D534) ## $a2 = 80B1D534 -/* 0122C 80B1CB2C 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 01230 80B1CB30 0C0187BF */ jal func_80061EFC -/* 01234 80B1CB34 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 01238 80B1CB38 3C038016 */ lui $v1, 0x8016 ## $v1 = 80160000 -/* 0123C 80B1CB3C 2463E660 */ addiu $v1, $v1, 0xE660 ## $v1 = 8015E660 -/* 01240 80B1CB40 9462000C */ lhu $v0, 0x000C($v1) ## 8015E66C -/* 01244 80B1CB44 3401C001 */ ori $at, $zero, 0xC001 ## $at = 0000C001 -/* 01248 80B1CB48 0041082A */ slt $at, $v0, $at -/* 0124C 80B1CB4C 1420000D */ bne $at, $zero, .L80B1CB84 -/* 01250 80B1CB50 3401E000 */ ori $at, $zero, 0xE000 ## $at = 0000E000 -/* 01254 80B1CB54 0041082A */ slt $at, $v0, $at -/* 01258 80B1CB58 1020000A */ beq $at, $zero, .L80B1CB84 -/* 0125C 80B1CB5C 00000000 */ nop -/* 01260 80B1CB60 8C790004 */ lw $t9, 0x0004($v1) ## 8015E664 -/* 01264 80B1CB64 8FA80044 */ lw $t0, 0x0044($sp) -/* 01268 80B1CB68 13200006 */ beq $t9, $zero, .L80B1CB84 -/* 0126C 80B1CB6C 00000000 */ nop -/* 01270 80B1CB70 850900A4 */ lh $t1, 0x00A4($t0) ## 000000A4 -/* 01274 80B1CB74 24010053 */ addiu $at, $zero, 0x0053 ## $at = 00000053 -/* 01278 80B1CB78 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0127C 80B1CB7C 11210005 */ beq $t1, $at, .L80B1CB94 -/* 01280 80B1CB80 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 -.L80B1CB84: -/* 01284 80B1CB84 0C00B55C */ jal Actor_Kill - -/* 01288 80B1CB88 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0128C 80B1CB8C 1000000F */ beq $zero, $zero, .L80B1CBCC -/* 01290 80B1CB90 8FBF002C */ lw $ra, 0x002C($sp) -.L80B1CB94: -/* 01294 80B1CB94 0C00B58B */ jal Actor_SetScale - -/* 01298 80B1CB98 34A5D70A */ ori $a1, $a1, 0xD70A ## $a1 = 0000D70A -/* 0129C 80B1CB9C 240A0006 */ addiu $t2, $zero, 0x0006 ## $t2 = 00000006 -/* 012A0 80B1CBA0 A20A001F */ sb $t2, 0x001F($s0) ## 0000001F -/* 012A4 80B1CBA4 3C0180B2 */ lui $at, %hi(D_80B1D684) ## $at = 80B20000 -/* 012A8 80B1CBA8 C428D684 */ lwc1 $f8, %lo(D_80B1D684)($at) -/* 012AC 80B1CBAC 3C0C80B2 */ lui $t4, %hi(func_80B1CC04) ## $t4 = 80B20000 -/* 012B0 80B1CBB0 240BFFFF */ addiu $t3, $zero, 0xFFFF ## $t3 = FFFFFFFF -/* 012B4 80B1CBB4 258CCC04 */ addiu $t4, $t4, %lo(func_80B1CC04) ## $t4 = 80B1CC04 -/* 012B8 80B1CBB8 AE0B0214 */ sw $t3, 0x0214($s0) ## 00000214 -/* 012BC 80B1CBBC AE000210 */ sw $zero, 0x0210($s0) ## 00000210 -/* 012C0 80B1CBC0 AE0C0190 */ sw $t4, 0x0190($s0) ## 00000190 -/* 012C4 80B1CBC4 E608006C */ swc1 $f8, 0x006C($s0) ## 0000006C -/* 012C8 80B1CBC8 8FBF002C */ lw $ra, 0x002C($sp) -.L80B1CBCC: -/* 012CC 80B1CBCC 8FB00028 */ lw $s0, 0x0028($sp) -/* 012D0 80B1CBD0 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 012D4 80B1CBD4 03E00008 */ jr $ra -/* 012D8 80B1CBD8 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Update.s deleted file mode 100644 index 1c06e60083..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Update.s +++ /dev/null @@ -1,49 +0,0 @@ -glabel EnTk_Update -/* 01858 80B1D158 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 0185C 80B1D15C AFB00020 */ sw $s0, 0x0020($sp) -/* 01860 80B1D160 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01864 80B1D164 AFBF0024 */ sw $ra, 0x0024($sp) -/* 01868 80B1D168 AFA5003C */ sw $a1, 0x003C($sp) -/* 0186C 80B1D16C 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 -/* 01870 80B1D170 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 -/* 01874 80B1D174 0C0189B7 */ jal ActorCollider_Cylinder_Update - -/* 01878 80B1D178 AFA6002C */ sw $a2, 0x002C($sp) -/* 0187C 80B1D17C 8FA4003C */ lw $a0, 0x003C($sp) -/* 01880 80B1D180 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 01884 80B1D184 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 01888 80B1D188 8FA6002C */ lw $a2, 0x002C($sp) -/* 0188C 80B1D18C 0C017713 */ jal Actor_CollisionCheck_SetOT - ## CollisionCheck_setOT -/* 01890 80B1D190 00812821 */ addu $a1, $a0, $at -/* 01894 80B1D194 0C02927F */ jal SkelAnime_FrameUpdateMatrix - -/* 01898 80B1D198 2604014C */ addiu $a0, $s0, 0x014C ## $a0 = 0000014C -/* 0189C 80B1D19C 0C00B638 */ jal Actor_MoveForward - -/* 018A0 80B1D1A0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 018A4 80B1D1A4 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 018A8 80B1D1A8 240E0005 */ addiu $t6, $zero, 0x0005 ## $t6 = 00000005 -/* 018AC 80B1D1AC AFAE0014 */ sw $t6, 0x0014($sp) -/* 018B0 80B1D1B0 8FA4003C */ lw $a0, 0x003C($sp) -/* 018B4 80B1D1B4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 018B8 80B1D1B8 3C064220 */ lui $a2, 0x4220 ## $a2 = 42200000 -/* 018BC 80B1D1BC 3C074120 */ lui $a3, 0x4120 ## $a3 = 41200000 -/* 018C0 80B1D1C0 0C00B92D */ jal func_8002E4B4 -/* 018C4 80B1D1C4 E7A40010 */ swc1 $f4, 0x0010($sp) -/* 018C8 80B1D1C8 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 -/* 018CC 80B1D1CC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 018D0 80B1D1D0 8FA5003C */ lw $a1, 0x003C($sp) -/* 018D4 80B1D1D4 0320F809 */ jalr $ra, $t9 -/* 018D8 80B1D1D8 00000000 */ nop -/* 018DC 80B1D1DC 0C2C6E69 */ jal func_80B1B9A4 -/* 018E0 80B1D1E0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 018E4 80B1D1E4 0C2C7003 */ jal func_80B1C00C -/* 018E8 80B1D1E8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 018EC 80B1D1EC 8FBF0024 */ lw $ra, 0x0024($sp) -/* 018F0 80B1D1F0 8FB00020 */ lw $s0, 0x0020($sp) -/* 018F4 80B1D1F4 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 018F8 80B1D1F8 03E00008 */ jr $ra -/* 018FC 80B1D1FC 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B900.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B900.s deleted file mode 100644 index 636b918065..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B900.s +++ /dev/null @@ -1,46 +0,0 @@ -glabel func_80B1B900 -/* 00000 80B1B900 24820310 */ addiu $v0, $a0, 0x0310 ## $v0 = 00000310 -/* 00004 80B1B904 24040001 */ addiu $a0, $zero, 0x0001 ## $a0 = 00000001 -/* 00008 80B1B908 00001825 */ or $v1, $zero, $zero ## $v1 = 00000000 -.L80B1B90C: -/* 0000C 80B1B90C 904E0000 */ lbu $t6, 0x0000($v0) ## 00000310 -/* 00010 80B1B910 24630001 */ addiu $v1, $v1, 0x0001 ## $v1 = 00000001 -/* 00014 80B1B914 00031C00 */ sll $v1, $v1, 16 -/* 00018 80B1B918 108E001D */ beq $a0, $t6, .L80B1B990 -/* 0001C 80B1B91C 00031C03 */ sra $v1, $v1, 16 -/* 00020 80B1B920 C7A40014 */ lwc1 $f4, 0x0014($sp) -/* 00024 80B1B924 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 00028 80B1B928 E4440004 */ swc1 $f4, 0x0004($v0) ## 00000314 -/* 0002C 80B1B92C C7A60018 */ lwc1 $f6, 0x0018($sp) -/* 00030 80B1B930 E4460008 */ swc1 $f6, 0x0008($v0) ## 00000318 -/* 00034 80B1B934 93B80013 */ lbu $t8, 0x0013($sp) -/* 00038 80B1B938 A0590000 */ sb $t9, 0x0000($v0) ## 00000310 -/* 0003C 80B1B93C A0580001 */ sb $t8, 0x0001($v0) ## 00000311 -/* 00040 80B1B940 A0580002 */ sb $t8, 0x0002($v0) ## 00000312 -/* 00044 80B1B944 8CA90000 */ lw $t1, 0x0000($a1) ## 00000000 -/* 00048 80B1B948 AC490014 */ sw $t1, 0x0014($v0) ## 00000324 -/* 0004C 80B1B94C 8CA80004 */ lw $t0, 0x0004($a1) ## 00000004 -/* 00050 80B1B950 AC480018 */ sw $t0, 0x0018($v0) ## 00000328 -/* 00054 80B1B954 8CA90008 */ lw $t1, 0x0008($a1) ## 00000008 -/* 00058 80B1B958 AC49001C */ sw $t1, 0x001C($v0) ## 0000032C -/* 0005C 80B1B95C 8CEB0000 */ lw $t3, 0x0000($a3) ## 00000000 -/* 00060 80B1B960 AC4B002C */ sw $t3, 0x002C($v0) ## 0000033C -/* 00064 80B1B964 8CEA0004 */ lw $t2, 0x0004($a3) ## 00000004 -/* 00068 80B1B968 AC4A0030 */ sw $t2, 0x0030($v0) ## 00000340 -/* 0006C 80B1B96C 8CEB0008 */ lw $t3, 0x0008($a3) ## 00000008 -/* 00070 80B1B970 AC4B0034 */ sw $t3, 0x0034($v0) ## 00000344 -/* 00074 80B1B974 8CCD0000 */ lw $t5, 0x0000($a2) ## 00000000 -/* 00078 80B1B978 AC4D0020 */ sw $t5, 0x0020($v0) ## 00000330 -/* 0007C 80B1B97C 8CCC0004 */ lw $t4, 0x0004($a2) ## 00000004 -/* 00080 80B1B980 AC4C0024 */ sw $t4, 0x0024($v0) ## 00000334 -/* 00084 80B1B984 8CCD0008 */ lw $t5, 0x0008($a2) ## 00000008 -/* 00088 80B1B988 03E00008 */ jr $ra -/* 0008C 80B1B98C AC4D0028 */ sw $t5, 0x0028($v0) ## 00000338 -.L80B1B990: -/* 00090 80B1B990 28610014 */ slti $at, $v1, 0x0014 -/* 00094 80B1B994 1420FFDD */ bne $at, $zero, .L80B1B90C -/* 00098 80B1B998 24420038 */ addiu $v0, $v0, 0x0038 ## $v0 = 00000348 -/* 0009C 80B1B99C 03E00008 */ jr $ra -/* 000A0 80B1B9A0 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B9A4.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B9A4.s deleted file mode 100644 index a74af4894b..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B9A4.s +++ /dev/null @@ -1,75 +0,0 @@ -glabel func_80B1B9A4 -/* 000A4 80B1B9A4 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 000A8 80B1B9A8 F7B60018 */ sdc1 $f22, 0x0018($sp) -/* 000AC 80B1B9AC 3C0180B2 */ lui $at, %hi(D_80B1D62C) ## $at = 80B20000 -/* 000B0 80B1B9B0 C436D62C */ lwc1 $f22, %lo(D_80B1D62C)($at) -/* 000B4 80B1B9B4 AFB10028 */ sw $s1, 0x0028($sp) -/* 000B8 80B1B9B8 AFB00024 */ sw $s0, 0x0024($sp) -/* 000BC 80B1B9BC F7B40010 */ sdc1 $f20, 0x0010($sp) -/* 000C0 80B1B9C0 3C0180B2 */ lui $at, %hi(D_80B1D630) ## $at = 80B20000 -/* 000C4 80B1B9C4 AFBF002C */ sw $ra, 0x002C($sp) -/* 000C8 80B1B9C8 24900310 */ addiu $s0, $a0, 0x0310 ## $s0 = 00000310 -/* 000CC 80B1B9CC C434D630 */ lwc1 $f20, %lo(D_80B1D630)($at) -/* 000D0 80B1B9D0 00008825 */ or $s1, $zero, $zero ## $s1 = 00000000 -.L80B1B9D4: -/* 000D4 80B1B9D4 920E0000 */ lbu $t6, 0x0000($s0) ## 00000310 -/* 000D8 80B1B9D8 51C00029 */ beql $t6, $zero, .L80B1BA80 -/* 000DC 80B1B9DC 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000001 -/* 000E0 80B1B9E0 920F0001 */ lbu $t7, 0x0001($s0) ## 00000311 -/* 000E4 80B1B9E4 25F8FFFF */ addiu $t8, $t7, 0xFFFF ## $t8 = FFFFFFFF -/* 000E8 80B1B9E8 331900FF */ andi $t9, $t8, 0x00FF ## $t9 = 000000FF -/* 000EC 80B1B9EC 17200002 */ bne $t9, $zero, .L80B1B9F8 -/* 000F0 80B1B9F0 A2180001 */ sb $t8, 0x0001($s0) ## 00000311 -/* 000F4 80B1B9F4 A2000000 */ sb $zero, 0x0000($s0) ## 00000310 -.L80B1B9F8: -/* 000F8 80B1B9F8 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 000FC 80B1B9FC 00000000 */ nop -/* 00100 80B1BA00 46140102 */ mul.s $f4, $f0, $f20 -/* 00104 80B1BA04 46162181 */ sub.s $f6, $f4, $f22 -/* 00108 80B1BA08 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 0010C 80B1BA0C E606002C */ swc1 $f6, 0x002C($s0) ## 0000033C -/* 00110 80B1BA10 C60C0020 */ lwc1 $f12, 0x0020($s0) ## 00000330 -/* 00114 80B1BA14 C60A0014 */ lwc1 $f10, 0x0014($s0) ## 00000324 -/* 00118 80B1BA18 46140202 */ mul.s $f8, $f0, $f20 -/* 0011C 80B1BA1C C60E0024 */ lwc1 $f14, 0x0024($s0) ## 00000334 -/* 00120 80B1BA20 460C5480 */ add.s $f18, $f10, $f12 -/* 00124 80B1BA24 C6040018 */ lwc1 $f4, 0x0018($s0) ## 00000328 -/* 00128 80B1BA28 C6100028 */ lwc1 $f16, 0x0028($s0) ## 00000338 -/* 0012C 80B1BA2C E6120014 */ swc1 $f18, 0x0014($s0) ## 00000324 -/* 00130 80B1BA30 C612002C */ lwc1 $f18, 0x002C($s0) ## 0000033C -/* 00134 80B1BA34 460E2180 */ add.s $f6, $f4, $f14 -/* 00138 80B1BA38 46164081 */ sub.s $f2, $f8, $f22 -/* 0013C 80B1BA3C C608001C */ lwc1 $f8, 0x001C($s0) ## 0000032C -/* 00140 80B1BA40 E6060018 */ swc1 $f6, 0x0018($s0) ## 00000328 -/* 00144 80B1BA44 46126100 */ add.s $f4, $f12, $f18 -/* 00148 80B1BA48 C6060030 */ lwc1 $f6, 0x0030($s0) ## 00000340 -/* 0014C 80B1BA4C C6120004 */ lwc1 $f18, 0x0004($s0) ## 00000314 -/* 00150 80B1BA50 46104280 */ add.s $f10, $f8, $f16 -/* 00154 80B1BA54 E6040020 */ swc1 $f4, 0x0020($s0) ## 00000330 -/* 00158 80B1BA58 C6040008 */ lwc1 $f4, 0x0008($s0) ## 00000318 -/* 0015C 80B1BA5C 46067200 */ add.s $f8, $f14, $f6 -/* 00160 80B1BA60 E60A001C */ swc1 $f10, 0x001C($s0) ## 0000032C -/* 00164 80B1BA64 E6020034 */ swc1 $f2, 0x0034($s0) ## 00000344 -/* 00168 80B1BA68 46028280 */ add.s $f10, $f16, $f2 -/* 0016C 80B1BA6C E6080024 */ swc1 $f8, 0x0024($s0) ## 00000334 -/* 00170 80B1BA70 46049180 */ add.s $f6, $f18, $f4 -/* 00174 80B1BA74 E60A0028 */ swc1 $f10, 0x0028($s0) ## 00000338 -/* 00178 80B1BA78 E6060004 */ swc1 $f6, 0x0004($s0) ## 00000314 -/* 0017C 80B1BA7C 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000002 -.L80B1BA80: -/* 00180 80B1BA80 00118C00 */ sll $s1, $s1, 16 -/* 00184 80B1BA84 00118C03 */ sra $s1, $s1, 16 -/* 00188 80B1BA88 2A210014 */ slti $at, $s1, 0x0014 -/* 0018C 80B1BA8C 1420FFD1 */ bne $at, $zero, .L80B1B9D4 -/* 00190 80B1BA90 26100038 */ addiu $s0, $s0, 0x0038 ## $s0 = 00000348 -/* 00194 80B1BA94 8FBF002C */ lw $ra, 0x002C($sp) -/* 00198 80B1BA98 D7B40010 */ ldc1 $f20, 0x0010($sp) -/* 0019C 80B1BA9C D7B60018 */ ldc1 $f22, 0x0018($sp) -/* 001A0 80B1BAA0 8FB00024 */ lw $s0, 0x0024($sp) -/* 001A4 80B1BAA4 8FB10028 */ lw $s1, 0x0028($sp) -/* 001A8 80B1BAA8 03E00008 */ jr $ra -/* 001AC 80B1BAAC 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BAB0.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BAB0.s deleted file mode 100644 index 77c327790c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BAB0.s +++ /dev/null @@ -1,213 +0,0 @@ -glabel func_80B1BAB0 -/* 001B0 80B1BAB0 27BDFF58 */ addiu $sp, $sp, 0xFF58 ## $sp = FFFFFF58 -/* 001B4 80B1BAB4 AFBE0050 */ sw $s8, 0x0050($sp) -/* 001B8 80B1BAB8 00A0F025 */ or $s8, $a1, $zero ## $s8 = 00000000 -/* 001BC 80B1BABC AFBF0054 */ sw $ra, 0x0054($sp) -/* 001C0 80B1BAC0 AFB7004C */ sw $s7, 0x004C($sp) -/* 001C4 80B1BAC4 AFB60048 */ sw $s6, 0x0048($sp) -/* 001C8 80B1BAC8 AFB50044 */ sw $s5, 0x0044($sp) -/* 001CC 80B1BACC AFB40040 */ sw $s4, 0x0040($sp) -/* 001D0 80B1BAD0 AFB3003C */ sw $s3, 0x003C($sp) -/* 001D4 80B1BAD4 AFB20038 */ sw $s2, 0x0038($sp) -/* 001D8 80B1BAD8 AFB10034 */ sw $s1, 0x0034($sp) -/* 001DC 80B1BADC AFB00030 */ sw $s0, 0x0030($sp) -/* 001E0 80B1BAE0 F7B80028 */ sdc1 $f24, 0x0028($sp) -/* 001E4 80B1BAE4 F7B60020 */ sdc1 $f22, 0x0020($sp) -/* 001E8 80B1BAE8 F7B40018 */ sdc1 $f20, 0x0018($sp) -/* 001EC 80B1BAEC 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 001F0 80B1BAF0 24920310 */ addiu $s2, $a0, 0x0310 ## $s2 = 00000310 -/* 001F4 80B1BAF4 3C0680B2 */ lui $a2, %hi(D_80B1D5B0) ## $a2 = 80B20000 -/* 001F8 80B1BAF8 24C6D5B0 */ addiu $a2, $a2, %lo(D_80B1D5B0) ## $a2 = 80B1D5B0 -/* 001FC 80B1BAFC 27A40088 */ addiu $a0, $sp, 0x0088 ## $a0 = FFFFFFE0 -/* 00200 80B1BB00 24070072 */ addiu $a3, $zero, 0x0072 ## $a3 = 00000072 -/* 00204 80B1BB04 0C031AB1 */ jal func_800C6AC4 -/* 00208 80B1BB08 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 0020C 80B1BB0C 0000B825 */ or $s7, $zero, $zero ## $s7 = 00000000 -/* 00210 80B1BB10 0C024F61 */ jal func_80093D84 -/* 00214 80B1BB14 8FC40000 */ lw $a0, 0x0000($s8) ## 00000000 -/* 00218 80B1BB18 3C014100 */ lui $at, 0x4100 ## $at = 41000000 -/* 0021C 80B1BB1C 4481C000 */ mtc1 $at, $f24 ## $f24 = 8.00 -/* 00220 80B1BB20 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 00224 80B1BB24 4481B000 */ mtc1 $at, $f22 ## $f22 = 1.00 -/* 00228 80B1BB28 3C01437F */ lui $at, 0x437F ## $at = 437F0000 -/* 0022C 80B1BB2C 4481A000 */ mtc1 $at, $f20 ## $f20 = 255.00 -/* 00230 80B1BB30 0000A025 */ or $s4, $zero, $zero ## $s4 = 00000000 -/* 00234 80B1BB34 3C16DE00 */ lui $s6, 0xDE00 ## $s6 = DE000000 -.L80B1BB38: -/* 00238 80B1BB38 924E0000 */ lbu $t6, 0x0000($s2) ## 00000310 -/* 0023C 80B1BB3C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00240 80B1BB40 34211DA0 */ ori $at, $at, 0x1DA0 ## $at = 00011DA0 -/* 00244 80B1BB44 11C0008A */ beq $t6, $zero, .L80B1BD70 -/* 00248 80B1BB48 03C19821 */ addu $s3, $s8, $at -/* 0024C 80B1BB4C 3C150601 */ lui $s5, 0x0601 ## $s5 = 06010000 -/* 00250 80B1BB50 16E00014 */ bne $s7, $zero, .L80B1BBA4 -/* 00254 80B1BB54 26B5BCA0 */ addiu $s5, $s5, 0xBCA0 ## $s5 = 0600BCA0 -/* 00258 80B1BB58 3C110601 */ lui $s1, 0x0601 ## $s1 = 06010000 -/* 0025C 80B1BB5C 2631BC90 */ addiu $s1, $s1, 0xBC90 ## $s1 = 0600BC90 -/* 00260 80B1BB60 8E0402D0 */ lw $a0, 0x02D0($s0) ## 000002D0 -/* 00264 80B1BB64 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00268 80B1BB68 0C024DDD */ jal func_80093774 -/* 0026C 80B1BB6C 24170001 */ addiu $s7, $zero, 0x0001 ## $s7 = 00000001 -/* 00270 80B1BB70 AE0202D0 */ sw $v0, 0x02D0($s0) ## 000002D0 -/* 00274 80B1BB74 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 00000008 -/* 00278 80B1BB78 AE0F02D0 */ sw $t7, 0x02D0($s0) ## 000002D0 -/* 0027C 80B1BB7C AC510004 */ sw $s1, 0x0004($v0) ## 00000004 -/* 00280 80B1BB80 AC560000 */ sw $s6, 0x0000($v0) ## 00000000 -/* 00284 80B1BB84 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 00288 80B1BB88 3C08643C */ lui $t0, 0x643C ## $t0 = 643C0000 -/* 0028C 80B1BB8C 35081400 */ ori $t0, $t0, 0x1400 ## $t0 = 643C1400 -/* 00290 80B1BB90 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008 -/* 00294 80B1BB94 AE1802D0 */ sw $t8, 0x02D0($s0) ## 000002D0 -/* 00298 80B1BB98 3C19FB00 */ lui $t9, 0xFB00 ## $t9 = FB000000 -/* 0029C 80B1BB9C AC590000 */ sw $t9, 0x0000($v0) ## 00000000 -/* 002A0 80B1BBA0 AC480004 */ sw $t0, 0x0004($v0) ## 00000004 -.L80B1BBA4: -/* 002A4 80B1BBA4 92490001 */ lbu $t1, 0x0001($s2) ## 00000311 -/* 002A8 80B1BBA8 3C014F80 */ lui $at, 0x4F80 ## $at = 4F800000 -/* 002AC 80B1BBAC 44892000 */ mtc1 $t1, $f4 ## $f4 = 0.00 -/* 002B0 80B1BBB0 05210004 */ bgez $t1, .L80B1BBC4 -/* 002B4 80B1BBB4 468021A0 */ cvt.s.w $f6, $f4 -/* 002B8 80B1BBB8 44814000 */ mtc1 $at, $f8 ## $f8 = 4294967296.00 -/* 002BC 80B1BBBC 00000000 */ nop -/* 002C0 80B1BBC0 46083180 */ add.s $f6, $f6, $f8 -.L80B1BBC4: -/* 002C4 80B1BBC4 924A0002 */ lbu $t2, 0x0002($s2) ## 00000312 -/* 002C8 80B1BBC8 3C014F80 */ lui $at, 0x4F80 ## $at = 4F800000 -/* 002CC 80B1BBCC 448A5000 */ mtc1 $t2, $f10 ## $f10 = 0.00 -/* 002D0 80B1BBD0 05410004 */ bgez $t2, .L80B1BBE4 -/* 002D4 80B1BBD4 46805420 */ cvt.s.w $f16, $f10 -/* 002D8 80B1BBD8 44819000 */ mtc1 $at, $f18 ## $f18 = 4294967296.00 -/* 002DC 80B1BBDC 00000000 */ nop -/* 002E0 80B1BBE0 46128400 */ add.s $f16, $f16, $f18 -.L80B1BBE4: -/* 002E4 80B1BBE4 4610A103 */ div.s $f4, $f20, $f16 -/* 002E8 80B1BBE8 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 002EC 80B1BBEC 3C01AA82 */ lui $at, 0xAA82 ## $at = AA820000 -/* 002F0 80B1BBF0 34215A00 */ ori $at, $at, 0x5A00 ## $at = AA825A00 -/* 002F4 80B1BBF4 244C0008 */ addiu $t4, $v0, 0x0008 ## $t4 = 00000008 -/* 002F8 80B1BBF8 AE0C02D0 */ sw $t4, 0x02D0($s0) ## 000002D0 -/* 002FC 80B1BBFC 3C0DFA00 */ lui $t5, 0xFA00 ## $t5 = FA000000 -/* 00300 80B1BC00 AC4D0000 */ sw $t5, 0x0000($v0) ## 00000000 -/* 00304 80B1BC04 3C19E700 */ lui $t9, 0xE700 ## $t9 = E7000000 -/* 00308 80B1BC08 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 0030C 80B1BC0C 46043202 */ mul.s $f8, $f6, $f4 -/* 00310 80B1BC10 4600428D */ trunc.w.s $f10, $f8 -/* 00314 80B1BC14 44045000 */ mfc1 $a0, $f10 -/* 00318 80B1BC18 00000000 */ nop -/* 0031C 80B1BC1C 00042400 */ sll $a0, $a0, 16 -/* 00320 80B1BC20 00042403 */ sra $a0, $a0, 16 -/* 00324 80B1BC24 308E00FF */ andi $t6, $a0, 0x00FF ## $t6 = 00000000 -/* 00328 80B1BC28 01C17825 */ or $t7, $t6, $at ## $t7 = AA825A00 -/* 0032C 80B1BC2C AC4F0004 */ sw $t7, 0x0004($v0) ## 00000004 -/* 00330 80B1BC30 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 00334 80B1BC34 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008 -/* 00338 80B1BC38 AE1802D0 */ sw $t8, 0x02D0($s0) ## 000002D0 -/* 0033C 80B1BC3C AC400004 */ sw $zero, 0x0004($v0) ## 00000004 -/* 00340 80B1BC40 AC590000 */ sw $t9, 0x0000($v0) ## 00000000 -/* 00344 80B1BC44 8E46001C */ lw $a2, 0x001C($s2) ## 0000032C -/* 00348 80B1BC48 C64E0018 */ lwc1 $f14, 0x0018($s2) ## 00000328 -/* 0034C 80B1BC4C 0C034261 */ jal Matrix_Translate -/* 00350 80B1BC50 C64C0014 */ lwc1 $f12, 0x0014($s2) ## 00000324 -/* 00354 80B1BC54 0C0347F5 */ jal func_800D1FD4 -/* 00358 80B1BC58 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 -/* 0035C 80B1BC5C C64C0004 */ lwc1 $f12, 0x0004($s2) ## 00000314 -/* 00360 80B1BC60 4406B000 */ mfc1 $a2, $f22 -/* 00364 80B1BC64 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 00368 80B1BC68 0C0342A3 */ jal Matrix_Scale -/* 0036C 80B1BC6C 46006386 */ mov.s $f14, $f12 -/* 00370 80B1BC70 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 00374 80B1BC74 3C09DA38 */ lui $t1, 0xDA38 ## $t1 = DA380000 -/* 00378 80B1BC78 35290003 */ ori $t1, $t1, 0x0003 ## $t1 = DA380003 -/* 0037C 80B1BC7C 24480008 */ addiu $t0, $v0, 0x0008 ## $t0 = 00000008 -/* 00380 80B1BC80 AE0802D0 */ sw $t0, 0x02D0($s0) ## 000002D0 -/* 00384 80B1BC84 3C0580B2 */ lui $a1, %hi(D_80B1D5C4) ## $a1 = 80B20000 -/* 00388 80B1BC88 AC490000 */ sw $t1, 0x0000($v0) ## 00000000 -/* 0038C 80B1BC8C 8FC40000 */ lw $a0, 0x0000($s8) ## 00000000 -/* 00390 80B1BC90 24A5D5C4 */ addiu $a1, $a1, %lo(D_80B1D5C4) ## $a1 = 80B1D5C4 -/* 00394 80B1BC94 2406008C */ addiu $a2, $zero, 0x008C ## $a2 = 0000008C -/* 00398 80B1BC98 0C0346A2 */ jal Matrix_NewMtx -/* 0039C 80B1BC9C 00408825 */ or $s1, $v0, $zero ## $s1 = 00000000 -/* 003A0 80B1BCA0 AE220004 */ sw $v0, 0x0004($s1) ## 00000004 -/* 003A4 80B1BCA4 924A0001 */ lbu $t2, 0x0001($s2) ## 00000311 -/* 003A8 80B1BCA8 3C014F80 */ lui $at, 0x4F80 ## $at = 4F800000 -/* 003AC 80B1BCAC 448A9000 */ mtc1 $t2, $f18 ## $f18 = 0.00 -/* 003B0 80B1BCB0 05410004 */ bgez $t2, .L80B1BCC4 -/* 003B4 80B1BCB4 46809420 */ cvt.s.w $f16, $f18 -/* 003B8 80B1BCB8 44813000 */ mtc1 $at, $f6 ## $f6 = 4294967296.00 -/* 003BC 80B1BCBC 00000000 */ nop -/* 003C0 80B1BCC0 46068400 */ add.s $f16, $f16, $f6 -.L80B1BCC4: -/* 003C4 80B1BCC4 924B0002 */ lbu $t3, 0x0002($s2) ## 00000312 -/* 003C8 80B1BCC8 3C014F80 */ lui $at, 0x4F80 ## $at = 4F800000 -/* 003CC 80B1BCCC 448B2000 */ mtc1 $t3, $f4 ## $f4 = 0.00 -/* 003D0 80B1BCD0 05610004 */ bgez $t3, .L80B1BCE4 -/* 003D4 80B1BCD4 46802220 */ cvt.s.w $f8, $f4 -/* 003D8 80B1BCD8 44815000 */ mtc1 $at, $f10 ## $f10 = 4294967296.00 -/* 003DC 80B1BCDC 00000000 */ nop -/* 003E0 80B1BCE0 460A4200 */ add.s $f8, $f8, $f10 -.L80B1BCE4: -/* 003E4 80B1BCE4 4608C483 */ div.s $f18, $f24, $f8 -/* 003E8 80B1BCE8 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 003EC 80B1BCEC 3C0EDB06 */ lui $t6, 0xDB06 ## $t6 = DB060000 -/* 003F0 80B1BCF0 35CE0020 */ ori $t6, $t6, 0x0020 ## $t6 = DB060020 -/* 003F4 80B1BCF4 244D0008 */ addiu $t5, $v0, 0x0008 ## $t5 = 00000008 -/* 003F8 80B1BCF8 AE0D02D0 */ sw $t5, 0x02D0($s0) ## 000002D0 -/* 003FC 80B1BCFC 3C0480B2 */ lui $a0, %hi(D_80B1D4D0) ## $a0 = 80B20000 -/* 00400 80B1BD00 AC4E0000 */ sw $t6, 0x0000($v0) ## 00000000 -/* 00404 80B1BD04 3C0A8016 */ lui $t2, 0x8016 ## $t2 = 80160000 -/* 00408 80B1BD08 3C0100FF */ lui $at, 0x00FF ## $at = 00FF0000 -/* 0040C 80B1BD0C 3421FFFF */ ori $at, $at, 0xFFFF ## $at = 00FFFFFF -/* 00410 80B1BD10 46128182 */ mul.s $f6, $f16, $f18 -/* 00414 80B1BD14 4600310D */ trunc.w.s $f4, $f6 -/* 00418 80B1BD18 44052000 */ mfc1 $a1, $f4 -/* 0041C 80B1BD1C 00000000 */ nop -/* 00420 80B1BD20 00052C00 */ sll $a1, $a1, 16 -/* 00424 80B1BD24 00052C03 */ sra $a1, $a1, 16 -/* 00428 80B1BD28 00057880 */ sll $t7, $a1, 2 -/* 0042C 80B1BD2C 008F2021 */ addu $a0, $a0, $t7 -/* 00430 80B1BD30 8C84D4D0 */ lw $a0, %lo(D_80B1D4D0)($a0) -/* 00434 80B1BD34 0004C900 */ sll $t9, $a0, 4 -/* 00438 80B1BD38 00194702 */ srl $t0, $t9, 28 -/* 0043C 80B1BD3C 00084880 */ sll $t1, $t0, 2 -/* 00440 80B1BD40 01495021 */ addu $t2, $t2, $t1 -/* 00444 80B1BD44 8D4A6FA8 */ lw $t2, 0x6FA8($t2) ## 80166FA8 -/* 00448 80B1BD48 0081C024 */ and $t8, $a0, $at -/* 0044C 80B1BD4C 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 00450 80B1BD50 030A5821 */ addu $t3, $t8, $t2 -/* 00454 80B1BD54 01616021 */ addu $t4, $t3, $at -/* 00458 80B1BD58 AC4C0004 */ sw $t4, 0x0004($v0) ## 00000004 -/* 0045C 80B1BD5C 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 00460 80B1BD60 244D0008 */ addiu $t5, $v0, 0x0008 ## $t5 = 00000008 -/* 00464 80B1BD64 AE0D02D0 */ sw $t5, 0x02D0($s0) ## 000002D0 -/* 00468 80B1BD68 AC550004 */ sw $s5, 0x0004($v0) ## 00000004 -/* 0046C 80B1BD6C AC560000 */ sw $s6, 0x0000($v0) ## 00000000 -.L80B1BD70: -/* 00470 80B1BD70 26940001 */ addiu $s4, $s4, 0x0001 ## $s4 = 00000001 -/* 00474 80B1BD74 0014A400 */ sll $s4, $s4, 16 -/* 00478 80B1BD78 0014A403 */ sra $s4, $s4, 16 -/* 0047C 80B1BD7C 2A810014 */ slti $at, $s4, 0x0014 -/* 00480 80B1BD80 1420FF6D */ bne $at, $zero, .L80B1BB38 -/* 00484 80B1BD84 26520038 */ addiu $s2, $s2, 0x0038 ## $s2 = 00000348 -/* 00488 80B1BD88 3C0680B2 */ lui $a2, %hi(D_80B1D5D8) ## $a2 = 80B20000 -/* 0048C 80B1BD8C 24C6D5D8 */ addiu $a2, $a2, %lo(D_80B1D5D8) ## $a2 = 80B1D5D8 -/* 00490 80B1BD90 27A40088 */ addiu $a0, $sp, 0x0088 ## $a0 = FFFFFFE0 -/* 00494 80B1BD94 8FC50000 */ lw $a1, 0x0000($s8) ## 00000000 -/* 00498 80B1BD98 0C031AD5 */ jal func_800C6B54 -/* 0049C 80B1BD9C 2407009A */ addiu $a3, $zero, 0x009A ## $a3 = 0000009A -/* 004A0 80B1BDA0 8FBF0054 */ lw $ra, 0x0054($sp) -/* 004A4 80B1BDA4 D7B40018 */ ldc1 $f20, 0x0018($sp) -/* 004A8 80B1BDA8 D7B60020 */ ldc1 $f22, 0x0020($sp) -/* 004AC 80B1BDAC D7B80028 */ ldc1 $f24, 0x0028($sp) -/* 004B0 80B1BDB0 8FB00030 */ lw $s0, 0x0030($sp) -/* 004B4 80B1BDB4 8FB10034 */ lw $s1, 0x0034($sp) -/* 004B8 80B1BDB8 8FB20038 */ lw $s2, 0x0038($sp) -/* 004BC 80B1BDBC 8FB3003C */ lw $s3, 0x003C($sp) -/* 004C0 80B1BDC0 8FB40040 */ lw $s4, 0x0040($sp) -/* 004C4 80B1BDC4 8FB50044 */ lw $s5, 0x0044($sp) -/* 004C8 80B1BDC8 8FB60048 */ lw $s6, 0x0048($sp) -/* 004CC 80B1BDCC 8FB7004C */ lw $s7, 0x004C($sp) -/* 004D0 80B1BDD0 8FBE0050 */ lw $s8, 0x0050($sp) -/* 004D4 80B1BDD4 03E00008 */ jr $ra -/* 004D8 80B1BDD8 27BD00A8 */ addiu $sp, $sp, 0x00A8 ## $sp = 00000000 - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BDDC.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BDDC.s deleted file mode 100644 index 69a8f7fbee..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BDDC.s +++ /dev/null @@ -1,50 +0,0 @@ -glabel func_80B1BDDC -/* 004DC 80B1BDDC 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8 -/* 004E0 80B1BDE0 3C0F80B2 */ lui $t7, %hi(D_80B1D4F0) ## $t7 = 80B20000 -/* 004E4 80B1BDE4 AFBF0024 */ sw $ra, 0x0024($sp) -/* 004E8 80B1BDE8 AFA40048 */ sw $a0, 0x0048($sp) -/* 004EC 80B1BDEC AFA5004C */ sw $a1, 0x004C($sp) -/* 004F0 80B1BDF0 AFA60050 */ sw $a2, 0x0050($sp) -/* 004F4 80B1BDF4 AFA70054 */ sw $a3, 0x0054($sp) -/* 004F8 80B1BDF8 25EFD4F0 */ addiu $t7, $t7, %lo(D_80B1D4F0) ## $t7 = 80B1D4F0 -/* 004FC 80B1BDFC 8DF90000 */ lw $t9, 0x0000($t7) ## 80B1D4F0 -/* 00500 80B1BE00 27AE003C */ addiu $t6, $sp, 0x003C ## $t6 = FFFFFFF4 -/* 00504 80B1BE04 8DF80004 */ lw $t8, 0x0004($t7) ## 80B1D4F4 -/* 00508 80B1BE08 ADD90000 */ sw $t9, 0x0000($t6) ## FFFFFFF4 -/* 0050C 80B1BE0C 8DF90008 */ lw $t9, 0x0008($t7) ## 80B1D4F8 -/* 00510 80B1BE10 3C0980B2 */ lui $t1, %hi(D_80B1D4FC) ## $t1 = 80B20000 -/* 00514 80B1BE14 2529D4FC */ addiu $t1, $t1, %lo(D_80B1D4FC) ## $t1 = 80B1D4FC -/* 00518 80B1BE18 ADD80004 */ sw $t8, 0x0004($t6) ## FFFFFFF8 -/* 0051C 80B1BE1C ADD90008 */ sw $t9, 0x0008($t6) ## FFFFFFFC -/* 00520 80B1BE20 8D2B0000 */ lw $t3, 0x0000($t1) ## 80B1D4FC -/* 00524 80B1BE24 27A80030 */ addiu $t0, $sp, 0x0030 ## $t0 = FFFFFFE8 -/* 00528 80B1BE28 8D2A0004 */ lw $t2, 0x0004($t1) ## 80B1D500 -/* 0052C 80B1BE2C AD0B0000 */ sw $t3, 0x0000($t0) ## FFFFFFE8 -/* 00530 80B1BE30 8D2B0008 */ lw $t3, 0x0008($t1) ## 80B1D504 -/* 00534 80B1BE34 AD0A0004 */ sw $t2, 0x0004($t0) ## FFFFFFEC -/* 00538 80B1BE38 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 0053C 80B1BE3C AD0B0008 */ sw $t3, 0x0008($t0) ## FFFFFFF0 -/* 00540 80B1BE40 C7A6005C */ lwc1 $f6, 0x005C($sp) -/* 00544 80B1BE44 C7A40034 */ lwc1 $f4, 0x0034($sp) -/* 00548 80B1BE48 93AC0053 */ lbu $t4, 0x0053($sp) -/* 0054C 80B1BE4C 46060202 */ mul.s $f8, $f0, $f6 -/* 00550 80B1BE50 C7B00054 */ lwc1 $f16, 0x0054($sp) -/* 00554 80B1BE54 C7B20058 */ lwc1 $f18, 0x0058($sp) -/* 00558 80B1BE58 8FA40048 */ lw $a0, 0x0048($sp) -/* 0055C 80B1BE5C 8FA5004C */ lw $a1, 0x004C($sp) -/* 00560 80B1BE60 27A6003C */ addiu $a2, $sp, 0x003C ## $a2 = FFFFFFF4 -/* 00564 80B1BE64 27A70030 */ addiu $a3, $sp, 0x0030 ## $a3 = FFFFFFE8 -/* 00568 80B1BE68 46082280 */ add.s $f10, $f4, $f8 -/* 0056C 80B1BE6C AFAC0010 */ sw $t4, 0x0010($sp) -/* 00570 80B1BE70 E7B00014 */ swc1 $f16, 0x0014($sp) -/* 00574 80B1BE74 E7B20018 */ swc1 $f18, 0x0018($sp) -/* 00578 80B1BE78 0C2C6E40 */ jal func_80B1B900 -/* 0057C 80B1BE7C E7AA0034 */ swc1 $f10, 0x0034($sp) -/* 00580 80B1BE80 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00584 80B1BE84 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000 -/* 00588 80B1BE88 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 0058C 80B1BE8C 03E00008 */ jr $ra -/* 00590 80B1BE90 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BE94.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BE94.s deleted file mode 100644 index 21dcf60bfc..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BE94.s +++ /dev/null @@ -1,38 +0,0 @@ -glabel func_80B1BE94 -/* 00594 80B1BE94 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00598 80B1BE98 AFA40028 */ sw $a0, 0x0028($sp) -/* 0059C 80B1BE9C AFBF0024 */ sw $ra, 0x0024($sp) -/* 005A0 80B1BEA0 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 005A4 80B1BEA4 AFA5002C */ sw $a1, 0x002C($sp) -/* 005A8 80B1BEA8 0C028800 */ jal SkelAnime_GetFrameCount - -/* 005AC 80B1BEAC 24842F84 */ addiu $a0, $a0, 0x2F84 ## $a0 = 06002F84 -/* 005B0 80B1BEB0 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00 -/* 005B4 80B1BEB4 3C01C120 */ lui $at, 0xC120 ## $at = C1200000 -/* 005B8 80B1BEB8 44814000 */ mtc1 $at, $f8 ## $f8 = -10.00 -/* 005BC 80B1BEBC 468021A0 */ cvt.s.w $f6, $f4 -/* 005C0 80B1BEC0 8FA40028 */ lw $a0, 0x0028($sp) -/* 005C4 80B1BEC4 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 005C8 80B1BEC8 24A52F84 */ addiu $a1, $a1, 0x2F84 ## $a1 = 06002F84 -/* 005CC 80B1BECC 3C063F80 */ lui $a2, 0x3F80 ## $a2 = 3F800000 -/* 005D0 80B1BED0 24070000 */ addiu $a3, $zero, 0x0000 ## $a3 = 00000000 -/* 005D4 80B1BED4 E7A60010 */ swc1 $f6, 0x0010($sp) -/* 005D8 80B1BED8 AFA00014 */ sw $zero, 0x0014($sp) -/* 005DC 80B1BEDC E7A80018 */ swc1 $f8, 0x0018($sp) -/* 005E0 80B1BEE0 0C029468 */ jal SkelAnime_ChangeAnimation - -/* 005E4 80B1BEE4 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C -/* 005E8 80B1BEE8 2404003C */ addiu $a0, $zero, 0x003C ## $a0 = 0000003C -/* 005EC 80B1BEEC 0C01DF64 */ jal Math_Rand_S16Offset - -/* 005F0 80B1BEF0 2405003C */ addiu $a1, $zero, 0x003C ## $a1 = 0000003C -/* 005F4 80B1BEF4 8FA30028 */ lw $v1, 0x0028($sp) -/* 005F8 80B1BEF8 44805000 */ mtc1 $zero, $f10 ## $f10 = 0.00 -/* 005FC 80B1BEFC A462021C */ sh $v0, 0x021C($v1) ## 0000021C -/* 00600 80B1BF00 E46A0068 */ swc1 $f10, 0x0068($v1) ## 00000068 -/* 00604 80B1BF04 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00608 80B1BF08 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 0060C 80B1BF0C 03E00008 */ jr $ra -/* 00610 80B1BF10 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF14.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF14.s deleted file mode 100644 index 72ede3767a..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF14.s +++ /dev/null @@ -1,36 +0,0 @@ -glabel func_80B1BF14 -/* 00614 80B1BF14 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00618 80B1BF18 AFA40028 */ sw $a0, 0x0028($sp) -/* 0061C 80B1BF1C AFBF0024 */ sw $ra, 0x0024($sp) -/* 00620 80B1BF20 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 00624 80B1BF24 AFA5002C */ sw $a1, 0x002C($sp) -/* 00628 80B1BF28 0C028800 */ jal SkelAnime_GetFrameCount - -/* 0062C 80B1BF2C 24842F84 */ addiu $a0, $a0, 0x2F84 ## $a0 = 06002F84 -/* 00630 80B1BF30 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00 -/* 00634 80B1BF34 3C01C120 */ lui $at, 0xC120 ## $at = C1200000 -/* 00638 80B1BF38 44814000 */ mtc1 $at, $f8 ## $f8 = -10.00 -/* 0063C 80B1BF3C 468021A0 */ cvt.s.w $f6, $f4 -/* 00640 80B1BF40 8FA40028 */ lw $a0, 0x0028($sp) -/* 00644 80B1BF44 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 00648 80B1BF48 24A51FA8 */ addiu $a1, $a1, 0x1FA8 ## $a1 = 06001FA8 -/* 0064C 80B1BF4C 3C063F80 */ lui $a2, 0x3F80 ## $a2 = 3F800000 -/* 00650 80B1BF50 24070000 */ addiu $a3, $zero, 0x0000 ## $a3 = 00000000 -/* 00654 80B1BF54 E7A60010 */ swc1 $f6, 0x0010($sp) -/* 00658 80B1BF58 AFA00014 */ sw $zero, 0x0014($sp) -/* 0065C 80B1BF5C E7A80018 */ swc1 $f8, 0x0018($sp) -/* 00660 80B1BF60 0C029468 */ jal SkelAnime_ChangeAnimation - -/* 00664 80B1BF64 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C -/* 00668 80B1BF68 240400F0 */ addiu $a0, $zero, 0x00F0 ## $a0 = 000000F0 -/* 0066C 80B1BF6C 0C01DF64 */ jal Math_Rand_S16Offset - -/* 00670 80B1BF70 240500F0 */ addiu $a1, $zero, 0x00F0 ## $a1 = 000000F0 -/* 00674 80B1BF74 8FAE0028 */ lw $t6, 0x0028($sp) -/* 00678 80B1BF78 A5C2021C */ sh $v0, 0x021C($t6) ## 0000021C -/* 0067C 80B1BF7C 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00680 80B1BF80 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 00684 80B1BF84 03E00008 */ jr $ra -/* 00688 80B1BF88 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF8C.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF8C.s deleted file mode 100644 index acea15376f..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF8C.s +++ /dev/null @@ -1,38 +0,0 @@ -glabel func_80B1BF8C -/* 0068C 80B1BF8C 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00690 80B1BF90 AFA40028 */ sw $a0, 0x0028($sp) -/* 00694 80B1BF94 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00698 80B1BF98 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 0069C 80B1BF9C AFA5002C */ sw $a1, 0x002C($sp) -/* 006A0 80B1BFA0 0C028800 */ jal SkelAnime_GetFrameCount - -/* 006A4 80B1BFA4 24841144 */ addiu $a0, $a0, 0x1144 ## $a0 = 06001144 -/* 006A8 80B1BFA8 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00 -/* 006AC 80B1BFAC 3C01C120 */ lui $at, 0xC120 ## $at = C1200000 -/* 006B0 80B1BFB0 44814000 */ mtc1 $at, $f8 ## $f8 = -10.00 -/* 006B4 80B1BFB4 468021A0 */ cvt.s.w $f6, $f4 -/* 006B8 80B1BFB8 8FA40028 */ lw $a0, 0x0028($sp) -/* 006BC 80B1BFBC 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 006C0 80B1BFC0 24A51144 */ addiu $a1, $a1, 0x1144 ## $a1 = 06001144 -/* 006C4 80B1BFC4 3C063F80 */ lui $a2, 0x3F80 ## $a2 = 3F800000 -/* 006C8 80B1BFC8 24070000 */ addiu $a3, $zero, 0x0000 ## $a3 = 00000000 -/* 006CC 80B1BFCC E7A60010 */ swc1 $f6, 0x0010($sp) -/* 006D0 80B1BFD0 AFA00014 */ sw $zero, 0x0014($sp) -/* 006D4 80B1BFD4 E7A80018 */ swc1 $f8, 0x0018($sp) -/* 006D8 80B1BFD8 0C029468 */ jal SkelAnime_ChangeAnimation - -/* 006DC 80B1BFDC 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C -/* 006E0 80B1BFE0 8FA40028 */ lw $a0, 0x0028($sp) -/* 006E4 80B1BFE4 0C2C7055 */ jal func_80B1C154 -/* 006E8 80B1BFE8 8FA5002C */ lw $a1, 0x002C($sp) -/* 006EC 80B1BFEC 04400003 */ bltz $v0, .L80B1BFFC -/* 006F0 80B1BFF0 8FAF0028 */ lw $t7, 0x0028($sp) -/* 006F4 80B1BFF4 240E0001 */ addiu $t6, $zero, 0x0001 ## $t6 = 00000001 -/* 006F8 80B1BFF8 A1EE0208 */ sb $t6, 0x0208($t7) ## 00000208 -.L80B1BFFC: -/* 006FC 80B1BFFC 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00700 80B1C000 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 00704 80B1C004 03E00008 */ jr $ra -/* 00708 80B1C008 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C00C.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C00C.s deleted file mode 100644 index 893baee77b..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C00C.s +++ /dev/null @@ -1,58 +0,0 @@ -glabel func_80B1C00C -/* 0070C 80B1C00C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00710 80B1C010 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00714 80B1C014 84820224 */ lh $v0, 0x0224($a0) ## 00000224 -/* 00718 80B1C018 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 0071C 80B1C01C 14400003 */ bne $v0, $zero, .L80B1C02C -/* 00720 80B1C020 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 00724 80B1C024 10000003 */ beq $zero, $zero, .L80B1C034 -/* 00728 80B1C028 00001825 */ or $v1, $zero, $zero ## $v1 = 00000000 -.L80B1C02C: -/* 0072C 80B1C02C A4CE0224 */ sh $t6, 0x0224($a2) ## 00000224 -/* 00730 80B1C030 84C30224 */ lh $v1, 0x0224($a2) ## 00000224 -.L80B1C034: -/* 00734 80B1C034 54600023 */ bnel $v1, $zero, .L80B1C0C4 -/* 00738 80B1C038 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0073C 80B1C03C 84CF0222 */ lh $t7, 0x0222($a2) ## 00000222 -/* 00740 80B1C040 25F80001 */ addiu $t8, $t7, 0x0001 ## $t8 = 00000001 -/* 00744 80B1C044 A4D80222 */ sh $t8, 0x0222($a2) ## 00000222 -/* 00748 80B1C048 84D90222 */ lh $t9, 0x0222($a2) ## 00000222 -/* 0074C 80B1C04C 2B210003 */ slti $at, $t9, 0x0003 -/* 00750 80B1C050 5420001C */ bnel $at, $zero, .L80B1C0C4 -/* 00754 80B1C054 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00758 80B1C058 84C80218 */ lh $t0, 0x0218($a2) ## 00000218 -/* 0075C 80B1C05C 2404001E */ addiu $a0, $zero, 0x001E ## $a0 = 0000001E -/* 00760 80B1C060 2405001E */ addiu $a1, $zero, 0x001E ## $a1 = 0000001E -/* 00764 80B1C064 2509FFFF */ addiu $t1, $t0, 0xFFFF ## $t1 = FFFFFFFF -/* 00768 80B1C068 A4C90218 */ sh $t1, 0x0218($a2) ## 00000218 -/* 0076C 80B1C06C 84CA0218 */ lh $t2, 0x0218($a2) ## 00000218 -/* 00770 80B1C070 05430013 */ bgezl $t2, .L80B1C0C0 -/* 00774 80B1C074 A4C00222 */ sh $zero, 0x0222($a2) ## 00000222 -/* 00778 80B1C078 0C01DF64 */ jal Math_Rand_S16Offset - -/* 0077C 80B1C07C AFA60018 */ sw $a2, 0x0018($sp) -/* 00780 80B1C080 8FA60018 */ lw $a2, 0x0018($sp) -/* 00784 80B1C084 240B0002 */ addiu $t3, $zero, 0x0002 ## $t3 = 00000002 -/* 00788 80B1C088 A4C20224 */ sh $v0, 0x0224($a2) ## 00000224 -/* 0078C 80B1C08C 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00790 80B1C090 A4CB0218 */ sh $t3, 0x0218($a2) ## 00000218 -/* 00794 80B1C094 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 00798 80B1C098 44812000 */ mtc1 $at, $f4 ## $f4 = 0.50 -/* 0079C 80B1C09C 8FA60018 */ lw $a2, 0x0018($sp) -/* 007A0 80B1C0A0 4600203C */ c.lt.s $f4, $f0 -/* 007A4 80B1C0A4 00000000 */ nop -/* 007A8 80B1C0A8 45020005 */ bc1fl .L80B1C0C0 -/* 007AC 80B1C0AC A4C00222 */ sh $zero, 0x0222($a2) ## 00000222 -/* 007B0 80B1C0B0 84CC0218 */ lh $t4, 0x0218($a2) ## 00000218 -/* 007B4 80B1C0B4 258D0001 */ addiu $t5, $t4, 0x0001 ## $t5 = 00000001 -/* 007B8 80B1C0B8 A4CD0218 */ sh $t5, 0x0218($a2) ## 00000218 -/* 007BC 80B1C0BC A4C00222 */ sh $zero, 0x0222($a2) ## 00000222 -.L80B1C0C0: -/* 007C0 80B1C0C0 8FBF0014 */ lw $ra, 0x0014($sp) -.L80B1C0C4: -/* 007C4 80B1C0C4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 007C8 80B1C0C8 03E00008 */ jr $ra -/* 007CC 80B1C0CC 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C0D0.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C0D0.s deleted file mode 100644 index e690ca31dc..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C0D0.s +++ /dev/null @@ -1,40 +0,0 @@ -glabel func_80B1C0D0 -/* 007D0 80B1C0D0 3C0180B2 */ lui $at, %hi(D_80B1D634) ## $at = 80B20000 -/* 007D4 80B1C0D4 C424D634 */ lwc1 $f4, %lo(D_80B1D634)($at) -/* 007D8 80B1C0D8 C486008C */ lwc1 $f6, 0x008C($a0) ## 0000008C -/* 007DC 80B1C0DC 4606203C */ c.lt.s $f4, $f6 -/* 007E0 80B1C0E0 00000000 */ nop -/* 007E4 80B1C0E4 45020004 */ bc1fl .L80B1C0F8 -/* 007E8 80B1C0E8 848200B6 */ lh $v0, 0x00B6($a0) ## 000000B6 -/* 007EC 80B1C0EC 03E00008 */ jr $ra -/* 007F0 80B1C0F0 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80B1C0F4: -/* 007F4 80B1C0F4 848200B6 */ lh $v0, 0x00B6($a0) ## 000000B6 -.L80B1C0F8: -/* 007F8 80B1C0F8 848E021E */ lh $t6, 0x021E($a0) ## 0000021E -/* 007FC 80B1C0FC 848F0226 */ lh $t7, 0x0226($a0) ## 00000226 -/* 00800 80B1C100 8498008A */ lh $t8, 0x008A($a0) ## 0000008A -/* 00804 80B1C104 004E1023 */ subu $v0, $v0, $t6 -/* 00808 80B1C108 00021400 */ sll $v0, $v0, 16 -/* 0080C 80B1C10C 00021403 */ sra $v0, $v0, 16 -/* 00810 80B1C110 004F1023 */ subu $v0, $v0, $t7 -/* 00814 80B1C114 00021400 */ sll $v0, $v0, 16 -/* 00818 80B1C118 00021403 */ sra $v0, $v0, 16 -/* 0081C 80B1C11C 03021823 */ subu $v1, $t8, $v0 -/* 00820 80B1C120 00031C00 */ sll $v1, $v1, 16 -/* 00824 80B1C124 00031C03 */ sra $v1, $v1, 16 -/* 00828 80B1C128 04600003 */ bltz $v1, .L80B1C138 -/* 0082C 80B1C12C 00031023 */ subu $v0, $zero, $v1 -/* 00830 80B1C130 10000001 */ beq $zero, $zero, .L80B1C138 -/* 00834 80B1C134 00601025 */ or $v0, $v1, $zero ## $v0 = 00000000 -.L80B1C138: -/* 00838 80B1C138 28411554 */ slti $at, $v0, 0x1554 -/* 0083C 80B1C13C 10200003 */ beq $at, $zero, .L80B1C14C -/* 00840 80B1C140 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 00844 80B1C144 03E00008 */ jr $ra -/* 00848 80B1C148 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80B1C14C: -/* 0084C 80B1C14C 03E00008 */ jr $ra -/* 00850 80B1C150 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C154.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C154.s deleted file mode 100644 index 0e3e273754..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C154.s +++ /dev/null @@ -1,68 +0,0 @@ -glabel func_80B1C154 -/* 00854 80B1C154 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 00858 80B1C158 AFBF003C */ sw $ra, 0x003C($sp) -/* 0085C 80B1C15C AFB20038 */ sw $s2, 0x0038($sp) -/* 00860 80B1C160 AFB10034 */ sw $s1, 0x0034($sp) -/* 00864 80B1C164 AFB00030 */ sw $s0, 0x0030($sp) -/* 00868 80B1C168 F7B80028 */ sdc1 $f24, 0x0028($sp) -/* 0086C 80B1C16C F7B60020 */ sdc1 $f22, 0x0020($sp) -/* 00870 80B1C170 F7B40018 */ sdc1 $f20, 0x0018($sp) -/* 00874 80B1C174 8CB01C64 */ lw $s0, 0x1C64($a1) ## 00001C64 -/* 00878 80B1C178 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000 -/* 0087C 80B1C17C 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00880 80B1C180 52000025 */ beql $s0, $zero, .L80B1C218 -/* 00884 80B1C184 2402FFFF */ addiu $v0, $zero, 0xFFFF ## $v0 = FFFFFFFF -/* 00888 80B1C188 4481C000 */ mtc1 $at, $f24 ## $f24 = 10.00 -/* 0088C 80B1C18C 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 00890 80B1C190 4481B000 */ mtc1 $at, $f22 ## $f22 = 40.00 -/* 00894 80B1C194 24120196 */ addiu $s2, $zero, 0x0196 ## $s2 = 00000196 -/* 00898 80B1C198 860E0000 */ lh $t6, 0x0000($s0) ## 00000000 -.L80B1C19C: -/* 0089C 80B1C19C 524E0004 */ beql $s2, $t6, .L80B1C1B0 -/* 008A0 80B1C1A0 8E2F0210 */ lw $t7, 0x0210($s1) ## 00000210 -/* 008A4 80B1C1A4 10000019 */ beq $zero, $zero, .L80B1C20C -/* 008A8 80B1C1A8 8E100124 */ lw $s0, 0x0124($s0) ## 00000124 -/* 008AC 80B1C1AC 8E2F0210 */ lw $t7, 0x0210($s1) ## 00000210 -.L80B1C1B0: -/* 008B0 80B1C1B0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 008B4 80B1C1B4 560F0004 */ bnel $s0, $t7, .L80B1C1C8 -/* 008B8 80B1C1B8 C6040028 */ lwc1 $f4, 0x0028($s0) ## 00000028 -/* 008BC 80B1C1BC 10000013 */ beq $zero, $zero, .L80B1C20C -/* 008C0 80B1C1C0 8E100124 */ lw $s0, 0x0124($s0) ## 00000124 -/* 008C4 80B1C1C4 C6040028 */ lwc1 $f4, 0x0028($s0) ## 00000028 -.L80B1C1C8: -/* 008C8 80B1C1C8 C6260080 */ lwc1 $f6, 0x0080($s1) ## 00000080 -/* 008CC 80B1C1CC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 008D0 80B1C1D0 0C00B6E3 */ jal func_8002DB8C -/* 008D4 80B1C1D4 46062501 */ sub.s $f20, $f4, $f6 -/* 008D8 80B1C1D8 4600B03C */ c.lt.s $f22, $f0 -/* 008DC 80B1C1DC 00000000 */ nop -/* 008E0 80B1C1E0 45010005 */ bc1t .L80B1C1F8 -/* 008E4 80B1C1E4 00000000 */ nop -/* 008E8 80B1C1E8 4614C03C */ c.lt.s $f24, $f20 -/* 008EC 80B1C1EC 00000000 */ nop -/* 008F0 80B1C1F0 45020004 */ bc1fl .L80B1C204 -/* 008F4 80B1C1F4 AE300210 */ sw $s0, 0x0210($s1) ## 00000210 -.L80B1C1F8: -/* 008F8 80B1C1F8 10000004 */ beq $zero, $zero, .L80B1C20C -/* 008FC 80B1C1FC 8E100124 */ lw $s0, 0x0124($s0) ## 00000124 -/* 00900 80B1C200 AE300210 */ sw $s0, 0x0210($s1) ## 00000210 -.L80B1C204: -/* 00904 80B1C204 10000004 */ beq $zero, $zero, .L80B1C218 -/* 00908 80B1C208 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -.L80B1C20C: -/* 0090C 80B1C20C 5600FFE3 */ bnel $s0, $zero, .L80B1C19C -/* 00910 80B1C210 860E0000 */ lh $t6, 0x0000($s0) ## 00000000 -/* 00914 80B1C214 2402FFFF */ addiu $v0, $zero, 0xFFFF ## $v0 = FFFFFFFF -.L80B1C218: -/* 00918 80B1C218 8FBF003C */ lw $ra, 0x003C($sp) -/* 0091C 80B1C21C D7B40018 */ ldc1 $f20, 0x0018($sp) -/* 00920 80B1C220 D7B60020 */ ldc1 $f22, 0x0020($sp) -/* 00924 80B1C224 D7B80028 */ ldc1 $f24, 0x0028($sp) -/* 00928 80B1C228 8FB00030 */ lw $s0, 0x0030($sp) -/* 0092C 80B1C22C 8FB10034 */ lw $s1, 0x0034($sp) -/* 00930 80B1C230 8FB20038 */ lw $s2, 0x0038($sp) -/* 00934 80B1C234 03E00008 */ jr $ra -/* 00938 80B1C238 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C23C.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C23C.s deleted file mode 100644 index 1db52b53ee..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C23C.s +++ /dev/null @@ -1,35 +0,0 @@ -glabel func_80B1C23C -/* 0093C 80B1C23C 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00940 80B1C240 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00944 80B1C244 8C850210 */ lw $a1, 0x0210($a0) ## 00000210 -/* 00948 80B1C248 50A00017 */ beql $a1, $zero, .L80B1C2A8 -/* 0094C 80B1C24C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00950 80B1C250 C4A40028 */ lwc1 $f4, 0x0028($a1) ## 00000028 -/* 00954 80B1C254 C4860080 */ lwc1 $f6, 0x0080($a0) ## 00000080 -/* 00958 80B1C258 AFA40020 */ sw $a0, 0x0020($sp) -/* 0095C 80B1C25C 46062201 */ sub.s $f8, $f4, $f6 -/* 00960 80B1C260 0C00B6E3 */ jal func_8002DB8C -/* 00964 80B1C264 E7A80018 */ swc1 $f8, 0x0018($sp) -/* 00968 80B1C268 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 0096C 80B1C26C 44815000 */ mtc1 $at, $f10 ## $f10 = 40.00 -/* 00970 80B1C270 8FA40020 */ lw $a0, 0x0020($sp) -/* 00974 80B1C274 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00978 80B1C278 4600503C */ c.lt.s $f10, $f0 -/* 0097C 80B1C27C C7B20018 */ lwc1 $f18, 0x0018($sp) -/* 00980 80B1C280 45030008 */ bc1tl .L80B1C2A4 -/* 00984 80B1C284 AC800210 */ sw $zero, 0x0210($a0) ## 00000210 -/* 00988 80B1C288 44818000 */ mtc1 $at, $f16 ## $f16 = 10.00 -/* 0098C 80B1C28C 00000000 */ nop -/* 00990 80B1C290 4612803C */ c.lt.s $f16, $f18 -/* 00994 80B1C294 00000000 */ nop -/* 00998 80B1C298 45020003 */ bc1fl .L80B1C2A8 -/* 0099C 80B1C29C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 009A0 80B1C2A0 AC800210 */ sw $zero, 0x0210($a0) ## 00000210 -.L80B1C2A4: -/* 009A4 80B1C2A4 8FBF0014 */ lw $ra, 0x0014($sp) -.L80B1C2A8: -/* 009A8 80B1C2A8 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 009AC 80B1C2AC 03E00008 */ jr $ra -/* 009B0 80B1C2B0 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C2B4.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C2B4.s deleted file mode 100644 index 50d6f15d94..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C2B4.s +++ /dev/null @@ -1,87 +0,0 @@ -glabel func_80B1C2B4 -/* 009B4 80B1C2B4 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 009B8 80B1C2B8 3C0F80B2 */ lui $t7, %hi(D_80B1D540) ## $t7 = 80B20000 -/* 009BC 80B1C2BC AFBF0014 */ sw $ra, 0x0014($sp) -/* 009C0 80B1C2C0 AFA50034 */ sw $a1, 0x0034($sp) -/* 009C4 80B1C2C4 25EFD540 */ addiu $t7, $t7, %lo(D_80B1D540) ## $t7 = 80B1D540 -/* 009C8 80B1C2C8 8DF90000 */ lw $t9, 0x0000($t7) ## 80B1D540 -/* 009CC 80B1C2CC 8DF80004 */ lw $t8, 0x0004($t7) ## 80B1D544 -/* 009D0 80B1C2D0 27AE0028 */ addiu $t6, $sp, 0x0028 ## $t6 = FFFFFFF8 -/* 009D4 80B1C2D4 ADD90000 */ sw $t9, 0x0000($t6) ## FFFFFFF8 -/* 009D8 80B1C2D8 ADD80004 */ sw $t8, 0x0004($t6) ## FFFFFFFC -/* 009DC 80B1C2DC 44807000 */ mtc1 $zero, $f14 ## $f14 = 0.00 -/* 009E0 80B1C2E0 C4800164 */ lwc1 $f0, 0x0164($a0) ## 00000164 -/* 009E4 80B1C2E4 3C0141C8 */ lui $at, 0x41C8 ## $at = 41C80000 -/* 009E8 80B1C2E8 240538B8 */ addiu $a1, $zero, 0x38B8 ## $a1 = 000038B8 -/* 009EC 80B1C2EC 46007032 */ c.eq.s $f14, $f0 -/* 009F0 80B1C2F0 00000000 */ nop -/* 009F4 80B1C2F4 45010007 */ bc1t .L80B1C314 -/* 009F8 80B1C2F8 00000000 */ nop -/* 009FC 80B1C2FC 44812000 */ mtc1 $at, $f4 ## $f4 = 25.00 -/* 00A00 80B1C300 00000000 */ nop -/* 00A04 80B1C304 46002032 */ c.eq.s $f4, $f0 -/* 00A08 80B1C308 00000000 */ nop -/* 00A0C 80B1C30C 45020006 */ bc1fl .L80B1C328 -/* 00A10 80B1C310 8C890154 */ lw $t1, 0x0154($a0) ## 00000154 -.L80B1C314: -/* 00A14 80B1C314 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 00A18 80B1C318 AFA40030 */ sw $a0, 0x0030($sp) -/* 00A1C 80B1C31C 44807000 */ mtc1 $zero, $f14 ## $f14 = 0.00 -/* 00A20 80B1C320 8FA40030 */ lw $a0, 0x0030($sp) -/* 00A24 80B1C324 8C890154 */ lw $t1, 0x0154($a0) ## 00000154 -.L80B1C328: -/* 00A28 80B1C328 3C080600 */ lui $t0, 0x0600 ## $t0 = 06000000 -/* 00A2C 80B1C32C 25081FA8 */ addiu $t0, $t0, 0x1FA8 ## $t0 = 06001FA8 -/* 00A30 80B1C330 11090003 */ beq $t0, $t1, .L80B1C340 -/* 00A34 80B1C334 27A20028 */ addiu $v0, $sp, 0x0028 ## $v0 = FFFFFFF8 -/* 00A38 80B1C338 10000024 */ beq $zero, $zero, .L80B1C3CC -/* 00A3C 80B1C33C 46007006 */ mov.s $f0, $f14 -.L80B1C340: -/* 00A40 80B1C340 3C014140 */ lui $at, 0x4140 ## $at = 41400000 -/* 00A44 80B1C344 44816000 */ mtc1 $at, $f12 ## $f12 = 12.00 -/* 00A48 80B1C348 C4820164 */ lwc1 $f2, 0x0164($a0) ## 00000164 -/* 00A4C 80B1C34C 27A30030 */ addiu $v1, $sp, 0x0030 ## $v1 = 00000000 -/* 00A50 80B1C350 C4400000 */ lwc1 $f0, 0x0000($v0) ## FFFFFFF8 -.L80B1C354: -/* 00A54 80B1C354 460C0180 */ add.s $f6, $f0, $f12 -/* 00A58 80B1C358 4606103C */ c.lt.s $f2, $f6 -/* 00A5C 80B1C35C 00000000 */ nop -/* 00A60 80B1C360 45020006 */ bc1fl .L80B1C37C -/* 00A64 80B1C364 24420004 */ addiu $v0, $v0, 0x0004 ## $v0 = FFFFFFFC -/* 00A68 80B1C368 4602003E */ c.le.s $f0, $f2 -/* 00A6C 80B1C36C 00000000 */ nop -/* 00A70 80B1C370 45030005 */ bc1tl .L80B1C388 -/* 00A74 80B1C374 27AA0030 */ addiu $t2, $sp, 0x0030 ## $t2 = 00000000 -/* 00A78 80B1C378 24420004 */ addiu $v0, $v0, 0x0004 ## $v0 = 00000000 -.L80B1C37C: -/* 00A7C 80B1C37C 5443FFF5 */ bnel $v0, $v1, .L80B1C354 -/* 00A80 80B1C380 C4400000 */ lwc1 $f0, 0x0000($v0) ## 00000000 -/* 00A84 80B1C384 27AA0030 */ addiu $t2, $sp, 0x0030 ## $t2 = 00000000 -.L80B1C388: -/* 00A88 80B1C388 004A082B */ sltu $at, $v0, $t2 -/* 00A8C 80B1C38C 54200004 */ bnel $at, $zero, .L80B1C3A0 -/* 00A90 80B1C390 C4480000 */ lwc1 $f8, 0x0000($v0) ## 00000000 -/* 00A94 80B1C394 1000000D */ beq $zero, $zero, .L80B1C3CC -/* 00A98 80B1C398 46007006 */ mov.s $f0, $f14 -/* 00A9C 80B1C39C C4480000 */ lwc1 $f8, 0x0000($v0) ## 00000000 -.L80B1C3A0: -/* 00AA0 80B1C3A0 3C0180B2 */ lui $at, %hi(D_80B1D638) ## $at = 80B20000 -/* 00AA4 80B1C3A4 C430D638 */ lwc1 $f16, %lo(D_80B1D638)($at) -/* 00AA8 80B1C3A8 46081281 */ sub.s $f10, $f2, $f8 -/* 00AAC 80B1C3AC 46105082 */ mul.s $f2, $f10, $f16 -/* 00AB0 80B1C3B0 4600148D */ trunc.w.s $f18, $f2 -/* 00AB4 80B1C3B4 44049000 */ mfc1 $a0, $f18 -/* 00AB8 80B1C3B8 00000000 */ nop -/* 00ABC 80B1C3BC 00042400 */ sll $a0, $a0, 16 -/* 00AC0 80B1C3C0 0C01DE1C */ jal Math_Sins - ## sins? -/* 00AC4 80B1C3C4 00042403 */ sra $a0, $a0, 16 -/* 00AC8 80B1C3C8 46000000 */ add.s $f0, $f0, $f0 -.L80B1C3CC: -/* 00ACC 80B1C3CC 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00AD0 80B1C3D0 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 00AD4 80B1C3D4 03E00008 */ jr $ra -/* 00AD8 80B1C3D8 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C3DC.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C3DC.s deleted file mode 100644 index 95de9f79df..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C3DC.s +++ /dev/null @@ -1,99 +0,0 @@ -glabel func_80B1C3DC -/* 00ADC 80B1C3DC 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 00AE0 80B1C3E0 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00AE4 80B1C3E4 AFB00020 */ sw $s0, 0x0020($sp) -/* 00AE8 80B1C3E8 848E001C */ lh $t6, 0x001C($a0) ## 0000001C -/* 00AEC 80B1C3EC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00AF0 80B1C3F0 3C040001 */ lui $a0, 0x0001 ## $a0 = 00010000 -/* 00AF4 80B1C3F4 05C10003 */ bgez $t6, .L80B1C404 -/* 00AF8 80B1C3F8 00852021 */ addu $a0, $a0, $a1 -/* 00AFC 80B1C3FC 1000004E */ beq $zero, $zero, .L80B1C538 -/* 00B00 80B1C400 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80B1C404: -/* 00B04 80B1C404 8C841E08 */ lw $a0, 0x1E08($a0) ## 00011E08 -/* 00B08 80B1C408 3C088016 */ lui $t0, 0x8016 ## $t0 = 80160000 -/* 00B0C 80B1C40C 860A0228 */ lh $t2, 0x0228($s0) ## 00000228 -/* 00B10 80B1C410 8C830004 */ lw $v1, 0x0004($a0) ## 00010004 -/* 00B14 80B1C414 3C0100FF */ lui $at, 0x00FF ## $at = 00FF0000 -/* 00B18 80B1C418 3421FFFF */ ori $at, $at, 0xFFFF ## $at = 00FFFFFF -/* 00B1C 80B1C41C 00037900 */ sll $t7, $v1, 4 -/* 00B20 80B1C420 000FC702 */ srl $t8, $t7, 28 -/* 00B24 80B1C424 0018C880 */ sll $t9, $t8, 2 -/* 00B28 80B1C428 01194021 */ addu $t0, $t0, $t9 -/* 00B2C 80B1C42C 8D086FA8 */ lw $t0, 0x6FA8($t0) ## 80166FA8 -/* 00B30 80B1C430 00614824 */ and $t1, $v1, $at -/* 00B34 80B1C434 000A5880 */ sll $t3, $t2, 2 -/* 00B38 80B1C438 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 00B3C 80B1C43C 016A5823 */ subu $t3, $t3, $t2 -/* 00B40 80B1C440 01091021 */ addu $v0, $t0, $t1 -/* 00B44 80B1C444 00411021 */ addu $v0, $v0, $at -/* 00B48 80B1C448 000B5840 */ sll $t3, $t3, 1 -/* 00B4C 80B1C44C 004B1021 */ addu $v0, $v0, $t3 -/* 00B50 80B1C450 844C0000 */ lh $t4, 0x0000($v0) ## 00000001 -/* 00B54 80B1C454 844D0004 */ lh $t5, 0x0004($v0) ## 00000005 -/* 00B58 80B1C458 C6080024 */ lwc1 $f8, 0x0024($s0) ## 00000024 -/* 00B5C 80B1C45C 448C2000 */ mtc1 $t4, $f4 ## $f4 = 0.00 -/* 00B60 80B1C460 448D5000 */ mtc1 $t5, $f10 ## $f10 = 0.00 -/* 00B64 80B1C464 C612002C */ lwc1 $f18, 0x002C($s0) ## 0000002C -/* 00B68 80B1C468 468021A0 */ cvt.s.w $f6, $f4 -/* 00B6C 80B1C46C AFA40034 */ sw $a0, 0x0034($sp) -/* 00B70 80B1C470 46805420 */ cvt.s.w $f16, $f10 -/* 00B74 80B1C474 46083301 */ sub.s $f12, $f6, $f8 -/* 00B78 80B1C478 46128381 */ sub.s $f14, $f16, $f18 -/* 00B7C 80B1C47C E7AC002C */ swc1 $f12, 0x002C($sp) -/* 00B80 80B1C480 0C03F494 */ jal func_800FD250 -/* 00B84 80B1C484 E7AE0028 */ swc1 $f14, 0x0028($sp) -/* 00B88 80B1C488 3C0180B2 */ lui $at, %hi(D_80B1D63C) ## $at = 80B20000 -/* 00B8C 80B1C48C C424D63C */ lwc1 $f4, %lo(D_80B1D63C)($at) -/* 00B90 80B1C490 240F0001 */ addiu $t7, $zero, 0x0001 ## $t7 = 00000001 -/* 00B94 80B1C494 AFAF0010 */ sw $t7, 0x0010($sp) -/* 00B98 80B1C498 46040182 */ mul.s $f6, $f0, $f4 -/* 00B9C 80B1C49C 260400B6 */ addiu $a0, $s0, 0x00B6 ## $a0 = 000000B6 -/* 00BA0 80B1C4A0 2406000A */ addiu $a2, $zero, 0x000A ## $a2 = 0000000A -/* 00BA4 80B1C4A4 240703E8 */ addiu $a3, $zero, 0x03E8 ## $a3 = 000003E8 -/* 00BA8 80B1C4A8 4600320D */ trunc.w.s $f8, $f6 -/* 00BAC 80B1C4AC 44054000 */ mfc1 $a1, $f8 -/* 00BB0 80B1C4B0 00000000 */ nop -/* 00BB4 80B1C4B4 00052C00 */ sll $a1, $a1, 16 -/* 00BB8 80B1C4B8 0C01E1A7 */ jal Math_SmoothScaleMaxMinS - -/* 00BBC 80B1C4BC 00052C03 */ sra $a1, $a1, 16 -/* 00BC0 80B1C4C0 C7AC002C */ lwc1 $f12, 0x002C($sp) -/* 00BC4 80B1C4C4 C7AE0028 */ lwc1 $f14, 0x0028($sp) -/* 00BC8 80B1C4C8 8A1900B4 */ lwl $t9, 0x00B4($s0) ## 000000B4 -/* 00BCC 80B1C4CC 460C6282 */ mul.s $f10, $f12, $f12 -/* 00BD0 80B1C4D0 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00BD4 80B1C4D4 44812000 */ mtc1 $at, $f4 ## $f4 = 10.00 -/* 00BD8 80B1C4D8 460E7402 */ mul.s $f16, $f14, $f14 -/* 00BDC 80B1C4DC 9A1900B7 */ lwr $t9, 0x00B7($s0) ## 000000B7 -/* 00BE0 80B1C4E0 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 00BE4 80B1C4E4 AA190030 */ swl $t9, 0x0030($s0) ## 00000030 -/* 00BE8 80B1C4E8 BA190033 */ swr $t9, 0x0033($s0) ## 00000033 -/* 00BEC 80B1C4EC 961900B8 */ lhu $t9, 0x00B8($s0) ## 000000B8 -/* 00BF0 80B1C4F0 46105480 */ add.s $f18, $f10, $f16 -/* 00BF4 80B1C4F4 A6190034 */ sh $t9, 0x0034($s0) ## 00000034 -/* 00BF8 80B1C4F8 4604903C */ c.lt.s $f18, $f4 -/* 00BFC 80B1C4FC 00000000 */ nop -/* 00C00 80B1C500 4500000D */ bc1f .L80B1C538 -/* 00C04 80B1C504 00000000 */ nop -/* 00C08 80B1C508 86080228 */ lh $t0, 0x0228($s0) ## 00000228 -/* 00C0C 80B1C50C 25090001 */ addiu $t1, $t0, 0x0001 ## $t1 = 00000001 -/* 00C10 80B1C510 A6090228 */ sh $t1, 0x0228($s0) ## 00000228 -/* 00C14 80B1C514 8FAB0034 */ lw $t3, 0x0034($sp) -/* 00C18 80B1C518 860A0228 */ lh $t2, 0x0228($s0) ## 00000228 -/* 00C1C 80B1C51C 916C0000 */ lbu $t4, 0x0000($t3) ## 00000000 -/* 00C20 80B1C520 014C082A */ slt $at, $t2, $t4 -/* 00C24 80B1C524 14200002 */ bne $at, $zero, .L80B1C530 -/* 00C28 80B1C528 00000000 */ nop -/* 00C2C 80B1C52C A6000228 */ sh $zero, 0x0228($s0) ## 00000228 -.L80B1C530: -/* 00C30 80B1C530 10000001 */ beq $zero, $zero, .L80B1C538 -/* 00C34 80B1C534 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80B1C538: -/* 00C38 80B1C538 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00C3C 80B1C53C 8FB00020 */ lw $s0, 0x0020($sp) -/* 00C40 80B1C540 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 00C44 80B1C544 03E00008 */ jr $ra -/* 00C48 80B1C548 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C54C.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C54C.s deleted file mode 100644 index 5cbdbbe679..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C54C.s +++ /dev/null @@ -1,26 +0,0 @@ -glabel func_80B1C54C -/* 00C4C 80B1C54C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00C50 80B1C550 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00C54 80B1C554 AFA5001C */ sw $a1, 0x001C($sp) -/* 00C58 80B1C558 0C01B0D8 */ jal func_8006C360 -/* 00C5C 80B1C55C 2405000E */ addiu $a1, $zero, 0x000E ## $a1 = 0000000E -/* 00C60 80B1C560 10400003 */ beq $v0, $zero, .L80B1C570 -/* 00C64 80B1C564 3043FFFF */ andi $v1, $v0, 0xFFFF ## $v1 = 00000000 -/* 00C68 80B1C568 10000009 */ beq $zero, $zero, .L80B1C590 -/* 00C6C 80B1C56C 00601025 */ or $v0, $v1, $zero ## $v0 = 00000000 -.L80B1C570: -/* 00C70 80B1C570 3C0E8016 */ lui $t6, 0x8016 ## $t6 = 80160000 -/* 00C74 80B1C574 95CEF572 */ lhu $t6, -0x0A8E($t6) ## 8015F572 -/* 00C78 80B1C578 24025018 */ addiu $v0, $zero, 0x5018 ## $v0 = 00005018 -/* 00C7C 80B1C57C 31CF0200 */ andi $t7, $t6, 0x0200 ## $t7 = 00000000 -/* 00C80 80B1C580 11E00003 */ beq $t7, $zero, .L80B1C590 -/* 00C84 80B1C584 00000000 */ nop -/* 00C88 80B1C588 10000001 */ beq $zero, $zero, .L80B1C590 -/* 00C8C 80B1C58C 24025019 */ addiu $v0, $zero, 0x5019 ## $v0 = 00005019 -.L80B1C590: -/* 00C90 80B1C590 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00C94 80B1C594 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00C98 80B1C598 03E00008 */ jr $ra -/* 00C9C 80B1C59C 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C5A0.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C5A0.s deleted file mode 100644 index 7adea6a832..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C5A0.s +++ /dev/null @@ -1,117 +0,0 @@ -glabel func_80B1C5A0 -/* 00CA0 80B1C5A0 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00CA4 80B1C5A4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00CA8 80B1C5A8 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 00CAC 80B1C5AC 240E0001 */ addiu $t6, $zero, 0x0001 ## $t6 = 00000001 -/* 00CB0 80B1C5B0 AFAE001C */ sw $t6, 0x001C($sp) -/* 00CB4 80B1C5B4 AFA70020 */ sw $a3, 0x0020($sp) -/* 00CB8 80B1C5B8 248420D8 */ addiu $a0, $a0, 0x20D8 ## $a0 = 000020D8 -/* 00CBC 80B1C5BC 0C042F6F */ jal func_8010BDBC -/* 00CC0 80B1C5C0 AFA50024 */ sw $a1, 0x0024($sp) -/* 00CC4 80B1C5C4 2C41000A */ sltiu $at, $v0, 0x000A -/* 00CC8 80B1C5C8 8FA60024 */ lw $a2, 0x0024($sp) -/* 00CCC 80B1C5CC 10200055 */ beq $at, $zero, .L80B1C724 -/* 00CD0 80B1C5D0 8FA70020 */ lw $a3, 0x0020($sp) -/* 00CD4 80B1C5D4 00027880 */ sll $t7, $v0, 2 -/* 00CD8 80B1C5D8 3C0180B2 */ lui $at, %hi(jtbl_80B1D640) ## $at = 80B20000 -/* 00CDC 80B1C5DC 002F0821 */ addu $at, $at, $t7 -/* 00CE0 80B1C5E0 8C2FD640 */ lw $t7, %lo(jtbl_80B1D640)($at) -/* 00CE4 80B1C5E4 01E00008 */ jr $t7 -/* 00CE8 80B1C5E8 00000000 */ nop -glabel L80B1C5EC -/* 00CEC 80B1C5EC 94D8010E */ lhu $t8, 0x010E($a2) ## 0000010E -/* 00CF0 80B1C5F0 24015028 */ addiu $at, $zero, 0x5028 ## $at = 00005028 -/* 00CF4 80B1C5F4 3C038016 */ lui $v1, 0x8016 ## $v1 = 80160000 -/* 00CF8 80B1C5F8 17010004 */ bne $t8, $at, .L80B1C60C -/* 00CFC 80B1C5FC 2463E660 */ addiu $v1, $v1, 0xE660 ## $v1 = 8015E660 -/* 00D00 80B1C600 94790F12 */ lhu $t9, 0x0F12($v1) ## 8015F572 -/* 00D04 80B1C604 37280100 */ ori $t0, $t9, 0x0100 ## $t0 = 00000100 -/* 00D08 80B1C608 A4680F12 */ sh $t0, 0x0F12($v1) ## 8015F572 -.L80B1C60C: -/* 00D0C 80B1C60C 10000045 */ beq $zero, $zero, .L80B1C724 -/* 00D10 80B1C610 AFA0001C */ sw $zero, 0x001C($sp) -glabel L80B1C614 -/* 00D14 80B1C614 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00D18 80B1C618 AFA60024 */ sw $a2, 0x0024($sp) -/* 00D1C 80B1C61C 0C041AF2 */ jal func_80106BC8 -/* 00D20 80B1C620 AFA70020 */ sw $a3, 0x0020($sp) -/* 00D24 80B1C624 8FA60024 */ lw $a2, 0x0024($sp) -/* 00D28 80B1C628 1040003E */ beq $v0, $zero, .L80B1C724 -/* 00D2C 80B1C62C 8FA70020 */ lw $a3, 0x0020($sp) -/* 00D30 80B1C630 94C2010E */ lhu $v0, 0x010E($a2) ## 0000010E -/* 00D34 80B1C634 24015018 */ addiu $at, $zero, 0x5018 ## $at = 00005018 -/* 00D38 80B1C638 3C090001 */ lui $t1, 0x0001 ## $t1 = 00010000 -/* 00D3C 80B1C63C 10410004 */ beq $v0, $at, .L80B1C650 -/* 00D40 80B1C640 01274821 */ addu $t1, $t1, $a3 -/* 00D44 80B1C644 24015019 */ addiu $at, $zero, 0x5019 ## $at = 00005019 -/* 00D48 80B1C648 54410037 */ bnel $v0, $at, .L80B1C728 -/* 00D4C 80B1C64C 87A2001E */ lh $v0, 0x001E($sp) -.L80B1C650: -/* 00D50 80B1C650 912904BD */ lbu $t1, 0x04BD($t1) ## 000104BD -/* 00D54 80B1C654 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 00D58 80B1C658 3C038016 */ lui $v1, 0x8016 ## $v1 = 80160000 -/* 00D5C 80B1C65C 15210004 */ bne $t1, $at, .L80B1C670 -/* 00D60 80B1C660 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00D64 80B1C664 240A0084 */ addiu $t2, $zero, 0x0084 ## $t2 = 00000084 -/* 00D68 80B1C668 10000016 */ beq $zero, $zero, .L80B1C6C4 -/* 00D6C 80B1C66C A4CA010E */ sh $t2, 0x010E($a2) ## 0000010E -.L80B1C670: -/* 00D70 80B1C670 2463E660 */ addiu $v1, $v1, 0xE660 ## $v1 = 8015E660 -/* 00D74 80B1C674 846B0034 */ lh $t3, 0x0034($v1) ## 8015E694 -/* 00D78 80B1C678 240C0085 */ addiu $t4, $zero, 0x0085 ## $t4 = 00000085 -/* 00D7C 80B1C67C 240D0037 */ addiu $t5, $zero, 0x0037 ## $t5 = 00000037 -/* 00D80 80B1C680 2961000A */ slti $at, $t3, 0x000A -/* 00D84 80B1C684 50200004 */ beql $at, $zero, .L80B1C698 -/* 00D88 80B1C688 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00D8C 80B1C68C 1000000D */ beq $zero, $zero, .L80B1C6C4 -/* 00D90 80B1C690 A4CC010E */ sh $t4, 0x010E($a2) ## 0000010E -/* 00D94 80B1C694 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -.L80B1C698: -/* 00D98 80B1C698 00270821 */ addu $at, $at, $a3 -/* 00D9C 80B1C69C A02D03DC */ sb $t5, 0x03DC($at) ## 000103DC -/* 00DA0 80B1C6A0 0C021CC3 */ jal Rupees_ChangeBy -/* 00DA4 80B1C6A4 2404FFF6 */ addiu $a0, $zero, 0xFFF6 ## $a0 = FFFFFFF6 -/* 00DA8 80B1C6A8 3C038016 */ lui $v1, 0x8016 ## $v1 = 80160000 -/* 00DAC 80B1C6AC 2463E660 */ addiu $v1, $v1, 0xE660 ## $v1 = 8015E660 -/* 00DB0 80B1C6B0 946E0F12 */ lhu $t6, 0x0F12($v1) ## 8015F572 -/* 00DB4 80B1C6B4 24020002 */ addiu $v0, $zero, 0x0002 ## $v0 = 00000002 -/* 00DB8 80B1C6B8 35CF0200 */ ori $t7, $t6, 0x0200 ## $t7 = 00000200 -/* 00DBC 80B1C6BC 1000001A */ beq $zero, $zero, .L80B1C728 -/* 00DC0 80B1C6C0 A46F0F12 */ sh $t7, 0x0F12($v1) ## 8015F572 -.L80B1C6C4: -/* 00DC4 80B1C6C4 0C042DC8 */ jal func_8010B720 -/* 00DC8 80B1C6C8 94C5010E */ lhu $a1, 0x010E($a2) ## 0000010E -/* 00DCC 80B1C6CC 3C038016 */ lui $v1, 0x8016 ## $v1 = 80160000 -/* 00DD0 80B1C6D0 2463E660 */ addiu $v1, $v1, 0xE660 ## $v1 = 8015E660 -/* 00DD4 80B1C6D4 94780F12 */ lhu $t8, 0x0F12($v1) ## 8015F572 -/* 00DD8 80B1C6D8 37190200 */ ori $t9, $t8, 0x0200 ## $t9 = 00000200 -/* 00DDC 80B1C6DC 10000011 */ beq $zero, $zero, .L80B1C724 -/* 00DE0 80B1C6E0 A4790F12 */ sh $t9, 0x0F12($v1) ## 8015F572 -glabel L80B1C6E4 -/* 00DE4 80B1C6E4 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00DE8 80B1C6E8 AFA60024 */ sw $a2, 0x0024($sp) -/* 00DEC 80B1C6EC 0C041AF2 */ jal func_80106BC8 -/* 00DF0 80B1C6F0 AFA70020 */ sw $a3, 0x0020($sp) -/* 00DF4 80B1C6F4 8FA60024 */ lw $a2, 0x0024($sp) -/* 00DF8 80B1C6F8 1040000A */ beq $v0, $zero, .L80B1C724 -/* 00DFC 80B1C6FC 8FA70020 */ lw $a3, 0x0020($sp) -/* 00E00 80B1C700 94C2010E */ lhu $v0, 0x010E($a2) ## 0000010E -/* 00E04 80B1C704 24010084 */ addiu $at, $zero, 0x0084 ## $at = 00000084 -/* 00E08 80B1C708 10410003 */ beq $v0, $at, .L80B1C718 -/* 00E0C 80B1C70C 24010085 */ addiu $at, $zero, 0x0085 ## $at = 00000085 -/* 00E10 80B1C710 54410005 */ bnel $v0, $at, .L80B1C728 -/* 00E14 80B1C714 87A2001E */ lh $v0, 0x001E($sp) -.L80B1C718: -/* 00E18 80B1C718 0C041B33 */ jal func_80106CCC -/* 00E1C 80B1C71C 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00E20 80B1C720 AFA0001C */ sw $zero, 0x001C($sp) -glabel L80B1C724 -.L80B1C724: -/* 00E24 80B1C724 87A2001E */ lh $v0, 0x001E($sp) -.L80B1C728: -/* 00E28 80B1C728 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00E2C 80B1C72C 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00E30 80B1C730 03E00008 */ jr $ra -/* 00E34 80B1C734 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C738.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C738.s deleted file mode 100644 index 73a3a42ce7..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C738.s +++ /dev/null @@ -1,131 +0,0 @@ -glabel func_80B1C738 -/* 00E38 80B1C738 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00E3C 80B1C73C AFBF0014 */ sw $ra, 0x0014($sp) -/* 00E40 80B1C740 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00E44 80B1C744 AFA40018 */ sw $a0, 0x0018($sp) -/* 00E48 80B1C748 3C0180B2 */ lui $at, %hi(D_80B1D668) ## $at = 80B20000 -/* 00E4C 80B1C74C C424D668 */ lwc1 $f4, %lo(D_80B1D668)($at) -/* 00E50 80B1C750 8FA50018 */ lw $a1, 0x0018($sp) -/* 00E54 80B1C754 3C0180B2 */ lui $at, %hi(D_80B1D670) ## $at = 80B20000 -/* 00E58 80B1C758 4604003C */ c.lt.s $f0, $f4 -/* 00E5C 80B1C75C 00000000 */ nop -/* 00E60 80B1C760 45000003 */ bc1f .L80B1C770 -/* 00E64 80B1C764 00000000 */ nop -/* 00E68 80B1C768 10000012 */ beq $zero, $zero, .L80B1C7B4 -/* 00E6C 80B1C76C 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -.L80B1C770: -/* 00E70 80B1C770 D426D670 */ ldc1 $f6, %lo(D_80B1D670)($at) -/* 00E74 80B1C774 460000A1 */ cvt.d.s $f2, $f0 -/* 00E78 80B1C778 3C0180B2 */ lui $at, %hi(D_80B1D678) ## $at = 80B20000 -/* 00E7C 80B1C77C 4626103C */ c.lt.d $f2, $f6 -/* 00E80 80B1C780 00000000 */ nop -/* 00E84 80B1C784 45000003 */ bc1f .L80B1C794 -/* 00E88 80B1C788 00000000 */ nop -/* 00E8C 80B1C78C 10000009 */ beq $zero, $zero, .L80B1C7B4 -/* 00E90 80B1C790 24040001 */ addiu $a0, $zero, 0x0001 ## $a0 = 00000001 -.L80B1C794: -/* 00E94 80B1C794 D428D678 */ ldc1 $f8, %lo(D_80B1D678)($at) -/* 00E98 80B1C798 24040003 */ addiu $a0, $zero, 0x0003 ## $a0 = 00000003 -/* 00E9C 80B1C79C 4628103C */ c.lt.d $f2, $f8 -/* 00EA0 80B1C7A0 00000000 */ nop -/* 00EA4 80B1C7A4 45000003 */ bc1f .L80B1C7B4 -/* 00EA8 80B1C7A8 00000000 */ nop -/* 00EAC 80B1C7AC 10000001 */ beq $zero, $zero, .L80B1C7B4 -/* 00EB0 80B1C7B0 24040002 */ addiu $a0, $zero, 0x0002 ## $a0 = 00000002 -.L80B1C7B4: -/* 00EB4 80B1C7B4 10800009 */ beq $a0, $zero, .L80B1C7DC -/* 00EB8 80B1C7B8 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 00EBC 80B1C7BC 1081000E */ beq $a0, $at, .L80B1C7F8 -/* 00EC0 80B1C7C0 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 00EC4 80B1C7C4 10810015 */ beq $a0, $at, .L80B1C81C -/* 00EC8 80B1C7C8 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 00ECC 80B1C7CC 5081001D */ beql $a0, $at, .L80B1C844 -/* 00ED0 80B1C7D0 90A3020C */ lbu $v1, 0x020C($a1) ## 0000020C -/* 00ED4 80B1C7D4 10000021 */ beq $zero, $zero, .L80B1C85C -/* 00ED8 80B1C7D8 90A30209 */ lbu $v1, 0x0209($a1) ## 00000209 -.L80B1C7DC: -/* 00EDC 80B1C7DC 90A30209 */ lbu $v1, 0x0209($a1) ## 00000209 -/* 00EE0 80B1C7E0 00801025 */ or $v0, $a0, $zero ## $v0 = 00000002 -/* 00EE4 80B1C7E4 28610008 */ slti $at, $v1, 0x0008 -/* 00EE8 80B1C7E8 1020001C */ beq $at, $zero, .L80B1C85C -/* 00EEC 80B1C7EC 246E0001 */ addiu $t6, $v1, 0x0001 ## $t6 = 00000001 -/* 00EF0 80B1C7F0 1000003B */ beq $zero, $zero, .L80B1C8E0 -/* 00EF4 80B1C7F4 A0AE0209 */ sb $t6, 0x0209($a1) ## 00000209 -.L80B1C7F8: -/* 00EF8 80B1C7F8 90A3020A */ lbu $v1, 0x020A($a1) ## 0000020A -/* 00EFC 80B1C7FC 00801025 */ or $v0, $a0, $zero ## $v0 = 00000002 -/* 00F00 80B1C800 28610004 */ slti $at, $v1, 0x0004 -/* 00F04 80B1C804 10200003 */ beq $at, $zero, .L80B1C814 -/* 00F08 80B1C808 246F0001 */ addiu $t7, $v1, 0x0001 ## $t7 = 00000001 -/* 00F0C 80B1C80C 10000034 */ beq $zero, $zero, .L80B1C8E0 -/* 00F10 80B1C810 A0AF020A */ sb $t7, 0x020A($a1) ## 0000020A -.L80B1C814: -/* 00F14 80B1C814 10000011 */ beq $zero, $zero, .L80B1C85C -/* 00F18 80B1C818 90A30209 */ lbu $v1, 0x0209($a1) ## 00000209 -.L80B1C81C: -/* 00F1C 80B1C81C 90A3020B */ lbu $v1, 0x020B($a1) ## 0000020B -/* 00F20 80B1C820 00801025 */ or $v0, $a0, $zero ## $v0 = 00000002 -/* 00F24 80B1C824 28610002 */ slti $at, $v1, 0x0002 -/* 00F28 80B1C828 10200003 */ beq $at, $zero, .L80B1C838 -/* 00F2C 80B1C82C 24780001 */ addiu $t8, $v1, 0x0001 ## $t8 = 00000001 -/* 00F30 80B1C830 1000002B */ beq $zero, $zero, .L80B1C8E0 -/* 00F34 80B1C834 A0B8020B */ sb $t8, 0x020B($a1) ## 0000020B -.L80B1C838: -/* 00F38 80B1C838 10000008 */ beq $zero, $zero, .L80B1C85C -/* 00F3C 80B1C83C 90A30209 */ lbu $v1, 0x0209($a1) ## 00000209 -/* 00F40 80B1C840 90A3020C */ lbu $v1, 0x020C($a1) ## 0000020C -.L80B1C844: -/* 00F44 80B1C844 00801025 */ or $v0, $a0, $zero ## $v0 = 00000002 -/* 00F48 80B1C848 1C600003 */ bgtz $v1, .L80B1C858 -/* 00F4C 80B1C84C 24790001 */ addiu $t9, $v1, 0x0001 ## $t9 = 00000001 -/* 00F50 80B1C850 10000023 */ beq $zero, $zero, .L80B1C8E0 -/* 00F54 80B1C854 A0B9020C */ sb $t9, 0x020C($a1) ## 0000020C -.L80B1C858: -/* 00F58 80B1C858 90A30209 */ lbu $v1, 0x0209($a1) ## 00000209 -.L80B1C85C: -/* 00F5C 80B1C85C 28610008 */ slti $at, $v1, 0x0008 -/* 00F60 80B1C860 10200004 */ beq $at, $zero, .L80B1C874 -/* 00F64 80B1C864 24680001 */ addiu $t0, $v1, 0x0001 ## $t0 = 00000001 -/* 00F68 80B1C868 A0A80209 */ sb $t0, 0x0209($a1) ## 00000209 -/* 00F6C 80B1C86C 1000001B */ beq $zero, $zero, .L80B1C8DC -/* 00F70 80B1C870 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -.L80B1C874: -/* 00F74 80B1C874 90A3020A */ lbu $v1, 0x020A($a1) ## 0000020A -/* 00F78 80B1C878 24040001 */ addiu $a0, $zero, 0x0001 ## $a0 = 00000001 -/* 00F7C 80B1C87C 28610004 */ slti $at, $v1, 0x0004 -/* 00F80 80B1C880 10200003 */ beq $at, $zero, .L80B1C890 -/* 00F84 80B1C884 24690001 */ addiu $t1, $v1, 0x0001 ## $t1 = 00000001 -/* 00F88 80B1C888 10000014 */ beq $zero, $zero, .L80B1C8DC -/* 00F8C 80B1C88C A0A9020A */ sb $t1, 0x020A($a1) ## 0000020A -.L80B1C890: -/* 00F90 80B1C890 90A3020B */ lbu $v1, 0x020B($a1) ## 0000020B -/* 00F94 80B1C894 24040002 */ addiu $a0, $zero, 0x0002 ## $a0 = 00000002 -/* 00F98 80B1C898 28610002 */ slti $at, $v1, 0x0002 -/* 00F9C 80B1C89C 10200003 */ beq $at, $zero, .L80B1C8AC -/* 00FA0 80B1C8A0 246A0001 */ addiu $t2, $v1, 0x0001 ## $t2 = 00000001 -/* 00FA4 80B1C8A4 1000000D */ beq $zero, $zero, .L80B1C8DC -/* 00FA8 80B1C8A8 A0AA020B */ sb $t2, 0x020B($a1) ## 0000020B -.L80B1C8AC: -/* 00FAC 80B1C8AC 90A3020C */ lbu $v1, 0x020C($a1) ## 0000020C -/* 00FB0 80B1C8B0 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 00FB4 80B1C8B4 240C0001 */ addiu $t4, $zero, 0x0001 ## $t4 = 00000001 -/* 00FB8 80B1C8B8 1C600004 */ bgtz $v1, .L80B1C8CC -/* 00FBC 80B1C8BC 246B0001 */ addiu $t3, $v1, 0x0001 ## $t3 = 00000001 -/* 00FC0 80B1C8C0 A0AB020C */ sb $t3, 0x020C($a1) ## 0000020C -/* 00FC4 80B1C8C4 10000005 */ beq $zero, $zero, .L80B1C8DC -/* 00FC8 80B1C8C8 24040003 */ addiu $a0, $zero, 0x0003 ## $a0 = 00000003 -.L80B1C8CC: -/* 00FCC 80B1C8CC A0AC0209 */ sb $t4, 0x0209($a1) ## 00000209 -/* 00FD0 80B1C8D0 A0A0020A */ sb $zero, 0x020A($a1) ## 0000020A -/* 00FD4 80B1C8D4 A0A0020B */ sb $zero, 0x020B($a1) ## 0000020B -/* 00FD8 80B1C8D8 A0A0020C */ sb $zero, 0x020C($a1) ## 0000020C -.L80B1C8DC: -/* 00FDC 80B1C8DC 00801025 */ or $v0, $a0, $zero ## $v0 = 00000003 -.L80B1C8E0: -/* 00FE0 80B1C8E0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00FE4 80B1C8E4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00FE8 80B1C8E8 03E00008 */ jr $ra -/* 00FEC 80B1C8EC 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C8F0.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C8F0.s deleted file mode 100644 index 5afdb12925..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C8F0.s +++ /dev/null @@ -1,99 +0,0 @@ -glabel func_80B1C8F0 -/* 00FF0 80B1C8F0 27BDFFB0 */ addiu $sp, $sp, 0xFFB0 ## $sp = FFFFFFB0 -/* 00FF4 80B1C8F4 3C0F80B2 */ lui $t7, %hi(D_80B1D548) ## $t7 = 80B20000 -/* 00FF8 80B1C8F8 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00FFC 80B1C8FC AFB00020 */ sw $s0, 0x0020($sp) -/* 01000 80B1C900 25EFD548 */ addiu $t7, $t7, %lo(D_80B1D548) ## $t7 = 80B1D548 -/* 01004 80B1C904 8DF90000 */ lw $t9, 0x0000($t7) ## 80B1D548 -/* 01008 80B1C908 27AE0044 */ addiu $t6, $sp, 0x0044 ## $t6 = FFFFFFF4 -/* 0100C 80B1C90C 8DF80004 */ lw $t8, 0x0004($t7) ## 80B1D54C -/* 01010 80B1C910 ADD90000 */ sw $t9, 0x0000($t6) ## FFFFFFF4 -/* 01014 80B1C914 8DF90008 */ lw $t9, 0x0008($t7) ## 80B1D550 -/* 01018 80B1C918 3C0980B2 */ lui $t1, %hi(D_80B1D554) ## $t1 = 80B20000 -/* 0101C 80B1C91C 2529D554 */ addiu $t1, $t1, %lo(D_80B1D554) ## $t1 = 80B1D554 -/* 01020 80B1C920 ADD80004 */ sw $t8, 0x0004($t6) ## FFFFFFF8 -/* 01024 80B1C924 ADD90008 */ sw $t9, 0x0008($t6) ## FFFFFFFC -/* 01028 80B1C928 8D2B0000 */ lw $t3, 0x0000($t1) ## 80B1D554 -/* 0102C 80B1C92C 27A80038 */ addiu $t0, $sp, 0x0038 ## $t0 = FFFFFFE8 -/* 01030 80B1C930 8D2A0004 */ lw $t2, 0x0004($t1) ## 80B1D558 -/* 01034 80B1C934 AD0B0000 */ sw $t3, 0x0000($t0) ## FFFFFFE8 -/* 01038 80B1C938 8D2B0008 */ lw $t3, 0x0008($t1) ## 80B1D55C -/* 0103C 80B1C93C 3C0D80B2 */ lui $t5, %hi(D_80B1D560) ## $t5 = 80B20000 -/* 01040 80B1C940 25ADD560 */ addiu $t5, $t5, %lo(D_80B1D560) ## $t5 = 80B1D560 -/* 01044 80B1C944 AD0A0004 */ sw $t2, 0x0004($t0) ## FFFFFFEC -/* 01048 80B1C948 AD0B0008 */ sw $t3, 0x0008($t0) ## FFFFFFF0 -/* 0104C 80B1C94C 8DAF0000 */ lw $t7, 0x0000($t5) ## 80B1D560 -/* 01050 80B1C950 27AC002C */ addiu $t4, $sp, 0x002C ## $t4 = FFFFFFDC -/* 01054 80B1C954 8DAE0004 */ lw $t6, 0x0004($t5) ## 80B1D564 -/* 01058 80B1C958 AD8F0000 */ sw $t7, 0x0000($t4) ## FFFFFFDC -/* 0105C 80B1C95C 8DAF0008 */ lw $t7, 0x0008($t5) ## 80B1D568 -/* 01060 80B1C960 3C014200 */ lui $at, 0x4200 ## $at = 42000000 -/* 01064 80B1C964 AD8E0004 */ sw $t6, 0x0004($t4) ## FFFFFFE0 -/* 01068 80B1C968 AD8F0008 */ sw $t7, 0x0008($t4) ## FFFFFFE4 -/* 0106C 80B1C96C C4800164 */ lwc1 $f0, 0x0164($a0) ## 00000164 -/* 01070 80B1C970 44812000 */ mtc1 $at, $f4 ## $f4 = 32.00 -/* 01074 80B1C974 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01078 80B1C978 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 0107C 80B1C97C 4600203E */ c.le.s $f4, $f0 -/* 01080 80B1C980 00000000 */ nop -/* 01084 80B1C984 45020032 */ bc1fl .L80B1CA50 -/* 01088 80B1C988 8FBF0024 */ lw $ra, 0x0024($sp) -/* 0108C 80B1C98C 44813000 */ mtc1 $at, $f6 ## $f6 = 40.00 -/* 01090 80B1C990 00000000 */ nop -/* 01094 80B1C994 4606003C */ c.lt.s $f0, $f6 -/* 01098 80B1C998 00000000 */ nop -/* 0109C 80B1C99C 4502002C */ bc1fl .L80B1CA50 -/* 010A0 80B1C9A0 8FBF0024 */ lw $ra, 0x0024($sp) -/* 010A4 80B1C9A4 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 010A8 80B1C9A8 00000000 */ nop -/* 010AC 80B1C9AC 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 010B0 80B1C9B0 44814000 */ mtc1 $at, $f8 ## $f8 = 0.50 -/* 010B4 80B1C9B4 3C014140 */ lui $at, 0x4140 ## $at = 41400000 -/* 010B8 80B1C9B8 44818000 */ mtc1 $at, $f16 ## $f16 = 12.00 -/* 010BC 80B1C9BC 46080281 */ sub.s $f10, $f0, $f8 -/* 010C0 80B1C9C0 C6040304 */ lwc1 $f4, 0x0304($s0) ## 00000304 -/* 010C4 80B1C9C4 46105482 */ mul.s $f18, $f10, $f16 -/* 010C8 80B1C9C8 46049180 */ add.s $f6, $f18, $f4 -/* 010CC 80B1C9CC 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 010D0 80B1C9D0 E7A60044 */ swc1 $f6, 0x0044($sp) -/* 010D4 80B1C9D4 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 010D8 80B1C9D8 44814000 */ mtc1 $at, $f8 ## $f8 = 0.50 -/* 010DC 80B1C9DC 3C014100 */ lui $at, 0x4100 ## $at = 41000000 -/* 010E0 80B1C9E0 44818000 */ mtc1 $at, $f16 ## $f16 = 8.00 -/* 010E4 80B1C9E4 46080281 */ sub.s $f10, $f0, $f8 -/* 010E8 80B1C9E8 C6040308 */ lwc1 $f4, 0x0308($s0) ## 00000308 -/* 010EC 80B1C9EC 46105482 */ mul.s $f18, $f10, $f16 -/* 010F0 80B1C9F0 46049180 */ add.s $f6, $f18, $f4 -/* 010F4 80B1C9F4 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 010F8 80B1C9F8 E7A60048 */ swc1 $f6, 0x0048($sp) -/* 010FC 80B1C9FC 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 01100 80B1CA00 44814000 */ mtc1 $at, $f8 ## $f8 = 0.50 -/* 01104 80B1CA04 3C014140 */ lui $at, 0x4140 ## $at = 41400000 -/* 01108 80B1CA08 44818000 */ mtc1 $at, $f16 ## $f16 = 12.00 -/* 0110C 80B1CA0C 46080281 */ sub.s $f10, $f0, $f8 -/* 01110 80B1CA10 C604030C */ lwc1 $f4, 0x030C($s0) ## 0000030C -/* 01114 80B1CA14 3C0180B2 */ lui $at, %hi(D_80B1D680) ## $at = 80B20000 -/* 01118 80B1CA18 C428D680 */ lwc1 $f8, %lo(D_80B1D680)($at) -/* 0111C 80B1CA1C 46105482 */ mul.s $f18, $f10, $f16 -/* 01120 80B1CA20 44805000 */ mtc1 $zero, $f10 ## $f10 = 0.00 -/* 01124 80B1CA24 3C073E4C */ lui $a3, 0x3E4C ## $a3 = 3E4C0000 -/* 01128 80B1CA28 34E7CCCD */ ori $a3, $a3, 0xCCCD ## $a3 = 3E4CCCCD -/* 0112C 80B1CA2C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01130 80B1CA30 27A50044 */ addiu $a1, $sp, 0x0044 ## $a1 = FFFFFFF4 -/* 01134 80B1CA34 2406000C */ addiu $a2, $zero, 0x000C ## $a2 = 0000000C -/* 01138 80B1CA38 46049180 */ add.s $f6, $f18, $f4 -/* 0113C 80B1CA3C E7A80010 */ swc1 $f8, 0x0010($sp) -/* 01140 80B1CA40 E7AA0014 */ swc1 $f10, 0x0014($sp) -/* 01144 80B1CA44 0C2C6F77 */ jal func_80B1BDDC -/* 01148 80B1CA48 E7A6004C */ swc1 $f6, 0x004C($sp) -/* 0114C 80B1CA4C 8FBF0024 */ lw $ra, 0x0024($sp) -.L80B1CA50: -/* 01150 80B1CA50 8FB00020 */ lw $s0, 0x0020($sp) -/* 01154 80B1CA54 27BD0050 */ addiu $sp, $sp, 0x0050 ## $sp = 00000000 -/* 01158 80B1CA58 03E00008 */ jr $ra -/* 0115C 80B1CA5C 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CC04.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CC04.s deleted file mode 100644 index 7613b19924..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CC04.s +++ /dev/null @@ -1,152 +0,0 @@ -glabel func_80B1CC04 -/* 01304 80B1CC04 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 01308 80B1CC08 AFBF0024 */ sw $ra, 0x0024($sp) -/* 0130C 80B1CC0C AFB00020 */ sw $s0, 0x0020($sp) -/* 01310 80B1CC10 AFA50034 */ sw $a1, 0x0034($sp) -/* 01314 80B1CC14 848201E0 */ lh $v0, 0x01E0($a0) ## 000001E0 -/* 01318 80B1CC18 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0131C 80B1CC1C 10400028 */ beq $v0, $zero, .L80B1CCC0 -/* 01320 80B1CC20 00000000 */ nop -/* 01324 80B1CC24 848300B6 */ lh $v1, 0x00B6($a0) ## 000000B6 -/* 01328 80B1CC28 848E021E */ lh $t6, 0x021E($a0) ## 0000021E -/* 0132C 80B1CC2C 848F008A */ lh $t7, 0x008A($a0) ## 0000008A -/* 01330 80B1CC30 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 01334 80B1CC34 006E1823 */ subu $v1, $v1, $t6 -/* 01338 80B1CC38 00031C00 */ sll $v1, $v1, 16 -/* 0133C 80B1CC3C 00031C03 */ sra $v1, $v1, 16 -/* 01340 80B1CC40 01E31823 */ subu $v1, $t7, $v1 -/* 01344 80B1CC44 00031C00 */ sll $v1, $v1, 16 -/* 01348 80B1CC48 14410008 */ bne $v0, $at, .L80B1CC6C -/* 0134C 80B1CC4C 00031C03 */ sra $v1, $v1, 16 -/* 01350 80B1CC50 0C2C6FE3 */ jal func_80B1BF8C -/* 01354 80B1CC54 00000000 */ nop -/* 01358 80B1CC58 3C1880B2 */ lui $t8, %hi(func_80B1CEF8) ## $t8 = 80B20000 -/* 0135C 80B1CC5C 2718CEF8 */ addiu $t8, $t8, %lo(func_80B1CEF8) ## $t8 = 80B1CEF8 -/* 01360 80B1CC60 A60001E0 */ sh $zero, 0x01E0($s0) ## 000001E0 -/* 01364 80B1CC64 1000006B */ beq $zero, $zero, .L80B1CE14 -/* 01368 80B1CC68 AE180190 */ sw $t8, 0x0190($s0) ## 00000190 -.L80B1CC6C: -/* 0136C 80B1CC6C 861901D4 */ lh $t9, 0x01D4($s0) ## 000001D4 -/* 01370 80B1CC70 3C0141F0 */ lui $at, 0x41F0 ## $at = 41F00000 -/* 01374 80B1CC74 44814000 */ mtc1 $at, $f8 ## $f8 = 30.00 -/* 01378 80B1CC78 44992000 */ mtc1 $t9, $f4 ## $f4 = 0.00 -/* 0137C 80B1CC7C 3C0880B2 */ lui $t0, %hi(func_80B1C54C) ## $t0 = 80B20000 -/* 01380 80B1CC80 3C0980B2 */ lui $t1, %hi(func_80B1C5A0) ## $t1 = 80B20000 -/* 01384 80B1CC84 468021A0 */ cvt.s.w $f6, $f4 -/* 01388 80B1CC88 2529C5A0 */ addiu $t1, $t1, %lo(func_80B1C5A0) ## $t1 = 80B1C5A0 -/* 0138C 80B1CC8C 2508C54C */ addiu $t0, $t0, %lo(func_80B1C54C) ## $t0 = 80B1C54C -/* 01390 80B1CC90 AFA80010 */ sw $t0, 0x0010($sp) -/* 01394 80B1CC94 AFA90014 */ sw $t1, 0x0014($sp) -/* 01398 80B1CC98 A7A3002E */ sh $v1, 0x002E($sp) -/* 0139C 80B1CC9C 46083280 */ add.s $f10, $f6, $f8 -/* 013A0 80B1CCA0 8FA40034 */ lw $a0, 0x0034($sp) -/* 013A4 80B1CCA4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 013A8 80B1CCA8 260601E0 */ addiu $a2, $s0, 0x01E0 ## $a2 = 000001E0 -/* 013AC 80B1CCAC 44075000 */ mfc1 $a3, $f10 -/* 013B0 80B1CCB0 0C00D0F3 */ jal func_800343CC -/* 013B4 80B1CCB4 00000000 */ nop -/* 013B8 80B1CCB8 10000044 */ beq $zero, $zero, .L80B1CDCC -/* 013BC 80B1CCBC 87A3002E */ lh $v1, 0x002E($sp) -.L80B1CCC0: -/* 013C0 80B1CCC0 0C2C7034 */ jal func_80B1C0D0 -/* 013C4 80B1CCC4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 013C8 80B1CCC8 1040001F */ beq $v0, $zero, .L80B1CD48 -/* 013CC 80B1CCCC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 013D0 80B1CCD0 860C01D4 */ lh $t4, 0x01D4($s0) ## 000001D4 -/* 013D4 80B1CCD4 860300B6 */ lh $v1, 0x00B6($s0) ## 000000B6 -/* 013D8 80B1CCD8 860A021E */ lh $t2, 0x021E($s0) ## 0000021E -/* 013DC 80B1CCDC 448C8000 */ mtc1 $t4, $f16 ## $f16 = 0.00 -/* 013E0 80B1CCE0 3C0141F0 */ lui $at, 0x41F0 ## $at = 41F00000 -/* 013E4 80B1CCE4 44812000 */ mtc1 $at, $f4 ## $f4 = 30.00 -/* 013E8 80B1CCE8 468084A0 */ cvt.s.w $f18, $f16 -/* 013EC 80B1CCEC 860B008A */ lh $t3, 0x008A($s0) ## 0000008A -/* 013F0 80B1CCF0 006A1823 */ subu $v1, $v1, $t2 -/* 013F4 80B1CCF4 00031C00 */ sll $v1, $v1, 16 -/* 013F8 80B1CCF8 00031C03 */ sra $v1, $v1, 16 -/* 013FC 80B1CCFC A600021C */ sh $zero, 0x021C($s0) ## 0000021C -/* 01400 80B1CD00 46049180 */ add.s $f6, $f18, $f4 -/* 01404 80B1CD04 01631823 */ subu $v1, $t3, $v1 -/* 01408 80B1CD08 00031C00 */ sll $v1, $v1, 16 -/* 0140C 80B1CD0C 3C0D80B2 */ lui $t5, %hi(func_80B1C54C) ## $t5 = 80B20000 -/* 01410 80B1CD10 3C0E80B2 */ lui $t6, %hi(func_80B1C5A0) ## $t6 = 80B20000 -/* 01414 80B1CD14 00031C03 */ sra $v1, $v1, 16 -/* 01418 80B1CD18 25CEC5A0 */ addiu $t6, $t6, %lo(func_80B1C5A0) ## $t6 = 80B1C5A0 -/* 0141C 80B1CD1C 25ADC54C */ addiu $t5, $t5, %lo(func_80B1C54C) ## $t5 = 80B1C54C -/* 01420 80B1CD20 44073000 */ mfc1 $a3, $f6 -/* 01424 80B1CD24 AFAD0010 */ sw $t5, 0x0010($sp) -/* 01428 80B1CD28 AFAE0014 */ sw $t6, 0x0014($sp) -/* 0142C 80B1CD2C A7A3002E */ sh $v1, 0x002E($sp) -/* 01430 80B1CD30 8FA40034 */ lw $a0, 0x0034($sp) -/* 01434 80B1CD34 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 01438 80B1CD38 0C00D0F3 */ jal func_800343CC -/* 0143C 80B1CD3C 260601E0 */ addiu $a2, $s0, 0x01E0 ## $a2 = 000001E0 -/* 01440 80B1CD40 10000022 */ beq $zero, $zero, .L80B1CDCC -/* 01444 80B1CD44 87A3002E */ lh $v1, 0x002E($sp) -.L80B1CD48: -/* 01448 80B1CD48 0C00BC65 */ jal func_8002F194 -/* 0144C 80B1CD4C 8FA50034 */ lw $a1, 0x0034($sp) -/* 01450 80B1CD50 1040000D */ beq $v0, $zero, .L80B1CD88 -/* 01454 80B1CD54 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 01458 80B1CD58 860300B6 */ lh $v1, 0x00B6($s0) ## 000000B6 -/* 0145C 80B1CD5C 860F021E */ lh $t7, 0x021E($s0) ## 0000021E -/* 01460 80B1CD60 8618008A */ lh $t8, 0x008A($s0) ## 0000008A -/* 01464 80B1CD64 A600021C */ sh $zero, 0x021C($s0) ## 0000021C -/* 01468 80B1CD68 006F1823 */ subu $v1, $v1, $t7 -/* 0146C 80B1CD6C 00031C00 */ sll $v1, $v1, 16 -/* 01470 80B1CD70 00031C03 */ sra $v1, $v1, 16 -/* 01474 80B1CD74 03031823 */ subu $v1, $t8, $v1 -/* 01478 80B1CD78 00031C00 */ sll $v1, $v1, 16 -/* 0147C 80B1CD7C 00031C03 */ sra $v1, $v1, 16 -/* 01480 80B1CD80 10000012 */ beq $zero, $zero, .L80B1CDCC -/* 01484 80B1CD84 A61901E0 */ sh $t9, 0x01E0($s0) ## 000001E0 -.L80B1CD88: -/* 01488 80B1CD88 8603021C */ lh $v1, 0x021C($s0) ## 0000021C -/* 0148C 80B1CD8C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01490 80B1CD90 14600003 */ bne $v1, $zero, .L80B1CDA0 -/* 01494 80B1CD94 2468FFFF */ addiu $t0, $v1, 0xFFFF ## $t0 = FFFFFFFF -/* 01498 80B1CD98 10000003 */ beq $zero, $zero, .L80B1CDA8 -/* 0149C 80B1CD9C 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80B1CDA0: -/* 014A0 80B1CDA0 A608021C */ sh $t0, 0x021C($s0) ## 0000021C -/* 014A4 80B1CDA4 8602021C */ lh $v0, 0x021C($s0) ## 0000021C -.L80B1CDA8: -/* 014A8 80B1CDA8 14400008 */ bne $v0, $zero, .L80B1CDCC -/* 014AC 80B1CDAC 00001825 */ or $v1, $zero, $zero ## $v1 = 00000000 -/* 014B0 80B1CDB0 0C2C6FC5 */ jal func_80B1BF14 -/* 014B4 80B1CDB4 8FA50034 */ lw $a1, 0x0034($sp) -/* 014B8 80B1CDB8 3C0980B2 */ lui $t1, %hi(func_80B1CE28) ## $t1 = 80B20000 -/* 014BC 80B1CDBC 2529CE28 */ addiu $t1, $t1, %lo(func_80B1CE28) ## $t1 = 80B1CE28 -/* 014C0 80B1CDC0 AE090190 */ sw $t1, 0x0190($s0) ## 00000190 -/* 014C4 80B1CDC4 10000001 */ beq $zero, $zero, .L80B1CDCC -/* 014C8 80B1CDC8 87A3002E */ lh $v1, 0x002E($sp) -.L80B1CDCC: -/* 014CC 80B1CDCC 00032023 */ subu $a0, $zero, $v1 -/* 014D0 80B1CDD0 288104F6 */ slti $at, $a0, 0x04F6 -/* 014D4 80B1CDD4 10200003 */ beq $at, $zero, .L80B1CDE4 -/* 014D8 80B1CDD8 24060006 */ addiu $a2, $zero, 0x0006 ## $a2 = 00000006 -/* 014DC 80B1CDDC 10000008 */ beq $zero, $zero, .L80B1CE00 -/* 014E0 80B1CDE0 240504F6 */ addiu $a1, $zero, 0x04F6 ## $a1 = 000004F6 -.L80B1CDE4: -/* 014E4 80B1CDE4 288129EB */ slti $at, $a0, 0x29EB -/* 014E8 80B1CDE8 14200003 */ bne $at, $zero, .L80B1CDF8 -/* 014EC 80B1CDEC 00801025 */ or $v0, $a0, $zero ## $v0 = 00000000 -/* 014F0 80B1CDF0 10000001 */ beq $zero, $zero, .L80B1CDF8 -/* 014F4 80B1CDF4 240229EA */ addiu $v0, $zero, 0x29EA ## $v0 = 000029EA -.L80B1CDF8: -/* 014F8 80B1CDF8 00022C00 */ sll $a1, $v0, 16 -/* 014FC 80B1CDFC 00052C03 */ sra $a1, $a1, 16 -.L80B1CE00: -/* 01500 80B1CE00 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 01504 80B1CE04 AFAA0010 */ sw $t2, 0x0010($sp) -/* 01508 80B1CE08 26040226 */ addiu $a0, $s0, 0x0226 ## $a0 = 00000226 -/* 0150C 80B1CE0C 0C01E1A7 */ jal Math_SmoothScaleMaxMinS - -/* 01510 80B1CE10 240703E8 */ addiu $a3, $zero, 0x03E8 ## $a3 = 000003E8 -.L80B1CE14: -/* 01514 80B1CE14 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01518 80B1CE18 8FB00020 */ lw $s0, 0x0020($sp) -/* 0151C 80B1CE1C 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 01520 80B1CE20 03E00008 */ jr $ra -/* 01524 80B1CE24 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CE28.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CE28.s deleted file mode 100644 index 0e8ef7f8b0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CE28.s +++ /dev/null @@ -1,61 +0,0 @@ -glabel func_80B1CE28 -/* 01528 80B1CE28 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 0152C 80B1CE2C AFBF0024 */ sw $ra, 0x0024($sp) -/* 01530 80B1CE30 AFB00020 */ sw $s0, 0x0020($sp) -/* 01534 80B1CE34 848E01E0 */ lh $t6, 0x01E0($a0) ## 000001E0 -/* 01538 80B1CE38 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 0153C 80B1CE3C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01540 80B1CE40 55C10009 */ bnel $t6, $at, .L80B1CE68 -/* 01544 80B1CE44 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01548 80B1CE48 0C2C6FE3 */ jal func_80B1BF8C -/* 0154C 80B1CE4C 00000000 */ nop -/* 01550 80B1CE50 3C0F80B2 */ lui $t7, %hi(func_80B1CEF8) ## $t7 = 80B20000 -/* 01554 80B1CE54 25EFCEF8 */ addiu $t7, $t7, %lo(func_80B1CEF8) ## $t7 = 80B1CEF8 -/* 01558 80B1CE58 A60001E0 */ sh $zero, 0x01E0($s0) ## 000001E0 -/* 0155C 80B1CE5C 10000021 */ beq $zero, $zero, .L80B1CEE4 -/* 01560 80B1CE60 AE0F0190 */ sw $t7, 0x0190($s0) ## 00000190 -/* 01564 80B1CE64 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80B1CE68: -/* 01568 80B1CE68 0C2C70AD */ jal func_80B1C2B4 -/* 0156C 80B1CE6C AFA5002C */ sw $a1, 0x002C($sp) -/* 01570 80B1CE70 E6000068 */ swc1 $f0, 0x0068($s0) ## 00000068 -/* 01574 80B1CE74 8FA5002C */ lw $a1, 0x002C($sp) -/* 01578 80B1CE78 0C2C70F7 */ jal func_80B1C3DC -/* 0157C 80B1CE7C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01580 80B1CE80 24180001 */ addiu $t8, $zero, 0x0001 ## $t8 = 00000001 -/* 01584 80B1CE84 AFB80010 */ sw $t8, 0x0010($sp) -/* 01588 80B1CE88 26040226 */ addiu $a0, $s0, 0x0226 ## $a0 = 00000226 -/* 0158C 80B1CE8C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 01590 80B1CE90 24060006 */ addiu $a2, $zero, 0x0006 ## $a2 = 00000006 -/* 01594 80B1CE94 0C01E1A7 */ jal Math_SmoothScaleMaxMinS - -/* 01598 80B1CE98 240703E8 */ addiu $a3, $zero, 0x03E8 ## $a3 = 000003E8 -/* 0159C 80B1CE9C 0C2C708F */ jal func_80B1C23C -/* 015A0 80B1CEA0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 015A4 80B1CEA4 8602021C */ lh $v0, 0x021C($s0) ## 0000021C -/* 015A8 80B1CEA8 10400002 */ beq $v0, $zero, .L80B1CEB4 -/* 015AC 80B1CEAC 2459FFFF */ addiu $t9, $v0, 0xFFFF ## $t9 = FFFFFFFF -/* 015B0 80B1CEB0 A619021C */ sh $t9, 0x021C($s0) ## 0000021C -.L80B1CEB4: -/* 015B4 80B1CEB4 0C2C7034 */ jal func_80B1C0D0 -/* 015B8 80B1CEB8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 015BC 80B1CEBC 14400004 */ bne $v0, $zero, .L80B1CED0 -/* 015C0 80B1CEC0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 015C4 80B1CEC4 8608021C */ lh $t0, 0x021C($s0) ## 0000021C -/* 015C8 80B1CEC8 55000007 */ bnel $t0, $zero, .L80B1CEE8 -/* 015CC 80B1CECC 8FBF0024 */ lw $ra, 0x0024($sp) -.L80B1CED0: -/* 015D0 80B1CED0 0C2C6FA5 */ jal func_80B1BE94 -/* 015D4 80B1CED4 8FA5002C */ lw $a1, 0x002C($sp) -/* 015D8 80B1CED8 3C0980B2 */ lui $t1, %hi(func_80B1CC04) ## $t1 = 80B20000 -/* 015DC 80B1CEDC 2529CC04 */ addiu $t1, $t1, %lo(func_80B1CC04) ## $t1 = 80B1CC04 -/* 015E0 80B1CEE0 AE090190 */ sw $t1, 0x0190($s0) ## 00000190 -.L80B1CEE4: -/* 015E4 80B1CEE4 8FBF0024 */ lw $ra, 0x0024($sp) -.L80B1CEE8: -/* 015E8 80B1CEE8 8FB00020 */ lw $s0, 0x0020($sp) -/* 015EC 80B1CEEC 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 015F0 80B1CEF0 03E00008 */ jr $ra -/* 015F4 80B1CEF4 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CEF8.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CEF8.s deleted file mode 100644 index 00173da907..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CEF8.s +++ /dev/null @@ -1,168 +0,0 @@ -glabel func_80B1CEF8 -/* 015F8 80B1CEF8 27BDFFA8 */ addiu $sp, $sp, 0xFFA8 ## $sp = FFFFFFA8 -/* 015FC 80B1CEFC 3C0F80B2 */ lui $t7, %hi(D_80B1D56C) ## $t7 = 80B20000 -/* 01600 80B1CF00 AFBF0024 */ sw $ra, 0x0024($sp) -/* 01604 80B1CF04 AFB00020 */ sw $s0, 0x0020($sp) -/* 01608 80B1CF08 AFA5005C */ sw $a1, 0x005C($sp) -/* 0160C 80B1CF0C 25EFD56C */ addiu $t7, $t7, %lo(D_80B1D56C) ## $t7 = 80B1D56C -/* 01610 80B1CF10 8DF90000 */ lw $t9, 0x0000($t7) ## 80B1D56C -/* 01614 80B1CF14 27AE002C */ addiu $t6, $sp, 0x002C ## $t6 = FFFFFFD4 -/* 01618 80B1CF18 8DF80004 */ lw $t8, 0x0004($t7) ## 80B1D570 -/* 0161C 80B1CF1C ADD90000 */ sw $t9, 0x0000($t6) ## FFFFFFD4 -/* 01620 80B1CF20 8DF90008 */ lw $t9, 0x0008($t7) ## 80B1D574 -/* 01624 80B1CF24 ADD80004 */ sw $t8, 0x0004($t6) ## FFFFFFD8 -/* 01628 80B1CF28 8DF8000C */ lw $t8, 0x000C($t7) ## 80B1D578 -/* 0162C 80B1CF2C ADD90008 */ sw $t9, 0x0008($t6) ## FFFFFFDC -/* 01630 80B1CF30 8DF90010 */ lw $t9, 0x0010($t7) ## 80B1D57C -/* 01634 80B1CF34 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01638 80B1CF38 ADD8000C */ sw $t8, 0x000C($t6) ## FFFFFFE0 -/* 0163C 80B1CF3C 0C2C723C */ jal func_80B1C8F0 -/* 01640 80B1CF40 ADD90010 */ sw $t9, 0x0010($t6) ## FFFFFFE4 -/* 01644 80B1CF44 3C014200 */ lui $at, 0x4200 ## $at = 42000000 -/* 01648 80B1CF48 44812000 */ mtc1 $at, $f4 ## $f4 = 32.00 -/* 0164C 80B1CF4C C6060164 */ lwc1 $f6, 0x0164($s0) ## 00000164 -/* 01650 80B1CF50 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01654 80B1CF54 46062032 */ c.eq.s $f4, $f6 -/* 01658 80B1CF58 00000000 */ nop -/* 0165C 80B1CF5C 45020038 */ bc1fl .L80B1D040 -/* 01660 80B1CF60 3C014200 */ lui $at, 0x4200 ## $at = 42000000 -/* 01664 80B1CF64 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 01668 80B1CF68 240528C8 */ addiu $a1, $zero, 0x28C8 ## $a1 = 000028C8 -/* 0166C 80B1CF6C 92080208 */ lbu $t0, 0x0208($s0) ## 00000208 -/* 01670 80B1CF70 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 01674 80B1CF74 A600021A */ sh $zero, 0x021A($s0) ## 0000021A -/* 01678 80B1CF78 55010031 */ bnel $t0, $at, .L80B1D040 -/* 0167C 80B1CF7C 3C014200 */ lui $at, 0x4200 ## $at = 42000000 -/* 01680 80B1CF80 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 01684 80B1CF84 3C01C220 */ lui $at, 0xC220 ## $at = C2200000 -/* 01688 80B1CF88 44814000 */ mtc1 $at, $f8 ## $f8 = -40.00 -/* 0168C 80B1CF8C E7A0004C */ swc1 $f0, 0x004C($sp) -/* 01690 80B1CF90 E7A00050 */ swc1 $f0, 0x0050($sp) -/* 01694 80B1CF94 E7A80054 */ swc1 $f8, 0x0054($sp) -/* 01698 80B1CF98 860900B6 */ lh $t1, 0x00B6($s0) ## 000000B6 -/* 0169C 80B1CF9C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 016A0 80B1CFA0 44895000 */ mtc1 $t1, $f10 ## $f10 = 0.00 -/* 016A4 80B1CFA4 0C034348 */ jal Matrix_RotateY -/* 016A8 80B1CFA8 46805320 */ cvt.s.w $f12, $f10 -/* 016AC 80B1CFAC 27A4004C */ addiu $a0, $sp, 0x004C ## $a0 = FFFFFFF4 -/* 016B0 80B1CFB0 0C0346BD */ jal Matrix_MultVec3f -/* 016B4 80B1CFB4 27A50040 */ addiu $a1, $sp, 0x0040 ## $a1 = FFFFFFE8 -/* 016B8 80B1CFB8 C7B00040 */ lwc1 $f16, 0x0040($sp) -/* 016BC 80B1CFBC C6120024 */ lwc1 $f18, 0x0024($s0) ## 00000024 -/* 016C0 80B1CFC0 C7A60044 */ lwc1 $f6, 0x0044($sp) -/* 016C4 80B1CFC4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 016C8 80B1CFC8 46128100 */ add.s $f4, $f16, $f18 -/* 016CC 80B1CFCC C7B00048 */ lwc1 $f16, 0x0048($sp) -/* 016D0 80B1CFD0 E7A40040 */ swc1 $f4, 0x0040($sp) -/* 016D4 80B1CFD4 C6080028 */ lwc1 $f8, 0x0028($s0) ## 00000028 -/* 016D8 80B1CFD8 46083280 */ add.s $f10, $f6, $f8 -/* 016DC 80B1CFDC E7AA0044 */ swc1 $f10, 0x0044($sp) -/* 016E0 80B1CFE0 C612002C */ lwc1 $f18, 0x002C($s0) ## 0000002C -/* 016E4 80B1CFE4 46128100 */ add.s $f4, $f16, $f18 -/* 016E8 80B1CFE8 0C2C71CE */ jal func_80B1C738 -/* 016EC 80B1CFEC E7A40048 */ swc1 $f4, 0x0048($sp) -/* 016F0 80B1CFF0 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 016F4 80B1CFF4 1441000A */ bne $v0, $at, .L80B1D020 -/* 016F8 80B1CFF8 AE020214 */ sw $v0, 0x0214($s0) ## 00000214 -/* 016FC 80B1CFFC 3C038016 */ lui $v1, 0x8016 ## $v1 = 80160000 -/* 01700 80B1D000 2463E660 */ addiu $v1, $v1, 0xE660 ## $v1 = 8015E660 -/* 01704 80B1D004 94620EF2 */ lhu $v0, 0x0EF2($v1) ## 8015F552 -/* 01708 80B1D008 240C0004 */ addiu $t4, $zero, 0x0004 ## $t4 = 00000004 -/* 0170C 80B1D00C 304A1000 */ andi $t2, $v0, 0x1000 ## $t2 = 00000000 -/* 01710 80B1D010 15400003 */ bne $t2, $zero, .L80B1D020 -/* 01714 80B1D014 344B1000 */ ori $t3, $v0, 0x1000 ## $t3 = 00001000 -/* 01718 80B1D018 A46B0EF2 */ sh $t3, 0x0EF2($v1) ## 8015F552 -/* 0171C 80B1D01C AE0C0214 */ sw $t4, 0x0214($s0) ## 00000214 -.L80B1D020: -/* 01720 80B1D020 8E0D0214 */ lw $t5, 0x0214($s0) ## 00000214 -/* 01724 80B1D024 8FA4005C */ lw $a0, 0x005C($sp) -/* 01728 80B1D028 27A50040 */ addiu $a1, $sp, 0x0040 ## $a1 = FFFFFFE8 -/* 0172C 80B1D02C 000D7080 */ sll $t6, $t5, 2 -/* 01730 80B1D030 03AE3021 */ addu $a2, $sp, $t6 -/* 01734 80B1D034 0C007D52 */ jal Item_DropCollectible - -/* 01738 80B1D038 84C6002E */ lh $a2, 0x002E($a2) ## 0000002E -/* 0173C 80B1D03C 3C014200 */ lui $at, 0x4200 ## $at = 42000000 -.L80B1D040: -/* 01740 80B1D040 44814000 */ mtc1 $at, $f8 ## $f8 = 32.00 -/* 01744 80B1D044 C6060164 */ lwc1 $f6, 0x0164($s0) ## 00000164 -/* 01748 80B1D048 4606403E */ c.le.s $f8, $f6 -/* 0174C 80B1D04C 00000000 */ nop -/* 01750 80B1D050 45020021 */ bc1fl .L80B1D0D8 -/* 01754 80B1D054 8609021A */ lh $t1, 0x021A($s0) ## 0000021A -/* 01758 80B1D058 860F021A */ lh $t7, 0x021A($s0) ## 0000021A -/* 0175C 80B1D05C 2401000A */ addiu $at, $zero, 0x000A ## $at = 0000000A -/* 01760 80B1D060 55E1001D */ bnel $t7, $at, .L80B1D0D8 -/* 01764 80B1D064 8609021A */ lh $t1, 0x021A($s0) ## 0000021A -/* 01768 80B1D068 92180208 */ lbu $t8, 0x0208($s0) ## 00000208 -/* 0176C 80B1D06C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01770 80B1D070 57000006 */ bnel $t8, $zero, .L80B1D08C -/* 01774 80B1D074 8E190214 */ lw $t9, 0x0214($s0) ## 00000214 -/* 01778 80B1D078 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 0177C 80B1D07C 24054806 */ addiu $a1, $zero, 0x4806 ## $a1 = 00004806 -/* 01780 80B1D080 10000015 */ beq $zero, $zero, .L80B1D0D8 -/* 01784 80B1D084 8609021A */ lh $t1, 0x021A($s0) ## 0000021A -/* 01788 80B1D088 8E190214 */ lw $t9, 0x0214($s0) ## 00000214 -.L80B1D08C: -/* 0178C 80B1D08C 24010004 */ addiu $at, $zero, 0x0004 ## $at = 00000004 -/* 01790 80B1D090 3C078013 */ lui $a3, 0x8013 ## $a3 = 80130000 -/* 01794 80B1D094 1721000D */ bne $t9, $at, .L80B1D0CC -/* 01798 80B1D098 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0179C 80B1D09C 3C088013 */ lui $t0, 0x8013 ## $t0 = 80130000 -/* 017A0 80B1D0A0 24E733E0 */ addiu $a3, $a3, 0x33E0 ## $a3 = 801333E0 -/* 017A4 80B1D0A4 250833E8 */ addiu $t0, $t0, 0x33E8 ## $t0 = 801333E8 -/* 017A8 80B1D0A8 3C058013 */ lui $a1, 0x8013 ## $a1 = 80130000 -/* 017AC 80B1D0AC 24A533D4 */ addiu $a1, $a1, 0x33D4 ## $a1 = 801333D4 -/* 017B0 80B1D0B0 AFA80014 */ sw $t0, 0x0014($sp) -/* 017B4 80B1D0B4 AFA70010 */ sw $a3, 0x0010($sp) -/* 017B8 80B1D0B8 24044802 */ addiu $a0, $zero, 0x4802 ## $a0 = 00004802 -/* 017BC 80B1D0BC 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 017C0 80B1D0C0 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 017C4 80B1D0C4 10000004 */ beq $zero, $zero, .L80B1D0D8 -/* 017C8 80B1D0C8 8609021A */ lh $t1, 0x021A($s0) ## 0000021A -.L80B1D0CC: -/* 017CC 80B1D0CC 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 017D0 80B1D0D0 24054807 */ addiu $a1, $zero, 0x4807 ## $a1 = 00004807 -/* 017D4 80B1D0D4 8609021A */ lh $t1, 0x021A($s0) ## 0000021A -.L80B1D0D8: -/* 017D8 80B1D0D8 2604014C */ addiu $a0, $s0, 0x014C ## $a0 = 0000014C -/* 017DC 80B1D0DC 8E05015C */ lw $a1, 0x015C($s0) ## 0000015C -/* 017E0 80B1D0E0 252A0001 */ addiu $t2, $t1, 0x0001 ## $t2 = 00000001 -/* 017E4 80B1D0E4 0C0295B2 */ jal func_800A56C8 -/* 017E8 80B1D0E8 A60A021A */ sh $t2, 0x021A($s0) ## 0000021A -/* 017EC 80B1D0EC 50400016 */ beql $v0, $zero, .L80B1D148 -/* 017F0 80B1D0F0 8FBF0024 */ lw $ra, 0x0024($sp) -/* 017F4 80B1D0F4 8E0B0214 */ lw $t3, 0x0214($s0) ## 00000214 -/* 017F8 80B1D0F8 8FA4005C */ lw $a0, 0x005C($sp) -/* 017FC 80B1D0FC 2405501A */ addiu $a1, $zero, 0x501A ## $a1 = 0000501A -/* 01800 80B1D100 05610005 */ bgez $t3, .L80B1D118 -/* 01804 80B1D104 00000000 */ nop -/* 01808 80B1D108 0C042DA0 */ jal func_8010B680 -/* 0180C 80B1D10C 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 01810 80B1D110 10000004 */ beq $zero, $zero, .L80B1D124 -/* 01814 80B1D114 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80B1D118: -/* 01818 80B1D118 0C041B33 */ jal func_80106CCC -/* 0181C 80B1D11C 8FA4005C */ lw $a0, 0x005C($sp) -/* 01820 80B1D120 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80B1D124: -/* 01824 80B1D124 0C2C6FA5 */ jal func_80B1BE94 -/* 01828 80B1D128 8FA5005C */ lw $a1, 0x005C($sp) -/* 0182C 80B1D12C 3C0D80B2 */ lui $t5, %hi(func_80B1CC04) ## $t5 = 80B20000 -/* 01830 80B1D130 240CFFFF */ addiu $t4, $zero, 0xFFFF ## $t4 = FFFFFFFF -/* 01834 80B1D134 25ADCC04 */ addiu $t5, $t5, %lo(func_80B1CC04) ## $t5 = 80B1CC04 -/* 01838 80B1D138 AE0C0214 */ sw $t4, 0x0214($s0) ## 00000214 -/* 0183C 80B1D13C A2000208 */ sb $zero, 0x0208($s0) ## 00000208 -/* 01840 80B1D140 AE0D0190 */ sw $t5, 0x0190($s0) ## 00000190 -/* 01844 80B1D144 8FBF0024 */ lw $ra, 0x0024($sp) -.L80B1D148: -/* 01848 80B1D148 8FB00020 */ lw $s0, 0x0020($sp) -/* 0184C 80B1D14C 27BD0058 */ addiu $sp, $sp, 0x0058 ## $sp = 00000000 -/* 01850 80B1D150 03E00008 */ jr $ra -/* 01854 80B1D154 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D200.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D200.s deleted file mode 100644 index 8b7e69da9b..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D200.s +++ /dev/null @@ -1,33 +0,0 @@ -glabel func_80B1D200 -/* 01900 80B1D200 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 01904 80B1D204 AFBF0014 */ sw $ra, 0x0014($sp) -/* 01908 80B1D208 AFA40038 */ sw $a0, 0x0038($sp) -/* 0190C 80B1D20C 8C850000 */ lw $a1, 0x0000($a0) ## 00000000 -/* 01910 80B1D210 3C0680B2 */ lui $a2, %hi(D_80B1D5EC) ## $a2 = 80B20000 -/* 01914 80B1D214 24C6D5EC */ addiu $a2, $a2, %lo(D_80B1D5EC) ## $a2 = 80B1D5EC -/* 01918 80B1D218 27A40024 */ addiu $a0, $sp, 0x0024 ## $a0 = FFFFFFEC -/* 0191C 80B1D21C 240704A4 */ addiu $a3, $zero, 0x04A4 ## $a3 = 000004A4 -/* 01920 80B1D220 0C031AB1 */ jal func_800C6AC4 -/* 01924 80B1D224 AFA50034 */ sw $a1, 0x0034($sp) -/* 01928 80B1D228 8FA80034 */ lw $t0, 0x0034($sp) -/* 0192C 80B1D22C 3C190601 */ lui $t9, 0x0601 ## $t9 = 06010000 -/* 01930 80B1D230 2739ACE0 */ addiu $t9, $t9, 0xACE0 ## $t9 = 0600ACE0 -/* 01934 80B1D234 8D0302C0 */ lw $v1, 0x02C0($t0) ## 000002C0 -/* 01938 80B1D238 3C18DE00 */ lui $t8, 0xDE00 ## $t8 = DE000000 -/* 0193C 80B1D23C 3C0680B2 */ lui $a2, %hi(D_80B1D5FC) ## $a2 = 80B20000 -/* 01940 80B1D240 246F0008 */ addiu $t7, $v1, 0x0008 ## $t7 = 00000008 -/* 01944 80B1D244 AD0F02C0 */ sw $t7, 0x02C0($t0) ## 000002C0 -/* 01948 80B1D248 AC790004 */ sw $t9, 0x0004($v1) ## 00000004 -/* 0194C 80B1D24C AC780000 */ sw $t8, 0x0000($v1) ## 00000000 -/* 01950 80B1D250 8FA90038 */ lw $t1, 0x0038($sp) -/* 01954 80B1D254 24C6D5FC */ addiu $a2, $a2, %lo(D_80B1D5FC) ## $a2 = 80B1D5FC -/* 01958 80B1D258 27A40024 */ addiu $a0, $sp, 0x0024 ## $a0 = FFFFFFEC -/* 0195C 80B1D25C 240704A6 */ addiu $a3, $zero, 0x04A6 ## $a3 = 000004A6 -/* 01960 80B1D260 0C031AD5 */ jal func_800C6B54 -/* 01964 80B1D264 8D250000 */ lw $a1, 0x0000($t1) ## 00000000 -/* 01968 80B1D268 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0196C 80B1D26C 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 01970 80B1D270 03E00008 */ jr $ra -/* 01974 80B1D274 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D278.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D278.s deleted file mode 100644 index f33dc6acc0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D278.s +++ /dev/null @@ -1,32 +0,0 @@ -glabel func_80B1D278 -/* 01978 80B1D278 2401000F */ addiu $at, $zero, 0x000F ## $at = 0000000F -/* 0197C 80B1D27C AFA40000 */ sw $a0, 0x0000($sp) -/* 01980 80B1D280 AFA60008 */ sw $a2, 0x0008($sp) -/* 01984 80B1D284 10A10006 */ beq $a1, $at, .L80B1D2A0 -/* 01988 80B1D288 AFA7000C */ sw $a3, 0x000C($sp) -/* 0198C 80B1D28C 24010010 */ addiu $at, $zero, 0x0010 ## $at = 00000010 -/* 01990 80B1D290 10A10009 */ beq $a1, $at, .L80B1D2B8 -/* 01994 80B1D294 8FA20014 */ lw $v0, 0x0014($sp) -/* 01998 80B1D298 03E00008 */ jr $ra -/* 0199C 80B1D29C 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80B1D2A0: -/* 019A0 80B1D2A0 8FA30010 */ lw $v1, 0x0010($sp) -/* 019A4 80B1D2A4 8FA20014 */ lw $v0, 0x0014($sp) -/* 019A8 80B1D2A8 846E0002 */ lh $t6, 0x0002($v1) ## 00000002 -/* 019AC 80B1D2AC A44E021E */ sh $t6, 0x021E($v0) ## 0000021E -/* 019B0 80B1D2B0 03E00008 */ jr $ra -/* 019B4 80B1D2B4 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80B1D2B8: -/* 019B8 80B1D2B8 8FA30010 */ lw $v1, 0x0010($sp) -/* 019BC 80B1D2BC 844F021E */ lh $t7, 0x021E($v0) ## 0000021E -/* 019C0 80B1D2C0 84490226 */ lh $t1, 0x0226($v0) ## 00000226 -/* 019C4 80B1D2C4 84780002 */ lh $t8, 0x0002($v1) ## 00000002 -/* 019C8 80B1D2C8 01F8C821 */ addu $t9, $t7, $t8 -/* 019CC 80B1D2CC A459021E */ sh $t9, 0x021E($v0) ## 0000021E -/* 019D0 80B1D2D0 84680002 */ lh $t0, 0x0002($v1) ## 00000002 -/* 019D4 80B1D2D4 01095021 */ addu $t2, $t0, $t1 -/* 019D8 80B1D2D8 A46A0002 */ sh $t2, 0x0002($v1) ## 00000002 -/* 019DC 80B1D2DC 03E00008 */ jr $ra -/* 019E0 80B1D2E0 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D2E4.s b/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D2E4.s deleted file mode 100644 index 7ae1beb53c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D2E4.s +++ /dev/null @@ -1,50 +0,0 @@ -glabel func_80B1D2E4 -/* 019E4 80B1D2E4 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 019E8 80B1D2E8 3C0F80B2 */ lui $t7, %hi(D_80B1D580) ## $t7 = 80B20000 -/* 019EC 80B1D2EC AFBF0014 */ sw $ra, 0x0014($sp) -/* 019F0 80B1D2F0 AFA40038 */ sw $a0, 0x0038($sp) -/* 019F4 80B1D2F4 AFA5003C */ sw $a1, 0x003C($sp) -/* 019F8 80B1D2F8 AFA60040 */ sw $a2, 0x0040($sp) -/* 019FC 80B1D2FC AFA70044 */ sw $a3, 0x0044($sp) -/* 01A00 80B1D300 25EFD580 */ addiu $t7, $t7, %lo(D_80B1D580) ## $t7 = 80B1D580 -/* 01A04 80B1D304 8DF90000 */ lw $t9, 0x0000($t7) ## 80B1D580 -/* 01A08 80B1D308 27AE0028 */ addiu $t6, $sp, 0x0028 ## $t6 = FFFFFFF0 -/* 01A0C 80B1D30C 8DF80004 */ lw $t8, 0x0004($t7) ## 80B1D584 -/* 01A10 80B1D310 ADD90000 */ sw $t9, 0x0000($t6) ## FFFFFFF0 -/* 01A14 80B1D314 8DF90008 */ lw $t9, 0x0008($t7) ## 80B1D588 -/* 01A18 80B1D318 3C0880B2 */ lui $t0, %hi(D_80B1D58C) ## $t0 = 80B20000 -/* 01A1C 80B1D31C 2508D58C */ addiu $t0, $t0, %lo(D_80B1D58C) ## $t0 = 80B1D58C -/* 01A20 80B1D320 ADD80004 */ sw $t8, 0x0004($t6) ## FFFFFFF4 -/* 01A24 80B1D324 ADD90008 */ sw $t9, 0x0008($t6) ## FFFFFFF8 -/* 01A28 80B1D328 8D0A0000 */ lw $t2, 0x0000($t0) ## 80B1D58C -/* 01A2C 80B1D32C 27A7001C */ addiu $a3, $sp, 0x001C ## $a3 = FFFFFFE4 -/* 01A30 80B1D330 24010010 */ addiu $at, $zero, 0x0010 ## $at = 00000010 -/* 01A34 80B1D334 ACEA0000 */ sw $t2, 0x0000($a3) ## FFFFFFE4 -/* 01A38 80B1D338 8D090004 */ lw $t1, 0x0004($t0) ## 80B1D590 -/* 01A3C 80B1D33C 00A03025 */ or $a2, $a1, $zero ## $a2 = 00000000 -/* 01A40 80B1D340 00E02025 */ or $a0, $a3, $zero ## $a0 = FFFFFFE4 -/* 01A44 80B1D344 ACE90004 */ sw $t1, 0x0004($a3) ## FFFFFFE8 -/* 01A48 80B1D348 8D0A0008 */ lw $t2, 0x0008($t0) ## 80B1D594 -/* 01A4C 80B1D34C 14A10006 */ bne $a1, $at, .L80B1D368 -/* 01A50 80B1D350 ACEA0008 */ sw $t2, 0x0008($a3) ## FFFFFFEC -/* 01A54 80B1D354 8FA50048 */ lw $a1, 0x0048($sp) -/* 01A58 80B1D358 AFA6003C */ sw $a2, 0x003C($sp) -/* 01A5C 80B1D35C 0C0346BD */ jal Matrix_MultVec3f -/* 01A60 80B1D360 24A50038 */ addiu $a1, $a1, 0x0038 ## $a1 = 00000038 -/* 01A64 80B1D364 8FA6003C */ lw $a2, 0x003C($sp) -.L80B1D368: -/* 01A68 80B1D368 2401000E */ addiu $at, $zero, 0x000E ## $at = 0000000E -/* 01A6C 80B1D36C 14C10006 */ bne $a2, $at, .L80B1D388 -/* 01A70 80B1D370 8FA50048 */ lw $a1, 0x0048($sp) -/* 01A74 80B1D374 27A40028 */ addiu $a0, $sp, 0x0028 ## $a0 = FFFFFFF0 -/* 01A78 80B1D378 0C0346BD */ jal Matrix_MultVec3f -/* 01A7C 80B1D37C 24A50304 */ addiu $a1, $a1, 0x0304 ## $a1 = 00000304 -/* 01A80 80B1D380 0C2C7480 */ jal func_80B1D200 -/* 01A84 80B1D384 8FA40038 */ lw $a0, 0x0038($sp) -.L80B1D388: -/* 01A88 80B1D388 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01A8C 80B1D38C 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 01A90 80B1D390 03E00008 */ jr $ra -/* 01A94 80B1D394 00000000 */ nop - - diff --git a/data/overlays/actors/z_en_tk.data.s b/data/overlays/actors/z_en_tk.data.s deleted file mode 100644 index 8bd649aeca..0000000000 --- a/data/overlays/actors/z_en_tk.data.s +++ /dev/null @@ -1,42 +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 En_Tk_InitVars - .word 0x00850400, 0x00000009, 0x00890000, 0x00000770 -.word EnTk_Init -.word EnTk_Destroy -.word EnTk_Update -.word EnTk_Draw -glabel D_80B1D4D0 - .word 0x040539B0, 0x040535B0, 0x040531B0, 0x04052DB0, 0x040529B0, 0x040525B0, 0x040521B0, 0x04051DB0 -glabel D_80B1D4F0 - .word 0x00000000, 0x00000000, 0x00000000 -glabel D_80B1D4FC - .word 0x00000000, 0x3E99999A, 0x00000000 -glabel D_80B1D508 - .word 0x0A000039, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x001E0034, 0x00000000, 0x00000000 -glabel D_80B1D534 - .word 0x00000000, 0x00000000, 0xFF000000 -glabel D_80B1D540 - .word 0x42100000, 0x41200000 -glabel D_80B1D548 - .word 0x00000000, 0x00000000, 0x00000000 -glabel D_80B1D554 - .word 0x00000000, 0x00000000, 0x00000000 -glabel D_80B1D560 - .word 0x00000000, 0x3E99999A, 0x00000000 -glabel D_80B1D56C - .word 0x00000000, 0x00000001, 0x00000002, 0x00000014, 0x00000006 -glabel D_80B1D580 - .word 0x00000000, 0x00000000, 0x458FC000 -glabel D_80B1D58C - .word 0x00000000, 0x00000000, 0x00000000 -glabel D_80B1D598 - .word 0x06003B40, 0x06004340, 0x06004B40, 0x00000000, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_en_tk.reloc.s b/data/overlays/actors/z_en_tk.reloc.s deleted file mode 100644 index e63a357638..0000000000 --- a/data/overlays/actors/z_en_tk.reloc.s +++ /dev/null @@ -1,11 +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_80B1D690 - -.incbin "baserom/ovl_En_Tk", 0x1D90, 0x00000200 diff --git a/data/overlays/actors/z_en_tk.rodata.s b/data/overlays/actors/z_en_tk.rodata.s deleted file mode 100644 index 8b109d004a..0000000000 --- a/data/overlays/actors/z_en_tk.rodata.s +++ /dev/null @@ -1,70 +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_80B1D5B0 - .asciz "../z_en_tk_eff.c" - .balign 4 - -glabel D_80B1D5C4 - .asciz "../z_en_tk_eff.c" - .balign 4 - -glabel D_80B1D5D8 - .asciz "../z_en_tk_eff.c" - .balign 4 - -glabel D_80B1D5EC - .asciz "../z_en_tk.c" - .balign 4 - -glabel D_80B1D5FC - .asciz "../z_en_tk.c" - .balign 4 - -glabel D_80B1D60C - .asciz "../z_en_tk.c" - .balign 4 - -glabel D_80B1D61C - .asciz "../z_en_tk.c" - .balign 4 - -glabel D_80B1D62C - .word 0x3E4CCCCD -glabel D_80B1D630 - .word 0x3ECCCCCD -glabel D_80B1D634 - .word 0x461C4000 -glabel D_80B1D638 - .word 0x452AAAAB -glabel D_80B1D63C - .word 0x4622F983 -glabel jtbl_80B1D640 -.word L80B1C724 -.word L80B1C724 -.word L80B1C5EC -.word L80B1C724 -.word L80B1C614 -.word L80B1C6E4 -.word L80B1C724 -.word L80B1C724 -.word L80B1C724 -.word L80B1C724 -glabel D_80B1D668 - .word 0x3ECCCCCD, 0x00000000 -glabel D_80B1D670 - .word 0x3FE66666, 0x66666666 -glabel D_80B1D678 - .word 0x3FECCCCC, 0xCCCCCCCD -glabel D_80B1D680 - .word 0x3DCCCCCD -glabel D_80B1D684 - .word 0xBDCCCCCD, 0x00000000, 0x00000000 - - diff --git a/include/functions.h b/include/functions.h index 3562b89692..71e14e63be 100644 --- a/include/functions.h +++ b/include/functions.h @@ -389,6 +389,7 @@ void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1); void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4); Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx); Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx); +s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, s16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*)); s16 func_800347E8(s16 arg0); void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha); void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha); @@ -743,7 +744,7 @@ s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60* // ? func_80061E48(?); // ? func_80061E8C(?); void func_80061ED4(SubActorStruct98 *sub98, ActorDamageChart *damageChart, SubActor98Init *subActor98Init); -// ? func_80061EFC(?); +void func_80061EFC(SubActorStruct98 *sub98, ActorDamageChart *damageChart, SubActor98Init *subActor98Init); // ? func_80061F64(?); // ? func_800622E4(?); // ? func_80062530(?); @@ -786,6 +787,7 @@ void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos2, s32 radius // ? func_8006BE88(?); // ? func_8006BF1C(?); // ? func_8006C0FC(?); +u16 func_8006C360(GlobalContext*, u32); // ? func_8006C3A0(?); // ? func_8006C3D0(?); void func_8006C438(GlobalContext* globalCtx, s16 arg1); @@ -1134,8 +1136,8 @@ Gfx* func_800A273C(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDLis // ? func_800A3F08(?); // ? func_800A3D70(?); // ? func_800A4478(?); -void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u8 unk0, u8 unk1, u8 unk2); -void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u8 unk0, u16* unk1, u8 unk2); +void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1, u8 unk2); +void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1, u8 unk2); // ? func_800A4A20(?); // ? func_800A4AD8(?); // ? func_800A4D9C(?); @@ -1151,7 +1153,7 @@ void func_800A5240(SkelAnime *skelAnime, u32 animation, f32 unk0); void func_800A529C(SkelAnime *skelAnime, u32 animation, f32 unk0, Actor *actor); // ? func_800A52F8(?); // ? func_800A54FC(?); -UNK_TYPE func_800A56C8(SkelAnime* skelAnime, f32 arg1); +s32 func_800A56C8(SkelAnime* skelAnime, f32 arg1); // ? func_800A56F0(?); // ? func_800A5774(?); // ? func_800A57C0(?); @@ -2349,7 +2351,7 @@ f32 absf(f32); // ? func_801069B0(?); u8 func_80106BC8(GlobalContext* globalCtx); // ? func_80106C88(?); -// ? func_80106CCC(?); +void func_80106CCC(GlobalContext*); // ? func_80106D40(?); // ? func_80106F1C(?); // ? func_80107244(?); @@ -2363,7 +2365,7 @@ u8 func_80106BC8(GlobalContext* globalCtx); // ? func_80109968(?); // ? func_80109B3C(?); // ? func_8010B0C0(?); -// ? func_8010B680(?); +void func_8010B680(GlobalContext*, u16, s32); void func_8010B720(GlobalContext* globalCtx, u16 textId); // ? func_8010B820(?); // ? func_8010BD58(?); diff --git a/include/macros.h b/include/macros.h index ef435aca55..e9238973ae 100644 --- a/include/macros.h +++ b/include/macros.h @@ -13,6 +13,7 @@ #define SQ(x) ((x)*(x)) #define ABS(x) ((x) >= 0 ? (x) : -(x)) #define DECR(x) ((x) == 0 ? 0 : ((x) -= 1)) +#define CLAMP(x,min,max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) #define PLAYER ((Player*)globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].first) diff --git a/include/z64.h b/include/z64.h index dc0baf5ee5..26b510e4af 100644 --- a/include/z64.h +++ b/include/z64.h @@ -802,6 +802,12 @@ typedef struct /* 0x01 */ u8 room; } EntranceEntry; +typedef struct +{ + /* 0x00 */ u8 n_points; + /* 0x04 */ Vec3s* point_array; +} Path; // size = 0x8 + typedef struct { /* 0x00 */ u32 vromStart; @@ -947,7 +953,7 @@ typedef struct GlobalContext /* 0x11DFC */ UNK_PTR unk_11DFC; /* 0x11E00 */ EntranceEntry* setupEntranceList; /* 0x11E04 */ UNK_PTR setupExitList; - /* 0x11E08 */ UNK_PTR setupPathList; + /* 0x11E08 */ Path* setupPathList; /* 0x11E0C */ UNK_PTR naviMsgSegment; /* 0x11E10 */ char unk_11E10[0x4]; /* 0x11E14 */ u8 skyboxId; diff --git a/spec b/spec index 1a3b075a91..64771f35e5 100644 --- a/spec +++ b/spec @@ -3693,9 +3693,7 @@ endseg beginseg name "ovl_En_Tk" include "build/src/overlays/actors/ovl_En_Tk/z_en_tk.o" - include "build/data/overlays/actors/z_en_tk.data.o" - include "build/data/overlays/actors/z_en_tk.rodata.o" - include "build/data/overlays/actors/z_en_tk.reloc.o" + include "build/src/overlays/actors/ovl_En_Tk/z_en_tk_reloc.o" endseg beginseg diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 71bba11f23..ba79db4aec 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4040,10 +4040,7 @@ Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx) return func_8002EB44(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); } -typedef s16 (*func_800343CC_arg4)(GlobalContext*, Actor*); -typedef s16 (*func_800343CC_arg5)(GlobalContext*, Actor*); - -s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, func_800343CC_arg4 unkFunc1, func_800343CC_arg5 unkFunc2) +s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, s16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*)) { s16 sp26; s16 sp24; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 04943e8722..5d9233314e 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -1,14 +1,48 @@ +#include +#include #include "z_en_tk.h" -#define ROOM 0x00 +typedef struct +{ + /* 0x0000 */ u8 health; /* SubActorStruct98.health */ + /* 0x0002 */ s16 h_2; /* SubActorStruct98.unk_10 */ + /* 0x0004 */ s16 h_4; /* SubActorStruct98.unk_12 */ + /* 0x0006 */ s16 h_6; /* SubActorStruct98.unk_14 */ + /* 0x0008 */ u8 mass; /* SubActorStruct98.mass */ + /* 0x000A */ +} EnTk_SubActorStruct98Init; + +#define ROOM 0x00 #define FLAGS 0x00000009 -void EnTk_Init(EnTk* this, GlobalContext* globalCtx); -void EnTk_Destroy(EnTk* this, GlobalContext* globalCtx); -void EnTk_Update(EnTk* this, GlobalContext* globalCtx); -void EnTk_Draw(EnTk* this, GlobalContext* globalCtx); +s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *ctxt); +void EnTk_Init(Actor *this, GlobalContext *ctxt); +void EnTk_Destroy(Actor *this, GlobalContext *ctxt); +void EnTk_Stop_Update(EnTk *this, GlobalContext *ctxt); +void EnTk_Walk_Update(EnTk *this, GlobalContext *ctxt); +void EnTk_Dig_Update(EnTk *this, GlobalContext *ctxt); +void EnTk_Update(Actor *this, GlobalContext *ctxt); +void EnTk_Draw(Actor *this, GlobalContext *ctxt); + +extern UNK_TYPE D_04051DB0; +extern UNK_TYPE D_040521B0; +extern UNK_TYPE D_040525B0; +extern UNK_TYPE D_040529B0; +extern UNK_TYPE D_04052DB0; +extern UNK_TYPE D_040531B0; +extern UNK_TYPE D_040535B0; +extern UNK_TYPE D_040539B0; +extern UNK_TYPE D_06001144; +extern UNK_TYPE D_06001FA8; +extern UNK_TYPE D_06002F84; +extern UNK_TYPE D_06003B40; +extern UNK_TYPE D_06004340; +extern UNK_TYPE D_06004B40; +extern UNK_TYPE D_0600ACE0; +extern UNK_TYPE D_0600BC90; +extern UNK_TYPE D_0600BCA0; +extern UNK_TYPE D_0600BE40; -/* const ActorInit En_Tk_InitVars = { ACTOR_EN_TK, @@ -17,62 +51,972 @@ const ActorInit En_Tk_InitVars = FLAGS, OBJECT_TK, sizeof(EnTk), - (ActorFunc)EnTk_Init, - (ActorFunc)EnTk_Destroy, - (ActorFunc)EnTk_Update, - (ActorFunc)EnTk_Draw, + EnTk_Init, + EnTk_Destroy, + EnTk_Update, + EnTk_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B900.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1B9A4.s") +void EnTk_Eff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel, + u8 duration, f32 size, f32 growth) +{ + s16 i; + EnTkEff *eff = this->eff; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BAB0.s") + for (i = 0; i < ARRAY_COUNT(this->eff); i++) + { + if (eff->active != 1) + { + eff->size = size; + eff->growth = growth; + eff->time_total = eff->time_left = duration; + eff->active = 1; + eff->pos = *pos; + eff->accel = *accel; + eff->speed = *speed; + break; + } + eff++; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BDDC.s") +void EnTk_Eff_Update(EnTk *this) +{ + s16 i; + EnTkEff *eff; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BE94.s") + eff = this->eff; + for (i = 0; i < ARRAY_COUNT(this->eff); i++) + { + if (eff->active != 0) + { + eff->time_left--; + if (eff->time_left == 0) + { + eff->active = 0; + } + eff->accel.x = Math_Rand_ZeroOne() * 0.4f - 0.2f; + eff->accel.z = Math_Rand_ZeroOne() * 0.4f - 0.2f; + VEC3_ADD(eff->pos, eff->speed) + VEC3_ADD(eff->speed, eff->accel) + eff->size += eff->growth; + } + eff++; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF14.s") +void EnTk_Eff_Draw(EnTk *this, GlobalContext *ctxt) +{ + static u32 images[] = + { + (u32)&D_040539B0, + (u32)&D_040535B0, + (u32)&D_040531B0, + (u32)&D_04052DB0, + (u32)&D_040529B0, + (u32)&D_040525B0, + (u32)&D_040521B0, + (u32)&D_04051DB0, + }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1BF8C.s") + EnTkEff *eff = this->eff; + GraphicsContext *gfx; + s16 gfx_setup; + s16 i; + s16 alpha; + s16 image_idx; + Gfx *pgdl[4]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C00C.s") + /* + * This assignment always occurs before a call to func_800C6AC4 which + * makes me suspect that they're inside a macro where the function call + * is present only for debug builds. Same for func_800C6B54 most likely. + */ + gfx = ctxt->state.gfxCtx; + func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk_eff.c", 114); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C0D0.s") + gfx_setup = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C154.s") + /* + * Same code is generated without the if, + * but that would make the do...while redundant so there's probably an if. + */ + do { if (1) { func_80093D84(ctxt->state.gfxCtx); } } while (0); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C23C.s") + for (i = 0; i < ARRAY_COUNT(this->eff); i++) + { + if (eff->active != 0) + { + if (gfx_setup == 0) + { + gfx->polyXlu.p = func_80093774(gfx->polyXlu.p, 0); + gSPDisplayList(gfx->polyXlu.p++, &D_0600BC90); + gDPSetEnvColor(gfx->polyXlu.p++, 0x64, 0x3C, 0x14, 0x00); + gfx_setup = 1; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C2B4.s") + alpha = eff->time_left * (255.f / eff->time_total); + gDPSetPrimColor(gfx->polyXlu.p++, 0, 0, 0xAA, 0x82, 0x5A, alpha); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C3DC.s") + gDPPipeSync(gfx->polyXlu.p++); + Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, 0); + func_800D1FD4(&ctxt->mf_11DA0); + Matrix_Scale(eff->size, eff->size, 1.f, 1); + gSPMatrix(gfx->polyXlu.p++, + Matrix_NewMtx(ctxt->state.gfxCtx, "../z_en_tk_eff.c", + 140), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C54C.s") + image_idx = eff->time_left * + ((f32)ARRAY_COUNT(images) / eff->time_total); + gSPSegment(gfx->polyXlu.p++, 0x08, + SEGMENTED_TO_VIRTUAL(images[image_idx])); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C5A0.s") + gSPDisplayList(gfx->polyXlu.p++, &D_0600BCA0); + } + eff++; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C738.s") + func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk_eff.c", 154); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1C8F0.s") +s32 EnTk_Eff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size, + f32 growth, f32 y_accel_max) +{ + Vec3f speed = {0.f, 0.f, 0.f}; + Vec3f accel = {0.f, 0.3f, 0.f}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Init.s") + accel.y += Math_Rand_ZeroOne() * y_accel_max; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Destroy.s") + EnTk_Eff_Create(this, pos, &speed, &accel, duration, size, growth); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CC04.s") + return 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CE28.s") +/** z_en_tk_eff.c ends here probably **/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1CEF8.s") +static ColliderCylinderInit D_80B1D508 = +{ + { + 0x0A, + 0x00, + 0x00, + 0x39, + 0x20, + 0x01, + { + 0x00, + 0x00, + }, + }, + { + 0x00, + { + 0x00, + 0x00, + 0x00, + }, + 0x00000000, + 0x00, + 0x00, + { + 0x00, + 0x00, + }, + 0x00000000, + { + 0x00, + 0x00, + 0x00, + 0x00, + }, + 0x00, + 0x00, + 0x01, + 0x00, + }, + { + 0x001E, + 0x0034, + 0x0000, + { + 0x0000, + 0x0000, + 0x0000, + }, + }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Update.s") +static EnTk_SubActorStruct98Init D_80B1D534 = +{ + 0x00, + 0x0000, + 0x0000, + 0x0000, + 0xFF, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D200.s") +void EnTk_Stop(EnTk *this, GlobalContext *ctxt) +{ + UNK_PTR anim = &D_06002F84; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D278.s") + SkelAnime_ChangeAnimation(&this->skel_anim, (u32)anim, 1.f, 0.f, + SkelAnime_GetFrameCount((u32)&D_06002F84), 0, + -10.f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/func_80B1D2E4.s") + this->action_countdown = Math_Rand_S16Offset(60, 60); + this->actor.speedXZ = 0.f; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tk/EnTk_Draw.s") +void EnTk_Walk(EnTk *this, GlobalContext *ctxt) +{ + UNK_PTR anim = &D_06001FA8; + + SkelAnime_ChangeAnimation(&this->skel_anim, (u32)anim, 1.f, 0.f, + SkelAnime_GetFrameCount((u32)&D_06002F84), 0, + -10.f); + + this->action_countdown = Math_Rand_S16Offset(240, 240); +} + +void EnTk_Dig(EnTk *this, GlobalContext *ctxt) +{ + UNK_PTR anim = &D_06001144; + + SkelAnime_ChangeAnimation(&this->skel_anim, (u32)anim, 1.f, 0.f, + SkelAnime_GetFrameCount((u32)&D_06001144), 0, + -10.f); + + if (EnTk_CheckNextSpot(this, ctxt) >= 0) + { + this->valid_dig_here = 1; + } +} + +void EnTk_UpdateEyes(EnTk *this) +{ + if (DECR(this->blink_countdown) == 0) + { + this->eye_image_idx++; + if (this->eye_image_idx > 2) + { + this->blink_cycles--; + if (this->blink_cycles < 0) + { + this->blink_countdown = Math_Rand_S16Offset(30, 30); + this->blink_cycles = 2; + if (Math_Rand_ZeroOne() > 0.5f) + { + this->blink_cycles++; + } + } + this->eye_image_idx = 0; + } + } +} + +s32 EnTk_CheckFacingPlayer(EnTk *this) +{ + s16 v0; + s16 v1; + + if (this->actor.waterSurfaceDist > 10000.f) + { + return 0; + } + + v0 = this->actor.shape.rot.y; + v0 -= this->h_21E; + v0 -= this->head_rot; + + v1 = this->actor.rotTowardsLinkY - v0; + if (ABS(v1) < 0x1554) + { + return 1; + } + else + { + return 0; + } +} + +s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *ctxt) +{ + Actor *prop; + f32 dxz; + f32 dy; + + prop = ctxt->actorCtx.actorList[ACTORTYPE_PROP].first; + + while (prop != NULL) + { + if (prop->id != ACTOR_EN_IT) + { + prop = prop->next; + continue; + } + + if (prop == this->current_spot) + { + prop = prop->next; + continue; + } + + dy = prop->posRot.pos.y - this->actor.unk_80; + dxz = func_8002DB8C(&this->actor, prop); + if (dxz > 40.f || dy > 10.f) + { + prop = prop->next; + continue; + } + + this->current_spot = prop; + return prop->params; + } + + return -1; +} + +void EnTk_CheckCurrentSpot(EnTk *this) +{ + f32 dxz; + f32 dy; + + if (this->current_spot != NULL) + { + dy = this->current_spot->posRot.pos.y - this->actor.unk_80; + dxz = func_8002DB8C(&this->actor, this->current_spot); + if (dxz > 40.f || dy > 10.f) + { + this->current_spot = NULL; + } + } +} + +f32 EnTk_Step(EnTk *this, GlobalContext *ctxt) +{ + f32 step_frames[] = {36.f, 10.f}; + f32 a1_; + s32 i; + + if (this->skel_anim.animCurrentFrame == 0.f || + this->skel_anim.animCurrentFrame == 25.f) + { + /* NA_SE_EN_MORIBLIN_WALK */ + Audio_PlayActorSound2(&this->actor, 0x38B8); + } + + if (this->skel_anim.animCurrent != (u32)&D_06001FA8) + { + return 0.f; + } + + a1_ = this->skel_anim.animCurrentFrame; + for (i = 0; i < ARRAY_COUNT(step_frames); i++) + { + if (a1_ < step_frames[i] + 12.f && a1_ >= step_frames[i]) + { + break; + } + } + if (i >= ARRAY_COUNT(step_frames)) + { + return 0.f; + } + else + { + a1_ = (0x8000 / 12.f) * (a1_ - step_frames[i]); + return Math_Sins(a1_) * 2.f; + } +} + +s32 EnTk_Orient(EnTk *this, GlobalContext *ctxt) +{ + Path *path; + Vec3s *point; + f32 dx; + f32 dz; + + if (this->actor.params < 0) + { + return 1; + } + + path = &ctxt->setupPathList[0]; + point = SEGMENTED_TO_VIRTUAL(path->point_array); + point += this->current_waypoint; + + dx = point->x - this->actor.posRot.pos.x; + dz = point->z - this->actor.posRot.pos.z; + + Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, + func_800FD250(dx, dz) * (0x8000 / M_PI), + 10, 1000, 1); + this->actor.posRot.rot = this->actor.shape.rot; + + if (SQ(dx) + SQ(dz) < 10.f) + { + this->current_waypoint++; + if (this->current_waypoint >= path->n_points) + { + this->current_waypoint = 0; + } + + return 0; + } + else + { + return 1; + } +} + +u16 func_80B1C54C(GlobalContext *ctxt, Actor *a1) +{ + u16 ret; + + ret = func_8006C360(ctxt, 14); + if (ret != 0) + { + return ret; + } + + if (gSaveContext.inf_table[13] & 0x0200) + { + /* "Do you want me to dig here? ..." */ + return 0x5019; + } + else + { + /* "Hey kid! ..." */ + return 0x5018; + } +} + +s16 func_80B1C5A0(GlobalContext *ctxt, Actor *actor) +{ + s32 ret = 1; + + switch (func_8010BDBC(&ctxt->msgCtx)) + { + case 0: + { + break; + } + case 1: + { + break; + } + case 2: + { + /* "I am the boss of the carpenters ..." (wtf?) */ + if (actor->textId == 0x5028) + { + gSaveContext.inf_table[13] |= 0x0100; + } + ret = 0; + break; + } + case 3: + { + break; + } + case 4: + { + if (func_80106BC8(ctxt) != 0 && + (actor->textId == 0x5018 || actor->textId == 0x5019)) + { + if (ctxt->msgCtx.choiceIndex == 1) + { + /* "Thanks a lot!" */ + actor->textId = 0x0084; + } + else if (gSaveContext.rupees < 10) + { + /* "You don't have enough Rupees!" */ + actor->textId = 0x0085; + } + else + { + ctxt->msgCtx.msgMode = 0x37; + Rupees_ChangeBy(-10); + gSaveContext.inf_table[13] |= 0x0200; + return 2; + } + func_8010B720(ctxt, actor->textId); + gSaveContext.inf_table[13] |= 0x0200; + } + break; + } + case 5: + { + if (func_80106BC8(ctxt) != 0 && + (actor->textId == 0x0084 || actor->textId == 0x0085)) + { + func_80106CCC(ctxt); + ret = 0; + } + break; + } + case 6: + { + break; + } + case 7: + { + break; + } + case 8: + { + break; + } + case 9: + { + break; + } + } + + return ret; +} + +s32 EnTk_ChooseReward(EnTk *this) +{ + f32 luck; + s32 reward; + + luck = Math_Rand_ZeroOne(); + + if (luck < 0.4f) + { + reward = 0; + } + else if (luck < 0.7) + { + reward = 1; + } + else if (luck < 0.9) + { + reward = 2; + } + else + { + reward = 3; + } + + switch (reward) + { + case 0: + { + if (this->reward_count[0] < 8) + { + this->reward_count[0] += 1; + return reward; + } + break; + } + case 1: + { + if (this->reward_count[1] < 4) + { + this->reward_count[1] += 1; + return reward; + } + break; + } + case 2: + { + if (this->reward_count[2] < 2) + { + this->reward_count[2] += 1; + return reward; + } + break; + } + case 3: + { + if (this->reward_count[3] < 1) + { + this->reward_count[3] += 1; + return reward; + } + break; + } + } + + if (this->reward_count[0] < 8) + { + this->reward_count[0] += 1; + reward = 0; + } + else if (this->reward_count[1] < 4) + { + this->reward_count[1] += 1; + reward = 1; + } + else if (this->reward_count[2] < 2) + { + this->reward_count[2] += 1; + reward = 2; + } + else if (this->reward_count[3] < 1) + { + this->reward_count[3] += 1; + reward = 3; + } + else + { + reward = 0; + this->reward_count[0] = 1; + this->reward_count[1] = 0; + this->reward_count[2] = 0; + this->reward_count[3] = 0; + } + + return reward; +} + +void EnTk_Dig_Eff(EnTk *this) +{ + Vec3f pos = {0.f, 0.f, 0.f}; + Vec3f speed = {0.f, 0.f, 0.f}; + Vec3f accel = {0.f, 0.3f, 0.f}; + + if (this->skel_anim.animCurrentFrame >= 32.f && + this->skel_anim.animCurrentFrame < 40.f) + { + pos.x = (Math_Rand_ZeroOne() - 0.5f) * 12.f + this->v3f_304.x; + pos.y = (Math_Rand_ZeroOne() - 0.5f) * 8.f + this->v3f_304.y; + pos.z = (Math_Rand_ZeroOne() - 0.5f) * 12.f + this->v3f_304.z; + EnTk_Eff_CreateDflt(this, &pos, 12, 0.2f, 0.1f, 0.f); + } +} + +void EnTk_Init(Actor *this, GlobalContext *ctxt) +{ + EnTk *tk = (EnTk *)this; + UNK_PTR anim = &D_06002F84; + + ActorShape_Init(&tk->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.f); + + func_800A46F8(ctxt, &tk->skel_anim, (u32)&D_0600BE40, 0, tk->hz_22A, + tk->hz_296, 18); + SkelAnime_ChangeAnimation(&tk->skel_anim, (u32)anim, 1.f, 0.f, + SkelAnime_GetFrameCount((u32)&D_06002F84), + 0, 0.f); + + ActorCollider_AllocCylinder(ctxt, &tk->collider); + ActorCollider_InitCylinder(ctxt, &tk->collider, &tk->actor, &D_80B1D508); + + func_80061EFC(&tk->actor.sub_98, NULL, &D_80B1D534); + + if (gSaveContext.day_time <= 0xC000 || + gSaveContext.day_time >= 0xE000 || + !LINK_IS_CHILD || + ctxt->sceneNum != SCENE_SPOT02) + { + Actor_Kill(&tk->actor); + return; + } + + Actor_SetScale(&tk->actor, 0.01f); + + tk->actor.unk_1F = 6; + tk->actor.gravity = -0.1f; + tk->current_reward = -1; + tk->current_spot = NULL; + tk->action_func = EnTk_Stop_Update; +} + +void EnTk_Destroy(Actor *this, GlobalContext *ctxt) +{ + EnTk *tk = (EnTk *)this; + ActorCollider_FreeCylinder(ctxt, &tk->collider); +} + +void EnTk_Stop_Update(EnTk *this, GlobalContext *ctxt) +{ + s16 v1; + s16 a1_; + + if (this->h_1E0 != 0) + { + v1 = this->actor.shape.rot.y; + v1 -= this->h_21E; + v1 = this->actor.rotTowardsLinkY - v1; + + if (this->h_1E0 == 2) + { + EnTk_Dig(this, ctxt); + this->h_1E0 = 0; + this->action_func = EnTk_Dig_Update; + return; + } + + func_800343CC(ctxt, &this->actor, &this->h_1E0, + this->collider.dim.radius + 30.f, + func_80B1C54C, func_80B1C5A0); + } + else if (EnTk_CheckFacingPlayer(this) != 0) + { + v1 = this->actor.shape.rot.y; + v1 -= this->h_21E; + v1 = this->actor.rotTowardsLinkY - v1; + + this->action_countdown = 0; + func_800343CC(ctxt, &this->actor, &this->h_1E0, + this->collider.dim.radius + 30.f, + func_80B1C54C, func_80B1C5A0); + } + else if (func_8002F194(&this->actor, ctxt) != 0) + { + v1 = this->actor.shape.rot.y; + v1 -= this->h_21E; + v1 = this->actor.rotTowardsLinkY - v1; + + this->action_countdown = 0; + this->h_1E0 = 1; + } + else if (DECR(this->action_countdown) == 0) + { + EnTk_Walk(this, ctxt); + this->action_func = EnTk_Walk_Update; + + /*! @bug v1 is uninitialized past this branch */ + } + else + { + v1 = 0; + } + + a1_ = CLAMP(-v1, 1270, 10730); + Math_SmoothScaleMaxMinS(&this->head_rot, a1_, 6, 1000, 1); +} + +void EnTk_Walk_Update(EnTk *this, GlobalContext *ctxt) +{ + if (this->h_1E0 == 2) + { + EnTk_Dig(this, ctxt); + this->h_1E0 = 0; + this->action_func = EnTk_Dig_Update; + } + else + { + this->actor.speedXZ = EnTk_Step(this, ctxt); + EnTk_Orient(this, ctxt); + Math_SmoothScaleMaxMinS(&this->head_rot, 0, 6, 1000, 1); + EnTk_CheckCurrentSpot(this); + + DECR(this->action_countdown); + if (EnTk_CheckFacingPlayer(this) != 0 || this->action_countdown == 0) + { + EnTk_Stop(this, ctxt); + this->action_func = EnTk_Stop_Update; + } + } +} + +void EnTk_Dig_Update(EnTk *this, GlobalContext *ctxt) +{ + Vec3f reward_origin; + Vec3f reward_pos; + s32 reward_params[] = + { + 0x0000, /* Green rupee */ + 0x0001, /* Blue rupee */ + 0x0002, /* Red rupee */ + 0x0014, /* Purple rupee */ + 0x0006, /* Heart piece */ + }; + + EnTk_Dig_Eff(this); + + if (this->skel_anim.animCurrentFrame == 32.f) + { + /* NA_SE_EV_DIG_UP - What's gonna come out? */ + Audio_PlayActorSound2(&this->actor, 0x28C8); + + this->reward_timer = 0; + + if (this->valid_dig_here == 1) + { + reward_origin.x = 0.f; + reward_origin.y = 0.f; + reward_origin.z = -40.f; + + Matrix_RotateY(this->actor.shape.rot.y, 0); + Matrix_MultVec3f(&reward_origin, &reward_pos); + + VEC3_ADD(reward_pos, this->actor.posRot.pos) + + this->current_reward = EnTk_ChooseReward(this); + if (this->current_reward == 3) + { + /* + * Upgrade the purple rupee reward to the heart piece if this + * is the first grand prize dig. + */ + if ((gSaveContext.item_get_inf[1] & 0x1000) == 0) + { + gSaveContext.item_get_inf[1] |= 0x1000; + this->current_reward = 4; + } + } + + Item_DropCollectible(ctxt, &reward_pos, + reward_params[this->current_reward]); + } + } + + if (this->skel_anim.animCurrentFrame >= 32.f && this->reward_timer == 10) + { + /* Play a reward sound shortly after digging */ + if (this->valid_dig_here == 0) + { + /* NA_SE_SY_ERROR - Bad dig spot */ + Audio_PlayActorSound2(&this->actor, 0x4806); + } + else if (this->current_reward == 4) + { + /* NA_SE_SY_CORRECT_CHIME - Heart piece */ + Audio_PlaySoundGeneral(0x4802, &D_801333D4, 4, &D_801333E0, + &D_801333E0, &D_801333E8); + } + else + { + /* NA_SE_SY_TRE_BOX_APPEAR - Rupee */ + Audio_PlayActorSound2(&this->actor, 0x4807); + } + } + this->reward_timer++; + + if (func_800A56C8(&this->skel_anim, this->skel_anim.animFrameCount) != 0) + { + if (this->current_reward < 0) + { + /* "Nope, nothing here!" */ + func_8010B680(ctxt, 0x501A, 0); + } + else + { + func_80106CCC(ctxt); + } + + EnTk_Stop(this, ctxt); + + this->current_reward = -1; + this->valid_dig_here = 0; + this->action_func = EnTk_Stop_Update; + } +} + +void EnTk_Update(Actor *this, GlobalContext *ctxt) +{ + EnTk *tk = (EnTk *)this; + ColliderCylinderMain *collider = &tk->collider; + + ActorCollider_Cylinder_Update(&tk->actor, collider); + Actor_CollisionCheck_SetOT(ctxt, &ctxt->sub_11E60, collider); + + SkelAnime_FrameUpdateMatrix(&tk->skel_anim); + + Actor_MoveForward(&tk->actor); + + func_8002E4B4(ctxt, &tk->actor, 40.f, 10.f, 0.f, 5); + + tk->action_func(tk, ctxt); + + EnTk_Eff_Update(tk); + + EnTk_UpdateEyes(tk); +} + +void func_80B1D200(GlobalContext *ctxt) +{ + GraphicsContext *gfx; + Gfx *pgdl[4]; + + gfx = ctxt->state.gfxCtx; + func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1188); + + gSPDisplayList(gfx->polyOpa.p++, &D_0600ACE0); + + func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1190); +} + +s32 func_80B1D278(s16 a0, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Vec3s *sp10, + Actor *actor) +{ + EnTk *tk = (EnTk *)actor; + + switch (a1) + { + /* Limb 15 - Head */ + case 15: + { + tk->h_21E = sp10->y; + break; + } + /* Limb 16 - Jaw */ + case 16: + { + tk->h_21E += sp10->y; + sp10->y += tk->head_rot; + break; + } + } + + return 0; +} + +void func_80B1D2E4(GlobalContext *ctxt, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, + Actor *actor) +{ + EnTk *this = (EnTk *)actor; + Vec3f sp28 = {0.f, 0.f, 4600.f}; + Vec3f sp1C = {0.f, 0.f, 0.f}; + + /* Limb 16 - Jaw */ + if (a1 == 16) + { + Matrix_MultVec3f(&sp1C, &this->actor.posRot2.pos); + } + + /* Limb 14 - Neck */ + if (a1 == 14) + { + Matrix_MultVec3f(&sp28, &this->v3f_304); + func_80B1D200(ctxt); + } +} + +void EnTk_Draw(Actor *this, GlobalContext *ctxt) +{ + static u32 eye_images[] = + { + (u32)&D_06003B40, + (u32)&D_06004340, + (u32)&D_06004B40, + }; + + EnTk *tk = (EnTk *)this; + GraphicsContext *gfx; + Gfx *pgdl[4]; + + Matrix_Push(); + EnTk_Eff_Draw(tk, ctxt); + Matrix_Pull(); + + gfx = ctxt->state.gfxCtx; + func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1294); + + func_80093D18(ctxt->state.gfxCtx); + + gSPSegment(gfx->polyOpa.p++, 0x08, + SEGMENTED_TO_VIRTUAL(eye_images[tk->eye_image_idx])); + + func_800A1AC8(ctxt, tk->skel_anim.limbIndex, + tk->skel_anim.actorDrawTbl, tk->skel_anim.dListCount, + func_80B1D278, func_80B1D2E4, &tk->actor); + + func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1312); +} diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/src/overlays/actors/ovl_En_Tk/z_en_tk.h index 9f6b3323b0..22c8ae5d46 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -4,11 +4,54 @@ #include #include +/* Dust particle effect */ typedef struct { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x624]; -} EnTk; // size = 0x0770 + /* 0x0000 */ u8 active; + /* 0x0001 */ u8 time_left; + /* 0x0002 */ u8 time_total; + /* 0x0004 */ f32 size; + /* 0x0008 */ f32 growth; + /* 0x000C */ char unk_C[0x8]; + /* 0x0014 */ Vec3f pos; + /* 0x0020 */ Vec3f speed; + /* 0x002C */ Vec3f accel; + /* 0x0038 */ +} EnTkEff; + +typedef struct EnTk EnTk; + +typedef void EnTkFunc(EnTk *this, GlobalContext *ctxt); + +struct EnTk +{ + /* 0x0000 */ Actor actor; + /* 0x014C */ SkelAnime skel_anim; + /* 0x018C */ char unk_18C[0x4]; + /* 0x0190 */ EnTkFunc *action_func; + /* 0x0194 */ ColliderCylinderMain + collider; + /* 0x01E0 */ s16 h_1E0; + /* 0x01E2 */ char unk_1E2[0x26]; + /* 0x0208 */ u8 valid_dig_here; + /* 0x0209 */ u8 reward_count[4]; + /* 0x0210 */ Actor *current_spot; + /* 0x0214 */ s32 current_reward; + /* 0x0218 */ s16 blink_cycles; + /* 0x021A */ s16 reward_timer; + /* 0x021C */ s16 action_countdown; + /* 0x021E */ s16 h_21E; + /* 0x0220 */ char unk_220[0x2]; + /* 0x0222 */ s16 eye_image_idx; + /* 0x0224 */ s16 blink_countdown; + /* 0x0226 */ s16 head_rot; + /* 0x0228 */ s16 current_waypoint; + /* 0x022A */ u16 hz_22A[54]; + /* 0x022A */ u16 hz_296[55]; + /* 0x0304 */ Vec3f v3f_304; + /* 0x0310 */ EnTkEff eff[20]; + /* 0x0770 */ +}; extern const ActorInit En_Tk_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 102b185600..43d0132a3d 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -309,6 +309,27 @@ D_06008604 = 0x06008604; D_06001420 = 0x06001420; D_06009A90 = 0x06009A90; +// z_en_tk +D_04051DB0 = 0x04051DB0; +D_040521B0 = 0x040521B0; +D_040525B0 = 0x040525B0; +D_040529B0 = 0x040529B0; +D_04052DB0 = 0x04052DB0; +D_040531B0 = 0x040531B0; +D_040535B0 = 0x040535B0; +D_040539B0 = 0x040539B0; +D_06001144 = 0x06001144; +D_06001FA8 = 0x06001FA8; +D_06002F84 = 0x06002F84; +D_06003B40 = 0x06003B40; +D_06004340 = 0x06004340; +D_06004B40 = 0x06004B40; +D_0600ACE0 = 0x0600ACE0; +D_0600BC90 = 0x0600BC90; +D_0600BCA0 = 0x0600BCA0; +D_0600BE40 = 0x0600BE40; +D_8002B5EC = 0x8002B5EC; + // z_arms_hook D_0602B288 = 0x0602B288; D_0602AFF0 = 0x0602AFF0; From d41ef6599ded288451a694c7e7ec50c9d628b538 Mon Sep 17 00:00:00 2001 From: glank Date: Thu, 19 Mar 2020 13:00:02 +0100 Subject: [PATCH 02/33] Responding to PR comments --- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 142 +++++++++--------------- src/overlays/actors/ovl_En_Tk/z_en_tk.h | 1 - 2 files changed, 51 insertions(+), 92 deletions(-) diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 5d9233314e..9a8208b7a6 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -18,9 +18,9 @@ typedef struct s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *ctxt); void EnTk_Init(Actor *this, GlobalContext *ctxt); void EnTk_Destroy(Actor *this, GlobalContext *ctxt); -void EnTk_Stop_Update(EnTk *this, GlobalContext *ctxt); -void EnTk_Walk_Update(EnTk *this, GlobalContext *ctxt); -void EnTk_Dig_Update(EnTk *this, GlobalContext *ctxt); +void EnTk_Rest(EnTk *this, GlobalContext *ctxt); +void EnTk_Walk(EnTk *this, GlobalContext *ctxt); +void EnTk_Dig(EnTk *this, GlobalContext *ctxt); void EnTk_Update(Actor *this, GlobalContext *ctxt); void EnTk_Draw(Actor *this, GlobalContext *ctxt); @@ -57,8 +57,8 @@ const ActorInit En_Tk_InitVars = EnTk_Draw, }; -void EnTk_Eff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel, - u8 duration, f32 size, f32 growth) +void EnTkEff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel, + u8 duration, f32 size, f32 growth) { s16 i; EnTkEff *eff = this->eff; @@ -80,7 +80,7 @@ void EnTk_Eff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel, } } -void EnTk_Eff_Update(EnTk *this) +void EnTkEff_Update(EnTk *this) { s16 i; EnTkEff *eff; @@ -105,7 +105,7 @@ void EnTk_Eff_Update(EnTk *this) } } -void EnTk_Eff_Draw(EnTk *this, GlobalContext *ctxt) +void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) { static u32 images[] = { @@ -180,15 +180,15 @@ void EnTk_Eff_Draw(EnTk *this, GlobalContext *ctxt) func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk_eff.c", 154); } -s32 EnTk_Eff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size, - f32 growth, f32 y_accel_max) +s32 EnTkEff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size, + f32 growth, f32 y_accel_max) { Vec3f speed = {0.f, 0.f, 0.f}; Vec3f accel = {0.f, 0.3f, 0.f}; accel.y += Math_Rand_ZeroOne() * y_accel_max; - EnTk_Eff_Create(this, pos, &speed, &accel, duration, size, growth); + EnTkEff_Create(this, pos, &speed, &accel, duration, size, growth); return 0; } @@ -197,54 +197,15 @@ s32 EnTk_Eff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size, static ColliderCylinderInit D_80B1D508 = { - { - 0x0A, - 0x00, - 0x00, - 0x39, - 0x20, - 0x01, - { - 0x00, - 0x00, - }, - }, - { - 0x00, - { - 0x00, - 0x00, - 0x00, - }, - 0x00000000, - 0x00, - 0x00, - { - 0x00, - 0x00, - }, - 0x00000000, - { - 0x00, - 0x00, - 0x00, - 0x00, - }, - 0x00, - 0x00, - 0x01, - 0x00, - }, - { - 0x001E, - 0x0034, - 0x0000, - { - 0x0000, - 0x0000, - 0x0000, - }, - }, + 0x0A, 0x00, 0x00, 0x39, + 0x20, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00000000, 0x00, 0x00, + 0x00, 0x00, 0x00000000, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, + 0x001E, 0x0034, 0x0000, + 0x0000, 0x0000, 0x0000, }; static EnTk_SubActorStruct98Init D_80B1D534 = @@ -256,7 +217,7 @@ static EnTk_SubActorStruct98Init D_80B1D534 = 0xFF, }; -void EnTk_Stop(EnTk *this, GlobalContext *ctxt) +void EnTk_RestAnim(EnTk *this, GlobalContext *ctxt) { UNK_PTR anim = &D_06002F84; @@ -268,7 +229,7 @@ void EnTk_Stop(EnTk *this, GlobalContext *ctxt) this->actor.speedXZ = 0.f; } -void EnTk_Walk(EnTk *this, GlobalContext *ctxt) +void EnTk_WalkAnim(EnTk *this, GlobalContext *ctxt) { UNK_PTR anim = &D_06001FA8; @@ -279,7 +240,7 @@ void EnTk_Walk(EnTk *this, GlobalContext *ctxt) this->action_countdown = Math_Rand_S16Offset(240, 240); } -void EnTk_Dig(EnTk *this, GlobalContext *ctxt) +void EnTk_DigAnim(EnTk *this, GlobalContext *ctxt) { UNK_PTR anim = &D_06001144; @@ -402,8 +363,7 @@ f32 EnTk_Step(EnTk *this, GlobalContext *ctxt) if (this->skel_anim.animCurrentFrame == 0.f || this->skel_anim.animCurrentFrame == 25.f) { - /* NA_SE_EN_MORIBLIN_WALK */ - Audio_PlayActorSound2(&this->actor, 0x38B8); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK); } if (this->skel_anim.animCurrent != (u32)&D_06001FA8) @@ -674,7 +634,7 @@ s32 EnTk_ChooseReward(EnTk *this) return reward; } -void EnTk_Dig_Eff(EnTk *this) +void EnTk_DigEff(EnTk *this) { Vec3f pos = {0.f, 0.f, 0.f}; Vec3f speed = {0.f, 0.f, 0.f}; @@ -686,7 +646,7 @@ void EnTk_Dig_Eff(EnTk *this) pos.x = (Math_Rand_ZeroOne() - 0.5f) * 12.f + this->v3f_304.x; pos.y = (Math_Rand_ZeroOne() - 0.5f) * 8.f + this->v3f_304.y; pos.z = (Math_Rand_ZeroOne() - 0.5f) * 12.f + this->v3f_304.z; - EnTk_Eff_CreateDflt(this, &pos, 12, 0.2f, 0.1f, 0.f); + EnTkEff_CreateDflt(this, &pos, 12, 0.2f, 0.1f, 0.f); } } @@ -723,7 +683,7 @@ void EnTk_Init(Actor *this, GlobalContext *ctxt) tk->actor.gravity = -0.1f; tk->current_reward = -1; tk->current_spot = NULL; - tk->action_func = EnTk_Stop_Update; + tk->action_func = EnTk_Rest; } void EnTk_Destroy(Actor *this, GlobalContext *ctxt) @@ -732,7 +692,7 @@ void EnTk_Destroy(Actor *this, GlobalContext *ctxt) ActorCollider_FreeCylinder(ctxt, &tk->collider); } -void EnTk_Stop_Update(EnTk *this, GlobalContext *ctxt) +void EnTk_Rest(EnTk *this, GlobalContext *ctxt) { s16 v1; s16 a1_; @@ -745,9 +705,9 @@ void EnTk_Stop_Update(EnTk *this, GlobalContext *ctxt) if (this->h_1E0 == 2) { - EnTk_Dig(this, ctxt); + EnTk_DigAnim(this, ctxt); this->h_1E0 = 0; - this->action_func = EnTk_Dig_Update; + this->action_func = EnTk_Dig; return; } @@ -777,8 +737,8 @@ void EnTk_Stop_Update(EnTk *this, GlobalContext *ctxt) } else if (DECR(this->action_countdown) == 0) { - EnTk_Walk(this, ctxt); - this->action_func = EnTk_Walk_Update; + EnTk_WalkAnim(this, ctxt); + this->action_func = EnTk_Walk; /*! @bug v1 is uninitialized past this branch */ } @@ -791,13 +751,13 @@ void EnTk_Stop_Update(EnTk *this, GlobalContext *ctxt) Math_SmoothScaleMaxMinS(&this->head_rot, a1_, 6, 1000, 1); } -void EnTk_Walk_Update(EnTk *this, GlobalContext *ctxt) +void EnTk_Walk(EnTk *this, GlobalContext *ctxt) { if (this->h_1E0 == 2) { - EnTk_Dig(this, ctxt); + EnTk_DigAnim(this, ctxt); this->h_1E0 = 0; - this->action_func = EnTk_Dig_Update; + this->action_func = EnTk_Dig; } else { @@ -809,13 +769,13 @@ void EnTk_Walk_Update(EnTk *this, GlobalContext *ctxt) DECR(this->action_countdown); if (EnTk_CheckFacingPlayer(this) != 0 || this->action_countdown == 0) { - EnTk_Stop(this, ctxt); - this->action_func = EnTk_Stop_Update; + EnTk_RestAnim(this, ctxt); + this->action_func = EnTk_Rest; } } } -void EnTk_Dig_Update(EnTk *this, GlobalContext *ctxt) +void EnTk_Dig(EnTk *this, GlobalContext *ctxt) { Vec3f reward_origin; Vec3f reward_pos; @@ -828,12 +788,12 @@ void EnTk_Dig_Update(EnTk *this, GlobalContext *ctxt) 0x0006, /* Heart piece */ }; - EnTk_Dig_Eff(this); + EnTk_DigEff(this); if (this->skel_anim.animCurrentFrame == 32.f) { - /* NA_SE_EV_DIG_UP - What's gonna come out? */ - Audio_PlayActorSound2(&this->actor, 0x28C8); + /* What's gonna come out? */ + Audio_PlayActorSound2(&this->actor, NA_SE_EV_DIG_UP); this->reward_timer = 0; @@ -872,19 +832,19 @@ void EnTk_Dig_Update(EnTk *this, GlobalContext *ctxt) /* Play a reward sound shortly after digging */ if (this->valid_dig_here == 0) { - /* NA_SE_SY_ERROR - Bad dig spot */ - Audio_PlayActorSound2(&this->actor, 0x4806); + /* Bad dig spot */ + Audio_PlayActorSound2(&this->actor, NA_SE_SY_ERROR); } else if (this->current_reward == 4) { - /* NA_SE_SY_CORRECT_CHIME - Heart piece */ - Audio_PlaySoundGeneral(0x4802, &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + /* Heart piece */ + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); } else { - /* NA_SE_SY_TRE_BOX_APPEAR - Rupee */ - Audio_PlayActorSound2(&this->actor, 0x4807); + /* Rupee */ + Audio_PlayActorSound2(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); } } this->reward_timer++; @@ -901,11 +861,11 @@ void EnTk_Dig_Update(EnTk *this, GlobalContext *ctxt) func_80106CCC(ctxt); } - EnTk_Stop(this, ctxt); + EnTk_RestAnim(this, ctxt); this->current_reward = -1; this->valid_dig_here = 0; - this->action_func = EnTk_Stop_Update; + this->action_func = EnTk_Rest; } } @@ -925,7 +885,7 @@ void EnTk_Update(Actor *this, GlobalContext *ctxt) tk->action_func(tk, ctxt); - EnTk_Eff_Update(tk); + EnTkEff_Update(tk); EnTk_UpdateEyes(tk); } @@ -1003,7 +963,7 @@ void EnTk_Draw(Actor *this, GlobalContext *ctxt) Gfx *pgdl[4]; Matrix_Push(); - EnTk_Eff_Draw(tk, ctxt); + EnTkEff_Draw(tk, ctxt); Matrix_Pull(); gfx = ctxt->state.gfxCtx; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/src/overlays/actors/ovl_En_Tk/z_en_tk.h index 22c8ae5d46..52a1f357b5 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -27,7 +27,6 @@ struct EnTk { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skel_anim; - /* 0x018C */ char unk_18C[0x4]; /* 0x0190 */ EnTkFunc *action_func; /* 0x0194 */ ColliderCylinderMain collider; From 8e5c9e78e4fd05f6bd49e1121d7c74b88aef8507 Mon Sep 17 00:00:00 2001 From: glank Date: Thu, 19 Mar 2020 23:00:39 +0100 Subject: [PATCH 03/33] Remove uses of VEC3_ADD --- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 9a8208b7a6..0f102ba52d 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -97,8 +97,12 @@ void EnTkEff_Update(EnTk *this) } eff->accel.x = Math_Rand_ZeroOne() * 0.4f - 0.2f; eff->accel.z = Math_Rand_ZeroOne() * 0.4f - 0.2f; - VEC3_ADD(eff->pos, eff->speed) - VEC3_ADD(eff->speed, eff->accel) + eff->pos.x += eff->speed.x; + eff->pos.y += eff->speed.y; + eff->pos.z += eff->speed.z; + eff->speed.x += eff->accel.x; + eff->speed.y += eff->accel.y; + eff->speed.z += eff->accel.z; eff->size += eff->growth; } eff++; @@ -806,7 +810,9 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt) Matrix_RotateY(this->actor.shape.rot.y, 0); Matrix_MultVec3f(&reward_origin, &reward_pos); - VEC3_ADD(reward_pos, this->actor.posRot.pos) + reward_pos.x += this->actor.posRot.pos.x; + reward_pos.y += this->actor.posRot.pos.y; + reward_pos.z += this->actor.posRot.pos.z; this->current_reward = EnTk_ChooseReward(this); if (this->current_reward == 3) From 882a7ba1f5d774e4bc3ac399323d67d577a5659a Mon Sep 17 00:00:00 2001 From: glank Date: Sat, 21 Mar 2020 12:20:43 +0100 Subject: [PATCH 04/33] Move Path to z64scene.h --- include/z64.h | 6 ------ include/z64scene.h | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/z64.h b/include/z64.h index 2f88d43405..aedfd8306b 100644 --- a/include/z64.h +++ b/include/z64.h @@ -806,12 +806,6 @@ typedef struct /* 0x01 */ u8 room; } EntranceEntry; -typedef struct -{ - /* 0x00 */ u8 n_points; - /* 0x04 */ Vec3s* point_array; -} Path; // size = 0x8 - typedef struct { /* 0x00 */ u32 vromStart; diff --git a/include/z64scene.h b/include/z64scene.h index 313565444a..46b208faef 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -303,6 +303,12 @@ typedef struct } MeshHeader2; +typedef struct +{ + /* 0x00 */ u8 nPoints; + /* 0x04 */ Vec3s* pointArray; +} Path; // size = 0x8 + typedef struct { u8 ambientClrR, ambientClrG, ambientClrB; From 8bea82f0414d635da3d8505f0509807b37fd4ace Mon Sep 17 00:00:00 2001 From: glank Date: Sat, 21 Mar 2020 12:16:23 +0100 Subject: [PATCH 05/33] Make variable names uglier and less readable --- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 244 ++++++++++++------------ src/overlays/actors/ovl_En_Tk/z_en_tk.h | 30 +-- 2 files changed, 137 insertions(+), 137 deletions(-) diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 0f102ba52d..ffaa51f375 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -69,7 +69,7 @@ void EnTkEff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel, { eff->size = size; eff->growth = growth; - eff->time_total = eff->time_left = duration; + eff->timeTotal = eff->timeLeft = duration; eff->active = 1; eff->pos = *pos; eff->accel = *accel; @@ -90,8 +90,8 @@ void EnTkEff_Update(EnTk *this) { if (eff->active != 0) { - eff->time_left--; - if (eff->time_left == 0) + eff->timeLeft--; + if (eff->timeLeft == 0) { eff->active = 0; } @@ -125,10 +125,10 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) EnTkEff *eff = this->eff; GraphicsContext *gfx; - s16 gfx_setup; + s16 gfxSetup; s16 i; s16 alpha; - s16 image_idx; + s16 imageIdx; Gfx *pgdl[4]; /* @@ -139,7 +139,7 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) gfx = ctxt->state.gfxCtx; func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk_eff.c", 114); - gfx_setup = 0; + gfxSetup = 0; /* * Same code is generated without the if, @@ -151,15 +151,15 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) { if (eff->active != 0) { - if (gfx_setup == 0) + if (gfxSetup == 0) { gfx->polyXlu.p = func_80093774(gfx->polyXlu.p, 0); gSPDisplayList(gfx->polyXlu.p++, &D_0600BC90); gDPSetEnvColor(gfx->polyXlu.p++, 0x64, 0x3C, 0x14, 0x00); - gfx_setup = 1; + gfxSetup = 1; } - alpha = eff->time_left * (255.f / eff->time_total); + alpha = eff->timeLeft * (255.f / eff->timeTotal); gDPSetPrimColor(gfx->polyXlu.p++, 0, 0, 0xAA, 0x82, 0x5A, alpha); gDPPipeSync(gfx->polyXlu.p++); @@ -171,10 +171,10 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) 140), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - image_idx = eff->time_left * - ((f32)ARRAY_COUNT(images) / eff->time_total); + imageIdx = eff->timeLeft * + ((f32)ARRAY_COUNT(images) / eff->timeTotal); gSPSegment(gfx->polyXlu.p++, 0x08, - SEGMENTED_TO_VIRTUAL(images[image_idx])); + SEGMENTED_TO_VIRTUAL(images[imageIdx])); gSPDisplayList(gfx->polyXlu.p++, &D_0600BCA0); } @@ -185,12 +185,12 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) } s32 EnTkEff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size, - f32 growth, f32 y_accel_max) + f32 growth, f32 yAccelMax) { Vec3f speed = {0.f, 0.f, 0.f}; Vec3f accel = {0.f, 0.3f, 0.f}; - accel.y += Math_Rand_ZeroOne() * y_accel_max; + accel.y += Math_Rand_ZeroOne() * yAccelMax; EnTkEff_Create(this, pos, &speed, &accel, duration, size, growth); @@ -225,11 +225,11 @@ void EnTk_RestAnim(EnTk *this, GlobalContext *ctxt) { UNK_PTR anim = &D_06002F84; - SkelAnime_ChangeAnimation(&this->skel_anim, (u32)anim, 1.f, 0.f, + SkelAnime_ChangeAnimation(&this->skelAnim, (u32)anim, 1.f, 0.f, SkelAnime_GetFrameCount((u32)&D_06002F84), 0, -10.f); - this->action_countdown = Math_Rand_S16Offset(60, 60); + this->actionCountdown = Math_Rand_S16Offset(60, 60); this->actor.speedXZ = 0.f; } @@ -237,45 +237,45 @@ void EnTk_WalkAnim(EnTk *this, GlobalContext *ctxt) { UNK_PTR anim = &D_06001FA8; - SkelAnime_ChangeAnimation(&this->skel_anim, (u32)anim, 1.f, 0.f, + SkelAnime_ChangeAnimation(&this->skelAnim, (u32)anim, 1.f, 0.f, SkelAnime_GetFrameCount((u32)&D_06002F84), 0, -10.f); - this->action_countdown = Math_Rand_S16Offset(240, 240); + this->actionCountdown = Math_Rand_S16Offset(240, 240); } void EnTk_DigAnim(EnTk *this, GlobalContext *ctxt) { UNK_PTR anim = &D_06001144; - SkelAnime_ChangeAnimation(&this->skel_anim, (u32)anim, 1.f, 0.f, + SkelAnime_ChangeAnimation(&this->skelAnim, (u32)anim, 1.f, 0.f, SkelAnime_GetFrameCount((u32)&D_06001144), 0, -10.f); if (EnTk_CheckNextSpot(this, ctxt) >= 0) { - this->valid_dig_here = 1; + this->validDigHere = 1; } } void EnTk_UpdateEyes(EnTk *this) { - if (DECR(this->blink_countdown) == 0) + if (DECR(this->blinkCountdown) == 0) { - this->eye_image_idx++; - if (this->eye_image_idx > 2) + this->eyeImageIdx++; + if (this->eyeImageIdx > 2) { - this->blink_cycles--; - if (this->blink_cycles < 0) + this->blinkCycles--; + if (this->blinkCycles < 0) { - this->blink_countdown = Math_Rand_S16Offset(30, 30); - this->blink_cycles = 2; + this->blinkCountdown = Math_Rand_S16Offset(30, 30); + this->blinkCycles = 2; if (Math_Rand_ZeroOne() > 0.5f) { - this->blink_cycles++; + this->blinkCycles++; } } - this->eye_image_idx = 0; + this->eyeImageIdx = 0; } } } @@ -292,7 +292,7 @@ s32 EnTk_CheckFacingPlayer(EnTk *this) v0 = this->actor.shape.rot.y; v0 -= this->h_21E; - v0 -= this->head_rot; + v0 -= this->headRot; v1 = this->actor.rotTowardsLinkY - v0; if (ABS(v1) < 0x1554) @@ -321,7 +321,7 @@ s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *ctxt) continue; } - if (prop == this->current_spot) + if (prop == this->currentSpot) { prop = prop->next; continue; @@ -335,7 +335,7 @@ s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *ctxt) continue; } - this->current_spot = prop; + this->currentSpot = prop; return prop->params; } @@ -347,49 +347,49 @@ void EnTk_CheckCurrentSpot(EnTk *this) f32 dxz; f32 dy; - if (this->current_spot != NULL) + if (this->currentSpot != NULL) { - dy = this->current_spot->posRot.pos.y - this->actor.unk_80; - dxz = func_8002DB8C(&this->actor, this->current_spot); + dy = this->currentSpot->posRot.pos.y - this->actor.unk_80; + dxz = func_8002DB8C(&this->actor, this->currentSpot); if (dxz > 40.f || dy > 10.f) { - this->current_spot = NULL; + this->currentSpot = NULL; } } } f32 EnTk_Step(EnTk *this, GlobalContext *ctxt) { - f32 step_frames[] = {36.f, 10.f}; + f32 stepFrames[] = {36.f, 10.f}; f32 a1_; s32 i; - if (this->skel_anim.animCurrentFrame == 0.f || - this->skel_anim.animCurrentFrame == 25.f) + if (this->skelAnim.animCurrentFrame == 0.f || + this->skelAnim.animCurrentFrame == 25.f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK); } - if (this->skel_anim.animCurrent != (u32)&D_06001FA8) + if (this->skelAnim.animCurrent != (u32)&D_06001FA8) { return 0.f; } - a1_ = this->skel_anim.animCurrentFrame; - for (i = 0; i < ARRAY_COUNT(step_frames); i++) + a1_ = this->skelAnim.animCurrentFrame; + for (i = 0; i < ARRAY_COUNT(stepFrames); i++) { - if (a1_ < step_frames[i] + 12.f && a1_ >= step_frames[i]) + if (a1_ < stepFrames[i] + 12.f && a1_ >= stepFrames[i]) { break; } } - if (i >= ARRAY_COUNT(step_frames)) + if (i >= ARRAY_COUNT(stepFrames)) { return 0.f; } else { - a1_ = (0x8000 / 12.f) * (a1_ - step_frames[i]); + a1_ = (0x8000 / 12.f) * (a1_ - stepFrames[i]); return Math_Sins(a1_) * 2.f; } } @@ -407,8 +407,8 @@ s32 EnTk_Orient(EnTk *this, GlobalContext *ctxt) } path = &ctxt->setupPathList[0]; - point = SEGMENTED_TO_VIRTUAL(path->point_array); - point += this->current_waypoint; + point = SEGMENTED_TO_VIRTUAL(path->pointArray); + point += this->currentWaypoint; dx = point->x - this->actor.posRot.pos.x; dz = point->z - this->actor.posRot.pos.z; @@ -420,10 +420,10 @@ s32 EnTk_Orient(EnTk *this, GlobalContext *ctxt) if (SQ(dx) + SQ(dz) < 10.f) { - this->current_waypoint++; - if (this->current_waypoint >= path->n_points) + this->currentWaypoint++; + if (this->currentWaypoint >= path->nPoints) { - this->current_waypoint = 0; + this->currentWaypoint = 0; } return 0; @@ -570,69 +570,69 @@ s32 EnTk_ChooseReward(EnTk *this) { case 0: { - if (this->reward_count[0] < 8) + if (this->rewardCount[0] < 8) { - this->reward_count[0] += 1; + this->rewardCount[0] += 1; return reward; } break; } case 1: { - if (this->reward_count[1] < 4) + if (this->rewardCount[1] < 4) { - this->reward_count[1] += 1; + this->rewardCount[1] += 1; return reward; } break; } case 2: { - if (this->reward_count[2] < 2) + if (this->rewardCount[2] < 2) { - this->reward_count[2] += 1; + this->rewardCount[2] += 1; return reward; } break; } case 3: { - if (this->reward_count[3] < 1) + if (this->rewardCount[3] < 1) { - this->reward_count[3] += 1; + this->rewardCount[3] += 1; return reward; } break; } } - if (this->reward_count[0] < 8) + if (this->rewardCount[0] < 8) { - this->reward_count[0] += 1; + this->rewardCount[0] += 1; reward = 0; } - else if (this->reward_count[1] < 4) + else if (this->rewardCount[1] < 4) { - this->reward_count[1] += 1; + this->rewardCount[1] += 1; reward = 1; } - else if (this->reward_count[2] < 2) + else if (this->rewardCount[2] < 2) { - this->reward_count[2] += 1; + this->rewardCount[2] += 1; reward = 2; } - else if (this->reward_count[3] < 1) + else if (this->rewardCount[3] < 1) { - this->reward_count[3] += 1; + this->rewardCount[3] += 1; reward = 3; } else { reward = 0; - this->reward_count[0] = 1; - this->reward_count[1] = 0; - this->reward_count[2] = 0; - this->reward_count[3] = 0; + this->rewardCount[0] = 1; + this->rewardCount[1] = 0; + this->rewardCount[2] = 0; + this->rewardCount[3] = 0; } return reward; @@ -644,8 +644,8 @@ void EnTk_DigEff(EnTk *this) Vec3f speed = {0.f, 0.f, 0.f}; Vec3f accel = {0.f, 0.3f, 0.f}; - if (this->skel_anim.animCurrentFrame >= 32.f && - this->skel_anim.animCurrentFrame < 40.f) + if (this->skelAnim.animCurrentFrame >= 32.f && + this->skelAnim.animCurrentFrame < 40.f) { pos.x = (Math_Rand_ZeroOne() - 0.5f) * 12.f + this->v3f_304.x; pos.y = (Math_Rand_ZeroOne() - 0.5f) * 8.f + this->v3f_304.y; @@ -661,9 +661,9 @@ void EnTk_Init(Actor *this, GlobalContext *ctxt) ActorShape_Init(&tk->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.f); - func_800A46F8(ctxt, &tk->skel_anim, (u32)&D_0600BE40, 0, tk->hz_22A, + func_800A46F8(ctxt, &tk->skelAnim, (u32)&D_0600BE40, 0, tk->hz_22A, tk->hz_296, 18); - SkelAnime_ChangeAnimation(&tk->skel_anim, (u32)anim, 1.f, 0.f, + SkelAnime_ChangeAnimation(&tk->skelAnim, (u32)anim, 1.f, 0.f, SkelAnime_GetFrameCount((u32)&D_06002F84), 0, 0.f); @@ -685,9 +685,9 @@ void EnTk_Init(Actor *this, GlobalContext *ctxt) tk->actor.unk_1F = 6; tk->actor.gravity = -0.1f; - tk->current_reward = -1; - tk->current_spot = NULL; - tk->action_func = EnTk_Rest; + tk->currentReward = -1; + tk->currentSpot = NULL; + tk->actionFunc = EnTk_Rest; } void EnTk_Destroy(Actor *this, GlobalContext *ctxt) @@ -711,7 +711,7 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt) { EnTk_DigAnim(this, ctxt); this->h_1E0 = 0; - this->action_func = EnTk_Dig; + this->actionFunc = EnTk_Dig; return; } @@ -725,7 +725,7 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt) v1 -= this->h_21E; v1 = this->actor.rotTowardsLinkY - v1; - this->action_countdown = 0; + this->actionCountdown = 0; func_800343CC(ctxt, &this->actor, &this->h_1E0, this->collider.dim.radius + 30.f, func_80B1C54C, func_80B1C5A0); @@ -736,13 +736,13 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt) v1 -= this->h_21E; v1 = this->actor.rotTowardsLinkY - v1; - this->action_countdown = 0; + this->actionCountdown = 0; this->h_1E0 = 1; } - else if (DECR(this->action_countdown) == 0) + else if (DECR(this->actionCountdown) == 0) { EnTk_WalkAnim(this, ctxt); - this->action_func = EnTk_Walk; + this->actionFunc = EnTk_Walk; /*! @bug v1 is uninitialized past this branch */ } @@ -752,7 +752,7 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt) } a1_ = CLAMP(-v1, 1270, 10730); - Math_SmoothScaleMaxMinS(&this->head_rot, a1_, 6, 1000, 1); + Math_SmoothScaleMaxMinS(&this->headRot, a1_, 6, 1000, 1); } void EnTk_Walk(EnTk *this, GlobalContext *ctxt) @@ -761,29 +761,29 @@ void EnTk_Walk(EnTk *this, GlobalContext *ctxt) { EnTk_DigAnim(this, ctxt); this->h_1E0 = 0; - this->action_func = EnTk_Dig; + this->actionFunc = EnTk_Dig; } else { this->actor.speedXZ = EnTk_Step(this, ctxt); EnTk_Orient(this, ctxt); - Math_SmoothScaleMaxMinS(&this->head_rot, 0, 6, 1000, 1); + Math_SmoothScaleMaxMinS(&this->headRot, 0, 6, 1000, 1); EnTk_CheckCurrentSpot(this); - DECR(this->action_countdown); - if (EnTk_CheckFacingPlayer(this) != 0 || this->action_countdown == 0) + DECR(this->actionCountdown); + if (EnTk_CheckFacingPlayer(this) != 0 || this->actionCountdown == 0) { EnTk_RestAnim(this, ctxt); - this->action_func = EnTk_Rest; + this->actionFunc = EnTk_Rest; } } } void EnTk_Dig(EnTk *this, GlobalContext *ctxt) { - Vec3f reward_origin; - Vec3f reward_pos; - s32 reward_params[] = + Vec3f rewardOrigin; + Vec3f rewardPos; + s32 rewardParams[] = { 0x0000, /* Green rupee */ 0x0001, /* Blue rupee */ @@ -794,28 +794,28 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt) EnTk_DigEff(this); - if (this->skel_anim.animCurrentFrame == 32.f) + if (this->skelAnim.animCurrentFrame == 32.f) { /* What's gonna come out? */ Audio_PlayActorSound2(&this->actor, NA_SE_EV_DIG_UP); - this->reward_timer = 0; + this->rewardTimer = 0; - if (this->valid_dig_here == 1) + if (this->validDigHere == 1) { - reward_origin.x = 0.f; - reward_origin.y = 0.f; - reward_origin.z = -40.f; + rewardOrigin.x = 0.f; + rewardOrigin.y = 0.f; + rewardOrigin.z = -40.f; Matrix_RotateY(this->actor.shape.rot.y, 0); - Matrix_MultVec3f(&reward_origin, &reward_pos); + Matrix_MultVec3f(&rewardOrigin, &rewardPos); - reward_pos.x += this->actor.posRot.pos.x; - reward_pos.y += this->actor.posRot.pos.y; - reward_pos.z += this->actor.posRot.pos.z; + rewardPos.x += this->actor.posRot.pos.x; + rewardPos.y += this->actor.posRot.pos.y; + rewardPos.z += this->actor.posRot.pos.z; - this->current_reward = EnTk_ChooseReward(this); - if (this->current_reward == 3) + this->currentReward = EnTk_ChooseReward(this); + if (this->currentReward == 3) { /* * Upgrade the purple rupee reward to the heart piece if this @@ -824,24 +824,24 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt) if ((gSaveContext.item_get_inf[1] & 0x1000) == 0) { gSaveContext.item_get_inf[1] |= 0x1000; - this->current_reward = 4; + this->currentReward = 4; } } - Item_DropCollectible(ctxt, &reward_pos, - reward_params[this->current_reward]); + Item_DropCollectible(ctxt, &rewardPos, + rewardParams[this->currentReward]); } } - if (this->skel_anim.animCurrentFrame >= 32.f && this->reward_timer == 10) + if (this->skelAnim.animCurrentFrame >= 32.f && this->rewardTimer == 10) { /* Play a reward sound shortly after digging */ - if (this->valid_dig_here == 0) + if (this->validDigHere == 0) { /* Bad dig spot */ Audio_PlayActorSound2(&this->actor, NA_SE_SY_ERROR); } - else if (this->current_reward == 4) + else if (this->currentReward == 4) { /* Heart piece */ Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, @@ -853,11 +853,11 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt) Audio_PlayActorSound2(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); } } - this->reward_timer++; + this->rewardTimer++; - if (func_800A56C8(&this->skel_anim, this->skel_anim.animFrameCount) != 0) + if (func_800A56C8(&this->skelAnim, this->skelAnim.animFrameCount) != 0) { - if (this->current_reward < 0) + if (this->currentReward < 0) { /* "Nope, nothing here!" */ func_8010B680(ctxt, 0x501A, 0); @@ -869,9 +869,9 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt) EnTk_RestAnim(this, ctxt); - this->current_reward = -1; - this->valid_dig_here = 0; - this->action_func = EnTk_Rest; + this->currentReward = -1; + this->validDigHere = 0; + this->actionFunc = EnTk_Rest; } } @@ -883,13 +883,13 @@ void EnTk_Update(Actor *this, GlobalContext *ctxt) ActorCollider_Cylinder_Update(&tk->actor, collider); Actor_CollisionCheck_SetOT(ctxt, &ctxt->sub_11E60, collider); - SkelAnime_FrameUpdateMatrix(&tk->skel_anim); + SkelAnime_FrameUpdateMatrix(&tk->skelAnim); Actor_MoveForward(&tk->actor); func_8002E4B4(ctxt, &tk->actor, 40.f, 10.f, 0.f, 5); - tk->action_func(tk, ctxt); + tk->actionFunc(tk, ctxt); EnTkEff_Update(tk); @@ -926,7 +926,7 @@ s32 func_80B1D278(s16 a0, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Vec3s *sp10, case 16: { tk->h_21E += sp10->y; - sp10->y += tk->head_rot; + sp10->y += tk->headRot; break; } } @@ -957,7 +957,7 @@ void func_80B1D2E4(GlobalContext *ctxt, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, void EnTk_Draw(Actor *this, GlobalContext *ctxt) { - static u32 eye_images[] = + static u32 eyeImages[] = { (u32)&D_06003B40, (u32)&D_06004340, @@ -978,10 +978,10 @@ void EnTk_Draw(Actor *this, GlobalContext *ctxt) func_80093D18(ctxt->state.gfxCtx); gSPSegment(gfx->polyOpa.p++, 0x08, - SEGMENTED_TO_VIRTUAL(eye_images[tk->eye_image_idx])); + SEGMENTED_TO_VIRTUAL(eyeImages[tk->eyeImageIdx])); - func_800A1AC8(ctxt, tk->skel_anim.limbIndex, - tk->skel_anim.actorDrawTbl, tk->skel_anim.dListCount, + func_800A1AC8(ctxt, tk->skelAnim.limbIndex, + tk->skelAnim.actorDrawTbl, tk->skelAnim.dListCount, func_80B1D278, func_80B1D2E4, &tk->actor); func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1312); diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/src/overlays/actors/ovl_En_Tk/z_en_tk.h index 52a1f357b5..f35741d3f4 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -8,8 +8,8 @@ typedef struct { /* 0x0000 */ u8 active; - /* 0x0001 */ u8 time_left; - /* 0x0002 */ u8 time_total; + /* 0x0001 */ u8 timeLeft; + /* 0x0002 */ u8 timeTotal; /* 0x0004 */ f32 size; /* 0x0008 */ f32 growth; /* 0x000C */ char unk_C[0x8]; @@ -26,25 +26,25 @@ typedef void EnTkFunc(EnTk *this, GlobalContext *ctxt); struct EnTk { /* 0x0000 */ Actor actor; - /* 0x014C */ SkelAnime skel_anim; - /* 0x0190 */ EnTkFunc *action_func; + /* 0x014C */ SkelAnime skelAnim; + /* 0x0190 */ EnTkFunc *actionFunc; /* 0x0194 */ ColliderCylinderMain collider; /* 0x01E0 */ s16 h_1E0; /* 0x01E2 */ char unk_1E2[0x26]; - /* 0x0208 */ u8 valid_dig_here; - /* 0x0209 */ u8 reward_count[4]; - /* 0x0210 */ Actor *current_spot; - /* 0x0214 */ s32 current_reward; - /* 0x0218 */ s16 blink_cycles; - /* 0x021A */ s16 reward_timer; - /* 0x021C */ s16 action_countdown; + /* 0x0208 */ u8 validDigHere; + /* 0x0209 */ u8 rewardCount[4]; + /* 0x0210 */ Actor *currentSpot; + /* 0x0214 */ s32 currentReward; + /* 0x0218 */ s16 blinkCycles; + /* 0x021A */ s16 rewardTimer; + /* 0x021C */ s16 actionCountdown; /* 0x021E */ s16 h_21E; /* 0x0220 */ char unk_220[0x2]; - /* 0x0222 */ s16 eye_image_idx; - /* 0x0224 */ s16 blink_countdown; - /* 0x0226 */ s16 head_rot; - /* 0x0228 */ s16 current_waypoint; + /* 0x0222 */ s16 eyeImageIdx; + /* 0x0224 */ s16 blinkCountdown; + /* 0x0226 */ s16 headRot; + /* 0x0228 */ s16 currentWaypoint; /* 0x022A */ u16 hz_22A[54]; /* 0x022A */ u16 hz_296[55]; /* 0x0304 */ Vec3f v3f_304; From f374ac8d2bea87dbfeb3fc263c2e654aa96be4c0 Mon Sep 17 00:00:00 2001 From: Lucas Shaw Date: Sat, 21 Mar 2020 11:54:45 -0700 Subject: [PATCH 06/33] started ovl_bg_toki_swd --- .../actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s | 2 +- ...unc_808BAE40.s => BgTokiSwd_SetupAction.s} | 2 +- .../actors/ovl_Bg_Toki_Swd/func_808BAF40.s | 2 +- .../actors/ovl_Bg_Toki_Swd/func_808BB0AC.s | 2 +- .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 130 ++++++++++++++++-- .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h | 3 +- undefined_syms.txt | 5 +- 7 files changed, 131 insertions(+), 15 deletions(-) rename asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/{func_808BAE40.s => BgTokiSwd_SetupAction.s} (83%) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s index b1e064bbbb..6f6709d681 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s @@ -13,7 +13,7 @@ glabel BgTokiSwd_Init /* 00030 808BAE70 3C05808C */ lui $a1, %hi(func_808BAF40) ## $a1 = 808C0000 /* 00034 808BAE74 24A5AF40 */ addiu $a1, $a1, %lo(func_808BAF40) ## $a1 = 808BAF40 /* 00038 808BAE78 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0003C 808BAE7C 0C22EB90 */ jal func_808BAE40 +/* 0003C 808BAE7C 0C22EB90 */ jal BgTokiSwd_SetupAction /* 00040 808BAE80 E60400BC */ swc1 $f4, 0x00BC($s0) ## 000000BC /* 00044 808BAE84 3C028016 */ lui $v0, 0x8016 ## $v0 = 80160000 /* 00048 808BAE88 2442E660 */ addiu $v0, $v0, 0xE660 ## $v0 = 8015E660 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAE40.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s similarity index 83% rename from asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAE40.s rename to asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s index cf2c1d0e52..9d8f50b116 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAE40.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s @@ -1,4 +1,4 @@ -glabel func_808BAE40 +glabel BgTokiSwd_SetupAction /* 00000 808BAE40 03E00008 */ jr $ra /* 00004 808BAE44 AC85014C */ sw $a1, 0x014C($a0) ## 0000014C diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s index 9a2cf736a8..ce23b22d65 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s @@ -71,7 +71,7 @@ glabel func_808BAF40 /* 001F8 808BB038 A2191414 */ sb $t9, 0x1414($s0) ## 8015FA74 /* 001FC 808BB03C 3C05808C */ lui $a1, %hi(func_808BB0AC) ## $a1 = 808C0000 /* 00200 808BB040 24A5B0AC */ addiu $a1, $a1, %lo(func_808BB0AC) ## $a1 = 808BB0AC -/* 00204 808BB044 0C22EB90 */ jal func_808BAE40 +/* 00204 808BB044 0C22EB90 */ jal BgTokiSwd_SetupAction /* 00208 808BB048 AC800118 */ sw $zero, 0x0118($a0) ## 00000118 /* 0020C 808BB04C 10000008 */ beq $zero, $zero, .L808BB070 /* 00210 808BB050 8E081360 */ lw $t0, 0x1360($s0) ## 8015F9C0 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s index 714956b3c3..1a0c1c6d90 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s @@ -22,7 +22,7 @@ glabel func_808BB0AC /* 002B4 808BB0F4 AC8F0134 */ sw $t7, 0x0134($a0) ## 00000134 .L808BB0F8: /* 002B8 808BB0F8 3C05808C */ lui $a1, %hi(func_808BB128) ## $a1 = 808C0000 -/* 002BC 808BB0FC 0C22EB90 */ jal func_808BAE40 +/* 002BC 808BB0FC 0C22EB90 */ jal BgTokiSwd_SetupAction /* 002C0 808BB100 24A5B128 */ addiu $a1, $a1, %lo(func_808BB128) ## $a1 = 808BB128 /* 002C4 808BB104 10000005 */ beq $zero, $zero, .L808BB11C /* 002C8 808BB108 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 4b75128177..57823bf2e0 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -7,7 +7,8 @@ void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx); void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx); void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx); void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx); - +void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx); +void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx); /* const ActorInit Bg_Toki_Swd_InitVars = { @@ -23,18 +24,129 @@ const ActorInit Bg_Toki_Swd_InitVars = (ActorFunc)BgTokiSwd_Draw, }; */ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAE40.s") +//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s") +void BgTokiSwd_SetupAction(BgTokiSwd* this, ActorFunc actionFunc) +{ + this->actionFunc = actionFunc; +} +//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s") +extern InitChainEntry D_808BC414; +extern ColliderCylinderInit D_808BC3E0; +extern SubActor98Init D_808BC40C; +void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) +{ + ColliderCylinderMain* collision; + Actor* thisx = &this->actor; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Destroy.s") + Actor_ProcessInitChain(thisx, &D_808BC414); + this->actor.shape.unk_08 = 800.0f; + BgTokiSwd_SetupAction(thisx, &func_808BAF40); + collision = &this->collider; + if (LINK_IS_ADULT) + { + thisx->draw = NULL; + } + if (gSaveContext.scene_setup_index == 5) + { + globalCtx->unk_11D30[0] = 0xFF; + } + ActorCollider_AllocCylinder(globalCtx, collision); + ActorCollider_InitCylinder(globalCtx, collision, thisx, &D_808BC3E0); + ActorCollider_Cylinder_Update(thisx, collision); + func_80061ED4(&thisx->sub_98, 0, &D_808BC40C); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s") +//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Destroy.s") +void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx) +{ + ColliderCylinderMain* collider = &this->collider; + ActorCollider_FreeCylinder(globalCtx, collider); +} +//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s") +extern D_808BBD90; +extern D_808BB2F0; +extern D_808BB7A0; +void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) +{ + if (((gSaveContext.event_chk_inf[4] & 0x8000) == 0) && (gSaveContext.scene_setup_index < 4) && + (func_8002E12C(&this->actor, 800.0f, 0x7530) != 0) && (func_800BFC84(globalCtx) == 0)) + { + gSaveContext.event_chk_inf[4] |= 0x8000; + globalCtx->csCtx.segment = &D_808BBD90; + gSaveContext.cutscene_trigger = 1; + } + if (LINK_IS_CHILD || ((gSaveContext.event_chk_inf[5] & 0x20) != 0)) + { + if (func_8002F410(&this->actor, globalCtx) != 0) + { + if (LINK_IS_CHILD) + { + Item_Give(globalCtx, 0x3C); + globalCtx->csCtx.segment = &D_808BB2F0; + } + else + { + globalCtx->csCtx.segment = &D_808BB7A0; + } + Audio_SetBGM(NA_BGM_STOP); + Audio_SetBGM(NA_SE_PL_BOUND_DIRT); + gSaveContext.cutscene_trigger = (u8)1; + this->actor.attachedA = 0; + BgTokiSwd_SetupAction(this, &func_808BB0AC); + } + else + { + if (func_8002E084(&this->actor, 0x2000) != 0) + { + func_8002F580(&this->actor, globalCtx); + } + } + } + if (gSaveContext.scene_setup_index == 5) + { + if (globalCtx->unk_11D30[0] > 0) + { + globalCtx->unk_11D30[0] = globalCtx->unk_11D30[0] - 1; + return; + } + globalCtx->unk_11D30[0] = 0; + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB128.s") +//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB128.s") +void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) +{ + if ((func_8006C4A4(globalCtx, 1) != 0) && (globalCtx->unk_11D30[0] < 0xFF)) + { + globalCtx->unk_11D30[0] = globalCtx->unk_11D30[0] + 5; + } +} +//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Update.s") +void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx) +{ + this->actionFunc(&this->actor, globalCtx); + Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); +} +//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Draw.s") +extern char D_808BC420[]; +extern char D_808BC434[]; +extern D_06001BD0; +extern char D_808BC448[]; +void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx) { + Gfx* gfxArr[7]; + GraphicsContext* gfxCtx; + + + gfxCtx = globalCtx->state.gfxCtx; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Update.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Draw.s") + func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, &D_808BC420, 0x2D7); + func_80093D18(globalCtx->state.gfxCtx); + func_8002EBCC(&this->actor, globalCtx, 0); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, Draw_TexScroll(globalCtx->state.gfxCtx, 0, -(globalCtx->gameplayFrames & 0x7F), 0x20, 0x20)); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, D_808BC434, 0x2E6), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001BD0); + func_800C6B54(gfxArr, globalCtx->state.gfxCtx, D_808BC448, 0x308); +} diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h index 535268eb27..efc0f885d6 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h @@ -7,7 +7,8 @@ typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x50]; + /* 0x014C */ ActorFunc actionFunc; + /* 0x0150 */ ColliderCylinderMain collider; } BgTokiSwd; // size = 0x019C extern const ActorInit Bg_Toki_Swd_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 92837d0b73..0d5822881d 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -394,4 +394,7 @@ D_06008688 = 0x06008688; D_04049210 = 0x04049210; // z_obj_bombiwa -D_060009E0 = 0x060009E0; \ No newline at end of file +D_060009E0 = 0x060009E0; + +// z_bg_toki_swd +D_06001BD0 = 0x06001BD0; \ No newline at end of file From 9a04a762969dc486f2280d89555fc71d57f57969 Mon Sep 17 00:00:00 2001 From: shawlucas Date: Sat, 21 Mar 2020 14:30:05 -0700 Subject: [PATCH 07/33] ovl_bg_toki_swd OK --- .../ovl_Bg_Toki_Swd/BgTokiSwd_Destroy.s | 14 - .../actors/ovl_Bg_Toki_Swd/BgTokiSwd_Draw.s | 77 ---- .../actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s | 61 --- .../ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s | 5 - .../actors/ovl_Bg_Toki_Swd/BgTokiSwd_Update.s | 22 - .../actors/ovl_Bg_Toki_Swd/func_808BAF40.s | 106 ----- .../actors/ovl_Bg_Toki_Swd/func_808BB0AC.s | 39 -- .../actors/ovl_Bg_Toki_Swd/func_808BB128.s | 26 -- data/overlays/actors/z_bg_toki_swd.data.s | 28 -- data/overlays/actors/z_bg_toki_swd.reloc.s | 11 - data/overlays/actors/z_bg_toki_swd.rodata.s | 23 - spec | 4 +- .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 433 ++++++++++++++++-- 13 files changed, 385 insertions(+), 464 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB128.s delete mode 100644 data/overlays/actors/z_bg_toki_swd.data.s delete mode 100644 data/overlays/actors/z_bg_toki_swd.reloc.s delete mode 100644 data/overlays/actors/z_bg_toki_swd.rodata.s diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Destroy.s deleted file mode 100644 index 00f28795cd..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Destroy.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel BgTokiSwd_Destroy -/* 000D8 808BAF18 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 000DC 808BAF1C 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 000E0 808BAF20 AFBF0014 */ sw $ra, 0x0014($sp) -/* 000E4 808BAF24 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 000E8 808BAF28 0C0170EB */ jal ActorCollider_FreeCylinder - -/* 000EC 808BAF2C 24C50150 */ addiu $a1, $a2, 0x0150 ## $a1 = 00000150 -/* 000F0 808BAF30 8FBF0014 */ lw $ra, 0x0014($sp) -/* 000F4 808BAF34 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 000F8 808BAF38 03E00008 */ jr $ra -/* 000FC 808BAF3C 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Draw.s deleted file mode 100644 index 32b688400d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Draw.s +++ /dev/null @@ -1,77 +0,0 @@ -glabel BgTokiSwd_Draw -/* 00384 808BB1C4 27BDFFA0 */ addiu $sp, $sp, 0xFFA0 ## $sp = FFFFFFA0 -/* 00388 808BB1C8 AFB0001C */ sw $s0, 0x001C($sp) -/* 0038C 808BB1CC 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 00390 808BB1D0 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00394 808BB1D4 AFB10020 */ sw $s1, 0x0020($sp) -/* 00398 808BB1D8 AFA40060 */ sw $a0, 0x0060($sp) -/* 0039C 808BB1DC 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 003A0 808BB1E0 3C06808C */ lui $a2, %hi(D_808BC420) ## $a2 = 808C0000 -/* 003A4 808BB1E4 24C6C420 */ addiu $a2, $a2, %lo(D_808BC420) ## $a2 = 808BC420 -/* 003A8 808BB1E8 27A40038 */ addiu $a0, $sp, 0x0038 ## $a0 = FFFFFFD8 -/* 003AC 808BB1EC 240702D7 */ addiu $a3, $zero, 0x02D7 ## $a3 = 000002D7 -/* 003B0 808BB1F0 0C031AB1 */ jal func_800C6AC4 -/* 003B4 808BB1F4 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 003B8 808BB1F8 0C024F46 */ jal func_80093D18 -/* 003BC 808BB1FC 8E040000 */ lw $a0, 0x0000($s0) ## 00000000 -/* 003C0 808BB200 8FA40060 */ lw $a0, 0x0060($sp) -/* 003C4 808BB204 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 003C8 808BB208 0C00BAF3 */ jal func_8002EBCC -/* 003CC 808BB20C 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 003D0 808BB210 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0 -/* 003D4 808BB214 3C0FDB06 */ lui $t7, 0xDB06 ## $t7 = DB060000 -/* 003D8 808BB218 35EF0020 */ ori $t7, $t7, 0x0020 ## $t7 = DB060020 -/* 003DC 808BB21C 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008 -/* 003E0 808BB220 AE2E02C0 */ sw $t6, 0x02C0($s1) ## 000002C0 -/* 003E4 808BB224 3C060001 */ lui $a2, 0x0001 ## $a2 = 00010000 -/* 003E8 808BB228 00D03021 */ addu $a2, $a2, $s0 -/* 003EC 808BB22C AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 -/* 003F0 808BB230 8CC61DE4 */ lw $a2, 0x1DE4($a2) ## 00011DE4 -/* 003F4 808BB234 8E040000 */ lw $a0, 0x0000($s0) ## 00000000 -/* 003F8 808BB238 24180020 */ addiu $t8, $zero, 0x0020 ## $t8 = 00000020 -/* 003FC 808BB23C 30C6007F */ andi $a2, $a2, 0x007F ## $a2 = 00000000 -/* 00400 808BB240 00063023 */ subu $a2, $zero, $a2 -/* 00404 808BB244 AFB80010 */ sw $t8, 0x0010($sp) -/* 00408 808BB248 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 0040C 808BB24C 24070020 */ addiu $a3, $zero, 0x0020 ## $a3 = 00000020 -/* 00410 808BB250 0C0253A7 */ jal Draw_TexScroll -/* 00414 808BB254 AFA20034 */ sw $v0, 0x0034($sp) -/* 00418 808BB258 8FA30034 */ lw $v1, 0x0034($sp) -/* 0041C 808BB25C 3C08DA38 */ lui $t0, 0xDA38 ## $t0 = DA380000 -/* 00420 808BB260 35080003 */ ori $t0, $t0, 0x0003 ## $t0 = DA380003 -/* 00424 808BB264 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00428 808BB268 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0 -/* 0042C 808BB26C 3C05808C */ lui $a1, %hi(D_808BC434) ## $a1 = 808C0000 -/* 00430 808BB270 24A5C434 */ addiu $a1, $a1, %lo(D_808BC434) ## $a1 = 808BC434 -/* 00434 808BB274 24590008 */ addiu $t9, $v0, 0x0008 ## $t9 = 00000008 -/* 00438 808BB278 AE3902C0 */ sw $t9, 0x02C0($s1) ## 000002C0 -/* 0043C 808BB27C AC480000 */ sw $t0, 0x0000($v0) ## 00000000 -/* 00440 808BB280 8E040000 */ lw $a0, 0x0000($s0) ## 00000000 -/* 00444 808BB284 240602E6 */ addiu $a2, $zero, 0x02E6 ## $a2 = 000002E6 -/* 00448 808BB288 0C0346A2 */ jal Matrix_NewMtx -/* 0044C 808BB28C AFA20030 */ sw $v0, 0x0030($sp) -/* 00450 808BB290 8FA30030 */ lw $v1, 0x0030($sp) -/* 00454 808BB294 3C0B0600 */ lui $t3, 0x0600 ## $t3 = 06000000 -/* 00458 808BB298 256B1BD0 */ addiu $t3, $t3, 0x1BD0 ## $t3 = 06001BD0 -/* 0045C 808BB29C AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00460 808BB2A0 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0 -/* 00464 808BB2A4 3C0ADE00 */ lui $t2, 0xDE00 ## $t2 = DE000000 -/* 00468 808BB2A8 3C06808C */ lui $a2, %hi(D_808BC448) ## $a2 = 808C0000 -/* 0046C 808BB2AC 24490008 */ addiu $t1, $v0, 0x0008 ## $t1 = 00000008 -/* 00470 808BB2B0 AE2902C0 */ sw $t1, 0x02C0($s1) ## 000002C0 -/* 00474 808BB2B4 AC4B0004 */ sw $t3, 0x0004($v0) ## 00000004 -/* 00478 808BB2B8 AC4A0000 */ sw $t2, 0x0000($v0) ## 00000000 -/* 0047C 808BB2BC 8E050000 */ lw $a1, 0x0000($s0) ## 00000000 -/* 00480 808BB2C0 24C6C448 */ addiu $a2, $a2, %lo(D_808BC448) ## $a2 = 808BC448 -/* 00484 808BB2C4 27A40038 */ addiu $a0, $sp, 0x0038 ## $a0 = FFFFFFD8 -/* 00488 808BB2C8 0C031AD5 */ jal func_800C6B54 -/* 0048C 808BB2CC 24070308 */ addiu $a3, $zero, 0x0308 ## $a3 = 00000308 -/* 00490 808BB2D0 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00494 808BB2D4 8FB0001C */ lw $s0, 0x001C($sp) -/* 00498 808BB2D8 8FB10020 */ lw $s1, 0x0020($sp) -/* 0049C 808BB2DC 03E00008 */ jr $ra -/* 004A0 808BB2E0 27BD0060 */ addiu $sp, $sp, 0x0060 ## $sp = 00000000 -/* 004A4 808BB2E4 00000000 */ nop -/* 004A8 808BB2E8 00000000 */ nop -/* 004AC 808BB2EC 00000000 */ nop - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s deleted file mode 100644 index 6f6709d681..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s +++ /dev/null @@ -1,61 +0,0 @@ -glabel BgTokiSwd_Init -/* 00008 808BAE48 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 0000C 808BAE4C AFA50034 */ sw $a1, 0x0034($sp) -/* 00010 808BAE50 AFBF001C */ sw $ra, 0x001C($sp) -/* 00014 808BAE54 AFB00018 */ sw $s0, 0x0018($sp) -/* 00018 808BAE58 3C05808C */ lui $a1, %hi(D_808BC414) ## $a1 = 808C0000 -/* 0001C 808BAE5C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00020 808BAE60 0C01E037 */ jal Actor_ProcessInitChain - -/* 00024 808BAE64 24A5C414 */ addiu $a1, $a1, %lo(D_808BC414) ## $a1 = 808BC414 -/* 00028 808BAE68 3C014448 */ lui $at, 0x4448 ## $at = 44480000 -/* 0002C 808BAE6C 44812000 */ mtc1 $at, $f4 ## $f4 = 800.00 -/* 00030 808BAE70 3C05808C */ lui $a1, %hi(func_808BAF40) ## $a1 = 808C0000 -/* 00034 808BAE74 24A5AF40 */ addiu $a1, $a1, %lo(func_808BAF40) ## $a1 = 808BAF40 -/* 00038 808BAE78 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0003C 808BAE7C 0C22EB90 */ jal BgTokiSwd_SetupAction -/* 00040 808BAE80 E60400BC */ swc1 $f4, 0x00BC($s0) ## 000000BC -/* 00044 808BAE84 3C028016 */ lui $v0, 0x8016 ## $v0 = 80160000 -/* 00048 808BAE88 2442E660 */ addiu $v0, $v0, 0xE660 ## $v0 = 8015E660 -/* 0004C 808BAE8C 8C4E0004 */ lw $t6, 0x0004($v0) ## 8015E664 -/* 00050 808BAE90 26050150 */ addiu $a1, $s0, 0x0150 ## $a1 = 00000150 -/* 00054 808BAE94 55C00003 */ bnel $t6, $zero, .L808BAEA4 -/* 00058 808BAE98 8C4F1360 */ lw $t7, 0x1360($v0) ## 8015F9C0 -/* 0005C 808BAE9C AE000134 */ sw $zero, 0x0134($s0) ## 00000134 -/* 00060 808BAEA0 8C4F1360 */ lw $t7, 0x1360($v0) ## 8015F9C0 -.L808BAEA4: -/* 00064 808BAEA4 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 00068 808BAEA8 8FB90034 */ lw $t9, 0x0034($sp) -/* 0006C 808BAEAC 15E10004 */ bne $t7, $at, .L808BAEC0 -/* 00070 808BAEB0 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00074 808BAEB4 00390821 */ addu $at, $at, $t9 -/* 00078 808BAEB8 241800FF */ addiu $t8, $zero, 0x00FF ## $t8 = 000000FF -/* 0007C 808BAEBC A4381D30 */ sh $t8, 0x1D30($at) ## 00011D30 -.L808BAEC0: -/* 00080 808BAEC0 8FA40034 */ lw $a0, 0x0034($sp) -/* 00084 808BAEC4 0C0170D9 */ jal ActorCollider_AllocCylinder - -/* 00088 808BAEC8 AFA50024 */ sw $a1, 0x0024($sp) -/* 0008C 808BAECC 3C07808C */ lui $a3, %hi(D_808BC3E0) ## $a3 = 808C0000 -/* 00090 808BAED0 24E7C3E0 */ addiu $a3, $a3, %lo(D_808BC3E0) ## $a3 = 808BC3E0 -/* 00094 808BAED4 8FA40034 */ lw $a0, 0x0034($sp) -/* 00098 808BAED8 8FA50024 */ lw $a1, 0x0024($sp) -/* 0009C 808BAEDC 0C01712B */ jal ActorCollider_InitCylinder - -/* 000A0 808BAEE0 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 000A4 808BAEE4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000A8 808BAEE8 0C0189B7 */ jal ActorCollider_Cylinder_Update - -/* 000AC 808BAEEC 8FA50024 */ lw $a1, 0x0024($sp) -/* 000B0 808BAEF0 3C06808C */ lui $a2, %hi(D_808BC40C) ## $a2 = 808C0000 -/* 000B4 808BAEF4 24C6C40C */ addiu $a2, $a2, %lo(D_808BC40C) ## $a2 = 808BC40C -/* 000B8 808BAEF8 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 000BC 808BAEFC 0C0187B5 */ jal func_80061ED4 -/* 000C0 808BAF00 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 000C4 808BAF04 8FBF001C */ lw $ra, 0x001C($sp) -/* 000C8 808BAF08 8FB00018 */ lw $s0, 0x0018($sp) -/* 000CC 808BAF0C 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 000D0 808BAF10 03E00008 */ jr $ra -/* 000D4 808BAF14 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s deleted file mode 100644 index 9d8f50b116..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s +++ /dev/null @@ -1,5 +0,0 @@ -glabel BgTokiSwd_SetupAction -/* 00000 808BAE40 03E00008 */ jr $ra -/* 00004 808BAE44 AC85014C */ sw $a1, 0x014C($a0) ## 0000014C - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Update.s deleted file mode 100644 index 48df28b486..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Update.s +++ /dev/null @@ -1,22 +0,0 @@ -glabel BgTokiSwd_Update -/* 0033C 808BB17C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00340 808BB180 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00344 808BB184 AFA5001C */ sw $a1, 0x001C($sp) -/* 00348 808BB188 AFA40018 */ sw $a0, 0x0018($sp) -/* 0034C 808BB18C 8C99014C */ lw $t9, 0x014C($a0) ## 0000014C -/* 00350 808BB190 0320F809 */ jalr $ra, $t9 -/* 00354 808BB194 00000000 */ nop -/* 00358 808BB198 8FA4001C */ lw $a0, 0x001C($sp) -/* 0035C 808BB19C 8FA70018 */ lw $a3, 0x0018($sp) -/* 00360 808BB1A0 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00364 808BB1A4 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 00368 808BB1A8 00812821 */ addu $a1, $a0, $at -/* 0036C 808BB1AC 0C017713 */ jal Actor_CollisionCheck_SetOT - ## CollisionCheck_setOT -/* 00370 808BB1B0 24E60150 */ addiu $a2, $a3, 0x0150 ## $a2 = 00000150 -/* 00374 808BB1B4 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00378 808BB1B8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0037C 808BB1BC 03E00008 */ jr $ra -/* 00380 808BB1C0 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s deleted file mode 100644 index ce23b22d65..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s +++ /dev/null @@ -1,106 +0,0 @@ -glabel func_808BAF40 -/* 00100 808BAF40 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00104 808BAF44 AFB00014 */ sw $s0, 0x0014($sp) -/* 00108 808BAF48 3C108016 */ lui $s0, 0x8016 ## $s0 = 80160000 -/* 0010C 808BAF4C 2610E660 */ addiu $s0, $s0, 0xE660 ## $s0 = 8015E660 -/* 00110 808BAF50 960E0EDC */ lhu $t6, 0x0EDC($s0) ## 8015F53C -/* 00114 808BAF54 AFB10018 */ sw $s1, 0x0018($sp) -/* 00118 808BAF58 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 0011C 808BAF5C 31CF8000 */ andi $t7, $t6, 0x8000 ## $t7 = 00000000 -/* 00120 808BAF60 AFBF001C */ sw $ra, 0x001C($sp) -/* 00124 808BAF64 15E00015 */ bne $t7, $zero, .L808BAFBC -/* 00128 808BAF68 AFA40020 */ sw $a0, 0x0020($sp) -/* 0012C 808BAF6C 8E181360 */ lw $t8, 0x1360($s0) ## 8015F9C0 -/* 00130 808BAF70 3C054448 */ lui $a1, 0x4448 ## $a1 = 44480000 -/* 00134 808BAF74 2B010004 */ slti $at, $t8, 0x0004 -/* 00138 808BAF78 50200011 */ beql $at, $zero, .L808BAFC0 -/* 0013C 808BAF7C 8E0B0004 */ lw $t3, 0x0004($s0) ## 8015E664 -/* 00140 808BAF80 0C00B84B */ jal func_8002E12C -/* 00144 808BAF84 24067530 */ addiu $a2, $zero, 0x7530 ## $a2 = 00007530 -/* 00148 808BAF88 5040000D */ beql $v0, $zero, .L808BAFC0 -/* 0014C 808BAF8C 8E0B0004 */ lw $t3, 0x0004($s0) ## 8015E664 -/* 00150 808BAF90 0C02FF21 */ jal func_800BFC84 -/* 00154 808BAF94 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00158 808BAF98 14400008 */ bne $v0, $zero, .L808BAFBC -/* 0015C 808BAF9C 3C09808C */ lui $t1, %hi(D_808BBD90) ## $t1 = 808C0000 -/* 00160 808BAFA0 96190EDC */ lhu $t9, 0x0EDC($s0) ## 8015F53C -/* 00164 808BAFA4 2529BD90 */ addiu $t1, $t1, %lo(D_808BBD90) ## $t1 = 808BBD90 -/* 00168 808BAFA8 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 0016C 808BAFAC 37288000 */ ori $t0, $t9, 0x8000 ## $t0 = 00008000 -/* 00170 808BAFB0 A6080EDC */ sh $t0, 0x0EDC($s0) ## 8015F53C -/* 00174 808BAFB4 AE291D68 */ sw $t1, 0x1D68($s1) ## 00001D68 -/* 00178 808BAFB8 A20A1414 */ sb $t2, 0x1414($s0) ## 8015FA74 -.L808BAFBC: -/* 0017C 808BAFBC 8E0B0004 */ lw $t3, 0x0004($s0) ## 8015E664 -.L808BAFC0: -/* 00180 808BAFC0 8FA40020 */ lw $a0, 0x0020($sp) -/* 00184 808BAFC4 15600005 */ bne $t3, $zero, .L808BAFDC -/* 00188 808BAFC8 00000000 */ nop -/* 0018C 808BAFCC 960C0EDE */ lhu $t4, 0x0EDE($s0) ## 8015F53E -/* 00190 808BAFD0 318D0020 */ andi $t5, $t4, 0x0020 ## $t5 = 00000000 -/* 00194 808BAFD4 51A00026 */ beql $t5, $zero, .L808BB070 -/* 00198 808BAFD8 8E081360 */ lw $t0, 0x1360($s0) ## 8015F9C0 -.L808BAFDC: -/* 0019C 808BAFDC 0C00BD04 */ jal func_8002F410 -/* 001A0 808BAFE0 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 001A4 808BAFE4 1040001B */ beq $v0, $zero, .L808BB054 -/* 001A8 808BAFE8 8FA40020 */ lw $a0, 0x0020($sp) -/* 001AC 808BAFEC 8E0E0004 */ lw $t6, 0x0004($s0) ## 8015E664 -/* 001B0 808BAFF0 3C18808C */ lui $t8, %hi(D_808BB7A0) ## $t8 = 808C0000 -/* 001B4 808BAFF4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 001B8 808BAFF8 11C00007 */ beq $t6, $zero, .L808BB018 -/* 001BC 808BAFFC 2718B7A0 */ addiu $t8, $t8, %lo(D_808BB7A0) ## $t8 = 808BB7A0 -/* 001C0 808BB000 0C021344 */ jal Item_Give -/* 001C4 808BB004 2405003C */ addiu $a1, $zero, 0x003C ## $a1 = 0000003C -/* 001C8 808BB008 3C0F808C */ lui $t7, %hi(D_808BB2F0) ## $t7 = 808C0000 -/* 001CC 808BB00C 25EFB2F0 */ addiu $t7, $t7, %lo(D_808BB2F0) ## $t7 = 808BB2F0 -/* 001D0 808BB010 10000002 */ beq $zero, $zero, .L808BB01C -/* 001D4 808BB014 AE2F1D68 */ sw $t7, 0x1D68($s1) ## 00001D68 -.L808BB018: -/* 001D8 808BB018 AE381D68 */ sw $t8, 0x1D68($s1) ## 00001D68 -.L808BB01C: -/* 001DC 808BB01C 3C041000 */ lui $a0, 0x1000 ## $a0 = 10000000 -/* 001E0 808BB020 0C03E803 */ jal Audio_SetBGM - -/* 001E4 808BB024 348400FF */ ori $a0, $a0, 0x00FF ## $a0 = 100000FF -/* 001E8 808BB028 0C03E803 */ jal Audio_SetBGM - -/* 001EC 808BB02C 24040053 */ addiu $a0, $zero, 0x0053 ## $a0 = 00000053 -/* 001F0 808BB030 8FA40020 */ lw $a0, 0x0020($sp) -/* 001F4 808BB034 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 001F8 808BB038 A2191414 */ sb $t9, 0x1414($s0) ## 8015FA74 -/* 001FC 808BB03C 3C05808C */ lui $a1, %hi(func_808BB0AC) ## $a1 = 808C0000 -/* 00200 808BB040 24A5B0AC */ addiu $a1, $a1, %lo(func_808BB0AC) ## $a1 = 808BB0AC -/* 00204 808BB044 0C22EB90 */ jal BgTokiSwd_SetupAction -/* 00208 808BB048 AC800118 */ sw $zero, 0x0118($a0) ## 00000118 -/* 0020C 808BB04C 10000008 */ beq $zero, $zero, .L808BB070 -/* 00210 808BB050 8E081360 */ lw $t0, 0x1360($s0) ## 8015F9C0 -.L808BB054: -/* 00214 808BB054 0C00B821 */ jal func_8002E084 -/* 00218 808BB058 24052000 */ addiu $a1, $zero, 0x2000 ## $a1 = 00002000 -/* 0021C 808BB05C 10400003 */ beq $v0, $zero, .L808BB06C -/* 00220 808BB060 8FA40020 */ lw $a0, 0x0020($sp) -/* 00224 808BB064 0C00BD60 */ jal func_8002F580 -/* 00228 808BB068 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -.L808BB06C: -/* 0022C 808BB06C 8E081360 */ lw $t0, 0x1360($s0) ## 8015F9C0 -.L808BB070: -/* 00230 808BB070 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 00234 808BB074 15010008 */ bne $t0, $at, .L808BB098 -/* 00238 808BB078 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 0023C 808BB07C 02211021 */ addu $v0, $s1, $at -/* 00240 808BB080 84431D30 */ lh $v1, 0x1D30($v0) ## 00001D30 -/* 00244 808BB084 18600003 */ blez $v1, .L808BB094 -/* 00248 808BB088 2469FFFF */ addiu $t1, $v1, 0xFFFF ## $t1 = FFFFFFFF -/* 0024C 808BB08C 10000002 */ beq $zero, $zero, .L808BB098 -/* 00250 808BB090 A4491D30 */ sh $t1, 0x1D30($v0) ## 00001D30 -.L808BB094: -/* 00254 808BB094 A4401D30 */ sh $zero, 0x1D30($v0) ## 00001D30 -.L808BB098: -/* 00258 808BB098 8FBF001C */ lw $ra, 0x001C($sp) -/* 0025C 808BB09C 8FB00014 */ lw $s0, 0x0014($sp) -/* 00260 808BB0A0 8FB10018 */ lw $s1, 0x0018($sp) -/* 00264 808BB0A4 03E00008 */ jr $ra -/* 00268 808BB0A8 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s deleted file mode 100644 index 1a0c1c6d90..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s +++ /dev/null @@ -1,39 +0,0 @@ -glabel func_808BB0AC -/* 0026C 808BB0AC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00270 808BB0B0 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00274 808BB0B4 AFA5001C */ sw $a1, 0x001C($sp) -/* 00278 808BB0B8 0C00BD04 */ jal func_8002F410 -/* 0027C 808BB0BC AFA40018 */ sw $a0, 0x0018($sp) -/* 00280 808BB0C0 10400012 */ beq $v0, $zero, .L808BB10C -/* 00284 808BB0C4 8FA40018 */ lw $a0, 0x0018($sp) -/* 00288 808BB0C8 3C0E8016 */ lui $t6, 0x8016 ## $t6 = 80160000 -/* 0028C 808BB0CC 8DCEE664 */ lw $t6, -0x199C($t6) ## 8015E664 -/* 00290 808BB0D0 3C0F808C */ lui $t7, %hi(BgTokiSwd_Draw) ## $t7 = 808C0000 -/* 00294 808BB0D4 2405182D */ addiu $a1, $zero, 0x182D ## $a1 = 0000182D -/* 00298 808BB0D8 11C00006 */ beq $t6, $zero, .L808BB0F4 -/* 0029C 808BB0DC 25EFB1C4 */ addiu $t7, $t7, %lo(BgTokiSwd_Draw) ## $t7 = 808BB1C4 -/* 002A0 808BB0E0 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 002A4 808BB0E4 AFA40018 */ sw $a0, 0x0018($sp) -/* 002A8 808BB0E8 8FA40018 */ lw $a0, 0x0018($sp) -/* 002AC 808BB0EC 10000002 */ beq $zero, $zero, .L808BB0F8 -/* 002B0 808BB0F0 AC800134 */ sw $zero, 0x0134($a0) ## 00000134 -.L808BB0F4: -/* 002B4 808BB0F4 AC8F0134 */ sw $t7, 0x0134($a0) ## 00000134 -.L808BB0F8: -/* 002B8 808BB0F8 3C05808C */ lui $a1, %hi(func_808BB128) ## $a1 = 808C0000 -/* 002BC 808BB0FC 0C22EB90 */ jal BgTokiSwd_SetupAction -/* 002C0 808BB100 24A5B128 */ addiu $a1, $a1, %lo(func_808BB128) ## $a1 = 808BB128 -/* 002C4 808BB104 10000005 */ beq $zero, $zero, .L808BB11C -/* 002C8 808BB108 8FBF0014 */ lw $ra, 0x0014($sp) -.L808BB10C: -/* 002CC 808BB10C 8FB8001C */ lw $t8, 0x001C($sp) -/* 002D0 808BB110 8F021C44 */ lw $v0, 0x1C44($t8) ## 00001C44 -/* 002D4 808BB114 AC440438 */ sw $a0, 0x0438($v0) ## 00000438 -/* 002D8 808BB118 8FBF0014 */ lw $ra, 0x0014($sp) -.L808BB11C: -/* 002DC 808BB11C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 002E0 808BB120 03E00008 */ jr $ra -/* 002E4 808BB124 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB128.s b/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB128.s deleted file mode 100644 index 11b8e59c4e..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB128.s +++ /dev/null @@ -1,26 +0,0 @@ -glabel func_808BB128 -/* 002E8 808BB128 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 002EC 808BB12C AFA40018 */ sw $a0, 0x0018($sp) -/* 002F0 808BB130 AFBF0014 */ sw $ra, 0x0014($sp) -/* 002F4 808BB134 AFA5001C */ sw $a1, 0x001C($sp) -/* 002F8 808BB138 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 002FC 808BB13C 0C01B129 */ jal func_8006C4A4 -/* 00300 808BB140 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001 -/* 00304 808BB144 5040000A */ beql $v0, $zero, .L808BB170 -/* 00308 808BB148 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0030C 808BB14C 8FA2001C */ lw $v0, 0x001C($sp) -/* 00310 808BB150 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00314 808BB154 00411021 */ addu $v0, $v0, $at -/* 00318 808BB158 84431D30 */ lh $v1, 0x1D30($v0) ## 00001D30 -/* 0031C 808BB15C 286100FF */ slti $at, $v1, 0x00FF -/* 00320 808BB160 10200002 */ beq $at, $zero, .L808BB16C -/* 00324 808BB164 246E0005 */ addiu $t6, $v1, 0x0005 ## $t6 = 00000005 -/* 00328 808BB168 A44E1D30 */ sh $t6, 0x1D30($v0) ## 00001D30 -.L808BB16C: -/* 0032C 808BB16C 8FBF0014 */ lw $ra, 0x0014($sp) -.L808BB170: -/* 00330 808BB170 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00334 808BB174 03E00008 */ jr $ra -/* 00338 808BB178 00000000 */ nop - - diff --git a/data/overlays/actors/z_bg_toki_swd.data.s b/data/overlays/actors/z_bg_toki_swd.data.s deleted file mode 100644 index cce1248200..0000000000 --- a/data/overlays/actors/z_bg_toki_swd.data.s +++ /dev/null @@ -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 D_808BB2F0 - .word 0x00000009, 0x000001A9, 0x0000000A, 0x00000001, 0x000C0000, 0x01000000, 0x00000000, 0x00000000, 0x00000036, 0x00000034, 0x00000000, 0x00000036, 0x00000034, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x0002006E, 0x006F0000, 0x00000000, 0x00000000, 0xFFFFFFE3, 0xFFFFFFC5, 0x00000000, 0xFFFFFFE3, 0xFFFFFFC5, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x000A006E, 0x006F0000, 0x00000000, 0x00000000, 0x0000002E, 0xFFFFFFE6, 0x00000000, 0x0000002E, 0xFFFFFFE6, 0x00000000, 0x00000000, 0x00000000, 0x000003E8, 0x00000001, 0x000800E6, 0x00E700E7, 0x0000002D, 0x00000001, 0x000100D2, 0x00E600E6, 0x00000001, 0x00010000, 0x00F10000, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD9018C, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD9019D, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD901AE, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD902A8, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD90000, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD9007A, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD90064, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD90074, 0xFF000000, 0x42700000, 0xFFD60048, 0xFFD9005F, 0x00000001, 0x00010050, 0x01960000, 0x00000000, 0x42700000, 0xFFFF005F, 0xFFED2F73, 0x00000000, 0x42700000, 0xFFFF005F, 0xFFED6B2F, 0x00000000, 0x42700000, 0xFFFF005F, 0xFFED6169, 0x00000000, 0x42700000, 0xFFFF005F, 0xFFED0000, 0x00000000, 0x42700000, 0xFFFF005F, 0xFFED0005, 0x00000000, 0x42700000, 0xFFFF0081, 0xFFDE7961, 0x00000000, 0x42700000, 0xFFFF00AD, 0xFFED742F, 0x00000000, 0x42700000, 0xFFEF00D9, 0xFFEC2E64, 0x00000000, 0x42700000, 0xFFE80148, 0xFFF40000, 0x00000000, 0x42700000, 0xFFE501FD, 0xFFFE2F73, 0x00000000, 0x42700000, 0xFFD7032D, 0x000A6B2F, 0x00000000, 0x42700000, 0xFFC40505, 0x00266D61, 0x00000000, 0x42700000, 0xFFC60776, 0x005B0000, 0x00000000, 0x42700000, 0xFFCB09DE, 0x00850005, 0x00000000, 0x42700000, 0xFFDF0D75, 0x00C17961, 0x00000000, 0x42700000, 0x00000F78, 0x00E1742F, 0x00000000, 0x42700000, 0x000710DD, 0x00F56565, 0x00000000, 0x42700000, 0x000710DC, 0x00F50000, 0x00000000, 0x42700000, 0x000710DC, 0x00F52F73, 0xFF000000, 0x42700000, 0x000710DC, 0x00F56B2F, 0x00000002, 0x00010000, 0x010E0000, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF72F73, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF76B2F, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF76169, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF70000, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF70005, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF77961, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF7742F, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF72E64, 0xFF00001E, 0x42700000, 0xFFEC0055, 0xFFF70000, 0x00000002, 0x00010050, 0x01A90000, 0x00000005, 0x42700000, 0xFFFF0070, 0x00072F73, 0x00000005, 0x42700000, 0xFFFF0070, 0x00076B2F, 0x00000005, 0x42700000, 0xFFFF0070, 0x00076169, 0x00000005, 0x42700000, 0xFFFF0070, 0x00070000, 0x0000000F, 0x42700000, 0xFFFF0070, 0x00070005, 0x00000014, 0x42700000, 0xFFFF0075, 0x00077961, 0x00000019, 0x42700000, 0xFFFF0075, 0x0007742F, 0x00000019, 0x42700000, 0xFFFF0075, 0x00072E64, 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, 0x00000014, 0x42700000, 0xFFFF0075, 0x00072F73, 0x00000014, 0x42700000, 0xFFFF0075, 0x00076B2F, 0x00000014, 0x42700000, 0xFFFF0075, 0x00076D61, 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, 0x00000014, 0x42700000, 0xFFFF0075, 0x00070005, 0x00000014, 0x42700000, 0xFFFF0075, 0x00077961, 0x00000014, 0x42700000, 0xFFFF0075, 0x0007742F, 0x00000014, 0x42700000, 0xFFFF0075, 0x00076565, 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, 0x00000014, 0x42700000, 0xFFFF0075, 0x00072F73, 0xFF000014, 0x42700000, 0xFFFF0075, 0x00076B2F, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000 -glabel D_808BB7A0 - .word 0x00000009, 0x00000170, 0x00000001, 0x00010000, 0x007E0000, 0x00000000, 0x42700000, 0xFFFF0065, 0xFF92616D, 0x00000000, 0x42200000, 0xFFFF0065, 0xFF926964, 0x00000000, 0x42200000, 0xFFFF0065, 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0065, 0xFF920111, 0x00000000, 0x42200000, 0xFFFF0065, 0xFF93012D, 0x00000000, 0x42200000, 0xFFFF0047, 0xFF920033, 0x00000000, 0x42200000, 0xFFFF0048, 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0048, 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0048, 0xFF922F68, 0xFF000000, 0x42200000, 0xFFFF0048, 0xFF92612F, 0x00000001, 0x0001003A, 0x01530000, 0x00000000, 0x42700001, 0xFFF7006A, 0xFFFDA1BC, 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5F3, 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5EB, 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5A2, 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBBAEE, 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBC9B8, 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCB0020, 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBA5A4, 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCB0020, 0x00000000, 0x42700000, 0xFFAD0066, 0xFFD6A5E1, 0x00000000, 0x42700000, 0xFF8C0051, 0xFFEDA5D0, 0x00000000, 0x42700000, 0xFF8A0051, 0x00360020, 0x00000000, 0x42700000, 0xFF96004E, 0x0074A5A6, 0x00000000, 0x42700000, 0xFFE5004B, 0x00E2A5E5, 0x00000000, 0x42700000, 0x00790052, 0x0138C0AE, 0x00000000, 0x42700000, 0x0128004C, 0x0176A5E5, 0x00000000, 0x42700000, 0x02350050, 0x01010020, 0x00000000, 0x42700000, 0x02660050, 0xFFFFA5EB, 0x00000000, 0x42700000, 0x02520050, 0xFF6FA5E1, 0x00000000, 0x42700000, 0x01DB0050, 0xFE840020, 0x00000000, 0x42700000, 0x01430050, 0xFDFFA5E1, 0x00000000, 0x42700000, 0x00C00050, 0xFDC2A5D0, 0x00000000, 0x42700000, 0xFFD30050, 0xFDA40020, 0x00000000, 0x42700000, 0xFF720050, 0xFDB3A5A6, 0x00000000, 0x42700000, 0xFF1C0050, 0xFDCEA5E5, 0x00000000, 0x42700000, 0xFE88005D, 0xFE23C0AE, 0x00000000, 0x42700000, 0xFDB8005F, 0xFF49A5E5, 0x00000000, 0x42700000, 0xFD9B005F, 0xFFDE0020, 0xFF000000, 0x42700000, 0xFDAD005F, 0x00A1A5EB, 0x00000002, 0x00010000, 0x009B0000, 0x00000005, 0x4221999A, 0xFFFF006F, 0x0005A1BC, 0x00000005, 0x42200000, 0xFFFF006F, 0x0005A5F3, 0x00000005, 0x42200000, 0xFFFF006F, 0x0005A5EB, 0x0000000F, 0x42200000, 0xFFFF006F, 0x0005A5A2, 0x0000000F, 0x42200000, 0xFFFF006F, 0x0005BAEE, 0x0000000F, 0x42200000, 0xFFFF0068, 0x0008C9B8, 0x00000005, 0x42200000, 0xFFFF0068, 0x00080020, 0x0000001E, 0x42200000, 0xFFFF0068, 0x0008A5A4, 0x0000001E, 0x42200000, 0xFFFF0068, 0x00080020, 0xFF00001E, 0x42200000, 0xFFFF0068, 0x0008A5E1, 0x00000002, 0x0001003A, 0x01700000, 0x00000005, 0x42700001, 0x00000078, 0x000CA1BC, 0x00000005, 0x42700000, 0x00000078, 0x000CA5F3, 0x00000005, 0x42700000, 0x00000078, 0x000CA5EB, 0x0000000A, 0x42700000, 0x00000078, 0x000CA5A2, 0x00000005, 0x42700000, 0xFFFF005F, 0x000BBAEE, 0x00000005, 0x42700000, 0xFFFF005F, 0x000BC9B8, 0x00000005, 0x42700000, 0xFFFF005F, 0x000B0020, 0x00000005, 0x42700000, 0xFFFF005F, 0x000BA5A4, 0x00000005, 0x42700000, 0xFFFF005F, 0x000B0020, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5E1, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5D0, 0x0000000A, 0x42700000, 0xFFFD005F, 0x00080020, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5A6, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5E5, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008C0AE, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5E5, 0x0000000A, 0x42700000, 0xFFFD005F, 0x00080020, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5EB, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5E1, 0x0000000A, 0x42700000, 0xFFFD005F, 0x00080020, 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008A5E1, 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008A5D0, 0x0000000F, 0x42700000, 0xFFFD005F, 0x00080020, 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008A5A6, 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008A5E5, 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008C0AE, 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008A5E5, 0x0000000F, 0x42700000, 0xFFFD005F, 0x00080020, 0xFF00001E, 0x42700000, 0xFFFD005F, 0x0008A5EB, 0x0000000A, 0x00000001, 0x000C0000, 0x00B40000, 0x00000000, 0x00000000, 0x0000001C, 0xFFFFFFF6, 0x00000000, 0xFFFFFFF2, 0x00000009, 0x00000000, 0xBE6EEEEF, 0x00000000, 0x00000004, 0x00000001, 0x0002005A, 0x005B0000, 0x00000000, 0x00000000, 0xFFFFFFF2, 0x00000024, 0x00000000, 0xFFFFFFF2, 0x00000024, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x000A005A, 0x005B0000, 0x00000000, 0x00000000, 0xFFFFFFF8, 0xFFFFFFDD, 0x00000000, 0xFFFFFFF8, 0xFFFFFFDD, 0x00000000, 0x00000000, 0x00000000, 0x0000002D, 0x00000001, 0x000100BE, 0x00D200D2, 0x000003E8, 0x00000001, 0x000800D2, 0x00D300D3, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000 -glabel D_808BBD90 - .word 0x0000000B, 0x00000BB8, 0x00000021, 0x00000001, 0x00010000, 0x0BB80000, 0x00000000, 0x00000000, 0xFFFFFFF8, 0xFFFFFFFF, 0x00000000, 0xFFFFFFF8, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x0000000A, 0x00000003, 0x00050000, 0x00010000, 0x80000000, 0x00000000, 0x00000000, 0x00000334, 0x00000000, 0x00000000, 0x00000334, 0x00000000, 0x00000000, 0x00000001, 0x00020001, 0x00100000, 0x80000000, 0x00000000, 0x00000000, 0x00000334, 0x00000000, 0x00000000, 0x000002D0, 0x00000000, 0x00000000, 0x00000001, 0x00050010, 0x00B00000, 0x80000000, 0x00000000, 0x00000000, 0x000002D0, 0x00000000, 0x00000000, 0x000002D0, 0x00000000, 0x00000000, 0x00000001, 0x0000003E, 0x00000003, 0x00040028, 0x00467D74, 0x00000000, 0xFFFFFFFF, 0x00000031, 0x000002CF, 0x00000001, 0x0000002F, 0x000002AF, 0x3D888889, 0xBD888889, 0xBD888889, 0x00040046, 0x00DC8010, 0x00000000, 0x00000001, 0x0000002F, 0x000002AF, 0x00000000, 0x00000086, 0x00000015, 0xBBDA740E, 0x3F147AE1, 0x3BDA740E, 0x000200DC, 0x01108000, 0x00000000, 0x00000000, 0x00000086, 0x00000015, 0x00000000, 0x00000065, 0x00000002, 0x00000000, 0xBF227627, 0x00000000, 0x00000003, 0x00000001, 0x000C0154, 0x01550000, 0x00000000, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFD, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFD, 0x00000000, 0x00000000, 0x00000000, 0x00000013, 0x00000006, 0xFFFF0000, 0x0032FFFF, 0xFFFFFFFF, 0x70E60032, 0x003C0000, 0x00000000, 0xFFFF003C, 0x00FAFFFF, 0xFFFFFFFF, 0x70E700FA, 0x01040000, 0x00000000, 0xFFFF0104, 0x0122FFFF, 0xFFFFFFFF, 0x70E80122, 0x01400000, 0x00000000, 0x00000001, 0x00010000, 0x00FB0000, 0x00000000, 0x42700000, 0xFFC5000C, 0x02B20222, 0x00000000, 0x42700000, 0xFFC5000C, 0x02B200FA, 0x00000000, 0x42700000, 0xFFC5000C, 0x02B20000, 0x00000000, 0x42700000, 0xFFC5000C, 0x02B20000, 0x00000000, 0x42700000, 0xFFC5000C, 0x02B20000, 0x00000000, 0x42700000, 0xFFE10018, 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, 0x02BD2D70, 0x00000000, 0x42700000, 0xFFE10018, 0x02BD0085, 0x00000000, 0x42700000, 0xFFE10018, 0x02BD01E6, 0xFF000000, 0x42700000, 0xFFE10018, 0x02BD0000, 0x00000001, 0x0001005A, 0x014B0000, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0222, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC00FA, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, 0xFF000000, 0x42700000, 0xFF66005C, 0x00EC2D70, 0x00000001, 0x000100DC, 0x01EB0000, 0x00000000, 0x42700001, 0xFFFE007A, 0x00270222, 0x00000000, 0x42700001, 0xFFFE007A, 0x002700FA, 0x00000000, 0x42700001, 0xFFFE0066, 0x00270000, 0x00000000, 0x42700001, 0xFFFE005A, 0x00270000, 0x00000000, 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, 0x42700001, 0xFFFE0051, 0x003E2D70, 0xFF000000, 0x42700001, 0xFFFE0051, 0x003E0085, 0x00000002, 0x00010000, 0x01180000, 0x0000001E, 0x42700000, 0x002B0034, 0x02CC0222, 0x0000001E, 0x42700000, 0x002B0034, 0x02CC00FA, 0x0000000A, 0x42700000, 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, 0x003F0056, 0x02D22D70, 0x0000001E, 0x42700000, 0x003F0055, 0x02D10085, 0x0000001E, 0x42700000, 0x003F0055, 0x02D101E6, 0xFF00001E, 0x42700000, 0x003E0055, 0x02D10000, 0x00000002, 0x0001005A, 0x01680000, 0x0000001E, 0x42700000, 0xFF970053, 0x016E0222, 0x0000001E, 0x42700000, 0xFF980053, 0x016C00FA, 0x0000001E, 0x42700000, 0xFFC10053, 0x01530000, 0x0000001E, 0x42700000, 0xFFF00063, 0x00FF0000, 0x0000001E, 0x42700000, 0xFFE2006F, 0x00B10000, 0x0000001E, 0x42700000, 0xFFB00070, 0x00790000, 0x0000001E, 0x42700000, 0xFFB00070, 0x00790000, 0x0000001E, 0x42700000, 0xFFB00070, 0x00790000, 0xFF00001E, 0x42700000, 0xFFB00070, 0x00792D70, 0x00000002, 0x000100DC, 0x02080000, 0x0000001E, 0x42700001, 0x00000089, 0xFFC90222, 0x0000001E, 0x42700001, 0x00000089, 0xFFC900FA, 0x0000001E, 0x42700001, 0x00000075, 0xFFC90000, 0x0000001E, 0x42700001, 0x00000069, 0xFFC90000, 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, 0x0000001E, 0x42700001, 0x00000062, 0xFFE12D70, 0xFF00001E, 0x42700001, 0x00000062, 0xFFE10085, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000 -glabel Bg_Toki_Swd_InitVars - .word 0x006C0600, 0x00000010, 0x005E0000, 0x0000019C -.word BgTokiSwd_Init -.word BgTokiSwd_Destroy -.word BgTokiSwd_Update -.word BgTokiSwd_Draw -glabel D_808BC3E0 - .word 0x0A000039, 0x12010000, 0x00000000, 0xFFCFFFFF, 0x00000000, 0xFFCFFFFF, 0x00000000, 0x00000100, 0x000A0046, 0x00000000, 0x00000000 -glabel D_808BC40C - .word 0x0A000023, 0x0064FF00 -glabel D_808BC414 - .word 0x48500019, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_bg_toki_swd.reloc.s b/data/overlays/actors/z_bg_toki_swd.reloc.s deleted file mode 100644 index 11b803e8ca..0000000000 --- a/data/overlays/actors/z_bg_toki_swd.reloc.s +++ /dev/null @@ -1,11 +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_808BC460 - -.incbin "baserom/ovl_Bg_Toki_Swd", 0x1620, 0x000000A0 diff --git a/data/overlays/actors/z_bg_toki_swd.rodata.s b/data/overlays/actors/z_bg_toki_swd.rodata.s deleted file mode 100644 index 5d4e7c1725..0000000000 --- a/data/overlays/actors/z_bg_toki_swd.rodata.s +++ /dev/null @@ -1,23 +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_808BC420 - .asciz "../z_bg_toki_swd.c" - .balign 4 - -glabel D_808BC434 - .asciz "../z_bg_toki_swd.c" - .balign 4 - -glabel D_808BC448 - .asciz "../z_bg_toki_swd.c" - .balign 4 - -.balign 16 - diff --git a/spec b/spec index d3f55e9869..16f2923d2a 100644 --- a/spec +++ b/spec @@ -1595,9 +1595,7 @@ endseg beginseg name "ovl_Bg_Toki_Swd" include "build/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.o" - include "build/data/overlays/actors/z_bg_toki_swd.data.o" - include "build/data/overlays/actors/z_bg_toki_swd.rodata.o" - include "build/data/overlays/actors/z_bg_toki_swd.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 57823bf2e0..69384dded9 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -1,15 +1,306 @@ +/* + * File: z_bg_toki_swd.c + * Overlay: ovl_Bg_Toki_Swd + * Description: Master Sword (Contains Cutscenes) +*/ + #include "z_bg_toki_swd.h" #define ROOM 0x00 #define FLAGS 0x00000010 -void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx); -void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx); -void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx); -void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx); -void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx); -void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx); -/* +static void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx); +static void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx); +static void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx); +static void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx); +static void BgTokiSwd_SetupAction(BgTokiSwd* this, ActorFunc actionFunc); +static void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx); +static void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx); +static void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx); + +extern u32 D_06001BD0; + +static u32 D_808BB2F0[] = +{ + 0x00000009, 0x000001A9, 0x0000000A, 0x00000001, + 0x000C0000, 0x01000000, 0x00000000, 0x00000000, + 0x00000036, 0x00000034, 0x00000000, 0x00000036, + 0x00000034, 0x00000000, 0x00000000, 0x00000000, + 0x00000004, 0x00000001, 0x0002006E, 0x006F0000, + 0x00000000, 0x00000000, 0xFFFFFFE3, 0xFFFFFFC5, + 0x00000000, 0xFFFFFFE3, 0xFFFFFFC5, 0x00000000, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, + 0x000A006E, 0x006F0000, 0x00000000, 0x00000000, + 0x0000002E, 0xFFFFFFE6, 0x00000000, 0x0000002E, + 0xFFFFFFE6, 0x00000000, 0x00000000, 0x00000000, + 0x000003E8, 0x00000001, 0x000800E6, 0x00E700E7, + 0x0000002D, 0x00000001, 0x000100D2, 0x00E600E6, + 0x00000001, 0x00010000, 0x00F10000, 0x00000000, + 0x42700000, 0xFFD60048, 0xFFD9018C, 0x00000000, + 0x42700000, 0xFFD60048, 0xFFD9019D, 0x00000000, + 0x42700000, 0xFFD60048, 0xFFD901AE, 0x00000000, + 0x42700000, 0xFFD60048, 0xFFD902A8, 0x00000000, + 0x42700000, 0xFFD60048, 0xFFD90000, 0x00000000, + 0x42700000, 0xFFD60048, 0xFFD9007A, 0x00000000, + 0x42700000, 0xFFD60048, 0xFFD90064, 0x00000000, + 0x42700000, 0xFFD60048, 0xFFD90074, 0xFF000000, + 0x42700000, 0xFFD60048, 0xFFD9005F, 0x00000001, + 0x00010050, 0x01960000, 0x00000000, 0x42700000, + 0xFFFF005F, 0xFFED2F73, 0x00000000, 0x42700000, + 0xFFFF005F, 0xFFED6B2F, 0x00000000, 0x42700000, + 0xFFFF005F, 0xFFED6169, 0x00000000, 0x42700000, + 0xFFFF005F, 0xFFED0000, 0x00000000, 0x42700000, + 0xFFFF005F, 0xFFED0005, 0x00000000, 0x42700000, + 0xFFFF0081, 0xFFDE7961, 0x00000000, 0x42700000, + 0xFFFF00AD, 0xFFED742F, 0x00000000, 0x42700000, + 0xFFEF00D9, 0xFFEC2E64, 0x00000000, 0x42700000, + 0xFFE80148, 0xFFF40000, 0x00000000, 0x42700000, + 0xFFE501FD, 0xFFFE2F73, 0x00000000, 0x42700000, + 0xFFD7032D, 0x000A6B2F, 0x00000000, 0x42700000, + 0xFFC40505, 0x00266D61, 0x00000000, 0x42700000, + 0xFFC60776, 0x005B0000, 0x00000000, 0x42700000, + 0xFFCB09DE, 0x00850005, 0x00000000, 0x42700000, + 0xFFDF0D75, 0x00C17961, 0x00000000, 0x42700000, + 0x00000F78, 0x00E1742F, 0x00000000, 0x42700000, + 0x000710DD, 0x00F56565, 0x00000000, 0x42700000, + 0x000710DC, 0x00F50000, 0x00000000, 0x42700000, + 0x000710DC, 0x00F52F73, 0xFF000000, 0x42700000, + 0x000710DC, 0x00F56B2F, 0x00000002, 0x00010000, + 0x010E0000, 0x0000001E, 0x42700000, 0xFFEC0055, + 0xFFF72F73, 0x0000001E, 0x42700000, 0xFFEC0055, + 0xFFF76B2F, 0x0000001E, 0x42700000, 0xFFEC0055, + 0xFFF76169, 0x0000001E, 0x42700000, 0xFFEC0055, + 0xFFF70000, 0x0000001E, 0x42700000, 0xFFEC0055, + 0xFFF70005, 0x0000001E, 0x42700000, 0xFFEC0055, + 0xFFF77961, 0x0000001E, 0x42700000, 0xFFEC0055, + 0xFFF7742F, 0x0000001E, 0x42700000, 0xFFEC0055, + 0xFFF72E64, 0xFF00001E, 0x42700000, 0xFFEC0055, + 0xFFF70000, 0x00000002, 0x00010050, 0x01A90000, + 0x00000005, 0x42700000, 0xFFFF0070, 0x00072F73, + 0x00000005, 0x42700000, 0xFFFF0070, 0x00076B2F, + 0x00000005, 0x42700000, 0xFFFF0070, 0x00076169, + 0x00000005, 0x42700000, 0xFFFF0070, 0x00070000, + 0x0000000F, 0x42700000, 0xFFFF0070, 0x00070005, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00077961, + 0x00000019, 0x42700000, 0xFFFF0075, 0x0007742F, + 0x00000019, 0x42700000, 0xFFFF0075, 0x00072E64, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00072F73, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00076B2F, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00076D61, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00070005, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00077961, + 0x00000014, 0x42700000, 0xFFFF0075, 0x0007742F, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00076565, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00072F73, + 0xFF000014, 0x42700000, 0xFFFF0075, 0x00076B2F, + 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, +}; + +static u32 D_808BB7A0[] = +{ + 0x00000009, 0x00000170, 0x00000001, 0x00010000, + 0x007E0000, 0x00000000, 0x42700000, 0xFFFF0065, + 0xFF92616D, 0x00000000, 0x42200000, 0xFFFF0065, + 0xFF926964, 0x00000000, 0x42200000, 0xFFFF0065, + 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0065, + 0xFF920111, 0x00000000, 0x42200000, 0xFFFF0065, + 0xFF93012D, 0x00000000, 0x42200000, 0xFFFF0047, + 0xFF920033, 0x00000000, 0x42200000, 0xFFFF0048, + 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0048, + 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0048, + 0xFF922F68, 0xFF000000, 0x42200000, 0xFFFF0048, + 0xFF92612F, 0x00000001, 0x0001003A, 0x01530000, + 0x00000000, 0x42700001, 0xFFF7006A, 0xFFFDA1BC, + 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5F3, + 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5EB, + 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5A2, + 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBBAEE, + 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBC9B8, + 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCB0020, + 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBA5A4, + 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCB0020, + 0x00000000, 0x42700000, 0xFFAD0066, 0xFFD6A5E1, + 0x00000000, 0x42700000, 0xFF8C0051, 0xFFEDA5D0, + 0x00000000, 0x42700000, 0xFF8A0051, 0x00360020, + 0x00000000, 0x42700000, 0xFF96004E, 0x0074A5A6, + 0x00000000, 0x42700000, 0xFFE5004B, 0x00E2A5E5, + 0x00000000, 0x42700000, 0x00790052, 0x0138C0AE, + 0x00000000, 0x42700000, 0x0128004C, 0x0176A5E5, + 0x00000000, 0x42700000, 0x02350050, 0x01010020, + 0x00000000, 0x42700000, 0x02660050, 0xFFFFA5EB, + 0x00000000, 0x42700000, 0x02520050, 0xFF6FA5E1, + 0x00000000, 0x42700000, 0x01DB0050, 0xFE840020, + 0x00000000, 0x42700000, 0x01430050, 0xFDFFA5E1, + 0x00000000, 0x42700000, 0x00C00050, 0xFDC2A5D0, + 0x00000000, 0x42700000, 0xFFD30050, 0xFDA40020, + 0x00000000, 0x42700000, 0xFF720050, 0xFDB3A5A6, + 0x00000000, 0x42700000, 0xFF1C0050, 0xFDCEA5E5, + 0x00000000, 0x42700000, 0xFE88005D, 0xFE23C0AE, + 0x00000000, 0x42700000, 0xFDB8005F, 0xFF49A5E5, + 0x00000000, 0x42700000, 0xFD9B005F, 0xFFDE0020, + 0xFF000000, 0x42700000, 0xFDAD005F, 0x00A1A5EB, + 0x00000002, 0x00010000, 0x009B0000, 0x00000005, + 0x4221999A, 0xFFFF006F, 0x0005A1BC, 0x00000005, + 0x42200000, 0xFFFF006F, 0x0005A5F3, 0x00000005, + 0x42200000, 0xFFFF006F, 0x0005A5EB, 0x0000000F, + 0x42200000, 0xFFFF006F, 0x0005A5A2, 0x0000000F, + 0x42200000, 0xFFFF006F, 0x0005BAEE, 0x0000000F, + 0x42200000, 0xFFFF0068, 0x0008C9B8, 0x00000005, + 0x42200000, 0xFFFF0068, 0x00080020, 0x0000001E, + 0x42200000, 0xFFFF0068, 0x0008A5A4, 0x0000001E, + 0x42200000, 0xFFFF0068, 0x00080020, 0xFF00001E, + 0x42200000, 0xFFFF0068, 0x0008A5E1, 0x00000002, + 0x0001003A, 0x01700000, 0x00000005, 0x42700001, + 0x00000078, 0x000CA1BC, 0x00000005, 0x42700000, + 0x00000078, 0x000CA5F3, 0x00000005, 0x42700000, + 0x00000078, 0x000CA5EB, 0x0000000A, 0x42700000, + 0x00000078, 0x000CA5A2, 0x00000005, 0x42700000, + 0xFFFF005F, 0x000BBAEE, 0x00000005, 0x42700000, + 0xFFFF005F, 0x000BC9B8, 0x00000005, 0x42700000, + 0xFFFF005F, 0x000B0020, 0x00000005, 0x42700000, + 0xFFFF005F, 0x000BA5A4, 0x00000005, 0x42700000, + 0xFFFF005F, 0x000B0020, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x0008A5E1, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x0008A5D0, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x00080020, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x0008A5A6, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x0008A5E5, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x0008C0AE, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x0008A5E5, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x00080020, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x0008A5EB, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x0008A5E1, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x00080020, 0x0000000F, 0x42700000, + 0xFFFD005F, 0x0008A5E1, 0x0000000F, 0x42700000, + 0xFFFD005F, 0x0008A5D0, 0x0000000F, 0x42700000, + 0xFFFD005F, 0x00080020, 0x0000000F, 0x42700000, + 0xFFFD005F, 0x0008A5A6, 0x0000000F, 0x42700000, + 0xFFFD005F, 0x0008A5E5, 0x0000000F, 0x42700000, + 0xFFFD005F, 0x0008C0AE, 0x0000000F, 0x42700000, + 0xFFFD005F, 0x0008A5E5, 0x0000000F, 0x42700000, + 0xFFFD005F, 0x00080020, 0xFF00001E, 0x42700000, + 0xFFFD005F, 0x0008A5EB, 0x0000000A, 0x00000001, + 0x000C0000, 0x00B40000, 0x00000000, 0x00000000, + 0x0000001C, 0xFFFFFFF6, 0x00000000, 0xFFFFFFF2, + 0x00000009, 0x00000000, 0xBE6EEEEF, 0x00000000, + 0x00000004, 0x00000001, 0x0002005A, 0x005B0000, + 0x00000000, 0x00000000, 0xFFFFFFF2, 0x00000024, + 0x00000000, 0xFFFFFFF2, 0x00000024, 0x00000000, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, + 0x000A005A, 0x005B0000, 0x00000000, 0x00000000, + 0xFFFFFFF8, 0xFFFFFFDD, 0x00000000, 0xFFFFFFF8, + 0xFFFFFFDD, 0x00000000, 0x00000000, 0x00000000, + 0x0000002D, 0x00000001, 0x000100BE, 0x00D200D2, + 0x000003E8, 0x00000001, 0x000800D2, 0x00D300D3, + 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, +}; + +static u32 D_808BBD90[] = +{ + 0x0000000B, 0x00000BB8, 0x00000021, 0x00000001, + 0x00010000, 0x0BB80000, 0x00000000, 0x00000000, + 0xFFFFFFF8, 0xFFFFFFFF, 0x00000000, 0xFFFFFFF8, + 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, + 0x0000000A, 0x00000003, 0x00050000, 0x00010000, + 0x80000000, 0x00000000, 0x00000000, 0x00000334, + 0x00000000, 0x00000000, 0x00000334, 0x00000000, + 0x00000000, 0x00000001, 0x00020001, 0x00100000, + 0x80000000, 0x00000000, 0x00000000, 0x00000334, + 0x00000000, 0x00000000, 0x000002D0, 0x00000000, + 0x00000000, 0x00000001, 0x00050010, 0x00B00000, + 0x80000000, 0x00000000, 0x00000000, 0x000002D0, + 0x00000000, 0x00000000, 0x000002D0, 0x00000000, + 0x00000000, 0x00000001, 0x0000003E, 0x00000003, + 0x00040028, 0x00467D74, 0x00000000, 0xFFFFFFFF, + 0x00000031, 0x000002CF, 0x00000001, 0x0000002F, + 0x000002AF, 0x3D888889, 0xBD888889, 0xBD888889, + 0x00040046, 0x00DC8010, 0x00000000, 0x00000001, + 0x0000002F, 0x000002AF, 0x00000000, 0x00000086, + 0x00000015, 0xBBDA740E, 0x3F147AE1, 0x3BDA740E, + 0x000200DC, 0x01108000, 0x00000000, 0x00000000, + 0x00000086, 0x00000015, 0x00000000, 0x00000065, + 0x00000002, 0x00000000, 0xBF227627, 0x00000000, + 0x00000003, 0x00000001, 0x000C0154, 0x01550000, + 0x00000000, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFD, + 0xFFFFFFFF, 0x00000000, 0xFFFFFFFD, 0x00000000, + 0x00000000, 0x00000000, 0x00000013, 0x00000006, + 0xFFFF0000, 0x0032FFFF, 0xFFFFFFFF, 0x70E60032, + 0x003C0000, 0x00000000, 0xFFFF003C, 0x00FAFFFF, + 0xFFFFFFFF, 0x70E700FA, 0x01040000, 0x00000000, + 0xFFFF0104, 0x0122FFFF, 0xFFFFFFFF, 0x70E80122, + 0x01400000, 0x00000000, 0x00000001, 0x00010000, + 0x00FB0000, 0x00000000, 0x42700000, 0xFFC5000C, + 0x02B20222, 0x00000000, 0x42700000, 0xFFC5000C, + 0x02B200FA, 0x00000000, 0x42700000, 0xFFC5000C, + 0x02B20000, 0x00000000, 0x42700000, 0xFFC5000C, + 0x02B20000, 0x00000000, 0x42700000, 0xFFC5000C, + 0x02B20000, 0x00000000, 0x42700000, 0xFFE10018, + 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, + 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, + 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, + 0x02BD2D70, 0x00000000, 0x42700000, 0xFFE10018, + 0x02BD0085, 0x00000000, 0x42700000, 0xFFE10018, + 0x02BD01E6, 0xFF000000, 0x42700000, 0xFFE10018, + 0x02BD0000, 0x00000001, 0x0001005A, 0x014B0000, + 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0222, + 0x00000000, 0x42700000, 0xFF66005C, 0x00EC00FA, + 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, + 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, + 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, + 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, + 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, + 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, + 0xFF000000, 0x42700000, 0xFF66005C, 0x00EC2D70, + 0x00000001, 0x000100DC, 0x01EB0000, 0x00000000, + 0x42700001, 0xFFFE007A, 0x00270222, 0x00000000, + 0x42700001, 0xFFFE007A, 0x002700FA, 0x00000000, + 0x42700001, 0xFFFE0066, 0x00270000, 0x00000000, + 0x42700001, 0xFFFE005A, 0x00270000, 0x00000000, + 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, + 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, + 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, + 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, + 0x42700001, 0xFFFE0051, 0x003E2D70, 0xFF000000, + 0x42700001, 0xFFFE0051, 0x003E0085, 0x00000002, + 0x00010000, 0x01180000, 0x0000001E, 0x42700000, + 0x002B0034, 0x02CC0222, 0x0000001E, 0x42700000, + 0x002B0034, 0x02CC00FA, 0x0000000A, 0x42700000, + 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, + 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, + 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, + 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, + 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, + 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, + 0x003F0056, 0x02D22D70, 0x0000001E, 0x42700000, + 0x003F0055, 0x02D10085, 0x0000001E, 0x42700000, + 0x003F0055, 0x02D101E6, 0xFF00001E, 0x42700000, + 0x003E0055, 0x02D10000, 0x00000002, 0x0001005A, + 0x01680000, 0x0000001E, 0x42700000, 0xFF970053, + 0x016E0222, 0x0000001E, 0x42700000, 0xFF980053, + 0x016C00FA, 0x0000001E, 0x42700000, 0xFFC10053, + 0x01530000, 0x0000001E, 0x42700000, 0xFFF00063, + 0x00FF0000, 0x0000001E, 0x42700000, 0xFFE2006F, + 0x00B10000, 0x0000001E, 0x42700000, 0xFFB00070, + 0x00790000, 0x0000001E, 0x42700000, 0xFFB00070, + 0x00790000, 0x0000001E, 0x42700000, 0xFFB00070, + 0x00790000, 0xFF00001E, 0x42700000, 0xFFB00070, + 0x00792D70, 0x00000002, 0x000100DC, 0x02080000, + 0x0000001E, 0x42700001, 0x00000089, 0xFFC90222, + 0x0000001E, 0x42700001, 0x00000089, 0xFFC900FA, + 0x0000001E, 0x42700001, 0x00000075, 0xFFC90000, + 0x0000001E, 0x42700001, 0x00000069, 0xFFC90000, + 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, + 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, + 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, + 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, + 0x0000001E, 0x42700001, 0x00000062, 0xFFE12D70, + 0xFF00001E, 0x42700001, 0x00000062, 0xFFE10085, + 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, +}; + const ActorInit Bg_Toki_Swd_InitVars = { ACTOR_BG_TOKI_SWD, @@ -23,57 +314,78 @@ const ActorInit Bg_Toki_Swd_InitVars = (ActorFunc)BgTokiSwd_Update, (ActorFunc)BgTokiSwd_Draw, }; -*/ -//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_SetupAction.s") -void BgTokiSwd_SetupAction(BgTokiSwd* this, ActorFunc actionFunc) + +static ColliderCylinderInit colliderInit = +{ + 0x0A, 0x00, 0x00, 0x39, + 0x12, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0xFFCFFFFF, + 0x00, 0x00, 0x00, 0x00, + 0xFFCFFFFF, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, + 0x000A, + 0x0046, + 0x0000000000000000, +}; + +static SubActor98Init subActor98Init = +{ + 0x0A, + 0x0023, + 0x0064, + 0xFF, +}; + +static InitChainEntry initChain[] = +{ + ICHAIN_VEC3F_DIV1000(scale, 0x19, ICHAIN_STOP), +}; + +static void BgTokiSwd_SetupAction(BgTokiSwd* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Init.s") -extern InitChainEntry D_808BC414; -extern ColliderCylinderInit D_808BC3E0; -extern SubActor98Init D_808BC40C; -void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) +static void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) { ColliderCylinderMain* collision; Actor* thisx = &this->actor; - Actor_ProcessInitChain(thisx, &D_808BC414); + Actor_ProcessInitChain(thisx, initChain); this->actor.shape.unk_08 = 800.0f; - BgTokiSwd_SetupAction(thisx, &func_808BAF40); + BgTokiSwd_SetupAction(thisx, func_808BAF40); collision = &this->collider; if (LINK_IS_ADULT) { thisx->draw = NULL; } + if (gSaveContext.scene_setup_index == 5) { globalCtx->unk_11D30[0] = 0xFF; } + ActorCollider_AllocCylinder(globalCtx, collision); - ActorCollider_InitCylinder(globalCtx, collision, thisx, &D_808BC3E0); + ActorCollider_InitCylinder(globalCtx, collision, thisx, &colliderInit); ActorCollider_Cylinder_Update(thisx, collision); - func_80061ED4(&thisx->sub_98, 0, &D_808BC40C); + func_80061ED4(&thisx->sub_98, 0, &subActor98Init); } -//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Destroy.s") -void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx) +static void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx) { ColliderCylinderMain* collider = &this->collider; ActorCollider_FreeCylinder(globalCtx, collider); } -//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BAF40.s") -extern D_808BBD90; -extern D_808BB2F0; -extern D_808BB7A0; -void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) + +static void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) { if (((gSaveContext.event_chk_inf[4] & 0x8000) == 0) && (gSaveContext.scene_setup_index < 4) && (func_8002E12C(&this->actor, 800.0f, 0x7530) != 0) && (func_800BFC84(globalCtx) == 0)) { gSaveContext.event_chk_inf[4] |= 0x8000; - globalCtx->csCtx.segment = &D_808BBD90; + globalCtx->csCtx.segment = D_808BBD90; gSaveContext.cutscene_trigger = 1; } if (LINK_IS_CHILD || ((gSaveContext.event_chk_inf[5] & 0x20) != 0)) @@ -83,17 +395,17 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) if (LINK_IS_CHILD) { Item_Give(globalCtx, 0x3C); - globalCtx->csCtx.segment = &D_808BB2F0; + globalCtx->csCtx.segment = D_808BB2F0; } else { - globalCtx->csCtx.segment = &D_808BB7A0; + globalCtx->csCtx.segment = D_808BB7A0; } Audio_SetBGM(NA_BGM_STOP); Audio_SetBGM(NA_SE_PL_BOUND_DIRT); gSaveContext.cutscene_trigger = (u8)1; this->actor.attachedA = 0; - BgTokiSwd_SetupAction(this, &func_808BB0AC); + BgTokiSwd_SetupAction(this, func_808BB0AC); } else { @@ -114,39 +426,62 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB0AC.s") +static void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx) +{ + Player* player; -//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/func_808BB128.s") -void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) + //if attached is set, sword has been pulled/placed from the pedestal + if (func_8002F410(&this->actor, globalCtx) != 0) + { + if (LINK_IS_CHILD) + { + Audio_PlayActorSound2(&this->actor, NA_SE_IT_SWORD_PUTAWAY_STN); + this->actor.draw = NULL; //sword has been pulled, dont draw sword + } + else + { + this->actor.draw = BgTokiSwd_Draw; //sword has been placed, draw the master sword + } + BgTokiSwd_SetupAction(this, func_808BB128); + return; + } + player = PLAYER; + player->interactRangeActor = &this->actor; +} + +static void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) { if ((func_8006C4A4(globalCtx, 1) != 0) && (globalCtx->unk_11D30[0] < 0xFF)) { globalCtx->unk_11D30[0] = globalCtx->unk_11D30[0] + 5; } } -//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Update.s") -void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx) + +static void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx) { this->actionFunc(&this->actor, globalCtx); Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); } -//#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Toki_Swd/BgTokiSwd_Draw.s") -extern char D_808BC420[]; -extern char D_808BC434[]; -extern D_06001BD0; -extern char D_808BC448[]; -void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx) { - Gfx* gfxArr[7]; - GraphicsContext* gfxCtx; - - + +static void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx) +{ + s32 pad[4]; + GameState* state; + GraphicsContext* gfxCtx; + Gfx* gfxArr[4]; + state = &globalCtx->state; gfxCtx = globalCtx->state.gfxCtx; - func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, &D_808BC420, 0x2D7); + func_800C6AC4(gfxArr, state->gfxCtx, "../z_bg_toki_swd.c", 727); func_80093D18(globalCtx->state.gfxCtx); + func_8002EBCC(&this->actor, globalCtx, 0); - gSPSegment(gfxCtx->polyOpa.p++, 0x08, Draw_TexScroll(globalCtx->state.gfxCtx, 0, -(globalCtx->gameplayFrames & 0x7F), 0x20, 0x20)); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, D_808BC434, 0x2E6), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPSegment(gfxCtx->polyOpa.p++, 0x08, Draw_TexScroll(globalCtx->state.gfxCtx, 0, + -(globalCtx->gameplayFrames % 0x80), 32, 32)); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 742), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001BD0); - func_800C6B54(gfxArr, globalCtx->state.gfxCtx, D_808BC448, 0x308); + + func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 776); } From f1ae94c2f30fe0c96646b027b53c99418cb3f2da Mon Sep 17 00:00:00 2001 From: shawlucas Date: Sat, 21 Mar 2020 18:08:45 -0700 Subject: [PATCH 08/33] Made suggested changes to ovl_Bg_Toki_Swd --- .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 69384dded9..759dde5eb9 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -394,7 +394,7 @@ static void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) { if (LINK_IS_CHILD) { - Item_Give(globalCtx, 0x3C); + Item_Give(globalCtx, ITEM_SWORD_MASTER); globalCtx->csCtx.segment = D_808BB2F0; } else @@ -403,7 +403,7 @@ static void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) } Audio_SetBGM(NA_BGM_STOP); Audio_SetBGM(NA_SE_PL_BOUND_DIRT); - gSaveContext.cutscene_trigger = (u8)1; + gSaveContext.cutscene_trigger = 1; this->actor.attachedA = 0; BgTokiSwd_SetupAction(this, func_808BB0AC); } @@ -419,10 +419,12 @@ static void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) { if (globalCtx->unk_11D30[0] > 0) { - globalCtx->unk_11D30[0] = globalCtx->unk_11D30[0] - 1; - return; + globalCtx->unk_11D30[0]--; + } + else + { + globalCtx->unk_11D30[0] = 0; } - globalCtx->unk_11D30[0] = 0; } } @@ -453,7 +455,7 @@ static void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) { if ((func_8006C4A4(globalCtx, 1) != 0) && (globalCtx->unk_11D30[0] < 0xFF)) { - globalCtx->unk_11D30[0] = globalCtx->unk_11D30[0] + 5; + globalCtx->unk_11D30[0]+= 5; } } From fd2dae78a2f90af23a834f77bab7dfff2e05f5d6 Mon Sep 17 00:00:00 2001 From: shawlucas Date: Sat, 21 Mar 2020 18:11:02 -0700 Subject: [PATCH 09/33] added one space to a line --- src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 759dde5eb9..53b2ba7a35 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -455,7 +455,7 @@ static void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) { if ((func_8006C4A4(globalCtx, 1) != 0) && (globalCtx->unk_11D30[0] < 0xFF)) { - globalCtx->unk_11D30[0]+= 5; + globalCtx->unk_11D30[0] += 5; } } From 13e2c84dbf2535c31db55e1bedebab5ee128d43d Mon Sep 17 00:00:00 2001 From: shawlucas Date: Sat, 21 Mar 2020 20:37:35 -0700 Subject: [PATCH 10/33] Made suggested changes --- src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 53b2ba7a35..459d1d3360 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -445,10 +445,12 @@ static void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx) this->actor.draw = BgTokiSwd_Draw; //sword has been placed, draw the master sword } BgTokiSwd_SetupAction(this, func_808BB128); - return; } - player = PLAYER; - player->interactRangeActor = &this->actor; + else + { + player = PLAYER; + player->interactRangeActor = &this->actor; + } } static void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) From bd00e0d1da2cf316d40654e4b5c743edd9532d06 Mon Sep 17 00:00:00 2001 From: Random <28494085+Random0666@users.noreply.github.com> Date: Sun, 22 Mar 2020 17:37:38 +0100 Subject: [PATCH 11/33] Decompiled z_sample.c `z_sample.c` : 1 non matching left --- .../{func_80097604.s => Sample_Draw.s} | 2 +- .../code/z_sample/func_800975D0.s | 16 --- .../code/z_sample/func_80097820.s | 12 -- .../code/z_sample/func_80097848.s | 4 - .../code/z_sample/func_80097850.s | 52 -------- .../code/z_sample/func_80097904.s | 40 ------ .../code/z_sample/func_80097974.s | 36 ------ include/functions.h | 15 +-- include/z64.h | 11 +- src/code/z_sample.c | 114 ++++++++++++++++-- 10 files changed, 126 insertions(+), 176 deletions(-) rename asm/non_matchings/code/z_sample/{func_80097604.s => Sample_Draw.s} (99%) delete mode 100644 asm/non_matchings/code/z_sample/func_800975D0.s delete mode 100644 asm/non_matchings/code/z_sample/func_80097820.s delete mode 100644 asm/non_matchings/code/z_sample/func_80097848.s delete mode 100644 asm/non_matchings/code/z_sample/func_80097850.s delete mode 100644 asm/non_matchings/code/z_sample/func_80097904.s delete mode 100644 asm/non_matchings/code/z_sample/func_80097974.s diff --git a/asm/non_matchings/code/z_sample/func_80097604.s b/asm/non_matchings/code/z_sample/Sample_Draw.s similarity index 99% rename from asm/non_matchings/code/z_sample/func_80097604.s rename to asm/non_matchings/code/z_sample/Sample_Draw.s index d00da8bad3..6a3a8fc58c 100644 --- a/asm/non_matchings/code/z_sample/func_80097604.s +++ b/asm/non_matchings/code/z_sample/Sample_Draw.s @@ -8,7 +8,7 @@ glabel D_8013F2D0 .balign 4 .text -glabel func_80097604 +glabel Sample_Draw /* B0E7A4 80097604 27BDFF90 */ addiu $sp, $sp, -0x70 /* B0E7A8 80097608 AFBF002C */ sw $ra, 0x2c($sp) /* B0E7AC 8009760C AFB00028 */ sw $s0, 0x28($sp) diff --git a/asm/non_matchings/code/z_sample/func_800975D0.s b/asm/non_matchings/code/z_sample/func_800975D0.s deleted file mode 100644 index 55ae52cfd8..0000000000 --- a/asm/non_matchings/code/z_sample/func_800975D0.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel func_800975D0 -/* B0E770 800975D0 948E0020 */ lhu $t6, 0x20($a0) -/* B0E774 800975D4 2401EFFF */ li $at, -4097 -/* B0E778 800975D8 3C18800C */ lui $t8, %hi(func_800BCA64) # $t8, 0x800c -/* B0E77C 800975DC 01C17827 */ nor $t7, $t6, $at -/* B0E780 800975E0 15E00006 */ bnez $t7, .L800975FC -/* B0E784 800975E4 2718CA64 */ addiu $t8, %lo(func_800BCA64) # addiu $t8, $t8, -0x359c -/* B0E788 800975E8 3C190001 */ lui $t9, (0x00012518 >> 16) # lui $t9, 1 -/* B0E78C 800975EC 37392518 */ ori $t9, (0x00012518 & 0xFFFF) # ori $t9, $t9, 0x2518 -/* B0E790 800975F0 AC990010 */ sw $t9, 0x10($a0) -/* B0E794 800975F4 AC98000C */ sw $t8, 0xc($a0) -/* B0E798 800975F8 AC800098 */ sw $zero, 0x98($a0) -.L800975FC: -/* B0E79C 800975FC 03E00008 */ jr $ra -/* B0E7A0 80097600 00000000 */ nop - diff --git a/asm/non_matchings/code/z_sample/func_80097820.s b/asm/non_matchings/code/z_sample/func_80097820.s deleted file mode 100644 index bc130040d0..0000000000 --- a/asm/non_matchings/code/z_sample/func_80097820.s +++ /dev/null @@ -1,12 +0,0 @@ -glabel func_80097820 -/* B0E9C0 80097820 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* B0E9C4 80097824 AFBF0014 */ sw $ra, 0x14($sp) -/* B0E9C8 80097828 0C025D81 */ jal func_80097604 -/* B0E9CC 8009782C AFA40018 */ sw $a0, 0x18($sp) -/* B0E9D0 80097830 0C025D74 */ jal func_800975D0 -/* B0E9D4 80097834 8FA40018 */ lw $a0, 0x18($sp) -/* B0E9D8 80097838 8FBF0014 */ lw $ra, 0x14($sp) -/* B0E9DC 8009783C 27BD0018 */ addiu $sp, $sp, 0x18 -/* B0E9E0 80097840 03E00008 */ jr $ra -/* B0E9E4 80097844 00000000 */ nop - diff --git a/asm/non_matchings/code/z_sample/func_80097848.s b/asm/non_matchings/code/z_sample/func_80097848.s deleted file mode 100644 index 6b04677c80..0000000000 --- a/asm/non_matchings/code/z_sample/func_80097848.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel func_80097848 -/* B0E9E8 80097848 03E00008 */ jr $ra -/* B0E9EC 8009784C AFA40000 */ sw $a0, ($sp) - diff --git a/asm/non_matchings/code/z_sample/func_80097850.s b/asm/non_matchings/code/z_sample/func_80097850.s deleted file mode 100644 index 6e99b41be4..0000000000 --- a/asm/non_matchings/code/z_sample/func_80097850.s +++ /dev/null @@ -1,52 +0,0 @@ -.late_rodata -glabel D_8013F300 - .float 3000 - -.text -glabel func_80097850 -/* B0E9F0 80097850 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* B0E9F4 80097854 AFB00018 */ sw $s0, 0x18($sp) -/* B0E9F8 80097858 AFBF001C */ sw $ra, 0x1c($sp) -/* B0E9FC 8009785C 8C850000 */ lw $a1, ($a0) -/* B0EA00 80097860 249000A8 */ addiu $s0, $a0, 0xa8 -/* B0EA04 80097864 0C02A89E */ jal func_800AA278 -/* B0EA08 80097868 02002025 */ move $a0, $s0 -/* B0EA0C 8009786C 240E00F0 */ li $t6, 240 -/* B0EA10 80097870 240F0140 */ li $t7, 320 -/* B0EA14 80097874 AFAF0054 */ sw $t7, 0x54($sp) -/* B0EA18 80097878 AFAE004C */ sw $t6, 0x4c($sp) -/* B0EA1C 8009787C AFA00048 */ sw $zero, 0x48($sp) -/* B0EA20 80097880 AFA00050 */ sw $zero, 0x50($sp) -/* B0EA24 80097884 02002025 */ move $a0, $s0 -/* B0EA28 80097888 0C02A93F */ jal func_800AA4FC -/* B0EA2C 8009788C 27A50048 */ addiu $a1, $sp, 0x48 -/* B0EA30 80097890 02002025 */ move $a0, $s0 -/* B0EA34 80097894 3C054270 */ lui $a1, 0x4270 -/* B0EA38 80097898 3C064120 */ lui $a2, 0x4120 -/* B0EA3C 8009789C 0C02A918 */ jal func_800AA460 -/* B0EA40 800978A0 3C074648 */ li $a3, 0x46480000 # 0.000000 -/* B0EA44 800978A4 44800000 */ mtc1 $zero, $f0 -/* B0EA48 800978A8 3C018014 */ lui $at, %hi(D_8013F300) -/* B0EA4C 800978AC C424F300 */ lwc1 $f4, %lo(D_8013F300)($at) -/* B0EA50 800978B0 3C013F80 */ li $at, 0x3F800000 # 0.000000 -/* B0EA54 800978B4 44813000 */ mtc1 $at, $f6 -/* B0EA58 800978B8 02002025 */ move $a0, $s0 -/* B0EA5C 800978BC 27A5003C */ addiu $a1, $sp, 0x3c -/* B0EA60 800978C0 27A60030 */ addiu $a2, $sp, 0x30 -/* B0EA64 800978C4 27A70024 */ addiu $a3, $sp, 0x24 -/* B0EA68 800978C8 E7A0003C */ swc1 $f0, 0x3c($sp) -/* B0EA6C 800978CC E7A00040 */ swc1 $f0, 0x40($sp) -/* B0EA70 800978D0 E7A00030 */ swc1 $f0, 0x30($sp) -/* B0EA74 800978D4 E7A00034 */ swc1 $f0, 0x34($sp) -/* B0EA78 800978D8 E7A00038 */ swc1 $f0, 0x38($sp) -/* B0EA7C 800978DC E7A00024 */ swc1 $f0, 0x24($sp) -/* B0EA80 800978E0 E7A0002C */ swc1 $f0, 0x2c($sp) -/* B0EA84 800978E4 E7A40044 */ swc1 $f4, 0x44($sp) -/* B0EA88 800978E8 0C02A8D6 */ jal func_800AA358 -/* B0EA8C 800978EC E7A60028 */ swc1 $f6, 0x28($sp) -/* B0EA90 800978F0 8FBF001C */ lw $ra, 0x1c($sp) -/* B0EA94 800978F4 8FB00018 */ lw $s0, 0x18($sp) -/* B0EA98 800978F8 27BD0060 */ addiu $sp, $sp, 0x60 -/* B0EA9C 800978FC 03E00008 */ jr $ra -/* B0EAA0 80097900 00000000 */ nop - diff --git a/asm/non_matchings/code/z_sample/func_80097904.s b/asm/non_matchings/code/z_sample/func_80097904.s deleted file mode 100644 index 359cf0b232..0000000000 --- a/asm/non_matchings/code/z_sample/func_80097904.s +++ /dev/null @@ -1,40 +0,0 @@ -.rdata -glabel D_8013F2E0 - .asciz "../z_sample.c" - .balign 4 - -glabel D_8013F2F0 - .asciz "../z_sample.c" - .balign 4 - -.text -glabel func_80097904 -/* B0EAA4 80097904 3C0E01AF */ lui $t6, %hi(_title_staticSegmentRomEnd) # $t6, 0x1af -/* B0EAA8 80097908 3C0F01AA */ lui $t7, %hi(_title_staticSegmentRomStart) # $t7, 0x1aa -/* B0EAAC 8009790C 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* B0EAB0 80097910 25EF4000 */ addiu $t7, %lo(_title_staticSegmentRomStart) # addiu $t7, $t7, 0x4000 -/* B0EAB4 80097914 25CEB440 */ addiu $t6, %lo(_title_staticSegmentRomEnd) # addiu $t6, $t6, -0x4bc0 -/* B0EAB8 80097918 AFBF001C */ sw $ra, 0x1c($sp) -/* B0EABC 8009791C 01CF2823 */ subu $a1, $t6, $t7 -/* B0EAC0 80097920 3C068014 */ lui $a2, %hi(D_8013F2E0) # $a2, 0x8014 -/* B0EAC4 80097924 AFA40028 */ sw $a0, 0x28($sp) -/* B0EAC8 80097928 24C6F2E0 */ addiu $a2, %lo(D_8013F2E0) # addiu $a2, $a2, -0xd20 -/* B0EACC 8009792C AFA50020 */ sw $a1, 0x20($sp) -/* B0EAD0 80097930 0C031521 */ jal Game_Alloc -/* B0EAD4 80097934 240700A3 */ li $a3, 163 -/* B0EAD8 80097938 8FB80028 */ lw $t8, 0x28($sp) -/* B0EADC 8009793C 3C0501AA */ lui $a1, %hi(_title_staticSegmentRomStart) # $a1, 0x1aa -/* B0EAE0 80097940 3C078014 */ lui $a3, %hi(D_8013F2F0) # $a3, 0x8014 -/* B0EAE4 80097944 241900A4 */ li $t9, 164 -/* B0EAE8 80097948 AF0200A4 */ sw $v0, 0xa4($t8) -/* B0EAEC 8009794C AFB90010 */ sw $t9, 0x10($sp) -/* B0EAF0 80097950 8FA60020 */ lw $a2, 0x20($sp) -/* B0EAF4 80097954 24E7F2F0 */ addiu $a3, %lo(D_8013F2F0) # addiu $a3, $a3, -0xd10 -/* B0EAF8 80097958 24A54000 */ addiu $a1, %lo(_title_staticSegmentRomStart) # addiu $a1, $a1, 0x4000 -/* B0EAFC 8009795C 0C0006A8 */ jal DmaMgr_SendRequest1 -/* B0EB00 80097960 00402025 */ move $a0, $v0 -/* B0EB04 80097964 8FBF001C */ lw $ra, 0x1c($sp) -/* B0EB08 80097968 27BD0028 */ addiu $sp, $sp, 0x28 -/* B0EB0C 8009796C 03E00008 */ jr $ra -/* B0EB10 80097970 00000000 */ nop - diff --git a/asm/non_matchings/code/z_sample/func_80097974.s b/asm/non_matchings/code/z_sample/func_80097974.s deleted file mode 100644 index 41bd087462..0000000000 --- a/asm/non_matchings/code/z_sample/func_80097974.s +++ /dev/null @@ -1,36 +0,0 @@ -glabel func_80097974 -/* B0EB14 80097974 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* B0EB18 80097978 AFBF0014 */ sw $ra, 0x14($sp) -/* B0EB1C 8009797C 3C0E8009 */ lui $t6, %hi(func_80097820) # $t6, 0x8009 -/* B0EB20 80097980 3C0F8009 */ lui $t7, %hi(func_80097848) # $t7, 0x8009 -/* B0EB24 80097984 3C028016 */ lui $v0, %hi(gGameInfo) # $v0, 0x8016 -/* B0EB28 80097988 25CE7820 */ addiu $t6, %lo(func_80097820) # addiu $t6, $t6, 0x7820 -/* B0EB2C 8009798C 25EF7848 */ addiu $t7, %lo(func_80097848) # addiu $t7, $t7, 0x7848 -/* B0EB30 80097990 2442FA90 */ addiu $v0, %lo(gGameInfo) # addiu $v0, $v0, -0x570 -/* B0EB34 80097994 AC8E0004 */ sw $t6, 4($a0) -/* B0EB38 80097998 AC8F0008 */ sw $t7, 8($a0) -/* B0EB3C 8009799C 8C590000 */ lw $t9, ($v0) -/* B0EB40 800979A0 24180001 */ li $t8, 1 -/* B0EB44 800979A4 A7380110 */ sh $t8, 0x110($t9) -/* B0EB48 800979A8 0C025E14 */ jal func_80097850 -/* B0EB4C 800979AC AFA40018 */ sw $a0, 0x18($sp) -/* B0EB50 800979B0 0C025E41 */ jal func_80097904 -/* B0EB54 800979B4 8FA40018 */ lw $a0, 0x18($sp) -/* B0EB58 800979B8 3C028016 */ lui $v0, %hi(gGameInfo) # $v0, 0x8016 -/* B0EB5C 800979BC 2442FA90 */ addiu $v0, %lo(gGameInfo) # addiu $v0, $v0, -0x570 -/* B0EB60 800979C0 8C480000 */ lw $t0, ($v0) -/* B0EB64 800979C4 A500011E */ sh $zero, 0x11e($t0) -/* B0EB68 800979C8 8C490000 */ lw $t1, ($v0) -/* B0EB6C 800979CC A5200120 */ sh $zero, 0x120($t1) -/* B0EB70 800979D0 8C4A0000 */ lw $t2, ($v0) -/* B0EB74 800979D4 A5400122 */ sh $zero, 0x122($t2) -/* B0EB78 800979D8 8C4B0000 */ lw $t3, ($v0) -/* B0EB7C 800979DC A5600124 */ sh $zero, 0x124($t3) -/* B0EB80 800979E0 8C4C0000 */ lw $t4, ($v0) -/* B0EB84 800979E4 A5800126 */ sh $zero, 0x126($t4) -/* B0EB88 800979E8 8C4D0000 */ lw $t5, ($v0) -/* B0EB8C 800979EC A5A00128 */ sh $zero, 0x128($t5) -/* B0EB90 800979F0 8FBF0014 */ lw $ra, 0x14($sp) -/* B0EB94 800979F4 27BD0018 */ addiu $sp, $sp, 0x18 -/* B0EB98 800979F8 03E00008 */ jr $ra -/* B0EB9C 800979FC 00000000 */ nop diff --git a/include/functions.h b/include/functions.h index 1e7ff1ce09..a2b527cd3c 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1091,12 +1091,13 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum); s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx); void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags); void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx); -// ? func_800975D0(?); -// ? func_80097604(?); -// ? func_80097820(?); -// ? func_80097848(?); -// ? func_80097850(?); -// ? func_80097904(?); +void Sample_Calc(SampleContext* this); +void Sample_Draw(SampleContext* this); +void Sample_Update(SampleContext* this); +void Sample_Destroy(SampleContext* this); +void Sample_SetupView(SampleContext* this); +void Sample_LoadTitleStatic(SampleContext* this); +void Sample_Init(SampleContext* this); void Inventory_ChangeEquipment(s16 equipment, u16 value); u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment); void Inventory_ChangeUpgrade(s16 upgrade, s16 value); @@ -2297,7 +2298,7 @@ void func_80103A70(UNK_PTR, Gfx*, Hilite*, f32, f32, f32, f32, f32, f32, f32, f3 // ? func_80103B30(?); // ? func_80103B60(?); // ? func_80103BB0(?); -// ? func_80103D58(?); +void func_80103D58(Mtx*, f32, f32, f32, f32, f32, f32, f32); // ? func_80103DC0(?); // ? func_80103E20(?); // ? func_80103FA4(?); diff --git a/include/z64.h b/include/z64.h index 7381d9bf78..c60ba8328c 100644 --- a/include/z64.h +++ b/include/z64.h @@ -302,7 +302,9 @@ typedef struct { /* 0x0000 */ char unk_00[0x28]; /* 0x0028 */ Vec3f eye; - /* 0x0034 */ char unk_34[0xF4]; + /* 0x0034 */ char unk_34[0xEC]; + /* 0x0120 */ u32 unk_120; + /* 0x0124 */ char unk_124[4]; } View; // size = 0x128 typedef struct @@ -865,6 +867,13 @@ typedef struct /* 0x01E2 */ char unk_1E2[6]; } TitleContext; // size = 0x1E8 +typedef struct +{ + /* 0x0000 */ GameState state; + /* 0x00A4 */ void* staticSegment; + /* 0x00A8 */ View view; +} SampleContext; + // Global Context (dbg ram start: 80212020) typedef struct GlobalContext { diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 441d8451a9..3c8f31f69f 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -1,17 +1,117 @@ #include #include +#include -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/func_800975D0.s") +void Sample_Calc(SampleContext* this) +{ + if (!~(this->state.input[0].padPressed | ~START_BUTTON)) + { + this->state.init = func_800BCA64; this->state.size = sizeof(GlobalContext); + this->state.running = false; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/func_80097604.s") +// very close from matching, the only difference is the place of "mtx" in the stack +#ifdef NON_MATCHING +void Sample_Draw(SampleContext* this) +{ + u32 pad; + GraphicsContext* gfxCtx = this->state.gfxCtx; + View* view = &this->view; + Gfx* gfxArr[4]; + Mtx* mtx; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/func_80097820.s") + func_800C6AC4(gfxArr, gfxCtx, "../z_sample.c", 62); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/func_80097848.s") + gSPSegment(gfxCtx->polyOpa.p++, 0, 0); + gSPSegment(gfxCtx->polyOpa.p++, 1, this->staticSegment); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/func_80097850.s") + func_80095248(gfxCtx, 0, 0, 0); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/func_80097904.s") + view->unk_120 = 7; + func_800AAA50(view, 15); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/func_80097974.s") + mtx = Graph_Alloc(gfxCtx, sizeof(Mtx)); + func_80103D58(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42)); + gSPMatrix(gfxCtx->polyOpa.p++, mtx, G_MTX_LOAD); + gfxCtx->polyOpa.p = func_80093708(gfxCtx->polyOpa.p, 0xFF, 0xFF, 0xFF, 0, 0, 0); + func_80093D18(gfxCtx); + + gDPSetCycleType(gfxCtx->polyOpa.p++, G_CYC_1CYCLE); + gDPSetRenderMode(gfxCtx->polyOpa.p++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + gDPSetCombineLERP(gfxCtx->polyOpa.p++, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE); + gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, 0xFF, 0xFF, 0x00, 0x00); + + func_800C6B54(gfxArr, gfxCtx, "../z_sample.c", 111); +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/Sample_Draw.s") +#endif + +void Sample_Update(SampleContext* this) +{ + Sample_Draw(this); + Sample_Calc(this); +} + +void Sample_Destroy(SampleContext* this) +{ + +} + +void Sample_SetupView(SampleContext* this) +{ + View* view; + GraphicsContext* gfxCtx; + u32 v0[4]; + Vec3f v1; + Vec3f v2; + Vec3f v3; + + view = &this->view; + gfxCtx = this->state.gfxCtx; + func_800AA278(view, gfxCtx); + + v0[1] = SCREEN_HEIGHT; v0[3] = SCREEN_WIDTH; + v0[0] = 0; + v0[2] = 0; + + func_800AA4FC(view, &v0); + func_800AA460(view, 60, 10, 12800); + + v1.x = 0; + v1.y = 0; + v2.x = 0; + v2.y = 0; + v2.z = 0; + v3.x = 0; + v3.z = 0; + v1.z = 3000; + v3.y = 1; + + func_800AA358(view, &v1, &v2, &v3); +} + +void Sample_LoadTitleStatic(SampleContext* this) +{ + u32 size = (u32)(_title_staticSegmentRomEnd - _title_staticSegmentRomStart); + + this->staticSegment = Game_Alloc(&this->state, size, "../z_sample.c", 163); + DmaMgr_SendRequest1(this->staticSegment, _title_staticSegmentRomStart, size, "../z_sample.c", 164); +} + +void Sample_Init(SampleContext* this) +{ + this->state.main = Sample_Update; + this->state.destroy = Sample_Destroy; + R_UPDATE_RATE = 1; + Sample_SetupView(this); + Sample_LoadTitleStatic(this); + SREG(37) = 0; + SREG(38) = 0; + SREG(39) = 0; + SREG(40) = 0; + SREG(41) = 0; + SREG(42) = 0; +} From fd7c3c9e563093ed6c879dbae7705f2f3e15be03 Mon Sep 17 00:00:00 2001 From: glank Date: Sun, 22 Mar 2020 18:55:05 +0100 Subject: [PATCH 12/33] Responding to PR comments --- include/functions.h | 2 +- include/z64scene.h | 6 - src/code/z_actor.c | 2 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 288 ++++++++++++------------ src/overlays/actors/ovl_En_Tk/z_en_tk.h | 8 +- undefined_syms.txt | 1 - 6 files changed, 144 insertions(+), 163 deletions(-) diff --git a/include/functions.h b/include/functions.h index 0d996fb68e..2350227cdc 100644 --- a/include/functions.h +++ b/include/functions.h @@ -389,7 +389,7 @@ void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1); void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4); Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx); Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx); -s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, s16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*)); +s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*)); s16 func_800347E8(s16 arg0); void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha); void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha); diff --git a/include/z64scene.h b/include/z64scene.h index b25cb5198a..20370040e6 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -303,12 +303,6 @@ typedef struct } MeshHeader2; -typedef struct -{ - /* 0x00 */ u8 nPoints; - /* 0x04 */ Vec3s* pointArray; -} Path; // size = 0x8 - typedef struct { u8 ambientClrR, ambientClrG, ambientClrB; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 3eb05efb49..958cc4dad2 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4040,7 +4040,7 @@ Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx) return func_8002EB44(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); } -s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, s16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*)) +s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*)) { s16 sp26; s16 sp24; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index ffaa51f375..f5ec3bc5d5 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -15,14 +15,14 @@ typedef struct #define ROOM 0x00 #define FLAGS 0x00000009 -s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *ctxt); -void EnTk_Init(Actor *this, GlobalContext *ctxt); -void EnTk_Destroy(Actor *this, GlobalContext *ctxt); -void EnTk_Rest(EnTk *this, GlobalContext *ctxt); -void EnTk_Walk(EnTk *this, GlobalContext *ctxt); -void EnTk_Dig(EnTk *this, GlobalContext *ctxt); -void EnTk_Update(Actor *this, GlobalContext *ctxt); -void EnTk_Draw(Actor *this, GlobalContext *ctxt); +s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *globalCtx); +void EnTk_Init(EnTk *this, GlobalContext *globalCtx); +void EnTk_Destroy(EnTk *this, GlobalContext *globalCtx); +void EnTk_Rest(EnTk *this, GlobalContext *globalCtx); +void EnTk_Walk(EnTk *this, GlobalContext *globalCtx); +void EnTk_Dig(EnTk *this, GlobalContext *globalCtx); +void EnTk_Update(EnTk *this, GlobalContext *globalCtx); +void EnTk_Draw(EnTk *this, GlobalContext *globalCtx); extern UNK_TYPE D_04051DB0; extern UNK_TYPE D_040521B0; @@ -51,10 +51,10 @@ const ActorInit En_Tk_InitVars = FLAGS, OBJECT_TK, sizeof(EnTk), - EnTk_Init, - EnTk_Destroy, - EnTk_Update, - EnTk_Draw, + (ActorFunc)EnTk_Init, + (ActorFunc)EnTk_Destroy, + (ActorFunc)EnTk_Update, + (ActorFunc)EnTk_Draw, }; void EnTkEff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel, @@ -109,22 +109,22 @@ void EnTkEff_Update(EnTk *this) } } -void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) +void EnTkEff_Draw(EnTk *this, GlobalContext *globalCtx) { - static u32 images[] = + static UNK_PTR images[] = { - (u32)&D_040539B0, - (u32)&D_040535B0, - (u32)&D_040531B0, - (u32)&D_04052DB0, - (u32)&D_040529B0, - (u32)&D_040525B0, - (u32)&D_040521B0, - (u32)&D_04051DB0, + &D_040539B0, + &D_040535B0, + &D_040531B0, + &D_04052DB0, + &D_040529B0, + &D_040525B0, + &D_040521B0, + &D_04051DB0, }; EnTkEff *eff = this->eff; - GraphicsContext *gfx; + GraphicsContext *gfxCtx; s16 gfxSetup; s16 i; s16 alpha; @@ -136,8 +136,8 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) * makes me suspect that they're inside a macro where the function call * is present only for debug builds. Same for func_800C6B54 most likely. */ - gfx = ctxt->state.gfxCtx; - func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk_eff.c", 114); + gfxCtx = globalCtx->state.gfxCtx; + func_800C6AC4(pgdl, globalCtx->state.gfxCtx, "../z_en_tk_eff.c", 114); gfxSetup = 0; @@ -145,7 +145,7 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) * Same code is generated without the if, * but that would make the do...while redundant so there's probably an if. */ - do { if (1) { func_80093D84(ctxt->state.gfxCtx); } } while (0); + do { if (1) { func_80093D84(globalCtx->state.gfxCtx); } } while (0); for (i = 0; i < ARRAY_COUNT(this->eff); i++) { @@ -153,35 +153,35 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt) { if (gfxSetup == 0) { - gfx->polyXlu.p = func_80093774(gfx->polyXlu.p, 0); - gSPDisplayList(gfx->polyXlu.p++, &D_0600BC90); - gDPSetEnvColor(gfx->polyXlu.p++, 0x64, 0x3C, 0x14, 0x00); + gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0); + gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600BC90); + gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x64, 0x3C, 0x14, 0x00); gfxSetup = 1; } alpha = eff->timeLeft * (255.f / eff->timeTotal); - gDPSetPrimColor(gfx->polyXlu.p++, 0, 0, 0xAA, 0x82, 0x5A, alpha); + gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0xAA, 0x82, 0x5A, alpha); - gDPPipeSync(gfx->polyXlu.p++); - Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, 0); - func_800D1FD4(&ctxt->mf_11DA0); - Matrix_Scale(eff->size, eff->size, 1.f, 1); - gSPMatrix(gfx->polyXlu.p++, - Matrix_NewMtx(ctxt->state.gfxCtx, "../z_en_tk_eff.c", + gDPPipeSync(gfxCtx->polyXlu.p++); + Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); + func_800D1FD4(&globalCtx->mf_11DA0); + Matrix_Scale(eff->size, eff->size, 1.f, MTXMODE_APPLY); + gSPMatrix(gfxCtx->polyXlu.p++, + Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tk_eff.c", 140), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); imageIdx = eff->timeLeft * ((f32)ARRAY_COUNT(images) / eff->timeTotal); - gSPSegment(gfx->polyXlu.p++, 0x08, + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(images[imageIdx])); - gSPDisplayList(gfx->polyXlu.p++, &D_0600BCA0); + gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600BCA0); } eff++; } - func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk_eff.c", 154); + func_800C6B54(pgdl, globalCtx->state.gfxCtx, "../z_en_tk_eff.c", 154); } s32 EnTkEff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size, @@ -221,7 +221,7 @@ static EnTk_SubActorStruct98Init D_80B1D534 = 0xFF, }; -void EnTk_RestAnim(EnTk *this, GlobalContext *ctxt) +void EnTk_RestAnim(EnTk *this, GlobalContext *globalCtx) { UNK_PTR anim = &D_06002F84; @@ -233,7 +233,7 @@ void EnTk_RestAnim(EnTk *this, GlobalContext *ctxt) this->actor.speedXZ = 0.f; } -void EnTk_WalkAnim(EnTk *this, GlobalContext *ctxt) +void EnTk_WalkAnim(EnTk *this, GlobalContext *globalCtx) { UNK_PTR anim = &D_06001FA8; @@ -244,7 +244,7 @@ void EnTk_WalkAnim(EnTk *this, GlobalContext *ctxt) this->actionCountdown = Math_Rand_S16Offset(240, 240); } -void EnTk_DigAnim(EnTk *this, GlobalContext *ctxt) +void EnTk_DigAnim(EnTk *this, GlobalContext *globalCtx) { UNK_PTR anim = &D_06001144; @@ -252,7 +252,7 @@ void EnTk_DigAnim(EnTk *this, GlobalContext *ctxt) SkelAnime_GetFrameCount((u32)&D_06001144), 0, -10.f); - if (EnTk_CheckNextSpot(this, ctxt) >= 0) + if (EnTk_CheckNextSpot(this, globalCtx) >= 0) { this->validDigHere = 1; } @@ -305,13 +305,13 @@ s32 EnTk_CheckFacingPlayer(EnTk *this) } } -s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *ctxt) +s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *globalCtx) { Actor *prop; f32 dxz; f32 dy; - prop = ctxt->actorCtx.actorList[ACTORTYPE_PROP].first; + prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; while (prop != NULL) { @@ -358,7 +358,7 @@ void EnTk_CheckCurrentSpot(EnTk *this) } } -f32 EnTk_Step(EnTk *this, GlobalContext *ctxt) +f32 EnTk_Step(EnTk *this, GlobalContext *globalCtx) { f32 stepFrames[] = {36.f, 10.f}; f32 a1_; @@ -370,7 +370,7 @@ f32 EnTk_Step(EnTk *this, GlobalContext *ctxt) Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK); } - if (this->skelAnim.animCurrent != (u32)&D_06001FA8) + if (this->skelAnim.animCurrent != (u32 *)&D_06001FA8) { return 0.f; } @@ -394,7 +394,7 @@ f32 EnTk_Step(EnTk *this, GlobalContext *ctxt) } } -s32 EnTk_Orient(EnTk *this, GlobalContext *ctxt) +s32 EnTk_Orient(EnTk *this, GlobalContext *globalCtx) { Path *path; Vec3s *point; @@ -406,22 +406,21 @@ s32 EnTk_Orient(EnTk *this, GlobalContext *ctxt) return 1; } - path = &ctxt->setupPathList[0]; - point = SEGMENTED_TO_VIRTUAL(path->pointArray); + path = &globalCtx->setupPathList[0]; + point = SEGMENTED_TO_VIRTUAL(path->path); point += this->currentWaypoint; dx = point->x - this->actor.posRot.pos.x; dz = point->z - this->actor.posRot.pos.z; Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, - func_800FD250(dx, dz) * (0x8000 / M_PI), - 10, 1000, 1); + Math_atan2f(dx, dz) * (0x8000 / M_PI), 10, 1000, 1); this->actor.posRot.rot = this->actor.shape.rot; if (SQ(dx) + SQ(dz) < 10.f) { this->currentWaypoint++; - if (this->currentWaypoint >= path->nPoints) + if (this->currentWaypoint >= path->count) { this->currentWaypoint = 0; } @@ -434,11 +433,11 @@ s32 EnTk_Orient(EnTk *this, GlobalContext *ctxt) } } -u16 func_80B1C54C(GlobalContext *ctxt, Actor *a1) +u16 func_80B1C54C(GlobalContext *globalCtx, Actor *a1) { u16 ret; - ret = func_8006C360(ctxt, 14); + ret = func_8006C360(globalCtx, 14); if (ret != 0) { return ret; @@ -456,16 +455,13 @@ u16 func_80B1C54C(GlobalContext *ctxt, Actor *a1) } } -s16 func_80B1C5A0(GlobalContext *ctxt, Actor *actor) +s16 func_80B1C5A0(GlobalContext *globalCtx, Actor *actor) { s32 ret = 1; - switch (func_8010BDBC(&ctxt->msgCtx)) + switch (func_8010BDBC(&globalCtx->msgCtx)) { case 0: - { - break; - } case 1: { break; @@ -486,10 +482,10 @@ s16 func_80B1C5A0(GlobalContext *ctxt, Actor *actor) } case 4: { - if (func_80106BC8(ctxt) != 0 && + if (func_80106BC8(globalCtx) != 0 && (actor->textId == 0x5018 || actor->textId == 0x5019)) { - if (ctxt->msgCtx.choiceIndex == 1) + if (globalCtx->msgCtx.choiceIndex == 1) { /* "Thanks a lot!" */ actor->textId = 0x0084; @@ -501,38 +497,29 @@ s16 func_80B1C5A0(GlobalContext *ctxt, Actor *actor) } else { - ctxt->msgCtx.msgMode = 0x37; + globalCtx->msgCtx.msgMode = 0x37; Rupees_ChangeBy(-10); gSaveContext.inf_table[13] |= 0x0200; return 2; } - func_8010B720(ctxt, actor->textId); + func_8010B720(globalCtx, actor->textId); gSaveContext.inf_table[13] |= 0x0200; } break; } case 5: { - if (func_80106BC8(ctxt) != 0 && + if (func_80106BC8(globalCtx) != 0 && (actor->textId == 0x0084 || actor->textId == 0x0085)) { - func_80106CCC(ctxt); + func_80106CCC(globalCtx); ret = 0; } break; } case 6: - { - break; - } case 7: - { - break; - } case 8: - { - break; - } case 9: { break; @@ -654,49 +641,51 @@ void EnTk_DigEff(EnTk *this) } } -void EnTk_Init(Actor *this, GlobalContext *ctxt) +void EnTk_Init(EnTk *this, GlobalContext *globalCtx) { - EnTk *tk = (EnTk *)this; + EnTk *thisAgain = this; UNK_PTR anim = &D_06002F84; - ActorShape_Init(&tk->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.f); + ActorShape_Init(&thisAgain->actor.shape, 0, ActorShadow_DrawFunc_Circle, + 24.f); - func_800A46F8(ctxt, &tk->skelAnim, (u32)&D_0600BE40, 0, tk->hz_22A, - tk->hz_296, 18); - SkelAnime_ChangeAnimation(&tk->skelAnim, (u32)anim, 1.f, 0.f, + func_800A46F8(globalCtx, &thisAgain->skelAnim, (u32)&D_0600BE40, 0, + thisAgain->hz_22A, thisAgain->hz_296, 18); + SkelAnime_ChangeAnimation(&thisAgain->skelAnim, (u32)anim, 1.f, 0.f, SkelAnime_GetFrameCount((u32)&D_06002F84), 0, 0.f); - ActorCollider_AllocCylinder(ctxt, &tk->collider); - ActorCollider_InitCylinder(ctxt, &tk->collider, &tk->actor, &D_80B1D508); + ActorCollider_AllocCylinder(globalCtx, &thisAgain->collider); + ActorCollider_InitCylinder(globalCtx, &thisAgain->collider, + &thisAgain->actor, &D_80B1D508); - func_80061EFC(&tk->actor.sub_98, NULL, &D_80B1D534); + func_80061EFC(&thisAgain->actor.sub_98, NULL, &D_80B1D534); if (gSaveContext.day_time <= 0xC000 || gSaveContext.day_time >= 0xE000 || !LINK_IS_CHILD || - ctxt->sceneNum != SCENE_SPOT02) + globalCtx->sceneNum != SCENE_SPOT02) { - Actor_Kill(&tk->actor); + Actor_Kill(&thisAgain->actor); return; } - Actor_SetScale(&tk->actor, 0.01f); + Actor_SetScale(&thisAgain->actor, 0.01f); - tk->actor.unk_1F = 6; - tk->actor.gravity = -0.1f; - tk->currentReward = -1; - tk->currentSpot = NULL; - tk->actionFunc = EnTk_Rest; + thisAgain->actor.unk_1F = 6; + thisAgain->actor.gravity = -0.1f; + thisAgain->currentReward = -1; + thisAgain->currentSpot = NULL; + thisAgain->actionFunc = EnTk_Rest; } -void EnTk_Destroy(Actor *this, GlobalContext *ctxt) +void EnTk_Destroy(EnTk *this, GlobalContext *globalCtx) { - EnTk *tk = (EnTk *)this; - ActorCollider_FreeCylinder(ctxt, &tk->collider); + EnTk *thisAgain = this; + ActorCollider_FreeCylinder(globalCtx, &thisAgain->collider); } -void EnTk_Rest(EnTk *this, GlobalContext *ctxt) +void EnTk_Rest(EnTk *this, GlobalContext *globalCtx) { s16 v1; s16 a1_; @@ -709,13 +698,13 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt) if (this->h_1E0 == 2) { - EnTk_DigAnim(this, ctxt); + EnTk_DigAnim(this, globalCtx); this->h_1E0 = 0; this->actionFunc = EnTk_Dig; return; } - func_800343CC(ctxt, &this->actor, &this->h_1E0, + func_800343CC(globalCtx, &this->actor, &this->h_1E0, this->collider.dim.radius + 30.f, func_80B1C54C, func_80B1C5A0); } @@ -726,11 +715,11 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt) v1 = this->actor.rotTowardsLinkY - v1; this->actionCountdown = 0; - func_800343CC(ctxt, &this->actor, &this->h_1E0, + func_800343CC(globalCtx, &this->actor, &this->h_1E0, this->collider.dim.radius + 30.f, func_80B1C54C, func_80B1C5A0); } - else if (func_8002F194(&this->actor, ctxt) != 0) + else if (func_8002F194(&this->actor, globalCtx) != 0) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; @@ -741,7 +730,7 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt) } else if (DECR(this->actionCountdown) == 0) { - EnTk_WalkAnim(this, ctxt); + EnTk_WalkAnim(this, globalCtx); this->actionFunc = EnTk_Walk; /*! @bug v1 is uninitialized past this branch */ @@ -755,31 +744,31 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt) Math_SmoothScaleMaxMinS(&this->headRot, a1_, 6, 1000, 1); } -void EnTk_Walk(EnTk *this, GlobalContext *ctxt) +void EnTk_Walk(EnTk *this, GlobalContext *globalCtx) { if (this->h_1E0 == 2) { - EnTk_DigAnim(this, ctxt); + EnTk_DigAnim(this, globalCtx); this->h_1E0 = 0; this->actionFunc = EnTk_Dig; } else { - this->actor.speedXZ = EnTk_Step(this, ctxt); - EnTk_Orient(this, ctxt); + this->actor.speedXZ = EnTk_Step(this, globalCtx); + EnTk_Orient(this, globalCtx); Math_SmoothScaleMaxMinS(&this->headRot, 0, 6, 1000, 1); EnTk_CheckCurrentSpot(this); DECR(this->actionCountdown); if (EnTk_CheckFacingPlayer(this) != 0 || this->actionCountdown == 0) { - EnTk_RestAnim(this, ctxt); + EnTk_RestAnim(this, globalCtx); this->actionFunc = EnTk_Rest; } } } -void EnTk_Dig(EnTk *this, GlobalContext *ctxt) +void EnTk_Dig(EnTk *this, GlobalContext *globalCtx) { Vec3f rewardOrigin; Vec3f rewardPos; @@ -807,7 +796,7 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt) rewardOrigin.y = 0.f; rewardOrigin.z = -40.f; - Matrix_RotateY(this->actor.shape.rot.y, 0); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW); Matrix_MultVec3f(&rewardOrigin, &rewardPos); rewardPos.x += this->actor.posRot.pos.x; @@ -828,7 +817,7 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt) } } - Item_DropCollectible(ctxt, &rewardPos, + Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]); } } @@ -860,14 +849,14 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt) if (this->currentReward < 0) { /* "Nope, nothing here!" */ - func_8010B680(ctxt, 0x501A, 0); + func_8010B680(globalCtx, 0x501A, 0); } else { - func_80106CCC(ctxt); + func_80106CCC(globalCtx); } - EnTk_RestAnim(this, ctxt); + EnTk_RestAnim(this, globalCtx); this->currentReward = -1; this->validDigHere = 0; @@ -875,38 +864,38 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt) } } -void EnTk_Update(Actor *this, GlobalContext *ctxt) +void EnTk_Update(EnTk *this, GlobalContext *globalCtx) { - EnTk *tk = (EnTk *)this; - ColliderCylinderMain *collider = &tk->collider; + EnTk *thisAgain = this; + ColliderCylinderMain *collider = &thisAgain->collider; - ActorCollider_Cylinder_Update(&tk->actor, collider); - Actor_CollisionCheck_SetOT(ctxt, &ctxt->sub_11E60, collider); + ActorCollider_Cylinder_Update(&thisAgain->actor, collider); + Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, collider); - SkelAnime_FrameUpdateMatrix(&tk->skelAnim); + SkelAnime_FrameUpdateMatrix(&thisAgain->skelAnim); - Actor_MoveForward(&tk->actor); + Actor_MoveForward(&thisAgain->actor); - func_8002E4B4(ctxt, &tk->actor, 40.f, 10.f, 0.f, 5); + func_8002E4B4(globalCtx, &thisAgain->actor, 40.f, 10.f, 0.f, 5); - tk->actionFunc(tk, ctxt); + thisAgain->actionFunc(thisAgain, globalCtx); - EnTkEff_Update(tk); + EnTkEff_Update(thisAgain); - EnTk_UpdateEyes(tk); + EnTk_UpdateEyes(thisAgain); } -void func_80B1D200(GlobalContext *ctxt) +void func_80B1D200(GlobalContext *globalCtx) { - GraphicsContext *gfx; + GraphicsContext *gfxCtx; Gfx *pgdl[4]; - gfx = ctxt->state.gfxCtx; - func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1188); + gfxCtx = globalCtx->state.gfxCtx; + func_800C6AC4(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1188); - gSPDisplayList(gfx->polyOpa.p++, &D_0600ACE0); + gSPDisplayList(gfxCtx->polyOpa.p++, &D_0600ACE0); - func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1190); + func_800C6B54(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1190); } s32 func_80B1D278(s16 a0, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Vec3s *sp10, @@ -934,8 +923,8 @@ s32 func_80B1D278(s16 a0, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Vec3s *sp10, return 0; } -void func_80B1D2E4(GlobalContext *ctxt, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, - Actor *actor) +void func_80B1D2E4(GlobalContext *globalCtx, UNK_TYPE a1, UNK_TYPE a2, + UNK_TYPE a3, Actor *actor) { EnTk *this = (EnTk *)actor; Vec3f sp28 = {0.f, 0.f, 4600.f}; @@ -951,38 +940,39 @@ void func_80B1D2E4(GlobalContext *ctxt, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, if (a1 == 14) { Matrix_MultVec3f(&sp28, &this->v3f_304); - func_80B1D200(ctxt); + func_80B1D200(globalCtx); } } -void EnTk_Draw(Actor *this, GlobalContext *ctxt) +void EnTk_Draw(EnTk *this, GlobalContext *globalCtx) { - static u32 eyeImages[] = + static UNK_PTR eyeImages[] = { - (u32)&D_06003B40, - (u32)&D_06004340, - (u32)&D_06004B40, + &D_06003B40, + &D_06004340, + &D_06004B40, }; - EnTk *tk = (EnTk *)this; - GraphicsContext *gfx; + EnTk *thisAgain = this; + GraphicsContext *gfxCtx; Gfx *pgdl[4]; Matrix_Push(); - EnTkEff_Draw(tk, ctxt); + EnTkEff_Draw(thisAgain, globalCtx); Matrix_Pull(); - gfx = ctxt->state.gfxCtx; - func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1294); + gfxCtx = globalCtx->state.gfxCtx; + func_800C6AC4(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1294); - func_80093D18(ctxt->state.gfxCtx); + func_80093D18(globalCtx->state.gfxCtx); - gSPSegment(gfx->polyOpa.p++, 0x08, - SEGMENTED_TO_VIRTUAL(eyeImages[tk->eyeImageIdx])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, + SEGMENTED_TO_VIRTUAL(eyeImages[thisAgain->eyeImageIdx])); - func_800A1AC8(ctxt, tk->skelAnim.limbIndex, - tk->skelAnim.actorDrawTbl, tk->skelAnim.dListCount, - func_80B1D278, func_80B1D2E4, &tk->actor); + func_800A1AC8(globalCtx, thisAgain->skelAnim.limbIndex, + thisAgain->skelAnim.actorDrawTbl, + thisAgain->skelAnim.dListCount, func_80B1D278, func_80B1D2E4, + &thisAgain->actor); - func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1312); + func_800C6B54(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1312); } diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/src/overlays/actors/ovl_En_Tk/z_en_tk.h index f35741d3f4..9aacdf1a5e 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -4,7 +4,7 @@ #include #include -/* Dust particle effect */ +/* Dirt particle effect */ typedef struct { /* 0x0000 */ u8 active; @@ -16,8 +16,7 @@ typedef struct /* 0x0014 */ Vec3f pos; /* 0x0020 */ Vec3f speed; /* 0x002C */ Vec3f accel; - /* 0x0038 */ -} EnTkEff; +} EnTkEff; // size = 0x0038 typedef struct EnTk EnTk; @@ -49,8 +48,7 @@ struct EnTk /* 0x022A */ u16 hz_296[55]; /* 0x0304 */ Vec3f v3f_304; /* 0x0310 */ EnTkEff eff[20]; - /* 0x0770 */ -}; +}; // size = 0x0770 extern const ActorInit En_Tk_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index b1fb2bb2e5..1e6763936b 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -332,7 +332,6 @@ D_0600ACE0 = 0x0600ACE0; D_0600BC90 = 0x0600BC90; D_0600BCA0 = 0x0600BCA0; D_0600BE40 = 0x0600BE40; -D_8002B5EC = 0x8002B5EC; // z_arms_hook D_0602B288 = 0x0602B288; From 0db4629a63bca63a1cd913c2d07f887dcf974228 Mon Sep 17 00:00:00 2001 From: Random <28494085+Random0666@users.noreply.github.com> Date: Sun, 22 Mar 2020 19:32:44 +0100 Subject: [PATCH 13/33] Update PR #22 minor fixes --- src/code/z_sample.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 3c8f31f69f..eb29dc4750 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -23,7 +23,7 @@ void Sample_Draw(SampleContext* this) func_800C6AC4(gfxArr, gfxCtx, "../z_sample.c", 62); - gSPSegment(gfxCtx->polyOpa.p++, 0, 0); + gSPSegment(gfxCtx->polyOpa.p++, 0, NULL; gSPSegment(gfxCtx->polyOpa.p++, 1, this->staticSegment); func_80095248(gfxCtx, 0, 0, 0); @@ -95,7 +95,7 @@ void Sample_SetupView(SampleContext* this) void Sample_LoadTitleStatic(SampleContext* this) { - u32 size = (u32)(_title_staticSegmentRomEnd - _title_staticSegmentRomStart); + u32 size = _title_staticSegmentRomEnd - _title_staticSegmentRomStart; this->staticSegment = Game_Alloc(&this->state, size, "../z_sample.c", 163); DmaMgr_SendRequest1(this->staticSegment, _title_staticSegmentRomStart, size, "../z_sample.c", 164); From 0704beba8dde8ef043a73f11149c9267a6c63bbc Mon Sep 17 00:00:00 2001 From: Roman971 Date: Wed, 18 Mar 2020 22:56:43 +0100 Subject: [PATCH 14/33] Setup formatting with clang-format and clang-tidy --- .clang-format | 23 +++++++++++++++++++++++ .clang-tidy | 5 +++++ fixle.sh | 2 ++ format.sh | 28 ++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 .clang-format create mode 100644 .clang-tidy create mode 100644 format.sh diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..c7b900f060 --- /dev/null +++ b/.clang-format @@ -0,0 +1,23 @@ +IndentWidth: 4 +Language: Cpp +UseTab: Never +ColumnLimit: 120 +PointerAlignment: Left +BreakBeforeBraces: Attach +SpaceAfterCStyleCast: false +Cpp11BracedListStyle: false +IndentCaseLabels: true +BinPackArguments: true +BinPackParameters: true +AlignAfterOpenBracket: Align +AlignOperands: true +BreakBeforeTernaryOperators: true +BreakBeforeBinaryOperators: None +AllowShortBlocksOnASingleLine: true +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AlignEscapedNewlines: Left +AlignTrailingComments: true +SortIncludes: false diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..4022a3f68a --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,5 @@ +Checks: '-*,readability-braces-around-statements' +WarningsAsErrors: '' +HeaderFilterRegex: '(src|include)\/.*\.h$' +FormatStyle: 'file' +CheckOptions: diff --git a/fixle.sh b/fixle.sh index bf4527540d..a1941b69ac 100644 --- a/fixle.sh +++ b/fixle.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + var="$1" if [ ! -n "$var" ] then diff --git a/format.sh b/format.sh new file mode 100644 index 0000000000..18a1cae68f --- /dev/null +++ b/format.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +FORMAT_OPTS="-i -style=file" +TIDY_OPTS="-p . --fix --fix-errors" +COMPILER_OPTS="-fno-builtin -std=gnu90 -Iinclude -Isrc -D_LANGUAGE_C" + +shopt -s globstar + +if (( $# > 0 )); then + echo "Formatting file(s) $*" + echo "Running clang-format..." + clang-format ${FORMAT_OPTS} "$@" + echo "Running clang-tidy..." + clang-tidy ${TIDY_OPTS} "$@" -- ${COMPILER_OPTS} &> /dev/null + echo "Adding missing final new lines..." + sed -i -e '$a\' "$@" + echo "Done formatting file(s) $*" + exit +fi + +echo "Formatting C files. This will take a bit" +echo "Running clang-format..." +clang-format ${FORMAT_OPTS} src/**/*.c +echo "Running clang-tidy..." +clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null +echo "Adding missing final new lines..." +find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \; +echo "Done formatting all files." From 251aea64ab3e6e8cd6f1d9ed34f514e656724777 Mon Sep 17 00:00:00 2001 From: Roman971 Date: Wed, 18 Mar 2020 22:18:25 +0100 Subject: [PATCH 15/33] Add comments and macros to prevent match issues with formatting --- include/macros.h | 4 +++ include/vt.h | 2 +- src/code/fault_drawer.c | 2 +- src/code/title_setup.c | 2 +- src/code/z_parameter.c | 26 ++++++++++++------- src/code/z_sample.c | 7 ++--- src/overlays/actors/ovl_Demo_Go/z_demo_go.c | 5 +--- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 3 +++ .../gamestates/ovl_opening/z_opening.c | 2 +- 9 files changed, 33 insertions(+), 20 deletions(-) diff --git a/include/macros.h b/include/macros.h index e9238973ae..217d01f841 100644 --- a/include/macros.h +++ b/include/macros.h @@ -35,4 +35,8 @@ #define CAPACITY(upg, value) gUpgradeCapacities[upg][value] #define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg)) +#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \ + (curState)->init = newInit; \ + (curState)->size = sizeof(newStruct); + #endif diff --git a/include/vt.h b/include/vt.h index c2d60246d4..fb08bc315e 100644 --- a/include/vt.h +++ b/include/vt.h @@ -21,7 +21,7 @@ #define VT_ESC "\x1b" #define VT_CSI "[" -#define VT_CUP(x, y) VT_ESC VT_CSI #y ";" #x "H" +#define VT_CUP(x, y) VT_ESC VT_CSI y ";" x "H" #define VT_ED(n) VT_ESC VT_CSI #n "J" #define VT_SGR(n) VT_ESC VT_CSI n "m" diff --git a/src/code/fault_drawer.c b/src/code/fault_drawer.c index 392290d8ab..82a7e83b05 100644 --- a/src/code/fault_drawer.c +++ b/src/code/fault_drawer.c @@ -175,7 +175,7 @@ void FaultDrawer_SetCharPad(s8 padW, s8 padH) void FaultDrawer_SetCursor(s32 x, s32 y) { if (sFaultDrawerStruct.osSyncPrintfEnabled) - osSyncPrintf(VT_CUP(%d, %d), (y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad), (x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad)); + osSyncPrintf(VT_CUP("%d", "%d"), (y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad), (x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad)); sFaultDrawerStruct.cursorX = x; sFaultDrawerStruct.cursorY = y; } diff --git a/src/code/title_setup.c b/src/code/title_setup.c index d7ac9cc87a..b0c3e76f99 100644 --- a/src/code/title_setup.c +++ b/src/code/title_setup.c @@ -6,7 +6,7 @@ void TitleSetup_InitImpl(GameState* gameState) osSyncPrintf("ゼルダ共通データ初期化\n"); SaveContext_Init(); gameState->running = false; - gameState->init = Title_Init; gameState->size = sizeof(TitleContext); + SET_NEXT_GAMESTATE(gameState, Title_Init, TitleContext); } void TitleSetup_Destroy(GameState* gameState) diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index cb5fb307c5..5b9a3abf9f 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2434,9 +2434,14 @@ void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState) !interfaceCtx->naviCalling && (globalCtx->csCtx.state == 0)) { - // Whitespace matters for codegen here - if (naviCallState == 0x1E) Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (naviCallState == 0x1D) func_800F4524(&D_801333D4, NA_SE_VO_NA_HELLO_2, 32); + // clang-format off + // NOLINTNEXTLINE + if (naviCallState == 0x1E) Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &D_801333D4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); + // clang-format on + + if (naviCallState == 0x1D) + func_800F4524(&D_801333D4, NA_SE_VO_NA_HELLO_2, 32); interfaceCtx->naviCalling = 1; sCUpInvisible = 0; @@ -2478,14 +2483,16 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) // Translates to: "***** Fluctuation=%d (now=%d, max=%d) ***" osSyncPrintf("***** 増減=%d (now=%d, max=%d) ***", healthChange, gSaveContext.health, gSaveContext.health_capacity); - // Whitespace matters for codegen here - if (healthChange > 0) Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - else if ((gSaveContext.double_defense != 0) && (healthChange < 0)) - { + // clang-format off + // NOLINTNEXTLINE + if (healthChange > 0) Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); + else if ((gSaveContext.double_defense != 0) && (healthChange < 0)) { healthChange >>= 1; // Translates to: "Heart decrease halved!!=%d" osSyncPrintf("ハート減少半分!!=%d\n", healthChange); } + // clang-format on gSaveContext.health += healthChange; @@ -3582,9 +3589,10 @@ void func_8008A994(InterfaceContext* interfaceCtx) { s32 sp18[4]; - // Whitespace matters for codegen here - sp18[1] = 240; sp18[3] = 320; + // clang-format off + sp18[1] = SCREEN_HEIGHT; sp18[3] = SCREEN_WIDTH; sp18[0] = 0; sp18[2] = 0; + // clang-format on func_800AA4FC(&interfaceCtx->view, sp18); func_800AB2C4(&interfaceCtx->view); diff --git a/src/code/z_sample.c b/src/code/z_sample.c index eb29dc4750..9aaf1db51f 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -6,7 +6,7 @@ void Sample_Calc(SampleContext* this) { if (!~(this->state.input[0].padPressed | ~START_BUTTON)) { - this->state.init = func_800BCA64; this->state.size = sizeof(GlobalContext); + SET_NEXT_GAMESTATE(&this->state, func_800BCA64, GlobalContext); this->state.running = false; } } @@ -73,9 +73,10 @@ void Sample_SetupView(SampleContext* this) gfxCtx = this->state.gfxCtx; func_800AA278(view, gfxCtx); + // clang-format off v0[1] = SCREEN_HEIGHT; v0[3] = SCREEN_WIDTH; - v0[0] = 0; - v0[2] = 0; + v0[0] = 0; v0[2] = 0; + // clang-format on func_800AA4FC(view, &v0); func_800AA460(view, 60, 10, 12800); 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 caafd18e0e..3006969e61 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -110,11 +110,8 @@ void func_8097C930(DemoGo* this) s16* something = &this->unk_192; s16* other = &this->unk_190; s32 pad[3]; - s16 phi_v0; - if (*something == 0) { phi_v0 = 0; } else { *something -= 1; phi_v0 = *something;} - - if (phi_v0 == 0) + if (DECR(*something) == 0) { *something = Math_Rand_S16Offset(0x3C, 0x3C); } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 7fb710eeaf..f1e89098fd 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -849,7 +849,10 @@ static void EnWallmas_DrawXlu(EnWallmas *this, GlobalContext *globalCtx) return; } + // clang-format off gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfx, globalCtx->state.gfxCtx, "../z_en_wallmas.c", 1386); + // clang-format on + func_80094044(globalCtx->state.gfxCtx); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0x00, 0x00, 0x00, 0xFF); diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index fa0e7e0484..98d806c01f 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -15,7 +15,7 @@ static void Opening_SetNextGameState(OpeningContext* this) func_800A82C8(); gSaveContext.cutscene_index = 0xFFF3; gSaveContext.scene_setup_index = 7; - this->state.init = func_800BCA64; this->state.size = sizeof(GlobalContext); + SET_NEXT_GAMESTATE(&this->state, func_800BCA64, GlobalContext); } static void func_80803C5C(OpeningContext* this) From 8cfe7cce9f8d8abea794e67510879e751d373a87 Mon Sep 17 00:00:00 2001 From: Roman971 Date: Sun, 22 Mar 2020 22:19:43 +0100 Subject: [PATCH 16/33] Format all src C files --- src/boot/assert.c | 3 +- src/boot/boot_main.c | 14 +- src/boot/idle.c | 19 +- src/boot/is_debug.c | 52 +- src/boot/logutils.c | 93 +- src/boot/stackcheck.c | 107 +- src/boot/viconfig.c | 35 +- src/boot/yaz0.c | 52 +- src/boot/z_locale.c | 36 +- src/boot/z_std_dma.c | 3322 ++++++++------- src/buffers/gfxbuffers.c | 2 +- src/code/TwoHeadArena.c | 103 +- src/code/__osMalloc.c | 581 ++- src/code/audioMgr.c | 1 - src/code/code_80026B00.c | 6 +- src/code/code_800430A0.c | 39 +- src/code/code_80043480.c | 66 +- src/code/code_80069420.c | 12 +- src/code/code_8006C360.c | 6 +- src/code/code_8006C3A0.c | 1 - src/code/code_8006C510.c | 1 - src/code/code_8006EA30.c | 5 +- src/code/code_8007BF90.c | 31 +- src/code/code_80097A00.c | 279 +- src/code/code_800A9D40.c | 19 +- src/code/code_800A9F30.c | 40 +- src/code/code_800ACE70.c | 109 +- src/code/code_800FBCE0.c | 16 +- src/code/code_800FC620.c | 141 +- src/code/code_800FCE80.c | 158 +- src/code/db_camera.c | 1 - src/code/debug_malloc.c | 83 +- src/code/fault.c | 296 +- src/code/fault_drawer.c | 226 +- src/code/gamealloc.c | 46 +- src/code/gfxprint.c | 435 +- src/code/irqmgr.c | 173 +- src/code/listalloc.c | 40 +- src/code/loadfragment2.c | 16 +- src/code/logseverity.c | 2 +- src/code/main.c | 62 +- src/code/padmgr.c | 185 +- src/code/relocation.c | 2 +- src/code/sched.c | 67 +- src/code/speed_meter.c | 24 +- src/code/sys_cfb.c | 53 +- src/code/sys_matrix.c | 297 +- src/code/sys_ucode.c | 12 +- src/code/system_malloc.c | 79 +- src/code/title_setup.c | 14 +- src/code/z_DLF.c | 79 +- src/code/z_actor.c | 3682 +++++++---------- src/code/z_actor_dlftbls.c | 58 +- src/code/z_bgcheck.c | 188 +- src/code/z_camera.c | 736 ++-- src/code/z_cheap_proc.c | 12 +- src/code/z_collision_check.c | 105 +- src/code/z_common_data.c | 4 +- src/code/z_construct.c | 77 +- src/code/z_debug.c | 222 +- src/code/z_debug_display.c | 52 +- src/code/z_demo.c | 732 ++-- src/code/z_draw.c | 294 +- src/code/z_eff_blure.c | 4 +- src/code/z_eff_shield_particle.c | 1 - src/code/z_eff_spark.c | 5 +- src/code/z_eff_ss_dead.c | 1 - src/code/z_effect_soft_sprite.c | 65 +- src/code/z_effect_soft_sprite_old_init.c | 1 - src/code/z_en_a_keep.c | 177 +- src/code/z_en_item00.c | 500 +-- src/code/z_fbdemo.c | 1 - src/code/z_fcurve_data_skelanime.c | 1 - src/code/z_horse.c | 294 +- src/code/z_jpeg.c | 1 - src/code/z_kaleido_manager.c | 63 +- src/code/z_kaleido_scope_call.c | 91 +- src/code/z_kanfont.c | 1 - src/code/z_kankyo.c | 16 +- src/code/z_lib.c | 374 +- src/code/z_lifemeter.c | 306 +- src/code/z_lights.c | 103 +- src/code/z_malloc.c | 83 +- src/code/z_map_exp.c | 1 - src/code/z_map_mark.c | 112 +- src/code/z_message_PAL.c | 1 - src/code/z_moji.c | 75 +- src/code/z_msgevent.c | 3 +- src/code/z_onepointdemo.c | 43 +- src/code/z_parameter.c | 3487 ++++++---------- src/code/z_play.c | 67 +- src/code/z_player_call.c | 18 +- src/code/z_player_lib.c | 97 +- src/code/z_prenmi.c | 22 +- src/code/z_prenmi_buff.c | 22 +- src/code/z_rcp.c | 45 +- src/code/z_room.c | 292 +- src/code/z_sample.c | 27 +- src/code/z_scene.c | 354 +- src/code/z_scene_table.c | 3066 ++++---------- src/code/z_skelanime.c | 1 - src/code/z_skin.c | 1 - src/code/z_skin_awb.c | 1 - src/code/z_skin_matrix.c | 1 - src/code/z_sram.c | 1 - src/code/z_view.c | 1 - src/code/z_vimode.c | 1 - src/code/z_vismono.c | 1 - src/code/z_vr_box.c | 1 - src/code/z_vr_box_draw.c | 1 - src/libultra_boot_O1/__osDequeueThread.c | 15 +- src/libultra_boot_O1/__osGetHWIntrRoutine.c | 3 +- src/libultra_boot_O1/__osResetGlobalIntMask.c | 5 +- src/libultra_boot_O1/__osSetGlobalIntMask.c | 5 +- src/libultra_boot_O1/__osSetHWIntrRoutine.c | 3 +- src/libultra_boot_O1/initialize.c | 58 +- src/libultra_boot_O1/osCreateMesgQueue.c | 3 +- src/libultra_boot_O1/osCreateThread.c | 9 +- src/libultra_boot_O1/osDestroyThread.c | 28 +- src/libultra_boot_O1/osGetMemSize.c | 15 +- src/libultra_boot_O1/osGetThreadId.c | 6 +- src/libultra_boot_O1/osGetThreadPri.c | 6 +- src/libultra_boot_O1/osGetTime.c | 3 +- src/libultra_boot_O1/osJamMesg.c | 2 +- src/libultra_boot_O1/osRecvMesg.c | 15 +- src/libultra_boot_O1/osSendMesg.c | 16 +- src/libultra_boot_O1/osSetEventMesg.c | 14 +- src/libultra_boot_O1/osSetThreadPri.c | 15 +- src/libultra_boot_O1/osStartThread.c | 43 +- src/libultra_boot_O1/osStopThread.c | 29 +- src/libultra_boot_O1/osViExtendVStart.c | 3 +- src/libultra_boot_O1/osViModePalLan1.c | 57 +- src/libultra_boot_O1/osVirtualToPhysical.c | 9 +- src/libultra_boot_O1/osYieldThread.c | 3 +- src/libultra_boot_O1/piacs.c | 12 +- src/libultra_boot_O1/timerintr.c | 19 +- src/libultra_boot_O2/_Ldtob.c | 26 +- src/libultra_boot_O2/_Litob.c | 21 +- src/libultra_boot_O2/_Printf.c | 93 +- src/libultra_boot_O2/__osDevMgrMain.c | 45 +- src/libultra_boot_O2/__osEPiRawReadIo.c | 40 +- src/libultra_boot_O2/__osEPiRawStartDma.c | 61 +- src/libultra_boot_O2/__osEPiRawWriteIo.c | 40 +- src/libultra_boot_O2/__osPiRawStartDma.c | 33 +- src/libultra_boot_O2/__osSiDeviceBusy.c | 8 +- src/libultra_boot_O2/__osSiRawReadIo.c | 8 +- src/libultra_boot_O2/__osSiRawWriteIo.c | 8 +- .../__osViGetCurrentContext.c | 3 +- src/libultra_boot_O2/__osViInit.c | 17 +- src/libultra_boot_O2/__osViSwapContext.c | 7 +- src/libultra_boot_O2/osCartRomInit.c | 9 +- src/libultra_boot_O2/osDriveRomInit.c | 9 +- src/libultra_boot_O2/osEPiReadIo.c | 5 +- src/libultra_boot_O2/osEPiStartDma.c | 18 +- src/libultra_boot_O2/osEPiWriteIo.c | 3 +- src/libultra_boot_O2/osPiGetCmdQueue.c | 6 +- src/libultra_boot_O2/osViBlack.c | 3 +- src/libultra_boot_O2/osViGetNextFramebuffer.c | 5 +- src/libultra_boot_O2/osViModeFpalLan1.c | 57 +- src/libultra_boot_O2/osViModeMpalLan1.c | 59 +- src/libultra_boot_O2/osViModeNtscLan1.c | 59 +- src/libultra_boot_O2/osViSetMode.c | 3 +- src/libultra_boot_O2/osViSetSpecialFeatures.c | 3 +- src/libultra_boot_O2/osViSetXScale.c | 3 +- src/libultra_boot_O2/osViSetYScale.c | 3 +- src/libultra_boot_O2/osViSwapBuffer.c | 3 +- src/libultra_boot_O2/pimgr.c | 23 +- src/libultra_boot_O2/sprintf.c | 15 +- src/libultra_boot_O2/string.c | 29 +- src/libultra_boot_O2/vimgr.c | 86 +- src/libultra_code/__osSiCreateAccessQueue.c | 6 +- src/libultra_code/__osSiRawStartDma.c | 13 +- src/libultra_code/__osSpGetStatus.c | 3 +- src/libultra_code/__osSpSetStatus.c | 3 +- src/libultra_code/code_80101B40.c.ignore | 3 +- src/libultra_code/code_80103B30.c | 6 +- src/libultra_code/code_80104140.c | 3 +- src/libultra_code/code_801064C0.c | 3 +- src/libultra_code/code_80106760.c | 3 +- src/libultra_code/code_801067A0.c | 6 +- src/libultra_code/guPerspectiveF.c | 11 +- src/libultra_code/osContInit.c | 18 +- src/libultra_code/osContStartReadData.c | 20 +- src/libultra_code/osDpGetStatus.c | 3 +- src/libultra_code/osDpSetStatus.c | 3 +- src/libultra_code/osVibrationPack.c | 70 +- .../actors/ovl_Arms_Hook/z_arms_hook.c | 2 +- .../actors/ovl_Arrow_Fire/z_arrow_fire.c | 2 +- .../actors/ovl_Arrow_Ice/z_arrow_ice.c | 2 +- .../actors/ovl_Arrow_Light/z_arrow_light.c | 2 +- .../ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c | 2 +- .../ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c | 351 +- .../actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c | 41 +- .../actors/ovl_Bg_Bombwall/z_bg_bombwall.c | 2 +- .../actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c | 2 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 2 +- .../actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c | 5 +- .../actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c | 2 +- .../actors/ovl_Bg_Dodoago/z_bg_dodoago.c | 3 +- .../ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c | 2 +- .../ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c | 2 +- .../ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c | 2 +- .../ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c | 2 +- .../ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 2 +- .../ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c | 2 +- .../ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c | 3 +- .../ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c | 43 +- .../ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c | 2 +- src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c | 2 +- .../actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c | 3 +- .../actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c | 2 +- .../ovl_Bg_Haka_Megane/z_bg_haka_megane.c | 5 +- .../ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c | 2 +- .../ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c | 2 +- .../actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c | 2 +- .../actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c | 2 +- .../actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c | 2 +- .../ovl_Bg_Haka_Water/z_bg_haka_water.c | 2 +- .../actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c | 2 +- .../ovl_Bg_Heavy_Block/z_bg_heavy_block.c | 2 +- .../ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c | 2 +- .../ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c | 5 +- .../z_bg_hidan_firewall.c | 2 +- .../ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c | 96 +- .../ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c | 2 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 2 +- .../ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c | 2 +- .../ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c | 2 +- .../z_bg_hidan_kowarerukabe.c | 2 +- .../ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c | 2 +- .../z_bg_hidan_rsekizou.c | 2 +- .../ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c | 2 +- .../ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c | 2 +- .../ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c | 96 +- .../ovl_Bg_Ice_Objects/z_bg_ice_objects.c | 2 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 2 +- .../ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c | 5 +- .../ovl_Bg_Ice_Turara/z_bg_ice_turara.c | 2 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 2 +- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.c | 2 +- .../z_bg_jya_amishutter.c | 85 +- .../ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c | 2 +- .../actors/ovl_Bg_Jya_Block/z_bg_jya_block.c | 2 +- .../z_bg_jya_bombchuiwa.c | 2 +- .../ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c | 2 +- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 2 +- .../ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c | 2 +- .../ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c | 2 +- .../ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c | 2 +- .../ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c | 73 +- .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c | 2 +- .../ovl_Bg_Jya_Megami/z_bg_jya_megami.c | 2 +- .../z_bg_jya_zurerukabe.c | 2 +- .../ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c | 3 +- .../z_bg_menkuri_kaiten.c | 34 +- .../z_bg_menkuri_nisekabe.c | 43 +- .../ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c | 2 +- .../ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c | 3 +- .../ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c | 2 +- .../actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c | 38 +- .../ovl_Bg_Mizu_Water/z_bg_mizu_water.c | 2 +- src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c | 63 +- .../ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 2 +- .../ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c | 2 +- .../ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c | 2 +- .../ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c | 3 +- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 2 +- .../ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c | 2 +- .../z_bg_mori_kaitenkabe.c | 2 +- .../z_bg_mori_rakkatenjo.c | 2 +- .../actors/ovl_Bg_Po_Event/z_bg_po_event.c | 3 +- .../ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c | 2 +- .../actors/ovl_Bg_Pushbox/z_bg_pushbox.c | 36 +- .../ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 2 +- .../ovl_Bg_Spot00_Break/z_bg_spot00_break.c | 57 +- .../z_bg_spot00_hanebasi.c | 2 +- .../ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c | 40 +- .../z_bg_spot01_idohashira.c | 2 +- .../z_bg_spot01_idomizu.c | 2 +- .../z_bg_spot01_idosoko.c | 41 +- .../z_bg_spot01_objects2.c | 2 +- .../z_bg_spot02_objects.c | 2 +- .../ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c | 2 +- .../ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c | 5 +- .../z_bg_spot06_objects.c | 2 +- .../ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c | 2 +- .../z_bg_spot08_bakudankabe.c | 2 +- .../z_bg_spot08_iceblock.c | 2 +- .../ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c | 2 +- .../z_bg_spot11_bakudankabe.c | 2 +- .../ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c | 2 +- .../ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c | 2 +- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 2 +- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 2 +- .../ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c | 43 +- .../z_bg_spot16_bombstone.c | 2 +- .../z_bg_spot16_doughnut.c | 2 +- .../z_bg_spot17_bakudankabe.c | 2 +- .../ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c | 2 +- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 2 +- .../ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c | 41 +- .../ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c | 2 +- .../z_bg_spot18_shutter.c | 5 +- .../actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c | 2 +- .../ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c | 2 +- .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 606 +-- .../actors/ovl_Bg_Treemouth/z_bg_treemouth.c | 2 +- .../actors/ovl_Bg_Umajump/z_bg_umajump.c | 44 +- .../actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c | 2 +- .../actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c | 2 +- .../ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c | 5 +- .../actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c | 2 +- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 2 +- .../actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 2 +- src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 2 +- src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c | 2 +- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 3 +- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 3 +- .../ovl_Boss_Ganondrof/z_boss_ganondrof.c | 2 +- .../actors/ovl_Boss_Goma/z_boss_goma.c | 2 +- src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 3 +- src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 3 +- src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 3 +- src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 3 +- src/overlays/actors/ovl_Demo_6K/z_demo_6k.c | 2 +- src/overlays/actors/ovl_Demo_Du/z_demo_du.c | 2 +- src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c | 2 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 2 +- src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c | 2 +- .../actors/ovl_Demo_Geff/z_demo_geff.c | 34 +- src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c | 2 +- src/overlays/actors/ovl_Demo_Go/z_demo_go.c | 207 +- src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c | 2 +- src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c | 2 +- src/overlays/actors/ovl_Demo_Im/z_demo_im.c | 2 +- .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 3 +- .../actors/ovl_Demo_Kekkai/z_demo_kekkai.c | 2 +- src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c | 2 +- src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c | 2 +- .../actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c | 2 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 127 +- .../actors/ovl_Door_Gerudo/z_door_gerudo.c | 2 +- .../actors/ovl_Door_Killer/z_door_killer.c | 2 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 2 +- .../actors/ovl_Door_Toki/z_door_toki.c | 45 +- .../actors/ovl_Door_Warp1/z_door_warp1.c | 3 +- .../actors/ovl_Efc_Erupc/z_efc_erupc.c | 2 +- src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c | 2 +- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 2 +- src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c | 2 +- src/overlays/actors/ovl_En_Am/z_en_am.c | 2 +- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 2 +- .../actors/ovl_En_Anubice/z_en_anubice.c | 2 +- .../ovl_En_Anubice_Fire/z_en_anubice_fire.c | 2 +- .../ovl_En_Anubice_Tag/z_en_anubice_tag.c | 93 +- .../actors/ovl_En_Arow_Trap/z_en_arow_trap.c | 48 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 2 +- .../ovl_En_Attack_Niw/z_en_attack_niw.c | 2 +- src/overlays/actors/ovl_En_Ba/z_en_ba.c | 2 +- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 2 +- .../actors/ovl_En_Bdfire/z_en_bdfire.c | 2 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 2 +- src/overlays/actors/ovl_En_Bili/z_en_bili.c | 2 +- src/overlays/actors/ovl_En_Bird/z_en_bird.c | 93 +- .../actors/ovl_En_Blkobj/z_en_blkobj.c | 2 +- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 2 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 2 +- .../ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c | 2 +- .../actors/ovl_En_Bom_Chu/z_en_bom_chu.c | 2 +- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 2 +- src/overlays/actors/ovl_En_Boom/z_en_boom.c | 183 +- src/overlays/actors/ovl_En_Box/z_en_box.c | 2 +- src/overlays/actors/ovl_En_Brob/z_en_brob.c | 2 +- .../actors/ovl_En_Bubble/z_en_bubble.c | 2 +- src/overlays/actors/ovl_En_Butte/z_en_butte.c | 2 +- src/overlays/actors/ovl_En_Bw/z_en_bw.c | 2 +- src/overlays/actors/ovl_En_Bx/z_en_bx.c | 2 +- .../actors/ovl_En_Changer/z_en_changer.c | 2 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 3 +- src/overlays/actors/ovl_En_Cow/z_en_cow.c | 2 +- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 2 +- src/overlays/actors/ovl_En_Cs/z_en_cs.c | 2 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 2 +- .../z_en_daiku_kakariko.c | 2 +- .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 2 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 2 +- src/overlays/actors/ovl_En_Dh/z_en_dh.c | 2 +- src/overlays/actors/ovl_En_Dha/z_en_dha.c | 2 +- .../ovl_En_Diving_Game/z_en_diving_game.c | 2 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 2 +- .../actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c | 2 +- .../actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c | 2 +- .../actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c | 2 +- .../actors/ovl_En_Dodojr/z_en_dodojr.c | 2 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 2 +- src/overlays/actors/ovl_En_Dog/z_en_dog.c | 386 +- src/overlays/actors/ovl_En_Door/z_en_door.c | 2 +- src/overlays/actors/ovl_En_Ds/z_en_ds.c | 5 +- src/overlays/actors/ovl_En_Du/z_en_du.c | 2 +- .../actors/ovl_En_Dy_Extra/z_en_dy_extra.c | 2 +- src/overlays/actors/ovl_En_Eg/z_en_eg.c | 55 +- src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c | 2 +- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 2 +- .../actors/ovl_En_Encount1/z_en_encount1.c | 2 +- .../actors/ovl_En_Encount2/z_en_encount2.c | 2 +- .../actors/ovl_En_Ex_Item/z_en_ex_item.c | 2 +- .../actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c | 2 +- src/overlays/actors/ovl_En_Fd/z_en_fd.c | 2 +- .../actors/ovl_En_Fd_Fire/z_en_fd_fire.c | 2 +- .../actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c | 2 +- .../actors/ovl_En_Fire_Rock/z_en_fire_rock.c | 2 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 2 +- src/overlays/actors/ovl_En_Fish/z_en_fish.c | 2 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 2 +- src/overlays/actors/ovl_En_Fr/z_en_fr.c | 2 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 3 +- src/overlays/actors/ovl_En_Fw/z_en_fw.c | 2 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 2 +- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 2 +- .../ovl_En_Ganon_Mant/z_en_ganon_mant.c | 2 +- .../ovl_En_Ganon_Organ/z_en_ganon_organ.c | 74 +- src/overlays/actors/ovl_En_Gb/z_en_gb.c | 2 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 2 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 2 +- src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 2 +- src/overlays/actors/ovl_En_GeldB/z_en_geldb.c | 2 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 2 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 2 +- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 2 +- src/overlays/actors/ovl_En_Goma/z_en_goma.c | 2 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 2 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 2 +- src/overlays/actors/ovl_En_Guest/z_en_guest.c | 2 +- src/overlays/actors/ovl_En_Hata/z_en_hata.c | 2 +- .../actors/ovl_En_Heishi1/z_en_heishi1.c | 2 +- .../actors/ovl_En_Heishi2/z_en_heishi2.c | 2 +- .../actors/ovl_En_Heishi3/z_en_heishi3.c | 2 +- .../actors/ovl_En_Heishi4/z_en_heishi4.c | 2 +- .../actors/ovl_En_Hintnuts/z_en_hintnuts.c | 2 +- src/overlays/actors/ovl_En_Holl/z_en_holl.c | 2 +- .../actors/ovl_En_Honotrap/z_en_honotrap.c | 2 +- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 2 +- .../z_en_horse_game_check.c | 2 +- .../ovl_En_Horse_Ganon/z_en_horse_ganon.c | 2 +- .../z_en_horse_link_child.c | 2 +- .../ovl_En_Horse_Normal/z_en_horse_normal.c | 2 +- .../ovl_En_Horse_Zelda/z_en_horse_zelda.c | 2 +- src/overlays/actors/ovl_En_Hs/z_en_hs.c | 2 +- src/overlays/actors/ovl_En_Hs2/z_en_hs2.c | 2 +- src/overlays/actors/ovl_En_Hy/z_en_hy.c | 2 +- .../actors/ovl_En_Ice_Hono/z_en_ice_hono.c | 2 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 3 +- src/overlays/actors/ovl_En_In/z_en_in.c | 2 +- .../actors/ovl_En_Insect/z_en_insect.c | 2 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 2 +- src/overlays/actors/ovl_En_It/z_en_it.c | 65 +- src/overlays/actors/ovl_En_Jj/z_en_jj.c | 2 +- src/overlays/actors/ovl_En_Js/z_en_js.c | 5 +- .../actors/ovl_En_Jsjutan/z_en_jsjutan.c | 3 +- .../actors/ovl_En_Kakasi/z_en_kakasi.c | 2 +- .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 2 +- .../actors/ovl_En_Kakasi3/z_en_kakasi3.c | 2 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 2 +- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 2 +- src/overlays/actors/ovl_En_Ko/z_en_ko.c | 2 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 2 +- src/overlays/actors/ovl_En_Kz/z_en_kz.c | 2 +- src/overlays/actors/ovl_En_Light/z_en_light.c | 2 +- .../actors/ovl_En_Lightbox/z_en_lightbox.c | 64 +- .../actors/ovl_En_M_Fire1/z_en_m_fire1.c | 61 +- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 2 +- src/overlays/actors/ovl_En_Ma1/z_en_ma1.c | 2 +- src/overlays/actors/ovl_En_Ma2/z_en_ma2.c | 2 +- src/overlays/actors/ovl_En_Ma3/z_en_ma3.c | 2 +- src/overlays/actors/ovl_En_Mag/z_en_mag.c | 2 +- src/overlays/actors/ovl_En_Mb/z_en_mb.c | 2 +- src/overlays/actors/ovl_En_Md/z_en_md.c | 2 +- src/overlays/actors/ovl_En_Mk/z_en_mk.c | 2 +- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 2 +- src/overlays/actors/ovl_En_Mm2/z_en_mm2.c | 2 +- src/overlays/actors/ovl_En_Ms/dlists.c | 2 - src/overlays/actors/ovl_En_Ms/z_en_ms.c | 128 +- src/overlays/actors/ovl_En_Mu/z_en_mu.c | 2 +- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 2 +- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 2 +- .../actors/ovl_En_Niw_Girl/z_en_niw_girl.c | 2 +- .../actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 2 +- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 80 +- src/overlays/actors/ovl_En_Nwc/z_en_nwc.c | 2 +- src/overlays/actors/ovl_En_Ny/z_en_ny.c | 2 +- src/overlays/actors/ovl_En_OE2/z_en_oe2.c | 52 +- .../z_en_okarina_effect.c | 101 +- .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 2 +- src/overlays/actors/ovl_En_Okuta/z_en_okuta.c | 2 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 2 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 2 +- src/overlays/actors/ovl_En_Part/z_en_part.c | 2 +- .../actors/ovl_En_Peehat/z_en_peehat.c | 2 +- .../actors/ovl_En_Po_Desert/z_en_po_desert.c | 2 +- .../actors/ovl_En_Po_Field/z_en_po_field.c | 3 +- .../actors/ovl_En_Po_Relay/z_en_po_relay.c | 2 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 2 +- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 2 +- .../actors/ovl_En_Pu_box/z_en_pu_box.c | 29 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- src/overlays/actors/ovl_En_Reeba/z_en_reeba.c | 2 +- .../ovl_En_River_Sound/z_en_river_sound.c | 2 +- src/overlays/actors/ovl_En_Rl/z_en_rl.c | 2 +- src/overlays/actors/ovl_En_Rr/z_en_rr.c | 2 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 2 +- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 2 +- src/overlays/actors/ovl_En_Sa/z_en_sa.c | 2 +- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 2 +- .../ovl_En_Scene_Change/z_en_scene_change.c | 37 +- src/overlays/actors/ovl_En_Sda/z_en_sda.c | 3 +- .../actors/ovl_En_Shopnuts/z_en_shopnuts.c | 2 +- src/overlays/actors/ovl_En_Si/z_en_si.c | 5 +- .../actors/ovl_En_Siofuki/z_en_siofuki.c | 2 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 2 +- src/overlays/actors/ovl_En_Skj/z_en_skj.c | 3 +- .../actors/ovl_En_Skjneedle/z_en_skjneedle.c | 2 +- src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 2 +- src/overlays/actors/ovl_En_St/z_en_st.c | 2 +- src/overlays/actors/ovl_En_Sth/z_en_sth.c | 2 +- .../actors/ovl_En_Stream/z_en_stream.c | 2 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 2 +- .../ovl_En_Syateki_Itm/z_en_syateki_itm.c | 2 +- .../ovl_En_Syateki_Man/z_en_syateki_man.c | 2 +- .../ovl_En_Syateki_Niw/z_en_syateki_niw.c | 2 +- src/overlays/actors/ovl_En_Ta/z_en_ta.c | 2 +- .../ovl_En_Takara_Man/z_en_takara_man.c | 2 +- src/overlays/actors/ovl_En_Tana/z_en_tana.c | 2 +- src/overlays/actors/ovl_En_Test/z_en_test.c | 2 +- src/overlays/actors/ovl_En_Tg/z_en_tg.c | 2 +- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 2 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 576 +-- src/overlays/actors/ovl_En_Torch/z_en_torch.c | 41 +- .../actors/ovl_En_Torch2/z_en_torch2.c | 3 +- src/overlays/actors/ovl_En_Toryo/z_en_toryo.c | 2 +- src/overlays/actors/ovl_En_Tp/z_en_tp.c | 2 +- src/overlays/actors/ovl_En_Tr/z_en_tr.c | 2 +- src/overlays/actors/ovl_En_Trap/z_en_trap.c | 2 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 103 +- src/overlays/actors/ovl_En_Vali/z_en_vali.c | 2 +- src/overlays/actors/ovl_En_Vase/z_en_vase.c | 33 +- .../actors/ovl_En_Vb_Ball/z_en_vb_ball.c | 2 +- .../actors/ovl_En_Viewer/z_en_viewer.c | 3 +- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 2 +- .../actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 681 +-- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 2 +- .../actors/ovl_En_Weiyer/z_en_weiyer.c | 2 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 2 +- .../ovl_En_Wonder_Item/z_en_wonder_item.c | 3 +- .../ovl_En_Wonder_Talk/z_en_wonder_talk.c | 2 +- .../ovl_En_Wonder_Talk2/z_en_wonder_talk2.c | 2 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 3 +- src/overlays/actors/ovl_En_Xc/z_en_xc.c | 3 +- .../ovl_En_Yabusame_Mark/z_en_yabusame_mark.c | 2 +- .../actors/ovl_En_Yukabyun/z_en_yukabyun.c | 2 +- src/overlays/actors/ovl_En_Zf/z_en_zf.c | 3 +- src/overlays/actors/ovl_En_Zl1/z_en_zl1.c | 2 +- src/overlays/actors/ovl_En_Zl2/z_en_zl2.c | 2 +- src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 2 +- src/overlays/actors/ovl_En_Zl4/z_en_zl4.c | 2 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 2 +- src/overlays/actors/ovl_En_fHG/z_en_fhg.c | 2 +- .../actors/ovl_End_Title/z_end_title.c | 2 +- src/overlays/actors/ovl_Fishing/z_fishing.c | 3 +- .../actors/ovl_Item_B_Heart/z_item_b_heart.c | 2 +- .../ovl_Item_Etcetera/z_item_etcetera.c | 2 +- .../actors/ovl_Item_Inbox/z_item_inbox.c | 28 +- .../actors/ovl_Item_Ocarina/z_item_ocarina.c | 2 +- .../actors/ovl_Item_Shield/z_item_shield.c | 2 +- .../actors/ovl_Magic_Dark/z_magic_dark.c | 2 +- .../actors/ovl_Magic_Fire/z_magic_fire.c | 2 +- .../actors/ovl_Magic_Wind/z_magic_wind.c | 2 +- src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c | 2 +- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 2 +- .../ovl_Obj_Blockstop/z_obj_blockstop.c | 39 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 90 +- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 2 +- .../actors/ovl_Obj_Dekujr/z_obj_dekujr.c | 2 +- .../actors/ovl_Obj_Elevator/z_obj_elevator.c | 70 +- .../actors/ovl_Obj_Hamishi/z_obj_hamishi.c | 2 +- src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c | 5 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 2 +- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c | 2 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 2 +- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 2 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 2 +- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 2 +- .../ovl_Obj_Makekinsuta/z_obj_makekinsuta.c | 54 +- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 2 +- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 2 +- .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 2 +- .../actors/ovl_Obj_Mure3/z_obj_mure3.c | 2 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 2 +- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 62 +- .../actors/ovl_Obj_Switch/z_obj_switch.c | 2 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 3 +- .../ovl_Obj_Timeblock/z_obj_timeblock.c | 2 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 2 +- .../ovl_Obj_Warp2block/z_obj_warp2block.c | 2 +- .../ovl_Object_Kankyo/z_object_kankyo.c | 2 +- .../actors/ovl_Oceff_Spot/z_oceff_spot.c | 2 +- .../actors/ovl_Oceff_Storm/z_oceff_storm.c | 2 +- .../actors/ovl_Oceff_Wipe/z_oceff_wipe.c | 2 +- .../actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c | 2 +- .../actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c | 2 +- .../actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c | 2 +- src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 2 +- .../actors/ovl_player_actor/z_player.c | 4 - .../ovl_Effect_Ss_Blast/z_effect_ss_blast.c | 4 - .../ovl_Effect_Ss_Bomb/z_effect_ss_bomb.c | 4 - .../ovl_Effect_Ss_Bomb2/z_effect_ss_bomb2.c | 4 - .../ovl_Effect_Ss_Bubble/z_effect_ss_bubble.c | 4 - .../ovl_Effect_Ss_D_Fire/z_effect_ss_d_fire.c | 4 - .../z_effect_ss_dead_db.c | 4 - .../z_effect_ss_dead_dd.c | 3 - .../z_effect_ss_dead_ds.c | 4 - .../z_effect_ss_dead_sound.c | 3 - .../z_effect_ss_dt_bubble.c | 4 - .../ovl_Effect_Ss_Dust/z_effect_ss_dust.c | 4 - .../z_effect_ss_en_fire.c | 4 - .../ovl_Effect_Ss_En_Ice/z_effect_ss_en_ice.c | 4 - .../ovl_Effect_Ss_Extra/z_effect_ss_extra.c | 3 - .../z_effect_ss_fcircle.c | 4 - .../z_effect_ss_fhg_flash.c | 4 - .../z_effect_ss_fire_tail.c | 4 - .../ovl_Effect_Ss_G_Fire/z_effect_ss_g_fire.c | 3 - .../z_effect_ss_g_magma.c | 3 - .../z_effect_ss_g_magma2.c | 4 - .../z_effect_ss_g_ripple.c | 4 - .../ovl_Effect_Ss_G_Spk/z_effect_ss_g_spk.c | 4 - .../z_effect_ss_g_splash.c | 4 - .../ovl_Effect_Ss_Hahen/z_effect_ss_hahen.c | 4 - .../z_effect_ss_hitmark.c | 4 - .../z_effect_ss_ice_piece.c | 4 - .../z_effect_ss_ice_smoke.c | 4 - .../ovl_Effect_Ss_K_Fire/z_effect_ss_k_fire.c | 4 - .../ovl_Effect_Ss_Kakera/z_effect_ss_kakera.c | 4 - .../z_effect_ss_kirakira.c | 4 - .../z_effect_ss_lightning.c | 4 - .../ovl_Effect_Ss_Sibuki/z_effect_ss_sibuki.c | 4 - .../z_effect_ss_sibuki2.c | 4 - .../z_eff_ss_solder_srch_ball.c | 3 - .../ovl_Effect_Ss_Stick/z_effect_ss_stick.c | 4 - .../ovl_Effect_Ss_Stone1/z_effect_ss_stone1.c | 4 - .../gamestates/ovl_opening/z_opening.c | 19 +- src/overlays/gamestates/ovl_title/z_title.c | 79 +- 652 files changed, 12488 insertions(+), 19093 deletions(-) diff --git a/src/boot/assert.c b/src/boot/assert.c index dc09d1a1cc..00dcd4f344 100644 --- a/src/boot/assert.c +++ b/src/boot/assert.c @@ -1,7 +1,6 @@ #include -void __assert(const char* exp, const char* file, s32 line) -{ +void __assert(const char* exp, const char* file, s32 line) { char msg[256]; osSyncPrintf("Assertion failed: %s, file %s, line %d, thread %d\n", exp, file, line, osGetThreadId(NULL)); sprintf(msg, "ASSERT: %s:%d(%d)", file, line, osGetThreadId(NULL)); diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c index f551d921be..06d4339195 100644 --- a/src/boot/boot_main.c +++ b/src/boot/boot_main.c @@ -7,14 +7,12 @@ u8 sIdleThreadStack[0x400]; StackEntry sIdleThreadInfo; u8 sBootThreadStack[0x400]; -void cleararena(void) -{ +void cleararena(void) { bzero(_dmadataSegmentStart, (u8*)osMemSize - OS_K0_TO_PHYSICAL(_dmadataSegmentStart)); } -void bootproc(void) -{ - StackCheck_Init(&sBootThreadInfo, sBootThreadStack, sBootThreadStack+sizeof(sBootThreadStack), 0, -1, "boot"); +void bootproc(void) { + StackCheck_Init(&sBootThreadInfo, sBootThreadStack, sBootThreadStack + sizeof(sBootThreadStack), 0, -1, "boot"); osMemSize = osGetMemSize(); cleararena(); @@ -25,8 +23,8 @@ void bootproc(void) osDriveRomInit(); isPrintfInit(); Locale_Init(); - - StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack+sizeof(sIdleThreadStack), 0, 256, "idle"); - osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, 0, sIdleThreadStack+sizeof(sIdleThreadStack), 10); + + StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack + sizeof(sIdleThreadStack), 0, 256, "idle"); + osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, 0, sIdleThreadStack + sizeof(sIdleThreadStack), 10); osStartThread(&sIdleThread); } diff --git a/src/boot/idle.c b/src/boot/idle.c index 7c6a9207aa..6ab012a4c3 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -17,15 +17,15 @@ u32 gViConfigFeatures = OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF; f32 gViConfigXScale = 1.0; f32 gViConfigYScale = 1.0; -void Main_ThreadEntry(void* arg0) -{ +void Main_ThreadEntry(void* arg0) { OSTime var1; osSyncPrintf("mainx 実行開始\n"); DmaMgr_Start(); osSyncPrintf("codeセグメントロード中..."); var1 = osGetTime(); - DmaMgr_SendRequest1((u32)_dmadataSegmentEnd, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart, "../idle.c", 238); + DmaMgr_SendRequest1((u32)_dmadataSegmentEnd, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart, + "../idle.c", 238); var1 -= osGetTime(); osSyncPrintf("\rcodeセグメントロード中...完了\n"); osSyncPrintf("転送時間 %6.3f\n"); @@ -35,8 +35,7 @@ void Main_ThreadEntry(void* arg0) osSyncPrintf("mainx 実行終了\n"); } -void Idle_ThreadEntry(void* a0) -{ +void Idle_ThreadEntry(void* a0) { osSyncPrintf("アイドルスレッド(idleproc)実行開始\n"); osSyncPrintf("作製者 : %s\n", gBuildTeam); osSyncPrintf("作成日時 : %s\n", gBuildDate); @@ -57,8 +56,7 @@ void Idle_ThreadEntry(void* a0) gViConfigXScale = 1.0f; gViConfigYScale = 1.0f; - switch (osTvType) - { + switch (osTvType) { case 1: D_80013960 = 2; gViConfigMode = osViModeNtscLan1; @@ -82,11 +80,12 @@ void Idle_ThreadEntry(void* a0) osViBlack(1); osViSwapBuffer(0x803da80); osCreatePiManager(0x96, &gPiMgrCmdQ, sPiMgrCmdBuff, 0x32); - StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack+sizeof(sMainStack), 0, 0x400, "main"); - osCreateThread(&sMainThread, 3, Main_ThreadEntry, a0, sMainStack+sizeof(sMainStack), 10); + StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack + sizeof(sMainStack), 0, 0x400, "main"); + osCreateThread(&sMainThread, 3, Main_ThreadEntry, a0, sMainStack + sizeof(sMainStack), 10); osStartThread(&sMainThread); osSetThreadPri(NULL, 0); - while(1) + while (1) { ; + } } diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c index 3f7a996b32..6214545275 100644 --- a/src/boot/is_debug.c +++ b/src/boot/is_debug.c @@ -1,82 +1,76 @@ #include #include -OSPiHandle* sISVHandle; //official name : is_Handle +OSPiHandle* sISVHandle; // official name : is_Handle #define gISVDbgPrnAdrs ((ISVDbg*)0xb3ff0000) #define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0))) -void isPrintfInit() -{ +void isPrintfInit() { sISVHandle = osCartRomInit(); osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, 0); osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, 0); - osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I','S','6','4')); + osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I', 'S', '6', '4')); } -void osSyncPrintfUnused(const char* fmt, ...) -{ +void osSyncPrintfUnused(const char* fmt, ...) { va_list args; va_start(args, fmt); _Printf(&is_proutSyncPrintf, NULL, fmt, args); } -void osSyncPrintf(const char* fmt, ...) -{ +void osSyncPrintf(const char* fmt, ...) { va_list args; va_start(args, fmt); _Printf(&is_proutSyncPrintf, NULL, fmt, args); } -//assumption -void rmonPrintf(const char* fmt, ...) -{ +// assumption +void rmonPrintf(const char* fmt, ...) { va_list args; va_start(args, fmt); _Printf(&is_proutSyncPrintf, NULL, fmt, args); } -u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count) -{ +u32 is_proutSyncPrintf(void* arg0, const char* str, s32 count) { u32 data; s32 pos; s32 start; s32 end; osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, &data); - if (data != ASCII_TO_U32('I','S','6','4')) + if (data != ASCII_TO_U32('I', 'S', '6', '4')) { return 1; + } osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, &data); pos = data; osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, &data); start = data; end = start + count; - if (end >= 0xffe0) - { + if (end >= 0xffe0) { end -= 0xffe0; - if (pos < end || start < pos) + if (pos < end || start < pos) { return 1; - } - else - { - if (start < pos && pos < end) + } + } else { + if (start < pos && pos < end) { return 1; + } } - while (count) - { + while (count) { u32 addr = (u32)&gISVDbgPrnAdrs->data + (start & 0xffffffc); s32 shift = ((3 - (start & 3)) * 8); - if (*str) - { + if (*str) { osEPiReadIo(sISVHandle, addr, &data); osEPiWriteIo(sISVHandle, addr, (*str << shift) | (data & ~(0xff << shift))); start++; - if (start >= 0xffe0) + if (start >= 0xffe0) { start -= 0xffe0; + } } count--; str++; @@ -85,9 +79,9 @@ u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count) return 1; } -void func_80002384(const char* exp, const char* file, u32 line) -{ +void func_80002384(const char* exp, const char* file, u32 line) { osSyncPrintf("File:%s Line:%d %s \n", file, line, exp); - while (true) + while (true) { ; + } } diff --git a/src/boot/logutils.c b/src/boot/logutils.c index 9d0022824e..ca678a9fc0 100644 --- a/src/boot/logutils.c +++ b/src/boot/logutils.c @@ -2,22 +2,25 @@ #include #include -float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, float var2, const char* var3Name, float var3) -{ - if (var1 < var2 || var3 < var1) - osSyncPrintf("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, arg1, var2Name, var2, var1Name, var1, var3Name, var3); +float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, + float var2, const char* var3Name, float var3) { + if (var1 < var2 || var3 < var1) { + osSyncPrintf("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, arg1, var2Name, var2, var1Name, var1, + var3Name, var3); + } return var1; } -s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2, const char* var3Name, s32 var3) -{ - if (var1 < var2 || var3 < var1) - osSyncPrintf("%s %d: range error %s(%d) < %s(%d) < %s(%d)\n", exp, arg1, var2Name, var2, var1Name, var1, var3Name, var3); +s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2, + const char* var3Name, s32 var3) { + if (var1 < var2 || var3 < var1) { + osSyncPrintf("%s %d: range error %s(%d) < %s(%d) < %s(%d)\n", exp, arg1, var2Name, var2, var1Name, var1, + var3Name, var3); + } return var1; } -void LogUtils_LogHexDump(void* ptr, s32 size0) -{ +void LogUtils_LogHexDump(void* ptr, s32 size0) { u8* addr = (u8*)ptr; s32 size = (s32)size0; s32 rest; @@ -28,40 +31,39 @@ void LogUtils_LogHexDump(void* ptr, s32 size0) osSyncPrintf("address off +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f 0123456789abcdef\n"); off = 0; - while (size > 0) - { + while (size > 0) { osSyncPrintf("%08x %04x", addr, off); rest = (size < 0x10) ? size : 0x10; i = 0; - while (true) - { - if(i < rest) + while (true) { + if (i < rest) { osSyncPrintf(" %02x", *((u8*)addr + i)); - else + } else { osSyncPrintf(" "); + } i++; - if (i > 0xf) + if (i > 0xf) { break; + } } osSyncPrintf(" "); i = 0; - while (true) - { - if(i < rest) - { - u8 a = *(addr+i); + while (true) { + if (i < rest) { + u8 a = *(addr + i); osSyncPrintf("%c", (a >= 0x20 && a < 0x7f) ? a : '.'); - } - else + } else { osSyncPrintf(" "); + } i++; - if (i > 0xf) + if (i > 0xf) { break; + } } osSyncPrintf("\n"); size -= rest; @@ -70,46 +72,43 @@ void LogUtils_LogHexDump(void* ptr, s32 size0) } } -void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char *name, const char *file, s32 line) -{ +void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, s32 line) { osSyncPrintf(VT_COL(RED, WHITE) "%s %d %s[%d] max=%u ptr=%08x\n" VT_RST, file, line, name, value, max, ptr); } -void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line) -{ - u32 mask = (unk - 1); - if (value & mask) - osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s(%08x) は バウンダリ(%d)違反です\n" VT_RST, file, line, name, value, unk); +void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line) { + u32 mask = (unk - 1); + if (value & mask) { + osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s(%08x) は バウンダリ(%d)違反です\n" VT_RST, file, line, name, value, + unk); + } } -void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line) -{ - if (!ptr) +void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line) { + if (!ptr) { osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s は はヌルポインタです\n" VT_RST, file, line, exp); + } } -//check valid pointer -void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line) -{ +// check valid pointer +void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line) { u32 ptr = (u32)ptr0; - if (!ptr || ptr < 0x80000000U || (0x80000000U + osMemSize) <= ptr) + if (!ptr || ptr < 0x80000000U || (0x80000000U + osMemSize) <= ptr) { osSyncPrintf(VT_COL(RED, WHITE) "%s %d:ポインタ %s(%08x) が異常です\n" VT_RST, file, line, exp, ptr); + } } -//there's probalby a macro like this : MACRO(exp) LogUtils_LogThreadId(__FILE__, __LINE__); osSyncPrintf(exp) -void LogUtils_LogThreadId(const char* name, s32 line) -{ +// there's probalby a macro like this : MACRO(exp) LogUtils_LogThreadId(__FILE__, __LINE__); osSyncPrintf(exp) +void LogUtils_LogThreadId(const char* name, s32 line) { osSyncPrintf("<%d %s %d>", osGetThreadId(NULL), name, line); } -void LogUtils_HungupThread(const char* name, s32 line) -{ +void LogUtils_HungupThread(const char* name, s32 line) { osSyncPrintf("*** HungUp in thread %d, [%s:%d] ***\n", osGetThreadId(NULL), name, line); Fault_AddHungupAndCrash(name, line); } -void LogUtils_ResetHungup() -{ +void LogUtils_ResetHungup() { osSyncPrintf("*** Reset ***\n"); Fault_AddHungupAndCrash("Reset", 0); -} \ No newline at end of file +} diff --git a/src/boot/stackcheck.c b/src/boot/stackcheck.c index d8d0b8fe2d..2ea3fad41b 100644 --- a/src/boot/stackcheck.c +++ b/src/boot/stackcheck.c @@ -5,137 +5,130 @@ StackEntry* sStackInfoListStart = NULL; StackEntry* sStackInfoListEnd = NULL; -void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace, const char* name) -{ +void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace, + const char* name) { StackEntry* iter; u32* addr; - if (!entry) + if (!entry) { sStackInfoListStart = NULL; - else - { + } else { entry->head = (u32)stackTop; entry->tail = (u32)stackBottom; entry->initValue = initValue; entry->minSpace = minSpace; entry->name = name; iter = sStackInfoListStart; - while (iter) - { - if (iter == entry) - { + while (iter) { + if (iter == entry) { osSyncPrintf(VT_COL(RED, WHITE) "stackcheck_init: %08x は既にリスト中にある\n" VT_RST, entry); return; } iter = iter->next; } - + entry->prev = sStackInfoListEnd; entry->next = NULL; - - if (sStackInfoListEnd) + + if (sStackInfoListEnd) { sStackInfoListEnd->next = entry; + } sStackInfoListEnd = entry; - if (!sStackInfoListStart) + if (!sStackInfoListStart) { sStackInfoListStart = entry; + } - if (entry->minSpace != -1) - { + if (entry->minSpace != -1) { addr = (u32*)entry->head; - while ((u32)addr < entry->tail) + while ((u32)addr < entry->tail) { *addr++ = entry->initValue; + } } } } -void StackCheck_Cleanup(StackEntry* entry) -{ +void StackCheck_Cleanup(StackEntry* entry) { bool inconsistency = false; - if (!entry->prev) - { - if (entry == sStackInfoListStart) + if (!entry->prev) { + if (entry == sStackInfoListStart) { sStackInfoListStart = entry->next; - else + } else { inconsistency = true; - } - else + } + } else { entry->prev->next = entry->next; - - if (!entry->next) - { - if (entry == sStackInfoListEnd) - sStackInfoListEnd = entry->prev; - else - inconsistency = true; } - if (inconsistency) + + if (!entry->next) { + if (entry == sStackInfoListEnd) { + sStackInfoListEnd = entry->prev; + } else { + inconsistency = true; + } + } + if (inconsistency) { osSyncPrintf(VT_COL(RED, WHITE) "stackcheck_cleanup: %08x リスト不整合です\n" VT_RST, entry); + } } -StackStatus StackCheck_GetState(StackEntry* entry) -{ +StackStatus StackCheck_GetState(StackEntry* entry) { u32* last; u32 used; u32 free; s32 ret; - for (last = (u32*)entry->head; (u32)last < entry->tail; last++) - { - if (entry->initValue != *last) + for (last = (u32*)entry->head; (u32)last < entry->tail; last++) { + if (entry->initValue != *last) { break; + } } used = entry->tail - (u32)last; free = (u32)last - entry->head; - if (free == 0) - { + if (free == 0) { ret = STACK_STATUS_OVERFLOW; osSyncPrintf(VT_FGCOL(RED)); - } - else if (free < entry->minSpace && entry->minSpace != -1) - { + } else if (free < entry->minSpace && entry->minSpace != -1) { ret = STACK_STATUS_WARNING; osSyncPrintf(VT_FGCOL(YELLOW)); - } - else - { + } else { osSyncPrintf(VT_FGCOL(GREEN)); ret = STACK_STATUS_OK; } - osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free, entry->name ? entry->name : "(null)"); + osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free, + entry->name ? entry->name : "(null)"); osSyncPrintf(VT_RST); - if (ret != STACK_STATUS_OK) + if (ret != STACK_STATUS_OK) { LogUtils_LogHexDump(entry->head, entry->tail - entry->head); + } return ret; } - -u32 StackCheck_CheckAll() -{ +u32 StackCheck_CheckAll() { u32 ret = 0; StackEntry* iter = sStackInfoListStart; - while(iter) - { + while (iter) { u32 state = StackCheck_GetState(iter); - if (state != STACK_STATUS_OK) + if (state != STACK_STATUS_OK) { ret = 1; + } iter = iter->next; } return ret; } -u32 StackCheck_Check(StackEntry* entry) -{ - if (!entry) +u32 StackCheck_Check(StackEntry* entry) { + if (!entry) { return StackCheck_CheckAll(); - else + } else { return StackCheck_GetState(entry); + } } diff --git a/src/boot/viconfig.c b/src/boot/viconfig.c index 9fe1efd40e..a31aa45371 100644 --- a/src/boot/viconfig.c +++ b/src/boot/viconfig.c @@ -2,35 +2,34 @@ #include #include -//this should probably go elsewhere but right now viconfig.o is the only object between idle and z_std_dma +// this should probably go elsewhere but right now viconfig.o is the only object between idle and z_std_dma OSPiHandle* gCartHandle = 0; -void ViConfig_UpdateVi(u32 arg0) -{ - if (arg0 != 0) - { +void ViConfig_UpdateVi(u32 arg0) { + if (arg0 != 0) { osSyncPrintf(VT_COL(YELLOW, BLACK) "osViSetYScale1(%f);\n" VT_RST, 1.0f); - if (osTvType == 0) + if (osTvType == 0) { osViSetMode(&osViModePalLan1); + } osViSetYScale(1.0f); - } - else - { + } else { osViSetMode(&gViConfigMode); - if (gViConfigAdditionalScanLines != 0) + if (gViConfigAdditionalScanLines != 0) { osViExtendVStart(gViConfigAdditionalScanLines); + } - if (gViConfigFeatures != 0) + if (gViConfigFeatures != 0) { osViSetSpecialFeatures(gViConfigFeatures); + } - if (gViConfigXScale != 1.0f) + if (gViConfigXScale != 1.0f) { osViSetXScale(gViConfigXScale); + } - if (gViConfigYScale != 1.0f) - { + if (gViConfigYScale != 1.0f) { osSyncPrintf(VT_COL(YELLOW, BLACK) "osViSetYScale3(%f);\n" VT_RST, gViConfigYScale); osViSetYScale(gViConfigYScale); } @@ -39,10 +38,10 @@ void ViConfig_UpdateVi(u32 arg0) gViConfigUseDefault = arg0; } -void ViConfig_UpdateBlack() -{ - if (gViConfigUseDefault != 0) +void ViConfig_UpdateBlack() { + if (gViConfigUseDefault != 0) { osViBlack(1); - else + } else { osViBlack(0); + } } diff --git a/src/boot/yaz0.c b/src/boot/yaz0.c index 03f4a720e0..5954e28aaa 100644 --- a/src/boot/yaz0.c +++ b/src/boot/yaz0.c @@ -7,50 +7,45 @@ u32 sYaz0CurRomStart; u32 sYaz0CurSize; u32 sYaz0MaxPtr; -void* Yaz0_FirstDMA() -{ +void* Yaz0_FirstDMA() { u32 pad0; u32 pad1; u32 dmaSize; u32 curSize; sYaz0MaxPtr = sYaz0CurDataEnd - 0x19; - + curSize = sYaz0CurDataEnd - (u32)sYaz0DataBuffer; - dmaSize = (curSize > sYaz0CurSize) - ? sYaz0CurSize - : curSize; - + dmaSize = (curSize > sYaz0CurSize) ? sYaz0CurSize : curSize; + DmaMgr_DMARomToRam(sYaz0CurRomStart, sYaz0DataBuffer, dmaSize); sYaz0CurRomStart += dmaSize; sYaz0CurSize -= dmaSize; return sYaz0DataBuffer; } -void* Yaz0_NextDMA(void* curSrcPos) -{ +void* Yaz0_NextDMA(void* curSrcPos) { u8* dst; u32 restSize; u32 dmaSize; restSize = sYaz0CurDataEnd - (u32)curSrcPos; - dst = (restSize & 7) - ? (sYaz0DataBuffer - (restSize & 7)) + 8 - : sYaz0DataBuffer; + dst = (restSize & 7) ? (sYaz0DataBuffer - (restSize & 7)) + 8 : sYaz0DataBuffer; bcopy(curSrcPos, dst, restSize); dmaSize = (sYaz0CurDataEnd - (u32)dst) - restSize; - if (sYaz0CurSize < dmaSize) + if (sYaz0CurSize < dmaSize) { dmaSize = sYaz0CurSize; + } - if (dmaSize != 0) - { + if (dmaSize != 0) { DmaMgr_DMARomToRam(sYaz0CurRomStart, (u32)dst + restSize, dmaSize); sYaz0CurRomStart += dmaSize; sYaz0CurSize -= dmaSize; - if (!sYaz0CurSize) + if (!sYaz0CurSize) { sYaz0MaxPtr = (u32)dst + restSize + dmaSize; + } } return dst; @@ -60,8 +55,7 @@ void* Yaz0_NextDMA(void* curSrcPos) // has an extra check at the start of the small compressed loop // along with an extra move instruction // maybe some regalloc differences besides these issues -void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst) -{ +void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst) { u32 bitIdx; u8* src; u8* dstEnd; @@ -76,10 +70,8 @@ void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst) src = hdr->data; dstEnd = dst + hdr->decSize; - do - { - if (bitIdx == 0) - { + do { + if (bitIdx == 0) { if ((sYaz0MaxPtr < (u32)src) && (sYaz0CurSize != 0)) src = Yaz0_NextDMA(src); @@ -90,19 +82,16 @@ void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst) curDecBit = chunkHeader & (1 << 7); chunkHeader <<= 1; - if (curDecBit) // uncompressed - { + if (curDecBit) { // uncompressed *dst++ = *src++; - } - else // compressed - { + } else { // compressed nibble = *src >> 4; backPtr = dst - (*(src + 1) | (*src & 0xF) << 8); src += 2; - chunkSize = (nibble == 0) // N = chunkSize; B = back offset - ? *src++ + 0x12 // 3 bytes 0B BB NN - : nibble + 2; // 2 bytes NB BB + chunkSize = (nibble == 0) // N = chunkSize; B = back offset + ? *src++ + 0x12 // 3 bytes 0B BB NN + : nibble + 2; // 2 bytes NB BB for (off = chunkSize; off > 0; off--) *dst++ = *(backPtr++ - 1); @@ -115,8 +104,7 @@ void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst) #pragma GLOBAL_ASM("asm/non_matchings/boot/yaz0/Yaz0_DecompressImpl.s") #endif -void Yaz0_Decompress(u32 romStart, void* dst, u32 size) -{ +void Yaz0_Decompress(u32 romStart, void* dst, u32 size) { sYaz0CurRomStart = romStart; sYaz0CurSize = size; sYaz0CurDataEnd = sYaz0DataBuffer + sizeof(sYaz0DataBuffer); diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c index ecd8ce1df9..4d2956e3ed 100644 --- a/src/boot/z_locale.c +++ b/src/boot/z_locale.c @@ -6,16 +6,14 @@ u32 gCurrentRegion = 0; LocaleCartInfo sCartInfo; -//temporary +// temporary extern PadMgr gPadMgr; -void Locale_Init() -{ +void Locale_Init() { osEPiReadIo(gCartHandle, 0x38, &sCartInfo.mediaFormat); osEPiReadIo(gCartHandle, 0x3C, &sCartInfo.regionInfo); - switch (sCartInfo.countryCode) - { + switch (sCartInfo.countryCode) { case 'J': // "NTSC-U (North America)" gCurrentRegion = REGION_US; break; @@ -36,39 +34,39 @@ void Locale_Init() osSyncPrintf("z_locale_init:日本用かアメリカ用か3コンで判断させる\n"); } -void Locale_ResetRegion() -{ +void Locale_ResetRegion() { gCurrentRegion = REGION_NULL; } -u32 func_80001F48() -{ - PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; //cast required to match +u32 func_80001F48() { + PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; // cast required to match - if (gCurrentRegion == REGION_NATIVE) + if (gCurrentRegion == REGION_NATIVE) { return 0; + } - if (padMgr->unk_2A8 & 4) + if (padMgr->unk_2A8 & 4) { return 0; + } return 1; } -u32 func_80001F8C() -{ - PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; //cast required to match +u32 func_80001F8C() { + PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; // cast required to match - if (gCurrentRegion == REGION_NATIVE) + if (gCurrentRegion == REGION_NATIVE) { return 0; + } - if (padMgr->unk_2A8 & 4) + if (padMgr->unk_2A8 & 4) { return 1; + } return 0; } // This function appears to be unused? -u32 Locale_IsRegionNative() -{ +u32 Locale_IsRegionNative() { return gCurrentRegion == REGION_NATIVE; } diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index 39618b8aba..b6c7a8f13a 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -13,1564 +13,1563 @@ s32 sDmaMgrCurFileLine; u32 D_80009460 = 0; u32 sDmaMgrDmaBuffSize = 0x2000; u32 sDmaMgrDataExistError = 0; -const char* sDmaMgrFileNames[0x5FC] = -{ - "makerom", - "boot", - "dmadata", - "Audiobank", - "Audioseq", - "Audiotable", - "link_animetion", - "icon_item_static", - "icon_item_24_static", - "icon_item_field_static", - "icon_item_dungeon_static", - "icon_item_gameover_static", - "icon_item_nes_static", - "icon_item_ger_static", - "icon_item_fra_static", - "item_name_static", - "map_name_static", - "do_action_static", - "message_static", - "message_texture_static", - "nes_font_static", - "nes_message_data_static", - "ger_message_data_static", - "fra_message_data_static", - "staff_message_data_static", - "map_grand_static", - "map_i_static", - "map_48x85_static", - "code", - "ovl_title", - "ovl_select", - "ovl_opening", - "ovl_file_choose", - "ovl_kaleido_scope", - "ovl_player_actor", - "ovl_map_mark_data", - "ovl_En_Test", - "ovl_Arms_Hook", - "ovl_Arrow_Fire", - "ovl_Arrow_Ice", - "ovl_Arrow_Light", - "ovl_Bg_Bdan_Objects", - "ovl_Bg_Bdan_Switch", - "ovl_Bg_Bom_Guard", - "ovl_Bg_Bombwall", - "ovl_Bg_Bowl_Wall", - "ovl_Bg_Breakwall", - "ovl_Bg_Ddan_Jd", - "ovl_Bg_Ddan_Kd", - "ovl_Bg_Dodoago", - "ovl_Bg_Dy_Yoseizo", - "ovl_Bg_Ganon_Otyuka", - "ovl_Bg_Gate_Shutter", - "ovl_Bg_Gjyo_Bridge", - "ovl_Bg_Gnd_Darkmeiro", - "ovl_Bg_Gnd_Firemeiro", - "ovl_Bg_Gnd_Iceblock", - "ovl_Bg_Gnd_Nisekabe", - "ovl_Bg_Gnd_Soulmeiro", - "ovl_Bg_Haka", - "ovl_Bg_Haka_Gate", - "ovl_Bg_Haka_Huta", - "ovl_Bg_Haka_Megane", - "ovl_Bg_Haka_MeganeBG", - "ovl_Bg_Haka_Sgami", - "ovl_Bg_Haka_Ship", - "ovl_Bg_Haka_Trap", - "ovl_Bg_Haka_Tubo", - "ovl_Bg_Haka_Water", - "ovl_Bg_Haka_Zou", - "ovl_Bg_Heavy_Block", - "ovl_Bg_Hidan_Curtain", - "ovl_Bg_Hidan_Dalm", - "ovl_Bg_Hidan_Firewall", - "ovl_Bg_Hidan_Fslift", - "ovl_Bg_Hidan_Fwbig", - "ovl_Bg_Hidan_Hamstep", - "ovl_Bg_Hidan_Hrock", - "ovl_Bg_Hidan_Kousi", - "ovl_Bg_Hidan_Kowarerukabe", - "ovl_Bg_Hidan_Rock", - "ovl_Bg_Hidan_Rsekizou", - "ovl_Bg_Hidan_Sekizou", - "ovl_Bg_Hidan_Sima", - "ovl_Bg_Hidan_Syoku", - "ovl_Bg_Ice_Objects", - "ovl_Bg_Ice_Shelter", - "ovl_Bg_Ice_Shutter", - "ovl_Bg_Ice_Turara", - "ovl_Bg_Ingate", - "ovl_Bg_Jya_1flift", - "ovl_Bg_Jya_Amishutter", - "ovl_Bg_Jya_Bigmirror", - "ovl_Bg_Jya_Block", - "ovl_Bg_Jya_Bombchuiwa", - "ovl_Bg_Jya_Bombiwa", - "ovl_Bg_Jya_Cobra", - "ovl_Bg_Jya_Goroiwa", - "ovl_Bg_Jya_Haheniron", - "ovl_Bg_Jya_Ironobj", - "ovl_Bg_Jya_Kanaami", - "ovl_Bg_Jya_Lift", - "ovl_Bg_Jya_Megami", - "ovl_Bg_Jya_Zurerukabe", - "ovl_Bg_Menkuri_Eye", - "ovl_Bg_Menkuri_Kaiten", - "ovl_Bg_Menkuri_Nisekabe", - "ovl_Bg_Mizu_Bwall", - "ovl_Bg_Mizu_Movebg", - "ovl_Bg_Mizu_Shutter", - "ovl_Bg_Mizu_Uzu", - "ovl_Bg_Mizu_Water", - "ovl_Bg_Mjin", - "ovl_Bg_Mori_Bigst", - "ovl_Bg_Mori_Elevator", - "ovl_Bg_Mori_Hashigo", - "ovl_Bg_Mori_Hashira4", - "ovl_Bg_Mori_Hineri", - "ovl_Bg_Mori_Idomizu", - "ovl_Bg_Mori_Kaitenkabe", - "ovl_Bg_Mori_Rakkatenjo", - "ovl_Bg_Po_Event", - "ovl_Bg_Po_Syokudai", - "ovl_Bg_Pushbox", - "ovl_Bg_Relay_Objects", - "ovl_Bg_Spot00_Break", - "ovl_Bg_Spot00_Hanebasi", - "ovl_Bg_Spot01_Fusya", - "ovl_Bg_Spot01_Idohashira", - "ovl_Bg_Spot01_Idomizu", - "ovl_Bg_Spot01_Idosoko", - "ovl_Bg_Spot01_Objects2", - "ovl_Bg_Spot02_Objects", - "ovl_Bg_Spot03_Taki", - "ovl_Bg_Spot05_Soko", - "ovl_Bg_Spot06_Objects", - "ovl_Bg_Spot07_Taki", - "ovl_Bg_Spot08_Bakudankabe", - "ovl_Bg_Spot08_Iceblock", - "ovl_Bg_Spot09_Obj", - "ovl_Bg_Spot11_Bakudankabe", - "ovl_Bg_Spot11_Oasis", - "ovl_Bg_Spot12_Gate", - "ovl_Bg_Spot12_Saku", - "ovl_Bg_Spot15_Rrbox", - "ovl_Bg_Spot15_Saku", - "ovl_Bg_Spot16_Bombstone", - "ovl_Bg_Spot16_Doughnut", - "ovl_Bg_Spot17_Bakudankabe", - "ovl_Bg_Spot17_Funen", - "ovl_Bg_Spot18_Basket", - "ovl_Bg_Spot18_Futa", - "ovl_Bg_Spot18_Obj", - "ovl_Bg_Spot18_Shutter", - "ovl_Bg_Sst_Floor", - "ovl_Bg_Toki_Hikari", - "ovl_Bg_Toki_Swd", - "ovl_Bg_Treemouth", - "ovl_Bg_Umajump", - "ovl_Bg_Vb_Sima", - "ovl_Bg_Ydan_Hasi", - "ovl_Bg_Ydan_Maruta", - "ovl_Bg_Ydan_Sp", - "ovl_Bg_Zg", - "ovl_Boss_Dodongo", - "ovl_Boss_Fd", - "ovl_Boss_Fd2", - "ovl_Boss_Ganon", - "ovl_Boss_Ganon2", - "ovl_Boss_Ganondrof", - "ovl_Boss_Goma", - "ovl_Boss_Mo", - "ovl_Boss_Sst", - "ovl_Boss_Tw", - "ovl_Boss_Va", - "ovl_Demo_6K", - "ovl_Demo_Du", - "ovl_Demo_Ec", - "ovl_Demo_Effect", - "ovl_Demo_Ext", - "ovl_Demo_Geff", - "ovl_Demo_Gj", - "ovl_Demo_Go", - "ovl_Demo_Gt", - "ovl_Demo_Ik", - "ovl_Demo_Im", - "ovl_Demo_Kankyo", - "ovl_Demo_Kekkai", - "ovl_Demo_Sa", - "ovl_Demo_Shd", - "ovl_Demo_Tre_Lgt", - "ovl_Door_Ana", - "ovl_Door_Gerudo", - "ovl_Door_Killer", - "ovl_Door_Shutter", - "ovl_Door_Toki", - "ovl_Door_Warp1", - "ovl_Efc_Erupc", - "ovl_Eff_Dust", - "ovl_Effect_Ss_Blast", - "ovl_Effect_Ss_Bomb", - "ovl_Effect_Ss_Bomb2", - "ovl_Effect_Ss_Bubble", - "ovl_Effect_Ss_D_Fire", - "ovl_Effect_Ss_Dead_Db", - "ovl_Effect_Ss_Dead_Dd", - "ovl_Effect_Ss_Dead_Ds", - "ovl_Effect_Ss_Dead_Sound", - "ovl_Effect_Ss_Dt_Bubble", - "ovl_Effect_Ss_Dust", - "ovl_Effect_Ss_En_Fire", - "ovl_Effect_Ss_En_Ice", - "ovl_Effect_Ss_Extra", - "ovl_Effect_Ss_Fcircle", - "ovl_Effect_Ss_Fhg_Flash", - "ovl_Effect_Ss_Fire_Tail", - "ovl_Effect_Ss_G_Fire", - "ovl_Effect_Ss_G_Magma", - "ovl_Effect_Ss_G_Magma2", - "ovl_Effect_Ss_G_Ripple", - "ovl_Effect_Ss_G_Spk", - "ovl_Effect_Ss_G_Splash", - "ovl_Effect_Ss_Hahen", - "ovl_Effect_Ss_HitMark", - "ovl_Effect_Ss_Ice_Piece", - "ovl_Effect_Ss_Ice_Smoke", - "ovl_Effect_Ss_K_Fire", - "ovl_Effect_Ss_Kakera", - "ovl_Effect_Ss_KiraKira", - "ovl_Effect_Ss_Lightning", - "ovl_Effect_Ss_Sibuki", - "ovl_Effect_Ss_Sibuki2", - "ovl_Effect_Ss_Solder_Srch_Ball", - "ovl_Effect_Ss_Stick", - "ovl_Effect_Ss_Stone1", - "ovl_Elf_Msg", - "ovl_Elf_Msg2", - "ovl_En_Am", - "ovl_En_Ani", - "ovl_En_Anubice", - "ovl_En_Anubice_Fire", - "ovl_En_Anubice_Tag", - "ovl_En_Arow_Trap", - "ovl_En_Arrow", - "ovl_En_Attack_Niw", - "ovl_En_Ba", - "ovl_En_Bb", - "ovl_En_Bdfire", - "ovl_En_Bigokuta", - "ovl_En_Bili", - "ovl_En_Bird", - "ovl_En_Blkobj", - "ovl_En_Bom", - "ovl_En_Bom_Bowl_Man", - "ovl_En_Bom_Bowl_Pit", - "ovl_En_Bom_Chu", - "ovl_En_Bombf", - "ovl_En_Boom", - "ovl_En_Box", - "ovl_En_Brob", - "ovl_En_Bubble", - "ovl_En_Butte", - "ovl_En_Bw", - "ovl_En_Bx", - "ovl_En_Changer", - "ovl_En_Clear_Tag", - "ovl_En_Cow", - "ovl_En_Crow", - "ovl_En_Cs", - "ovl_En_Daiku", - "ovl_En_Daiku_Kakariko", - "ovl_En_Dekubaba", - "ovl_En_Dekunuts", - "ovl_En_Dh", - "ovl_En_Dha", - "ovl_En_Diving_Game", - "ovl_En_Dns", - "ovl_En_Dnt_Demo", - "ovl_En_Dnt_Jiji", - "ovl_En_Dnt_Nomal", - "ovl_En_Dodojr", - "ovl_En_Dodongo", - "ovl_En_Dog", - "ovl_En_Door", - "ovl_En_Ds", - "ovl_En_Du", - "ovl_En_Dy_Extra", - "ovl_En_Eg", - "ovl_En_Eiyer", - "ovl_En_Elf", - "ovl_En_Encount1", - "ovl_En_Encount2", - "ovl_En_Ex_Item", - "ovl_En_Ex_Ruppy", - "ovl_En_Fd", - "ovl_En_Fd_Fire", - "ovl_En_Fhg_Fire", - "ovl_En_Fire_Rock", - "ovl_En_Firefly", - "ovl_En_Fish", - "ovl_En_Floormas", - "ovl_En_Fr", - "ovl_En_Fu", - "ovl_En_Fw", - "ovl_En_Fz", - "ovl_En_G_Switch", - "ovl_En_Ganon_Mant", - "ovl_En_Ganon_Organ", - "ovl_En_Gb", - "ovl_En_Ge1", - "ovl_En_Ge2", - "ovl_En_Ge3", - "ovl_En_GeldB", - "ovl_En_GirlA", - "ovl_En_Gm", - "ovl_En_Go", - "ovl_En_Go2", - "ovl_En_Goma", - "ovl_En_Goroiwa", - "ovl_En_Gs", - "ovl_En_Guest", - "ovl_En_Hata", - "ovl_En_Heishi1", - "ovl_En_Heishi2", - "ovl_En_Heishi3", - "ovl_En_Heishi4", - "ovl_En_Hintnuts", - "ovl_En_Holl", - "ovl_En_Honotrap", - "ovl_En_Horse", - "ovl_En_Horse_Game_Check", - "ovl_En_Horse_Ganon", - "ovl_En_Horse_Link_Child", - "ovl_En_Horse_Normal", - "ovl_En_Horse_Zelda", - "ovl_En_Hs", - "ovl_En_Hs2", - "ovl_En_Hy", - "ovl_En_Ice_Hono", - "ovl_En_Ik", - "ovl_En_In", - "ovl_En_Insect", - "ovl_En_Ishi", - "ovl_En_It", - "ovl_En_Jj", - "ovl_En_Js", - "ovl_En_Jsjutan", - "ovl_En_Kakasi", - "ovl_En_Kakasi2", - "ovl_En_Kakasi3", - "ovl_En_Kanban", - "ovl_En_Karebaba", - "ovl_En_Ko", - "ovl_En_Kusa", - "ovl_En_Kz", - "ovl_En_Light", - "ovl_En_Lightbox", - "ovl_En_M_Fire1", - "ovl_En_M_Thunder", - "ovl_En_Ma1", - "ovl_En_Ma2", - "ovl_En_Ma3", - "ovl_En_Mag", - "ovl_En_Mb", - "ovl_En_Md", - "ovl_En_Mk", - "ovl_En_Mm", - "ovl_En_Mm2", - "ovl_En_Ms", - "ovl_En_Mu", - "ovl_En_Nb", - "ovl_En_Niw", - "ovl_En_Niw_Girl", - "ovl_En_Niw_Lady", - "ovl_En_Nutsball", - "ovl_En_Nwc", - "ovl_En_Ny", - "ovl_En_OE2", - "ovl_En_Okarina_Effect", - "ovl_En_Okarina_Tag", - "ovl_En_Okuta", - "ovl_En_Ossan", - "ovl_En_Owl", - "ovl_En_Part", - "ovl_En_Peehat", - "ovl_En_Po_Desert", - "ovl_En_Po_Field", - "ovl_En_Po_Relay", - "ovl_En_Po_Sisters", - "ovl_En_Poh", - "ovl_En_Pu_box", - "ovl_En_Rd", - "ovl_En_Reeba", - "ovl_En_River_Sound", - "ovl_En_Rl", - "ovl_En_Rr", - "ovl_En_Ru1", - "ovl_En_Ru2", - "ovl_En_Sa", - "ovl_En_Sb", - "ovl_En_Scene_Change", - "ovl_En_Sda", - "ovl_En_Shopnuts", - "ovl_En_Si", - "ovl_En_Siofuki", - "ovl_En_Skb", - "ovl_En_Skj", - "ovl_En_Skjneedle", - "ovl_En_Ssh", - "ovl_En_St", - "ovl_En_Sth", - "ovl_En_Stream", - "ovl_En_Sw", - "ovl_En_Syateki_Itm", - "ovl_En_Syateki_Man", - "ovl_En_Syateki_Niw", - "ovl_En_Ta", - "ovl_En_Takara_Man", - "ovl_En_Tana", - "ovl_En_Tg", - "ovl_En_Tite", - "ovl_En_Tk", - "ovl_En_Torch", - "ovl_En_Torch2", - "ovl_En_Toryo", - "ovl_En_Tp", - "ovl_En_Tr", - "ovl_En_Trap", - "ovl_En_Tubo_Trap", - "ovl_En_Vali", - "ovl_En_Vase", - "ovl_En_Vb_Ball", - "ovl_En_Viewer", - "ovl_En_Vm", - "ovl_En_Wall_Tubo", - "ovl_En_Wallmas", - "ovl_En_Weather_Tag", - "ovl_En_Weiyer", - "ovl_En_Wf", - "ovl_En_Wonder_Item", - "ovl_En_Wonder_Talk", - "ovl_En_Wonder_Talk2", - "ovl_En_Wood02", - "ovl_En_Xc", - "ovl_En_Yabusame_Mark", - "ovl_En_Yukabyun", - "ovl_En_Zf", - "ovl_En_Zl1", - "ovl_En_Zl2", - "ovl_En_Zl3", - "ovl_En_Zl4", - "ovl_En_Zo", - "ovl_En_fHG", - "ovl_End_Title", - "ovl_Fishing", - "ovl_Item_B_Heart", - "ovl_Item_Etcetera", - "ovl_Item_Inbox", - "ovl_Item_Ocarina", - "ovl_Item_Shield", - "ovl_Magic_Dark", - "ovl_Magic_Fire", - "ovl_Magic_Wind", - "ovl_Mir_Ray", - "ovl_Obj_Bean", - "ovl_Obj_Blockstop", - "ovl_Obj_Bombiwa", - "ovl_Obj_Comb", - "ovl_Obj_Dekujr", - "ovl_Obj_Elevator", - "ovl_Obj_Hamishi", - "ovl_Obj_Hana", - "ovl_Obj_Hsblock", - "ovl_Obj_Ice_Poly", - "ovl_Obj_Kibako", - "ovl_Obj_Kibako2", - "ovl_Obj_Lift", - "ovl_Obj_Lightswitch", - "ovl_Obj_Makekinsuta", - "ovl_Obj_Makeoshihiki", - "ovl_Obj_Mure", - "ovl_Obj_Mure2", - "ovl_Obj_Mure3", - "ovl_Obj_Oshihiki", - "ovl_Obj_Roomtimer", - "ovl_Obj_Switch", - "ovl_Obj_Syokudai", - "ovl_Obj_Timeblock", - "ovl_Obj_Tsubo", - "ovl_Obj_Warp2block", - "ovl_Object_Kankyo", - "ovl_Oceff_Spot", - "ovl_Oceff_Storm", - "ovl_Oceff_Wipe", - "ovl_Oceff_Wipe2", - "ovl_Oceff_Wipe3", - "ovl_Oceff_Wipe4", - "ovl_Shot_Sun", - "gameplay_keep", - "gameplay_field_keep", - "gameplay_dangeon_keep", - "gameplay_object_exchange_static", - "object_link_boy", - "object_link_child", - "object_box", - "object_human", - "object_okuta", - "object_poh", - "object_wallmaster", - "object_dy_obj", - "object_firefly", - "object_dodongo", - "object_fire", - "object_niw", - "object_tite", - "object_reeba", - "object_peehat", - "object_kingdodongo", - "object_horse", - "object_zf", - "object_goma", - "object_zl1", - "object_gol", - "object_bubble", - "object_dodojr", - "object_torch2", - "object_bl", - "object_tp", - "object_oA1", - "object_st", - "object_bw", - "object_ei", - "object_horse_normal", - "object_oB1", - "object_o_anime", - "object_spot04_objects", - "object_ddan_objects", - "object_hidan_objects", - "object_horse_ganon", - "object_oA2", - "object_spot00_objects", - "object_mb", - "object_bombf", - "object_sk2", - "object_oE1", - "object_oE_anime", - "object_oE2", - "object_ydan_objects", - "object_gnd", - "object_am", - "object_dekubaba", - "object_oA3", - "object_oA4", - "object_oA5", - "object_oA6", - "object_oA7", - "object_jj", - "object_oA8", - "object_oA9", - "object_oB2", - "object_oB3", - "object_oB4", - "object_horse_zelda", - "object_opening_demo1", - "object_warp1", - "object_b_heart", - "object_dekunuts", - "object_oE3", - "object_oE4", - "object_menkuri_objects", - "object_oE5", - "object_oE6", - "object_oE7", - "object_oE8", - "object_oE9", - "object_oE10", - "object_oE11", - "object_oE12", - "object_vali", - "object_oA10", - "object_oA11", - "object_mizu_objects", - "object_fhg", - "object_ossan", - "object_mori_hineri1", - "object_Bb", - "object_toki_objects", - "object_yukabyun", - "object_zl2", - "object_mjin", - "object_mjin_flash", - "object_mjin_dark", - "object_mjin_flame", - "object_mjin_ice", - "object_mjin_soul", - "object_mjin_wind", - "object_mjin_oka", - "object_haka_objects", - "object_spot06_objects", - "object_ice_objects", - "object_relay_objects", - "object_mori_hineri1a", - "object_mori_hineri2", - "object_mori_hineri2a", - "object_mori_objects", - "object_mori_tex", - "object_spot08_obj", - "object_warp2", - "object_hata", - "object_bird", - "object_wood02", - "object_lightbox", - "object_pu_box", - "object_trap", - "object_vase", - "object_im", - "object_ta", - "object_tk", - "object_xc", - "object_vm", - "object_bv", - "object_hakach_objects", - "object_efc_crystal_light", - "object_efc_fire_ball", - "object_efc_flash", - "object_efc_lgt_shower", - "object_efc_star_field", - "object_god_lgt", - "object_light_ring", - "object_triforce_spot", - "object_medal", - "object_bdan_objects", - "object_sd", - "object_rd", - "object_po_sisters", - "object_heavy_object", - "object_gndd", - "object_fd", - "object_du", - "object_fw", - "object_horse_link_child", - "object_spot02_objects", - "object_haka", - "object_ru1", - "object_syokudai", - "object_fd2", - "object_dh", - "object_rl", - "object_efc_tw", - "object_demo_tre_lgt", - "object_gi_key", - "object_mir_ray", - "object_brob", - "object_gi_jewel", - "object_spot09_obj", - "object_spot18_obj", - "object_bdoor", - "object_spot17_obj", - "object_shop_dungen", - "object_nb", - "object_mo", - "object_sb", - "object_gi_melody", - "object_gi_heart", - "object_gi_compass", - "object_gi_bosskey", - "object_gi_medal", - "object_gi_nuts", - "object_sa", - "object_gi_hearts", - "object_gi_arrowcase", - "object_gi_bombpouch", - "object_in", - "object_tr", - "object_spot16_obj", - "object_oE1s", - "object_oE4s", - "object_os_anime", - "object_gi_bottle", - "object_gi_stick", - "object_gi_map", - "object_oF1d_map", - "object_ru2", - "object_gi_shield_1", - "object_dekujr", - "object_gi_magicpot", - "object_gi_bomb_1", - "object_oF1s", - "object_ma2", - "object_gi_purse", - "object_hni", - "object_tw", - "object_rr", - "object_bxa", - "object_anubice", - "object_gi_gerudo", - "object_gi_arrow", - "object_gi_bomb_2", - "object_gi_egg", - "object_gi_scale", - "object_gi_shield_2", - "object_gi_hookshot", - "object_gi_ocarina", - "object_gi_milk", - "object_ma1", - "object_ganon", - "object_sst", - "object_ny", - "object_fr", - "object_gi_pachinko", - "object_gi_boomerang", - "object_gi_bow", - "object_gi_glasses", - "object_gi_liquid", - "object_ani", - "object_demo_6k", - "object_gi_shield_3", - "object_gi_letter", - "object_spot15_obj", - "object_jya_obj", - "object_gi_clothes", - "object_gi_bean", - "object_gi_fish", - "object_gi_saw", - "object_gi_hammer", - "object_gi_grass", - "object_gi_longsword", - "object_spot01_objects", - "object_md", - "object_km1", - "object_kw1", - "object_zo", - "object_kz", - "object_umajump", - "object_masterkokiri", - "object_masterkokirihead", - "object_mastergolon", - "object_masterzoora", - "object_aob", - "object_ik", - "object_ahg", - "object_cne", - "object_gi_niwatori", - "object_skj", - "object_gi_bottle_letter", - "object_bji", - "object_bba", - "object_gi_ocarina_0", - "object_ds", - "object_ane", - "object_boj", - "object_spot03_object", - "object_spot07_object", - "object_fz", - "object_bob", - "object_ge1", - "object_yabusame_point", - "object_gi_boots_2", - "object_gi_seed", - "object_gnd_magic", - "object_d_elevator", - "object_d_hsblock", - "object_d_lift", - "object_mamenoki", - "object_goroiwa", - "object_toryo", - "object_daiku", - "object_nwc", - "object_blkobj", - "object_gm", - "object_ms", - "object_hs", - "object_ingate", - "object_lightswitch", - "object_kusa", - "object_tsubo", - "object_gi_gloves", - "object_gi_coin", - "object_kanban", - "object_gjyo_objects", - "object_owl", - "object_mk", - "object_fu", - "object_gi_ki_tan_mask", - "object_gi_redead_mask", - "object_gi_skj_mask", - "object_gi_rabit_mask", - "object_gi_truth_mask", - "object_ganon_objects", - "object_siofuki", - "object_stream", - "object_mm", - "object_fa", - "object_os", - "object_gi_eye_lotion", - "object_gi_powder", - "object_gi_mushroom", - "object_gi_ticketstone", - "object_gi_brokensword", - "object_js", - "object_cs", - "object_gi_prescription", - "object_gi_bracelet", - "object_gi_soldout", - "object_gi_frog", - "object_mag", - "object_door_gerudo", - "object_gt", - "object_efc_erupc", - "object_zl2_anime1", - "object_zl2_anime2", - "object_gi_golonmask", - "object_gi_zoramask", - "object_gi_gerudomask", - "object_ganon2", - "object_ka", - "object_ts", - "object_zg", - "object_gi_hoverboots", - "object_gi_m_arrow", - "object_ds2", - "object_ec", - "object_fish", - "object_gi_sutaru", - "object_gi_goddess", - "object_ssh", - "object_bigokuta", - "object_bg", - "object_spot05_objects", - "object_spot12_obj", - "object_bombiwa", - "object_hintnuts", - "object_rs", - "object_spot00_break", - "object_gla", - "object_shopnuts", - "object_geldb", - "object_gr", - "object_dog", - "object_jya_iron", - "object_jya_door", - "object_spot01_objects2", - "object_spot11_obj", - "object_kibako2", - "object_dns", - "object_dnk", - "object_gi_fire", - "object_gi_insect", - "object_gi_butterfly", - "object_gi_ghost", - "object_gi_soul", - "object_bowl", - "object_po_field", - "object_demo_kekkai", - "object_efc_doughnut", - "object_gi_dekupouch", - "object_ganon_anime1", - "object_ganon_anime2", - "object_ganon_anime3", - "object_gi_rupy", - "object_spot01_matoya", - "object_spot01_matoyab", - "object_po_composer", - "object_mu", - "object_wf", - "object_skb", - "object_gj", - "object_geff", - "object_haka_door", - "object_gs", - "object_ps", - "object_bwall", - "object_crow", - "object_cow", - "object_cob", - "object_gi_sword_1", - "object_door_killer", - "object_ouke_haka", - "object_timeblock", - "object_zl4", - "g_pn_01", - "g_pn_02", - "g_pn_03", - "g_pn_04", - "g_pn_05", - "g_pn_06", - "g_pn_07", - "g_pn_08", - "g_pn_09", - "g_pn_10", - "g_pn_11", - "g_pn_12", - "g_pn_13", - "g_pn_14", - "g_pn_15", - "g_pn_16", - "g_pn_17", - "g_pn_18", - "g_pn_19", - "g_pn_20", - "g_pn_21", - "g_pn_22", - "g_pn_23", - "g_pn_24", - "g_pn_25", - "g_pn_26", - "g_pn_27", - "g_pn_28", - "g_pn_29", - "g_pn_30", - "g_pn_31", - "g_pn_32", - "g_pn_33", - "g_pn_34", - "g_pn_35", - "g_pn_36", - "g_pn_37", - "g_pn_38", - "g_pn_39", - "g_pn_40", - "g_pn_41", - "g_pn_42", - "g_pn_43", - "g_pn_44", - "g_pn_45", - "g_pn_46", - "g_pn_47", - "g_pn_48", - "g_pn_49", - "g_pn_50", - "g_pn_51", - "g_pn_52", - "g_pn_53", - "g_pn_54", - "g_pn_55", - "g_pn_56", - "g_pn_57", - "z_select_static", - "nintendo_rogo_static", - "title_static", - "parameter_static", - "vr_fine0_static", - "vr_fine0_pal_static", - "vr_fine1_static", - "vr_fine1_pal_static", - "vr_fine2_static", - "vr_fine2_pal_static", - "vr_fine3_static", - "vr_fine3_pal_static", - "vr_cloud0_static", - "vr_cloud0_pal_static", - "vr_cloud1_static", - "vr_cloud1_pal_static", - "vr_cloud2_static", - "vr_cloud2_pal_static", - "vr_cloud3_static", - "vr_cloud3_pal_static", - "vr_holy0_static", - "vr_holy0_pal_static", - "vr_holy1_static", - "vr_holy1_pal_static", - "vr_MDVR_static", - "vr_MDVR_pal_static", - "vr_MNVR_static", - "vr_MNVR_pal_static", - "vr_RUVR_static", - "vr_RUVR_pal_static", - "vr_LHVR_static", - "vr_LHVR_pal_static", - "vr_KHVR_static", - "vr_KHVR_pal_static", - "vr_K3VR_static", - "vr_K3VR_pal_static", - "vr_K4VR_static", - "vr_K4VR_pal_static", - "vr_K5VR_static", - "vr_K5VR_pal_static", - "vr_SP1a_static", - "vr_SP1a_pal_static", - "vr_MLVR_static", - "vr_MLVR_pal_static", - "vr_KKRVR_static", - "vr_KKRVR_pal_static", - "vr_KR3VR_static", - "vr_KR3VR_pal_static", - "vr_IPVR_static", - "vr_IPVR_pal_static", - "vr_KSVR_static", - "vr_KSVR_pal_static", - "vr_GLVR_static", - "vr_GLVR_pal_static", - "vr_ZRVR_static", - "vr_ZRVR_pal_static", - "vr_DGVR_static", - "vr_DGVR_pal_static", - "vr_ALVR_static", - "vr_ALVR_pal_static", - "vr_NSVR_static", - "vr_NSVR_pal_static", - "vr_LBVR_static", - "vr_LBVR_pal_static", - "vr_TTVR_static", - "vr_TTVR_pal_static", - "vr_FCVR_static", - "vr_FCVR_pal_static", - "elf_message_field", - "elf_message_ydan", - "syotes_scene", - "syotes_room_0", - "syotes2_scene", - "syotes2_room_0", - "depth_test_scene", - "depth_test_room_0", - "spot00_scene", - "spot00_room_0", - "spot01_scene", - "spot01_room_0", - "spot02_scene", - "spot02_room_0", - "spot02_room_1", - "spot03_scene", - "spot03_room_0", - "spot03_room_1", - "spot04_scene", - "spot04_room_0", - "spot04_room_1", - "spot04_room_2", - "spot05_scene", - "spot05_room_0", - "spot06_scene", - "spot06_room_0", - "spot07_scene", - "spot07_room_0", - "spot07_room_1", - "spot08_scene", - "spot08_room_0", - "spot09_scene", - "spot09_room_0", - "spot10_scene", - "spot10_room_0", - "spot10_room_1", - "spot10_room_2", - "spot10_room_3", - "spot10_room_4", - "spot10_room_5", - "spot10_room_6", - "spot10_room_7", - "spot10_room_8", - "spot10_room_9", - "spot11_scene", - "spot11_room_0", - "spot12_scene", - "spot12_room_0", - "spot12_room_1", - "spot13_scene", - "spot13_room_0", - "spot13_room_1", - "spot15_scene", - "spot15_room_0", - "spot16_scene", - "spot16_room_0", - "spot17_scene", - "spot17_room_0", - "spot17_room_1", - "spot18_scene", - "spot18_room_0", - "spot18_room_1", - "spot18_room_2", - "spot18_room_3", - "ydan_scene", - "ydan_room_0", - "ydan_room_1", - "ydan_room_2", - "ydan_room_3", - "ydan_room_4", - "ydan_room_5", - "ydan_room_6", - "ydan_room_7", - "ydan_room_8", - "ydan_room_9", - "ydan_room_10", - "ydan_room_11", - "ddan_scene", - "ddan_room_0", - "ddan_room_1", - "ddan_room_2", - "ddan_room_3", - "ddan_room_4", - "ddan_room_5", - "ddan_room_6", - "ddan_room_7", - "ddan_room_8", - "ddan_room_9", - "ddan_room_10", - "ddan_room_11", - "ddan_room_12", - "ddan_room_13", - "ddan_room_14", - "ddan_room_15", - "ddan_room_16", - "bdan_scene", - "bdan_room_0", - "bdan_room_1", - "bdan_room_2", - "bdan_room_3", - "bdan_room_4", - "bdan_room_5", - "bdan_room_6", - "bdan_room_7", - "bdan_room_8", - "bdan_room_9", - "bdan_room_10", - "bdan_room_11", - "bdan_room_12", - "bdan_room_13", - "bdan_room_14", - "bdan_room_15", - "Bmori1_scene", - "Bmori1_room_0", - "Bmori1_room_1", - "Bmori1_room_2", - "Bmori1_room_3", - "Bmori1_room_4", - "Bmori1_room_5", - "Bmori1_room_6", - "Bmori1_room_7", - "Bmori1_room_8", - "Bmori1_room_9", - "Bmori1_room_10", - "Bmori1_room_11", - "Bmori1_room_12", - "Bmori1_room_13", - "Bmori1_room_14", - "Bmori1_room_15", - "Bmori1_room_16", - "Bmori1_room_17", - "Bmori1_room_18", - "Bmori1_room_19", - "Bmori1_room_20", - "Bmori1_room_21", - "Bmori1_room_22", - "HIDAN_scene", - "HIDAN_room_0", - "HIDAN_room_1", - "HIDAN_room_2", - "HIDAN_room_3", - "HIDAN_room_4", - "HIDAN_room_5", - "HIDAN_room_6", - "HIDAN_room_7", - "HIDAN_room_8", - "HIDAN_room_9", - "HIDAN_room_10", - "HIDAN_room_11", - "HIDAN_room_12", - "HIDAN_room_13", - "HIDAN_room_14", - "HIDAN_room_15", - "HIDAN_room_16", - "HIDAN_room_17", - "HIDAN_room_18", - "HIDAN_room_19", - "HIDAN_room_20", - "HIDAN_room_21", - "HIDAN_room_22", - "HIDAN_room_23", - "HIDAN_room_24", - "HIDAN_room_25", - "HIDAN_room_26", - "MIZUsin_scene", - "MIZUsin_room_0", - "MIZUsin_room_1", - "MIZUsin_room_2", - "MIZUsin_room_3", - "MIZUsin_room_4", - "MIZUsin_room_5", - "MIZUsin_room_6", - "MIZUsin_room_7", - "MIZUsin_room_8", - "MIZUsin_room_9", - "MIZUsin_room_10", - "MIZUsin_room_11", - "MIZUsin_room_12", - "MIZUsin_room_13", - "MIZUsin_room_14", - "MIZUsin_room_15", - "MIZUsin_room_16", - "MIZUsin_room_17", - "MIZUsin_room_18", - "MIZUsin_room_19", - "MIZUsin_room_20", - "MIZUsin_room_21", - "MIZUsin_room_22", - "jyasinzou_scene", - "jyasinzou_room_0", - "jyasinzou_room_1", - "jyasinzou_room_2", - "jyasinzou_room_3", - "jyasinzou_room_4", - "jyasinzou_room_5", - "jyasinzou_room_6", - "jyasinzou_room_7", - "jyasinzou_room_8", - "jyasinzou_room_9", - "jyasinzou_room_10", - "jyasinzou_room_11", - "jyasinzou_room_12", - "jyasinzou_room_13", - "jyasinzou_room_14", - "jyasinzou_room_15", - "jyasinzou_room_16", - "jyasinzou_room_17", - "jyasinzou_room_18", - "jyasinzou_room_19", - "jyasinzou_room_20", - "jyasinzou_room_21", - "jyasinzou_room_22", - "jyasinzou_room_23", - "jyasinzou_room_24", - "jyasinzou_room_25", - "jyasinzou_room_26", - "jyasinzou_room_27", - "jyasinzou_room_28", - "HAKAdan_scene", - "HAKAdan_room_0", - "HAKAdan_room_1", - "HAKAdan_room_2", - "HAKAdan_room_3", - "HAKAdan_room_4", - "HAKAdan_room_5", - "HAKAdan_room_6", - "HAKAdan_room_7", - "HAKAdan_room_8", - "HAKAdan_room_9", - "HAKAdan_room_10", - "HAKAdan_room_11", - "HAKAdan_room_12", - "HAKAdan_room_13", - "HAKAdan_room_14", - "HAKAdan_room_15", - "HAKAdan_room_16", - "HAKAdan_room_17", - "HAKAdan_room_18", - "HAKAdan_room_19", - "HAKAdan_room_20", - "HAKAdan_room_21", - "HAKAdan_room_22", - "HAKAdanCH_scene", - "HAKAdanCH_room_0", - "HAKAdanCH_room_1", - "HAKAdanCH_room_2", - "HAKAdanCH_room_3", - "HAKAdanCH_room_4", - "HAKAdanCH_room_5", - "HAKAdanCH_room_6", - "ice_doukutu_scene", - "ice_doukutu_room_0", - "ice_doukutu_room_1", - "ice_doukutu_room_2", - "ice_doukutu_room_3", - "ice_doukutu_room_4", - "ice_doukutu_room_5", - "ice_doukutu_room_6", - "ice_doukutu_room_7", - "ice_doukutu_room_8", - "ice_doukutu_room_9", - "ice_doukutu_room_10", - "ice_doukutu_room_11", - "men_scene", - "men_room_0", - "men_room_1", - "men_room_2", - "men_room_3", - "men_room_4", - "men_room_5", - "men_room_6", - "men_room_7", - "men_room_8", - "men_room_9", - "men_room_10", - "ganontika_scene", - "ganontika_room_0", - "ganontika_room_1", - "ganontika_room_2", - "ganontika_room_3", - "ganontika_room_4", - "ganontika_room_5", - "ganontika_room_6", - "ganontika_room_7", - "ganontika_room_8", - "ganontika_room_9", - "ganontika_room_10", - "ganontika_room_11", - "ganontika_room_12", - "ganontika_room_13", - "ganontika_room_14", - "ganontika_room_15", - "ganontika_room_16", - "ganontika_room_17", - "ganontika_room_18", - "ganontika_room_19", - "market_day_scene", - "market_day_room_0", - "market_night_scene", - "market_night_room_0", - "testroom_scene", - "testroom_room_0", - "testroom_room_1", - "testroom_room_2", - "testroom_room_3", - "testroom_room_4", - "kenjyanoma_scene", - "kenjyanoma_room_0", - "tokinoma_scene", - "tokinoma_room_0", - "tokinoma_room_1", - "sutaru_scene", - "sutaru_room_0", - "link_home_scene", - "link_home_room_0", - "kokiri_shop_scene", - "kokiri_shop_room_0", - "kokiri_home_scene", - "kokiri_home_room_0", - "kakusiana_scene", - "kakusiana_room_0", - "kakusiana_room_1", - "kakusiana_room_2", - "kakusiana_room_3", - "kakusiana_room_4", - "kakusiana_room_5", - "kakusiana_room_6", - "kakusiana_room_7", - "kakusiana_room_8", - "kakusiana_room_9", - "kakusiana_room_10", - "kakusiana_room_11", - "kakusiana_room_12", - "kakusiana_room_13", - "entra_scene", - "entra_room_0", - "moribossroom_scene", - "moribossroom_room_0", - "moribossroom_room_1", - "syatekijyou_scene", - "syatekijyou_room_0", - "shop1_scene", - "shop1_room_0", - "hairal_niwa_scene", - "hairal_niwa_room_0", - "ganon_tou_scene", - "ganon_tou_room_0", - "sasatest_scene", - "sasatest_room_0", - "market_alley_scene", - "market_alley_room_0", - "spot20_scene", - "spot20_room_0", - "market_ruins_scene", - "market_ruins_room_0", - "entra_n_scene", - "entra_n_room_0", - "enrui_scene", - "enrui_room_0", - "market_alley_n_scene", - "market_alley_n_room_0", - "hiral_demo_scene", - "hiral_demo_room_0", - "kokiri_home3_scene", - "kokiri_home3_room_0", - "malon_stable_scene", - "malon_stable_room_0", - "kakariko_scene", - "kakariko_room_0", - "bdan_boss_scene", - "bdan_boss_room_0", - "bdan_boss_room_1", - "FIRE_bs_scene", - "FIRE_bs_room_0", - "FIRE_bs_room_1", - "hut_scene", - "hut_room_0", - "daiyousei_izumi_scene", - "daiyousei_izumi_room_0", - "hakaana_scene", - "hakaana_room_0", - "yousei_izumi_tate_scene", - "yousei_izumi_tate_room_0", - "yousei_izumi_yoko_scene", - "yousei_izumi_yoko_room_0", - "golon_scene", - "golon_room_0", - "zoora_scene", - "zoora_room_0", - "drag_scene", - "drag_room_0", - "alley_shop_scene", - "alley_shop_room_0", - "night_shop_scene", - "night_shop_room_0", - "impa_scene", - "impa_room_0", - "labo_scene", - "labo_room_0", - "tent_scene", - "tent_room_0", - "nakaniwa_scene", - "nakaniwa_room_0", - "ddan_boss_scene", - "ddan_boss_room_0", - "ddan_boss_room_1", - "ydan_boss_scene", - "ydan_boss_room_0", - "ydan_boss_room_1", - "HAKAdan_bs_scene", - "HAKAdan_bs_room_0", - "HAKAdan_bs_room_1", - "MIZUsin_bs_scene", - "MIZUsin_bs_room_0", - "MIZUsin_bs_room_1", - "ganon_scene", - "ganon_room_0", - "ganon_room_1", - "ganon_room_2", - "ganon_room_3", - "ganon_room_4", - "ganon_room_5", - "ganon_room_6", - "ganon_room_7", - "ganon_room_8", - "ganon_room_9", - "ganon_boss_scene", - "ganon_boss_room_0", - "jyasinboss_scene", - "jyasinboss_room_0", - "jyasinboss_room_1", - "jyasinboss_room_2", - "jyasinboss_room_3", - "kokiri_home4_scene", - "kokiri_home4_room_0", - "kokiri_home5_scene", - "kokiri_home5_room_0", - "ganon_final_scene", - "ganon_final_room_0", - "kakariko3_scene", - "kakariko3_room_0", - "hairal_niwa2_scene", - "hairal_niwa2_room_0", - "hakasitarelay_scene", - "hakasitarelay_room_0", - "hakasitarelay_room_1", - "hakasitarelay_room_2", - "hakasitarelay_room_3", - "hakasitarelay_room_4", - "hakasitarelay_room_5", - "hakasitarelay_room_6", - "shrine_scene", - "shrine_room_0", - "turibori_scene", - "turibori_room_0", - "shrine_n_scene", - "shrine_n_room_0", - "shrine_r_scene", - "shrine_r_room_0", - "hakaana2_scene", - "hakaana2_room_0", - "gerudoway_scene", - "gerudoway_room_0", - "gerudoway_room_1", - "gerudoway_room_2", - "gerudoway_room_3", - "gerudoway_room_4", - "gerudoway_room_5", - "hairal_niwa_n_scene", - "hairal_niwa_n_room_0", - "bowling_scene", - "bowling_room_0", - "hakaana_ouke_scene", - "hakaana_ouke_room_0", - "hakaana_ouke_room_1", - "hakaana_ouke_room_2", - "hylia_labo_scene", - "hylia_labo_room_0", - "souko_scene", - "souko_room_0", - "souko_room_1", - "souko_room_2", - "miharigoya_scene", - "miharigoya_room_0", - "mahouya_scene", - "mahouya_room_0", - "takaraya_scene", - "takaraya_room_0", - "takaraya_room_1", - "takaraya_room_2", - "takaraya_room_3", - "takaraya_room_4", - "takaraya_room_5", - "takaraya_room_6", - "ganon_sonogo_scene", - "ganon_sonogo_room_0", - "ganon_sonogo_room_1", - "ganon_sonogo_room_2", - "ganon_sonogo_room_3", - "ganon_sonogo_room_4", - "ganon_demo_scene", - "ganon_demo_room_0", - "besitu_scene", - "besitu_room_0", - "face_shop_scene", - "face_shop_room_0", - "kinsuta_scene", - "kinsuta_room_0", - "ganontikasonogo_scene", - "ganontikasonogo_room_0", - "ganontikasonogo_room_1", - "test01_scene", - "test01_room_0", - "bump_texture_static", - "anime_model_1_static", - "anime_model_2_static", - "anime_model_3_static", - "anime_model_4_static", - "anime_model_5_static", - "anime_model_6_static", - "anime_texture_1_static", - "anime_texture_2_static", - "anime_texture_3_static", - "anime_texture_4_static", - "anime_texture_5_static", - "anime_texture_6_static", +const char* sDmaMgrFileNames[0x5FC] = { + "makerom", + "boot", + "dmadata", + "Audiobank", + "Audioseq", + "Audiotable", + "link_animetion", + "icon_item_static", + "icon_item_24_static", + "icon_item_field_static", + "icon_item_dungeon_static", + "icon_item_gameover_static", + "icon_item_nes_static", + "icon_item_ger_static", + "icon_item_fra_static", + "item_name_static", + "map_name_static", + "do_action_static", + "message_static", + "message_texture_static", + "nes_font_static", + "nes_message_data_static", + "ger_message_data_static", + "fra_message_data_static", + "staff_message_data_static", + "map_grand_static", + "map_i_static", + "map_48x85_static", + "code", + "ovl_title", + "ovl_select", + "ovl_opening", + "ovl_file_choose", + "ovl_kaleido_scope", + "ovl_player_actor", + "ovl_map_mark_data", + "ovl_En_Test", + "ovl_Arms_Hook", + "ovl_Arrow_Fire", + "ovl_Arrow_Ice", + "ovl_Arrow_Light", + "ovl_Bg_Bdan_Objects", + "ovl_Bg_Bdan_Switch", + "ovl_Bg_Bom_Guard", + "ovl_Bg_Bombwall", + "ovl_Bg_Bowl_Wall", + "ovl_Bg_Breakwall", + "ovl_Bg_Ddan_Jd", + "ovl_Bg_Ddan_Kd", + "ovl_Bg_Dodoago", + "ovl_Bg_Dy_Yoseizo", + "ovl_Bg_Ganon_Otyuka", + "ovl_Bg_Gate_Shutter", + "ovl_Bg_Gjyo_Bridge", + "ovl_Bg_Gnd_Darkmeiro", + "ovl_Bg_Gnd_Firemeiro", + "ovl_Bg_Gnd_Iceblock", + "ovl_Bg_Gnd_Nisekabe", + "ovl_Bg_Gnd_Soulmeiro", + "ovl_Bg_Haka", + "ovl_Bg_Haka_Gate", + "ovl_Bg_Haka_Huta", + "ovl_Bg_Haka_Megane", + "ovl_Bg_Haka_MeganeBG", + "ovl_Bg_Haka_Sgami", + "ovl_Bg_Haka_Ship", + "ovl_Bg_Haka_Trap", + "ovl_Bg_Haka_Tubo", + "ovl_Bg_Haka_Water", + "ovl_Bg_Haka_Zou", + "ovl_Bg_Heavy_Block", + "ovl_Bg_Hidan_Curtain", + "ovl_Bg_Hidan_Dalm", + "ovl_Bg_Hidan_Firewall", + "ovl_Bg_Hidan_Fslift", + "ovl_Bg_Hidan_Fwbig", + "ovl_Bg_Hidan_Hamstep", + "ovl_Bg_Hidan_Hrock", + "ovl_Bg_Hidan_Kousi", + "ovl_Bg_Hidan_Kowarerukabe", + "ovl_Bg_Hidan_Rock", + "ovl_Bg_Hidan_Rsekizou", + "ovl_Bg_Hidan_Sekizou", + "ovl_Bg_Hidan_Sima", + "ovl_Bg_Hidan_Syoku", + "ovl_Bg_Ice_Objects", + "ovl_Bg_Ice_Shelter", + "ovl_Bg_Ice_Shutter", + "ovl_Bg_Ice_Turara", + "ovl_Bg_Ingate", + "ovl_Bg_Jya_1flift", + "ovl_Bg_Jya_Amishutter", + "ovl_Bg_Jya_Bigmirror", + "ovl_Bg_Jya_Block", + "ovl_Bg_Jya_Bombchuiwa", + "ovl_Bg_Jya_Bombiwa", + "ovl_Bg_Jya_Cobra", + "ovl_Bg_Jya_Goroiwa", + "ovl_Bg_Jya_Haheniron", + "ovl_Bg_Jya_Ironobj", + "ovl_Bg_Jya_Kanaami", + "ovl_Bg_Jya_Lift", + "ovl_Bg_Jya_Megami", + "ovl_Bg_Jya_Zurerukabe", + "ovl_Bg_Menkuri_Eye", + "ovl_Bg_Menkuri_Kaiten", + "ovl_Bg_Menkuri_Nisekabe", + "ovl_Bg_Mizu_Bwall", + "ovl_Bg_Mizu_Movebg", + "ovl_Bg_Mizu_Shutter", + "ovl_Bg_Mizu_Uzu", + "ovl_Bg_Mizu_Water", + "ovl_Bg_Mjin", + "ovl_Bg_Mori_Bigst", + "ovl_Bg_Mori_Elevator", + "ovl_Bg_Mori_Hashigo", + "ovl_Bg_Mori_Hashira4", + "ovl_Bg_Mori_Hineri", + "ovl_Bg_Mori_Idomizu", + "ovl_Bg_Mori_Kaitenkabe", + "ovl_Bg_Mori_Rakkatenjo", + "ovl_Bg_Po_Event", + "ovl_Bg_Po_Syokudai", + "ovl_Bg_Pushbox", + "ovl_Bg_Relay_Objects", + "ovl_Bg_Spot00_Break", + "ovl_Bg_Spot00_Hanebasi", + "ovl_Bg_Spot01_Fusya", + "ovl_Bg_Spot01_Idohashira", + "ovl_Bg_Spot01_Idomizu", + "ovl_Bg_Spot01_Idosoko", + "ovl_Bg_Spot01_Objects2", + "ovl_Bg_Spot02_Objects", + "ovl_Bg_Spot03_Taki", + "ovl_Bg_Spot05_Soko", + "ovl_Bg_Spot06_Objects", + "ovl_Bg_Spot07_Taki", + "ovl_Bg_Spot08_Bakudankabe", + "ovl_Bg_Spot08_Iceblock", + "ovl_Bg_Spot09_Obj", + "ovl_Bg_Spot11_Bakudankabe", + "ovl_Bg_Spot11_Oasis", + "ovl_Bg_Spot12_Gate", + "ovl_Bg_Spot12_Saku", + "ovl_Bg_Spot15_Rrbox", + "ovl_Bg_Spot15_Saku", + "ovl_Bg_Spot16_Bombstone", + "ovl_Bg_Spot16_Doughnut", + "ovl_Bg_Spot17_Bakudankabe", + "ovl_Bg_Spot17_Funen", + "ovl_Bg_Spot18_Basket", + "ovl_Bg_Spot18_Futa", + "ovl_Bg_Spot18_Obj", + "ovl_Bg_Spot18_Shutter", + "ovl_Bg_Sst_Floor", + "ovl_Bg_Toki_Hikari", + "ovl_Bg_Toki_Swd", + "ovl_Bg_Treemouth", + "ovl_Bg_Umajump", + "ovl_Bg_Vb_Sima", + "ovl_Bg_Ydan_Hasi", + "ovl_Bg_Ydan_Maruta", + "ovl_Bg_Ydan_Sp", + "ovl_Bg_Zg", + "ovl_Boss_Dodongo", + "ovl_Boss_Fd", + "ovl_Boss_Fd2", + "ovl_Boss_Ganon", + "ovl_Boss_Ganon2", + "ovl_Boss_Ganondrof", + "ovl_Boss_Goma", + "ovl_Boss_Mo", + "ovl_Boss_Sst", + "ovl_Boss_Tw", + "ovl_Boss_Va", + "ovl_Demo_6K", + "ovl_Demo_Du", + "ovl_Demo_Ec", + "ovl_Demo_Effect", + "ovl_Demo_Ext", + "ovl_Demo_Geff", + "ovl_Demo_Gj", + "ovl_Demo_Go", + "ovl_Demo_Gt", + "ovl_Demo_Ik", + "ovl_Demo_Im", + "ovl_Demo_Kankyo", + "ovl_Demo_Kekkai", + "ovl_Demo_Sa", + "ovl_Demo_Shd", + "ovl_Demo_Tre_Lgt", + "ovl_Door_Ana", + "ovl_Door_Gerudo", + "ovl_Door_Killer", + "ovl_Door_Shutter", + "ovl_Door_Toki", + "ovl_Door_Warp1", + "ovl_Efc_Erupc", + "ovl_Eff_Dust", + "ovl_Effect_Ss_Blast", + "ovl_Effect_Ss_Bomb", + "ovl_Effect_Ss_Bomb2", + "ovl_Effect_Ss_Bubble", + "ovl_Effect_Ss_D_Fire", + "ovl_Effect_Ss_Dead_Db", + "ovl_Effect_Ss_Dead_Dd", + "ovl_Effect_Ss_Dead_Ds", + "ovl_Effect_Ss_Dead_Sound", + "ovl_Effect_Ss_Dt_Bubble", + "ovl_Effect_Ss_Dust", + "ovl_Effect_Ss_En_Fire", + "ovl_Effect_Ss_En_Ice", + "ovl_Effect_Ss_Extra", + "ovl_Effect_Ss_Fcircle", + "ovl_Effect_Ss_Fhg_Flash", + "ovl_Effect_Ss_Fire_Tail", + "ovl_Effect_Ss_G_Fire", + "ovl_Effect_Ss_G_Magma", + "ovl_Effect_Ss_G_Magma2", + "ovl_Effect_Ss_G_Ripple", + "ovl_Effect_Ss_G_Spk", + "ovl_Effect_Ss_G_Splash", + "ovl_Effect_Ss_Hahen", + "ovl_Effect_Ss_HitMark", + "ovl_Effect_Ss_Ice_Piece", + "ovl_Effect_Ss_Ice_Smoke", + "ovl_Effect_Ss_K_Fire", + "ovl_Effect_Ss_Kakera", + "ovl_Effect_Ss_KiraKira", + "ovl_Effect_Ss_Lightning", + "ovl_Effect_Ss_Sibuki", + "ovl_Effect_Ss_Sibuki2", + "ovl_Effect_Ss_Solder_Srch_Ball", + "ovl_Effect_Ss_Stick", + "ovl_Effect_Ss_Stone1", + "ovl_Elf_Msg", + "ovl_Elf_Msg2", + "ovl_En_Am", + "ovl_En_Ani", + "ovl_En_Anubice", + "ovl_En_Anubice_Fire", + "ovl_En_Anubice_Tag", + "ovl_En_Arow_Trap", + "ovl_En_Arrow", + "ovl_En_Attack_Niw", + "ovl_En_Ba", + "ovl_En_Bb", + "ovl_En_Bdfire", + "ovl_En_Bigokuta", + "ovl_En_Bili", + "ovl_En_Bird", + "ovl_En_Blkobj", + "ovl_En_Bom", + "ovl_En_Bom_Bowl_Man", + "ovl_En_Bom_Bowl_Pit", + "ovl_En_Bom_Chu", + "ovl_En_Bombf", + "ovl_En_Boom", + "ovl_En_Box", + "ovl_En_Brob", + "ovl_En_Bubble", + "ovl_En_Butte", + "ovl_En_Bw", + "ovl_En_Bx", + "ovl_En_Changer", + "ovl_En_Clear_Tag", + "ovl_En_Cow", + "ovl_En_Crow", + "ovl_En_Cs", + "ovl_En_Daiku", + "ovl_En_Daiku_Kakariko", + "ovl_En_Dekubaba", + "ovl_En_Dekunuts", + "ovl_En_Dh", + "ovl_En_Dha", + "ovl_En_Diving_Game", + "ovl_En_Dns", + "ovl_En_Dnt_Demo", + "ovl_En_Dnt_Jiji", + "ovl_En_Dnt_Nomal", + "ovl_En_Dodojr", + "ovl_En_Dodongo", + "ovl_En_Dog", + "ovl_En_Door", + "ovl_En_Ds", + "ovl_En_Du", + "ovl_En_Dy_Extra", + "ovl_En_Eg", + "ovl_En_Eiyer", + "ovl_En_Elf", + "ovl_En_Encount1", + "ovl_En_Encount2", + "ovl_En_Ex_Item", + "ovl_En_Ex_Ruppy", + "ovl_En_Fd", + "ovl_En_Fd_Fire", + "ovl_En_Fhg_Fire", + "ovl_En_Fire_Rock", + "ovl_En_Firefly", + "ovl_En_Fish", + "ovl_En_Floormas", + "ovl_En_Fr", + "ovl_En_Fu", + "ovl_En_Fw", + "ovl_En_Fz", + "ovl_En_G_Switch", + "ovl_En_Ganon_Mant", + "ovl_En_Ganon_Organ", + "ovl_En_Gb", + "ovl_En_Ge1", + "ovl_En_Ge2", + "ovl_En_Ge3", + "ovl_En_GeldB", + "ovl_En_GirlA", + "ovl_En_Gm", + "ovl_En_Go", + "ovl_En_Go2", + "ovl_En_Goma", + "ovl_En_Goroiwa", + "ovl_En_Gs", + "ovl_En_Guest", + "ovl_En_Hata", + "ovl_En_Heishi1", + "ovl_En_Heishi2", + "ovl_En_Heishi3", + "ovl_En_Heishi4", + "ovl_En_Hintnuts", + "ovl_En_Holl", + "ovl_En_Honotrap", + "ovl_En_Horse", + "ovl_En_Horse_Game_Check", + "ovl_En_Horse_Ganon", + "ovl_En_Horse_Link_Child", + "ovl_En_Horse_Normal", + "ovl_En_Horse_Zelda", + "ovl_En_Hs", + "ovl_En_Hs2", + "ovl_En_Hy", + "ovl_En_Ice_Hono", + "ovl_En_Ik", + "ovl_En_In", + "ovl_En_Insect", + "ovl_En_Ishi", + "ovl_En_It", + "ovl_En_Jj", + "ovl_En_Js", + "ovl_En_Jsjutan", + "ovl_En_Kakasi", + "ovl_En_Kakasi2", + "ovl_En_Kakasi3", + "ovl_En_Kanban", + "ovl_En_Karebaba", + "ovl_En_Ko", + "ovl_En_Kusa", + "ovl_En_Kz", + "ovl_En_Light", + "ovl_En_Lightbox", + "ovl_En_M_Fire1", + "ovl_En_M_Thunder", + "ovl_En_Ma1", + "ovl_En_Ma2", + "ovl_En_Ma3", + "ovl_En_Mag", + "ovl_En_Mb", + "ovl_En_Md", + "ovl_En_Mk", + "ovl_En_Mm", + "ovl_En_Mm2", + "ovl_En_Ms", + "ovl_En_Mu", + "ovl_En_Nb", + "ovl_En_Niw", + "ovl_En_Niw_Girl", + "ovl_En_Niw_Lady", + "ovl_En_Nutsball", + "ovl_En_Nwc", + "ovl_En_Ny", + "ovl_En_OE2", + "ovl_En_Okarina_Effect", + "ovl_En_Okarina_Tag", + "ovl_En_Okuta", + "ovl_En_Ossan", + "ovl_En_Owl", + "ovl_En_Part", + "ovl_En_Peehat", + "ovl_En_Po_Desert", + "ovl_En_Po_Field", + "ovl_En_Po_Relay", + "ovl_En_Po_Sisters", + "ovl_En_Poh", + "ovl_En_Pu_box", + "ovl_En_Rd", + "ovl_En_Reeba", + "ovl_En_River_Sound", + "ovl_En_Rl", + "ovl_En_Rr", + "ovl_En_Ru1", + "ovl_En_Ru2", + "ovl_En_Sa", + "ovl_En_Sb", + "ovl_En_Scene_Change", + "ovl_En_Sda", + "ovl_En_Shopnuts", + "ovl_En_Si", + "ovl_En_Siofuki", + "ovl_En_Skb", + "ovl_En_Skj", + "ovl_En_Skjneedle", + "ovl_En_Ssh", + "ovl_En_St", + "ovl_En_Sth", + "ovl_En_Stream", + "ovl_En_Sw", + "ovl_En_Syateki_Itm", + "ovl_En_Syateki_Man", + "ovl_En_Syateki_Niw", + "ovl_En_Ta", + "ovl_En_Takara_Man", + "ovl_En_Tana", + "ovl_En_Tg", + "ovl_En_Tite", + "ovl_En_Tk", + "ovl_En_Torch", + "ovl_En_Torch2", + "ovl_En_Toryo", + "ovl_En_Tp", + "ovl_En_Tr", + "ovl_En_Trap", + "ovl_En_Tubo_Trap", + "ovl_En_Vali", + "ovl_En_Vase", + "ovl_En_Vb_Ball", + "ovl_En_Viewer", + "ovl_En_Vm", + "ovl_En_Wall_Tubo", + "ovl_En_Wallmas", + "ovl_En_Weather_Tag", + "ovl_En_Weiyer", + "ovl_En_Wf", + "ovl_En_Wonder_Item", + "ovl_En_Wonder_Talk", + "ovl_En_Wonder_Talk2", + "ovl_En_Wood02", + "ovl_En_Xc", + "ovl_En_Yabusame_Mark", + "ovl_En_Yukabyun", + "ovl_En_Zf", + "ovl_En_Zl1", + "ovl_En_Zl2", + "ovl_En_Zl3", + "ovl_En_Zl4", + "ovl_En_Zo", + "ovl_En_fHG", + "ovl_End_Title", + "ovl_Fishing", + "ovl_Item_B_Heart", + "ovl_Item_Etcetera", + "ovl_Item_Inbox", + "ovl_Item_Ocarina", + "ovl_Item_Shield", + "ovl_Magic_Dark", + "ovl_Magic_Fire", + "ovl_Magic_Wind", + "ovl_Mir_Ray", + "ovl_Obj_Bean", + "ovl_Obj_Blockstop", + "ovl_Obj_Bombiwa", + "ovl_Obj_Comb", + "ovl_Obj_Dekujr", + "ovl_Obj_Elevator", + "ovl_Obj_Hamishi", + "ovl_Obj_Hana", + "ovl_Obj_Hsblock", + "ovl_Obj_Ice_Poly", + "ovl_Obj_Kibako", + "ovl_Obj_Kibako2", + "ovl_Obj_Lift", + "ovl_Obj_Lightswitch", + "ovl_Obj_Makekinsuta", + "ovl_Obj_Makeoshihiki", + "ovl_Obj_Mure", + "ovl_Obj_Mure2", + "ovl_Obj_Mure3", + "ovl_Obj_Oshihiki", + "ovl_Obj_Roomtimer", + "ovl_Obj_Switch", + "ovl_Obj_Syokudai", + "ovl_Obj_Timeblock", + "ovl_Obj_Tsubo", + "ovl_Obj_Warp2block", + "ovl_Object_Kankyo", + "ovl_Oceff_Spot", + "ovl_Oceff_Storm", + "ovl_Oceff_Wipe", + "ovl_Oceff_Wipe2", + "ovl_Oceff_Wipe3", + "ovl_Oceff_Wipe4", + "ovl_Shot_Sun", + "gameplay_keep", + "gameplay_field_keep", + "gameplay_dangeon_keep", + "gameplay_object_exchange_static", + "object_link_boy", + "object_link_child", + "object_box", + "object_human", + "object_okuta", + "object_poh", + "object_wallmaster", + "object_dy_obj", + "object_firefly", + "object_dodongo", + "object_fire", + "object_niw", + "object_tite", + "object_reeba", + "object_peehat", + "object_kingdodongo", + "object_horse", + "object_zf", + "object_goma", + "object_zl1", + "object_gol", + "object_bubble", + "object_dodojr", + "object_torch2", + "object_bl", + "object_tp", + "object_oA1", + "object_st", + "object_bw", + "object_ei", + "object_horse_normal", + "object_oB1", + "object_o_anime", + "object_spot04_objects", + "object_ddan_objects", + "object_hidan_objects", + "object_horse_ganon", + "object_oA2", + "object_spot00_objects", + "object_mb", + "object_bombf", + "object_sk2", + "object_oE1", + "object_oE_anime", + "object_oE2", + "object_ydan_objects", + "object_gnd", + "object_am", + "object_dekubaba", + "object_oA3", + "object_oA4", + "object_oA5", + "object_oA6", + "object_oA7", + "object_jj", + "object_oA8", + "object_oA9", + "object_oB2", + "object_oB3", + "object_oB4", + "object_horse_zelda", + "object_opening_demo1", + "object_warp1", + "object_b_heart", + "object_dekunuts", + "object_oE3", + "object_oE4", + "object_menkuri_objects", + "object_oE5", + "object_oE6", + "object_oE7", + "object_oE8", + "object_oE9", + "object_oE10", + "object_oE11", + "object_oE12", + "object_vali", + "object_oA10", + "object_oA11", + "object_mizu_objects", + "object_fhg", + "object_ossan", + "object_mori_hineri1", + "object_Bb", + "object_toki_objects", + "object_yukabyun", + "object_zl2", + "object_mjin", + "object_mjin_flash", + "object_mjin_dark", + "object_mjin_flame", + "object_mjin_ice", + "object_mjin_soul", + "object_mjin_wind", + "object_mjin_oka", + "object_haka_objects", + "object_spot06_objects", + "object_ice_objects", + "object_relay_objects", + "object_mori_hineri1a", + "object_mori_hineri2", + "object_mori_hineri2a", + "object_mori_objects", + "object_mori_tex", + "object_spot08_obj", + "object_warp2", + "object_hata", + "object_bird", + "object_wood02", + "object_lightbox", + "object_pu_box", + "object_trap", + "object_vase", + "object_im", + "object_ta", + "object_tk", + "object_xc", + "object_vm", + "object_bv", + "object_hakach_objects", + "object_efc_crystal_light", + "object_efc_fire_ball", + "object_efc_flash", + "object_efc_lgt_shower", + "object_efc_star_field", + "object_god_lgt", + "object_light_ring", + "object_triforce_spot", + "object_medal", + "object_bdan_objects", + "object_sd", + "object_rd", + "object_po_sisters", + "object_heavy_object", + "object_gndd", + "object_fd", + "object_du", + "object_fw", + "object_horse_link_child", + "object_spot02_objects", + "object_haka", + "object_ru1", + "object_syokudai", + "object_fd2", + "object_dh", + "object_rl", + "object_efc_tw", + "object_demo_tre_lgt", + "object_gi_key", + "object_mir_ray", + "object_brob", + "object_gi_jewel", + "object_spot09_obj", + "object_spot18_obj", + "object_bdoor", + "object_spot17_obj", + "object_shop_dungen", + "object_nb", + "object_mo", + "object_sb", + "object_gi_melody", + "object_gi_heart", + "object_gi_compass", + "object_gi_bosskey", + "object_gi_medal", + "object_gi_nuts", + "object_sa", + "object_gi_hearts", + "object_gi_arrowcase", + "object_gi_bombpouch", + "object_in", + "object_tr", + "object_spot16_obj", + "object_oE1s", + "object_oE4s", + "object_os_anime", + "object_gi_bottle", + "object_gi_stick", + "object_gi_map", + "object_oF1d_map", + "object_ru2", + "object_gi_shield_1", + "object_dekujr", + "object_gi_magicpot", + "object_gi_bomb_1", + "object_oF1s", + "object_ma2", + "object_gi_purse", + "object_hni", + "object_tw", + "object_rr", + "object_bxa", + "object_anubice", + "object_gi_gerudo", + "object_gi_arrow", + "object_gi_bomb_2", + "object_gi_egg", + "object_gi_scale", + "object_gi_shield_2", + "object_gi_hookshot", + "object_gi_ocarina", + "object_gi_milk", + "object_ma1", + "object_ganon", + "object_sst", + "object_ny", + "object_fr", + "object_gi_pachinko", + "object_gi_boomerang", + "object_gi_bow", + "object_gi_glasses", + "object_gi_liquid", + "object_ani", + "object_demo_6k", + "object_gi_shield_3", + "object_gi_letter", + "object_spot15_obj", + "object_jya_obj", + "object_gi_clothes", + "object_gi_bean", + "object_gi_fish", + "object_gi_saw", + "object_gi_hammer", + "object_gi_grass", + "object_gi_longsword", + "object_spot01_objects", + "object_md", + "object_km1", + "object_kw1", + "object_zo", + "object_kz", + "object_umajump", + "object_masterkokiri", + "object_masterkokirihead", + "object_mastergolon", + "object_masterzoora", + "object_aob", + "object_ik", + "object_ahg", + "object_cne", + "object_gi_niwatori", + "object_skj", + "object_gi_bottle_letter", + "object_bji", + "object_bba", + "object_gi_ocarina_0", + "object_ds", + "object_ane", + "object_boj", + "object_spot03_object", + "object_spot07_object", + "object_fz", + "object_bob", + "object_ge1", + "object_yabusame_point", + "object_gi_boots_2", + "object_gi_seed", + "object_gnd_magic", + "object_d_elevator", + "object_d_hsblock", + "object_d_lift", + "object_mamenoki", + "object_goroiwa", + "object_toryo", + "object_daiku", + "object_nwc", + "object_blkobj", + "object_gm", + "object_ms", + "object_hs", + "object_ingate", + "object_lightswitch", + "object_kusa", + "object_tsubo", + "object_gi_gloves", + "object_gi_coin", + "object_kanban", + "object_gjyo_objects", + "object_owl", + "object_mk", + "object_fu", + "object_gi_ki_tan_mask", + "object_gi_redead_mask", + "object_gi_skj_mask", + "object_gi_rabit_mask", + "object_gi_truth_mask", + "object_ganon_objects", + "object_siofuki", + "object_stream", + "object_mm", + "object_fa", + "object_os", + "object_gi_eye_lotion", + "object_gi_powder", + "object_gi_mushroom", + "object_gi_ticketstone", + "object_gi_brokensword", + "object_js", + "object_cs", + "object_gi_prescription", + "object_gi_bracelet", + "object_gi_soldout", + "object_gi_frog", + "object_mag", + "object_door_gerudo", + "object_gt", + "object_efc_erupc", + "object_zl2_anime1", + "object_zl2_anime2", + "object_gi_golonmask", + "object_gi_zoramask", + "object_gi_gerudomask", + "object_ganon2", + "object_ka", + "object_ts", + "object_zg", + "object_gi_hoverboots", + "object_gi_m_arrow", + "object_ds2", + "object_ec", + "object_fish", + "object_gi_sutaru", + "object_gi_goddess", + "object_ssh", + "object_bigokuta", + "object_bg", + "object_spot05_objects", + "object_spot12_obj", + "object_bombiwa", + "object_hintnuts", + "object_rs", + "object_spot00_break", + "object_gla", + "object_shopnuts", + "object_geldb", + "object_gr", + "object_dog", + "object_jya_iron", + "object_jya_door", + "object_spot01_objects2", + "object_spot11_obj", + "object_kibako2", + "object_dns", + "object_dnk", + "object_gi_fire", + "object_gi_insect", + "object_gi_butterfly", + "object_gi_ghost", + "object_gi_soul", + "object_bowl", + "object_po_field", + "object_demo_kekkai", + "object_efc_doughnut", + "object_gi_dekupouch", + "object_ganon_anime1", + "object_ganon_anime2", + "object_ganon_anime3", + "object_gi_rupy", + "object_spot01_matoya", + "object_spot01_matoyab", + "object_po_composer", + "object_mu", + "object_wf", + "object_skb", + "object_gj", + "object_geff", + "object_haka_door", + "object_gs", + "object_ps", + "object_bwall", + "object_crow", + "object_cow", + "object_cob", + "object_gi_sword_1", + "object_door_killer", + "object_ouke_haka", + "object_timeblock", + "object_zl4", + "g_pn_01", + "g_pn_02", + "g_pn_03", + "g_pn_04", + "g_pn_05", + "g_pn_06", + "g_pn_07", + "g_pn_08", + "g_pn_09", + "g_pn_10", + "g_pn_11", + "g_pn_12", + "g_pn_13", + "g_pn_14", + "g_pn_15", + "g_pn_16", + "g_pn_17", + "g_pn_18", + "g_pn_19", + "g_pn_20", + "g_pn_21", + "g_pn_22", + "g_pn_23", + "g_pn_24", + "g_pn_25", + "g_pn_26", + "g_pn_27", + "g_pn_28", + "g_pn_29", + "g_pn_30", + "g_pn_31", + "g_pn_32", + "g_pn_33", + "g_pn_34", + "g_pn_35", + "g_pn_36", + "g_pn_37", + "g_pn_38", + "g_pn_39", + "g_pn_40", + "g_pn_41", + "g_pn_42", + "g_pn_43", + "g_pn_44", + "g_pn_45", + "g_pn_46", + "g_pn_47", + "g_pn_48", + "g_pn_49", + "g_pn_50", + "g_pn_51", + "g_pn_52", + "g_pn_53", + "g_pn_54", + "g_pn_55", + "g_pn_56", + "g_pn_57", + "z_select_static", + "nintendo_rogo_static", + "title_static", + "parameter_static", + "vr_fine0_static", + "vr_fine0_pal_static", + "vr_fine1_static", + "vr_fine1_pal_static", + "vr_fine2_static", + "vr_fine2_pal_static", + "vr_fine3_static", + "vr_fine3_pal_static", + "vr_cloud0_static", + "vr_cloud0_pal_static", + "vr_cloud1_static", + "vr_cloud1_pal_static", + "vr_cloud2_static", + "vr_cloud2_pal_static", + "vr_cloud3_static", + "vr_cloud3_pal_static", + "vr_holy0_static", + "vr_holy0_pal_static", + "vr_holy1_static", + "vr_holy1_pal_static", + "vr_MDVR_static", + "vr_MDVR_pal_static", + "vr_MNVR_static", + "vr_MNVR_pal_static", + "vr_RUVR_static", + "vr_RUVR_pal_static", + "vr_LHVR_static", + "vr_LHVR_pal_static", + "vr_KHVR_static", + "vr_KHVR_pal_static", + "vr_K3VR_static", + "vr_K3VR_pal_static", + "vr_K4VR_static", + "vr_K4VR_pal_static", + "vr_K5VR_static", + "vr_K5VR_pal_static", + "vr_SP1a_static", + "vr_SP1a_pal_static", + "vr_MLVR_static", + "vr_MLVR_pal_static", + "vr_KKRVR_static", + "vr_KKRVR_pal_static", + "vr_KR3VR_static", + "vr_KR3VR_pal_static", + "vr_IPVR_static", + "vr_IPVR_pal_static", + "vr_KSVR_static", + "vr_KSVR_pal_static", + "vr_GLVR_static", + "vr_GLVR_pal_static", + "vr_ZRVR_static", + "vr_ZRVR_pal_static", + "vr_DGVR_static", + "vr_DGVR_pal_static", + "vr_ALVR_static", + "vr_ALVR_pal_static", + "vr_NSVR_static", + "vr_NSVR_pal_static", + "vr_LBVR_static", + "vr_LBVR_pal_static", + "vr_TTVR_static", + "vr_TTVR_pal_static", + "vr_FCVR_static", + "vr_FCVR_pal_static", + "elf_message_field", + "elf_message_ydan", + "syotes_scene", + "syotes_room_0", + "syotes2_scene", + "syotes2_room_0", + "depth_test_scene", + "depth_test_room_0", + "spot00_scene", + "spot00_room_0", + "spot01_scene", + "spot01_room_0", + "spot02_scene", + "spot02_room_0", + "spot02_room_1", + "spot03_scene", + "spot03_room_0", + "spot03_room_1", + "spot04_scene", + "spot04_room_0", + "spot04_room_1", + "spot04_room_2", + "spot05_scene", + "spot05_room_0", + "spot06_scene", + "spot06_room_0", + "spot07_scene", + "spot07_room_0", + "spot07_room_1", + "spot08_scene", + "spot08_room_0", + "spot09_scene", + "spot09_room_0", + "spot10_scene", + "spot10_room_0", + "spot10_room_1", + "spot10_room_2", + "spot10_room_3", + "spot10_room_4", + "spot10_room_5", + "spot10_room_6", + "spot10_room_7", + "spot10_room_8", + "spot10_room_9", + "spot11_scene", + "spot11_room_0", + "spot12_scene", + "spot12_room_0", + "spot12_room_1", + "spot13_scene", + "spot13_room_0", + "spot13_room_1", + "spot15_scene", + "spot15_room_0", + "spot16_scene", + "spot16_room_0", + "spot17_scene", + "spot17_room_0", + "spot17_room_1", + "spot18_scene", + "spot18_room_0", + "spot18_room_1", + "spot18_room_2", + "spot18_room_3", + "ydan_scene", + "ydan_room_0", + "ydan_room_1", + "ydan_room_2", + "ydan_room_3", + "ydan_room_4", + "ydan_room_5", + "ydan_room_6", + "ydan_room_7", + "ydan_room_8", + "ydan_room_9", + "ydan_room_10", + "ydan_room_11", + "ddan_scene", + "ddan_room_0", + "ddan_room_1", + "ddan_room_2", + "ddan_room_3", + "ddan_room_4", + "ddan_room_5", + "ddan_room_6", + "ddan_room_7", + "ddan_room_8", + "ddan_room_9", + "ddan_room_10", + "ddan_room_11", + "ddan_room_12", + "ddan_room_13", + "ddan_room_14", + "ddan_room_15", + "ddan_room_16", + "bdan_scene", + "bdan_room_0", + "bdan_room_1", + "bdan_room_2", + "bdan_room_3", + "bdan_room_4", + "bdan_room_5", + "bdan_room_6", + "bdan_room_7", + "bdan_room_8", + "bdan_room_9", + "bdan_room_10", + "bdan_room_11", + "bdan_room_12", + "bdan_room_13", + "bdan_room_14", + "bdan_room_15", + "Bmori1_scene", + "Bmori1_room_0", + "Bmori1_room_1", + "Bmori1_room_2", + "Bmori1_room_3", + "Bmori1_room_4", + "Bmori1_room_5", + "Bmori1_room_6", + "Bmori1_room_7", + "Bmori1_room_8", + "Bmori1_room_9", + "Bmori1_room_10", + "Bmori1_room_11", + "Bmori1_room_12", + "Bmori1_room_13", + "Bmori1_room_14", + "Bmori1_room_15", + "Bmori1_room_16", + "Bmori1_room_17", + "Bmori1_room_18", + "Bmori1_room_19", + "Bmori1_room_20", + "Bmori1_room_21", + "Bmori1_room_22", + "HIDAN_scene", + "HIDAN_room_0", + "HIDAN_room_1", + "HIDAN_room_2", + "HIDAN_room_3", + "HIDAN_room_4", + "HIDAN_room_5", + "HIDAN_room_6", + "HIDAN_room_7", + "HIDAN_room_8", + "HIDAN_room_9", + "HIDAN_room_10", + "HIDAN_room_11", + "HIDAN_room_12", + "HIDAN_room_13", + "HIDAN_room_14", + "HIDAN_room_15", + "HIDAN_room_16", + "HIDAN_room_17", + "HIDAN_room_18", + "HIDAN_room_19", + "HIDAN_room_20", + "HIDAN_room_21", + "HIDAN_room_22", + "HIDAN_room_23", + "HIDAN_room_24", + "HIDAN_room_25", + "HIDAN_room_26", + "MIZUsin_scene", + "MIZUsin_room_0", + "MIZUsin_room_1", + "MIZUsin_room_2", + "MIZUsin_room_3", + "MIZUsin_room_4", + "MIZUsin_room_5", + "MIZUsin_room_6", + "MIZUsin_room_7", + "MIZUsin_room_8", + "MIZUsin_room_9", + "MIZUsin_room_10", + "MIZUsin_room_11", + "MIZUsin_room_12", + "MIZUsin_room_13", + "MIZUsin_room_14", + "MIZUsin_room_15", + "MIZUsin_room_16", + "MIZUsin_room_17", + "MIZUsin_room_18", + "MIZUsin_room_19", + "MIZUsin_room_20", + "MIZUsin_room_21", + "MIZUsin_room_22", + "jyasinzou_scene", + "jyasinzou_room_0", + "jyasinzou_room_1", + "jyasinzou_room_2", + "jyasinzou_room_3", + "jyasinzou_room_4", + "jyasinzou_room_5", + "jyasinzou_room_6", + "jyasinzou_room_7", + "jyasinzou_room_8", + "jyasinzou_room_9", + "jyasinzou_room_10", + "jyasinzou_room_11", + "jyasinzou_room_12", + "jyasinzou_room_13", + "jyasinzou_room_14", + "jyasinzou_room_15", + "jyasinzou_room_16", + "jyasinzou_room_17", + "jyasinzou_room_18", + "jyasinzou_room_19", + "jyasinzou_room_20", + "jyasinzou_room_21", + "jyasinzou_room_22", + "jyasinzou_room_23", + "jyasinzou_room_24", + "jyasinzou_room_25", + "jyasinzou_room_26", + "jyasinzou_room_27", + "jyasinzou_room_28", + "HAKAdan_scene", + "HAKAdan_room_0", + "HAKAdan_room_1", + "HAKAdan_room_2", + "HAKAdan_room_3", + "HAKAdan_room_4", + "HAKAdan_room_5", + "HAKAdan_room_6", + "HAKAdan_room_7", + "HAKAdan_room_8", + "HAKAdan_room_9", + "HAKAdan_room_10", + "HAKAdan_room_11", + "HAKAdan_room_12", + "HAKAdan_room_13", + "HAKAdan_room_14", + "HAKAdan_room_15", + "HAKAdan_room_16", + "HAKAdan_room_17", + "HAKAdan_room_18", + "HAKAdan_room_19", + "HAKAdan_room_20", + "HAKAdan_room_21", + "HAKAdan_room_22", + "HAKAdanCH_scene", + "HAKAdanCH_room_0", + "HAKAdanCH_room_1", + "HAKAdanCH_room_2", + "HAKAdanCH_room_3", + "HAKAdanCH_room_4", + "HAKAdanCH_room_5", + "HAKAdanCH_room_6", + "ice_doukutu_scene", + "ice_doukutu_room_0", + "ice_doukutu_room_1", + "ice_doukutu_room_2", + "ice_doukutu_room_3", + "ice_doukutu_room_4", + "ice_doukutu_room_5", + "ice_doukutu_room_6", + "ice_doukutu_room_7", + "ice_doukutu_room_8", + "ice_doukutu_room_9", + "ice_doukutu_room_10", + "ice_doukutu_room_11", + "men_scene", + "men_room_0", + "men_room_1", + "men_room_2", + "men_room_3", + "men_room_4", + "men_room_5", + "men_room_6", + "men_room_7", + "men_room_8", + "men_room_9", + "men_room_10", + "ganontika_scene", + "ganontika_room_0", + "ganontika_room_1", + "ganontika_room_2", + "ganontika_room_3", + "ganontika_room_4", + "ganontika_room_5", + "ganontika_room_6", + "ganontika_room_7", + "ganontika_room_8", + "ganontika_room_9", + "ganontika_room_10", + "ganontika_room_11", + "ganontika_room_12", + "ganontika_room_13", + "ganontika_room_14", + "ganontika_room_15", + "ganontika_room_16", + "ganontika_room_17", + "ganontika_room_18", + "ganontika_room_19", + "market_day_scene", + "market_day_room_0", + "market_night_scene", + "market_night_room_0", + "testroom_scene", + "testroom_room_0", + "testroom_room_1", + "testroom_room_2", + "testroom_room_3", + "testroom_room_4", + "kenjyanoma_scene", + "kenjyanoma_room_0", + "tokinoma_scene", + "tokinoma_room_0", + "tokinoma_room_1", + "sutaru_scene", + "sutaru_room_0", + "link_home_scene", + "link_home_room_0", + "kokiri_shop_scene", + "kokiri_shop_room_0", + "kokiri_home_scene", + "kokiri_home_room_0", + "kakusiana_scene", + "kakusiana_room_0", + "kakusiana_room_1", + "kakusiana_room_2", + "kakusiana_room_3", + "kakusiana_room_4", + "kakusiana_room_5", + "kakusiana_room_6", + "kakusiana_room_7", + "kakusiana_room_8", + "kakusiana_room_9", + "kakusiana_room_10", + "kakusiana_room_11", + "kakusiana_room_12", + "kakusiana_room_13", + "entra_scene", + "entra_room_0", + "moribossroom_scene", + "moribossroom_room_0", + "moribossroom_room_1", + "syatekijyou_scene", + "syatekijyou_room_0", + "shop1_scene", + "shop1_room_0", + "hairal_niwa_scene", + "hairal_niwa_room_0", + "ganon_tou_scene", + "ganon_tou_room_0", + "sasatest_scene", + "sasatest_room_0", + "market_alley_scene", + "market_alley_room_0", + "spot20_scene", + "spot20_room_0", + "market_ruins_scene", + "market_ruins_room_0", + "entra_n_scene", + "entra_n_room_0", + "enrui_scene", + "enrui_room_0", + "market_alley_n_scene", + "market_alley_n_room_0", + "hiral_demo_scene", + "hiral_demo_room_0", + "kokiri_home3_scene", + "kokiri_home3_room_0", + "malon_stable_scene", + "malon_stable_room_0", + "kakariko_scene", + "kakariko_room_0", + "bdan_boss_scene", + "bdan_boss_room_0", + "bdan_boss_room_1", + "FIRE_bs_scene", + "FIRE_bs_room_0", + "FIRE_bs_room_1", + "hut_scene", + "hut_room_0", + "daiyousei_izumi_scene", + "daiyousei_izumi_room_0", + "hakaana_scene", + "hakaana_room_0", + "yousei_izumi_tate_scene", + "yousei_izumi_tate_room_0", + "yousei_izumi_yoko_scene", + "yousei_izumi_yoko_room_0", + "golon_scene", + "golon_room_0", + "zoora_scene", + "zoora_room_0", + "drag_scene", + "drag_room_0", + "alley_shop_scene", + "alley_shop_room_0", + "night_shop_scene", + "night_shop_room_0", + "impa_scene", + "impa_room_0", + "labo_scene", + "labo_room_0", + "tent_scene", + "tent_room_0", + "nakaniwa_scene", + "nakaniwa_room_0", + "ddan_boss_scene", + "ddan_boss_room_0", + "ddan_boss_room_1", + "ydan_boss_scene", + "ydan_boss_room_0", + "ydan_boss_room_1", + "HAKAdan_bs_scene", + "HAKAdan_bs_room_0", + "HAKAdan_bs_room_1", + "MIZUsin_bs_scene", + "MIZUsin_bs_room_0", + "MIZUsin_bs_room_1", + "ganon_scene", + "ganon_room_0", + "ganon_room_1", + "ganon_room_2", + "ganon_room_3", + "ganon_room_4", + "ganon_room_5", + "ganon_room_6", + "ganon_room_7", + "ganon_room_8", + "ganon_room_9", + "ganon_boss_scene", + "ganon_boss_room_0", + "jyasinboss_scene", + "jyasinboss_room_0", + "jyasinboss_room_1", + "jyasinboss_room_2", + "jyasinboss_room_3", + "kokiri_home4_scene", + "kokiri_home4_room_0", + "kokiri_home5_scene", + "kokiri_home5_room_0", + "ganon_final_scene", + "ganon_final_room_0", + "kakariko3_scene", + "kakariko3_room_0", + "hairal_niwa2_scene", + "hairal_niwa2_room_0", + "hakasitarelay_scene", + "hakasitarelay_room_0", + "hakasitarelay_room_1", + "hakasitarelay_room_2", + "hakasitarelay_room_3", + "hakasitarelay_room_4", + "hakasitarelay_room_5", + "hakasitarelay_room_6", + "shrine_scene", + "shrine_room_0", + "turibori_scene", + "turibori_room_0", + "shrine_n_scene", + "shrine_n_room_0", + "shrine_r_scene", + "shrine_r_room_0", + "hakaana2_scene", + "hakaana2_room_0", + "gerudoway_scene", + "gerudoway_room_0", + "gerudoway_room_1", + "gerudoway_room_2", + "gerudoway_room_3", + "gerudoway_room_4", + "gerudoway_room_5", + "hairal_niwa_n_scene", + "hairal_niwa_n_room_0", + "bowling_scene", + "bowling_room_0", + "hakaana_ouke_scene", + "hakaana_ouke_room_0", + "hakaana_ouke_room_1", + "hakaana_ouke_room_2", + "hylia_labo_scene", + "hylia_labo_room_0", + "souko_scene", + "souko_room_0", + "souko_room_1", + "souko_room_2", + "miharigoya_scene", + "miharigoya_room_0", + "mahouya_scene", + "mahouya_room_0", + "takaraya_scene", + "takaraya_room_0", + "takaraya_room_1", + "takaraya_room_2", + "takaraya_room_3", + "takaraya_room_4", + "takaraya_room_5", + "takaraya_room_6", + "ganon_sonogo_scene", + "ganon_sonogo_room_0", + "ganon_sonogo_room_1", + "ganon_sonogo_room_2", + "ganon_sonogo_room_3", + "ganon_sonogo_room_4", + "ganon_demo_scene", + "ganon_demo_room_0", + "besitu_scene", + "besitu_room_0", + "face_shop_scene", + "face_shop_room_0", + "kinsuta_scene", + "kinsuta_room_0", + "ganontikasonogo_scene", + "ganontikasonogo_room_0", + "ganontikasonogo_room_1", + "test01_scene", + "test01_room_0", + "bump_texture_static", + "anime_model_1_static", + "anime_model_2_static", + "anime_model_3_static", + "anime_model_4_static", + "anime_model_5_static", + "anime_model_6_static", + "anime_texture_1_static", + "anime_texture_2_static", + "anime_texture_3_static", + "anime_texture_4_static", + "anime_texture_5_static", + "anime_texture_6_static", "softsprite_matrix_static", }; -s32 DmaMgr_CompareName(const char* name1, const char* name2) -{ - while (*name1 != 0u) - { - if (*name1 > *name2) +s32 DmaMgr_CompareName(const char* name1, const char* name2) { + while (*name1 != 0u) { + if (*name1 > *name2) { return 1; + } - if (*name1 < *name2) + if (*name1 < *name2) { return -1; + } name1++; name2++; } - if (*name2 > 0) + if (*name2 > 0) { return -1; + } return 0; } -s32 DmaMgr_DMARomToRam(u32 rom, u32 ram, u32 size) -{ +s32 DmaMgr_DMARomToRam(u32 rom, u32 ram, u32 size) { OSIoMesg ioMsg; OSMesgQueue queue; OSMesg msg; @@ -1579,15 +1578,15 @@ s32 DmaMgr_DMARomToRam(u32 rom, u32 ram, u32 size) u32 pad[2]; buffSize = sDmaMgrDmaBuffSize; - if (buffSize == 0) + if (buffSize == 0) { buffSize = 0x2000; + } osInvalICache((void*)ram, size); osInvalDCache((void*)ram, size); osCreateMesgQueue(&queue, &msg, 1); - while (size > buffSize) - { + while (size > buffSize) { if (1) {} // Necessary to match ioMsg.hdr.pri = OS_MESG_PRI_NORMAL; @@ -1596,22 +1595,24 @@ s32 DmaMgr_DMARomToRam(u32 rom, u32 ram, u32 size) ioMsg.dramAddr = (void*)ram; ioMsg.size = buffSize; - if (D_80009460 == 10) - osSyncPrintf("%10lld ノーマルDMA %08x %08x %08x (%d)\n", - OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr, ioMsg.devAddr, ioMsg.size, gPiMgrCmdQ.validCount); + if (D_80009460 == 10) { + osSyncPrintf("%10lld ノーマルDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr, + ioMsg.devAddr, ioMsg.size, gPiMgrCmdQ.validCount); + } ret = osEPiStartDma(gCartHandle, &ioMsg, OS_READ); - if (ret) + if (ret) { goto DmaMgr_DMARomToRam_end; + } - if (D_80009460 == 10) - osSyncPrintf("%10lld ノーマルDMA START (%d)\n", - OS_CYCLES_TO_USEC(osGetTime()), gPiMgrCmdQ.validCount); + if (D_80009460 == 10) { + osSyncPrintf("%10lld ノーマルDMA START (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), gPiMgrCmdQ.validCount); + } osRecvMesg(&queue, NULL, 1); - if (D_80009460 == 10) - osSyncPrintf("%10lld ノーマルDMA END (%d)\n", - OS_CYCLES_TO_USEC(osGetTime()), gPiMgrCmdQ.validCount); + if (D_80009460 == 10) { + osSyncPrintf("%10lld ノーマルDMA END (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), gPiMgrCmdQ.validCount); + } size -= buffSize; rom += buffSize; @@ -1626,18 +1627,20 @@ s32 DmaMgr_DMARomToRam(u32 rom, u32 ram, u32 size) ioMsg.dramAddr = (void*)ram; ioMsg.size = size; - if (D_80009460 == 10) - osSyncPrintf("%10lld ノーマルDMA %08x %08x %08x (%d)\n", - OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr, ioMsg.devAddr, ioMsg.size, gPiMgrCmdQ.validCount); + if (D_80009460 == 10) { + osSyncPrintf("%10lld ノーマルDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr, + ioMsg.devAddr, ioMsg.size, gPiMgrCmdQ.validCount); + } ret = osEPiStartDma(gCartHandle, &ioMsg, OS_READ); - if (ret) + if (ret) { goto DmaMgr_DMARomToRam_end; + } osRecvMesg(&queue, NULL, 1); - if (D_80009460 == 10) - osSyncPrintf("%10lld ノーマルDMA END (%d)\n", - OS_CYCLES_TO_USEC(osGetTime()), gPiMgrCmdQ.validCount); + if (D_80009460 == 10) { + osSyncPrintf("%10lld ノーマルDMA END (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), gPiMgrCmdQ.validCount); + } DmaMgr_DMARomToRam_end: osInvalICache((void*)ram, size); @@ -1646,31 +1649,34 @@ DmaMgr_DMARomToRam_end: return ret; } -s32 DmaMgr_DmaCallback0(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) -{ +s32 DmaMgr_DmaCallback0(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) { s32 ret; - if (pihandle != gCartHandle) + if (pihandle != gCartHandle) { __assert("pihandle == carthandle", "../z_std_dma.c", 530); - - if (direction != OS_READ) - __assert("direction == OS_READ", "../z_std_dma.c", 531); - - if (mb == NULL) - __assert("mb != NULL", "../z_std_dma.c", 532); + } - if (D_80009460 == 10) - osSyncPrintf("%10lld サウンドDMA %08x %08x %08x (%d)\n", - OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr, mb->devAddr, mb->size, gPiMgrCmdQ.validCount); + if (direction != OS_READ) { + __assert("direction == OS_READ", "../z_std_dma.c", 531); + } + + if (mb == NULL) { + __assert("mb != NULL", "../z_std_dma.c", 532); + } + + if (D_80009460 == 10) { + osSyncPrintf("%10lld サウンドDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr, + mb->devAddr, mb->size, gPiMgrCmdQ.validCount); + } ret = osEPiStartDma(pihandle, mb, direction); - if (ret) + if (ret) { osSyncPrintf("OOPS!!\n"); + } return ret; } -void DmaMgr_DmaCallback1(u32 ram, u32 rom, u32 size) -{ +void DmaMgr_DmaCallback1(u32 ram, u32 rom, u32 size) { OSPiHandle* handle; OSMesgQueue queue; OSMesg msg; @@ -1693,13 +1699,12 @@ void DmaMgr_DmaCallback1(u32 ram, u32 rom, u32 size) return; } -void DmaMgr_Error(DmaRequest* req, const char* file, const char* errorName, const char* errorDesc) -{ +void DmaMgr_Error(DmaRequest* req, const char* file, const char* errorName, const char* errorDesc) { u32 vrom; u32 ram; u32 size; - char buff1 [80]; - char buff2 [80]; + char buff1[80]; + char buff2[80]; vrom = req->vromAddr; ram = (u32)req->dramAddr; @@ -1708,60 +1713,61 @@ void DmaMgr_Error(DmaRequest* req, const char* file, const char* errorName, cons osSyncPrintf("%c", 7); osSyncPrintf(VT_FGCOL(RED)); osSyncPrintf("DMA致命的エラー(%s)\nROM:%X RAM:%X SIZE:%X %s\n", - errorDesc ? errorDesc : (errorName ? errorName : "???"), - vrom, ram, size, file ? file : "???"); + errorDesc ? errorDesc : (errorName ? errorName : "???"), vrom, ram, size, file ? file : "???"); - if (req->filename) + if (req->filename) { osSyncPrintf("DMA ERROR: %s %d", req->filename, req->line); - else if (sDmaMgrCurFileName) + } else if (sDmaMgrCurFileName) { osSyncPrintf("DMA ERROR: %s %d", sDmaMgrCurFileName, sDmaMgrCurFileLine); + } osSyncPrintf(VT_RST); - if (req->filename) + if (req->filename) { sprintf(buff1, "DMA ERROR: %s %d", req->filename, req->line); - else if (sDmaMgrCurFileName) + } else if (sDmaMgrCurFileName) { sprintf(buff1, "DMA ERROR: %s %d", sDmaMgrCurFileName, sDmaMgrCurFileLine); - else + } else { sprintf(buff1, "DMA ERROR: %s", errorName ? errorName : "???"); - + } + sprintf(buff2, "%07X %08X %X %s", vrom, ram, size, file ? file : "???"); Fault_AddHungupAndCrashImpl(buff1, buff2); } -const char* DmaMgr_GetFileNameImpl(u32 vrom) -{ +const char* DmaMgr_GetFileNameImpl(u32 vrom) { DmaEntry* iter; const char** name; iter = gDmaDataTable; name = sDmaMgrFileNames; - while (iter->vromEnd) - { - if (vrom >= iter->vromStart && vrom < iter->vromEnd) + while (iter->vromEnd) { + if (vrom >= iter->vromStart && vrom < iter->vromEnd) { return *name; + } iter++; name++; } - // BUG: since the devs forgot to return in case the file isn't found, the return value will be a pointer to the end of gDmaDataTable + // BUG: since the devs forgot to return in case the file isn't found, the return value will be a pointer to the end + // of gDmaDataTable } -const char* DmaMgr_GetFileName(u32 vrom) -{ +const char* DmaMgr_GetFileName(u32 vrom) { const char* ret = DmaMgr_GetFileNameImpl(vrom); - if (!ret) + if (!ret) { return "(unknown)"; + } - if (DmaMgr_CompareName(ret, "kanji") == 0 || DmaMgr_CompareName(ret, "link_animetion") == 0) + if (DmaMgr_CompareName(ret, "kanji") == 0 || DmaMgr_CompareName(ret, "link_animetion") == 0) { return NULL; + } return ret; } -void DmaMgr_ProcessMsg(DmaRequest* req) -{ +void DmaMgr_ProcessMsg(DmaRequest* req) { u32 vrom; void* ram; u32 size; @@ -1781,35 +1787,33 @@ void DmaMgr_ProcessMsg(DmaRequest* req) // defined in .rodata but not used "DMA ROM:%08X RAM:%08X SIZE:%08X %s\n"; - while (iter->vromEnd) - { - if (vrom >= iter->vromStart && vrom < iter->vromEnd) - { + while (iter->vromEnd) { + if (vrom >= iter->vromStart && vrom < iter->vromEnd) { if (1) {} // Necessary to match - if (iter->romEnd == 0) - { - if (iter->vromEnd < vrom + size) + if (iter->romEnd == 0) { + if (iter->vromEnd < vrom + size) { DmaMgr_Error(req, filename, "Segment Alignment Error", "セグメント境界をまたがってDMA転送することはできません"); + } DmaMgr_DMARomToRam(iter->romStart + (vrom - iter->vromStart), (u32)ram, size); found = true; "No Press ROM:%08X RAM:%08X SIZE:%08X\n"; - } - else - { + } else { romStart = iter->romStart; romSize = iter->romEnd - iter->romStart; - if (vrom != iter->vromStart) + if (vrom != iter->vromStart) { DmaMgr_Error(req, filename, "Can't Transfer Segment", "圧縮されたセグメントの途中からはDMA転送することはできません"); + } - if (size != iter->vromEnd - iter->vromStart) + if (size != iter->vromEnd - iter->vromStart) { DmaMgr_Error(req, filename, "Can't Transfer Segment", "圧縮されたセグメントの一部だけをDMA転送することはできません"); + } osSetThreadPri(NULL, 0x0A); Yaz0_Decompress(romStart, ram, romSize); @@ -1823,10 +1827,8 @@ void DmaMgr_ProcessMsg(DmaRequest* req) iter++; } - if (!found) - { - if (sDmaMgrDataExistError) - { + if (!found) { + if (sDmaMgrDataExistError) { DmaMgr_Error(req, NULL, "DATA DON'T EXIST", "該当するデータが存在しません"); return; } @@ -1837,25 +1839,23 @@ void DmaMgr_ProcessMsg(DmaRequest* req) } } -void DmaMgr_ThreadEntry(void* arg0) -{ +void DmaMgr_ThreadEntry(void* arg0) { OSMesg msg; DmaRequest* req; - + osSyncPrintf("DMAマネージャスレッド実行開始\n"); - while (true) - { + while (true) { osRecvMesg(&sDmaMgrMsgQueue, &msg, 1); req = (DmaRequest*)msg; - if (!req) + if (!req) { break; - + } + // strings present in .rodata but not actually used in the function, probably a removed function "DMA登録受付 dmap=%08x\n"; DmaMgr_ProcessMsg(req); - if (req->notifyQueue) - { + if (req->notifyQueue) { osSendMesg(req->notifyQueue, req->notifyMsg, 0); "osSendMesg: dmap=%08x, mq=%08x, m=%08x \n"; } @@ -1863,13 +1863,13 @@ void DmaMgr_ThreadEntry(void* arg0) osSyncPrintf("DMAマネージャスレッド実行終了\n"); } -s32 DmaMgr_SendRequestImpl(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk, OSMesgQueue* queue, OSMesg msg) -{ +s32 DmaMgr_SendRequestImpl(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk, OSMesgQueue* queue, OSMesg msg) { static s32 sDmaMgrQueueFullLogged = 0; - if ((1 && (ram == 0)) || (osMemSize < ram + size + 0x80000000) || - (vrom & 1) || (vrom > 0x4000000U) || (size == 0) || (size & 1)) + if ((1 && (ram == 0)) || (osMemSize < ram + size + 0x80000000) || (vrom & 1) || (vrom > 0x4000000U) || + (size == 0) || (size & 1)) { DmaMgr_Error(req, NULL, "ILLIGAL DMA-FUNCTION CALL", "パラメータ異常です"); + } req->vromAddr = vrom; req->dramAddr = (void*)ram; @@ -1878,10 +1878,8 @@ s32 DmaMgr_SendRequestImpl(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk req->notifyQueue = queue; req->notifyMsg = msg; - if (1) - { - if ((sDmaMgrQueueFullLogged == 0) && (sDmaMgrMsgQueue.validCount >= sDmaMgrMsgQueue.msgCount)) - { + if (1) { + if ((sDmaMgrQueueFullLogged == 0) && (sDmaMgrMsgQueue.validCount >= sDmaMgrMsgQueue.msgCount)) { sDmaMgrQueueFullLogged++; osSyncPrintf("%c", 7); osSyncPrintf(VT_FGCOL(RED)); @@ -1897,8 +1895,7 @@ s32 DmaMgr_SendRequestImpl(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk return 0; } -s32 DmaMgr_SendRequest0(u32 ram, u32 vrom, u32 size) -{ +s32 DmaMgr_SendRequest0(u32 ram, u32 vrom, u32 size) { DmaRequest req; OSMesgQueue queue; OSMesg msg; @@ -1906,22 +1903,23 @@ s32 DmaMgr_SendRequest0(u32 ram, u32 vrom, u32 size) osCreateMesgQueue(&queue, &msg, 1); ret = DmaMgr_SendRequestImpl(&req, ram, vrom, size, 0, &queue, NULL); - if (ret == -1) + if (ret == -1) { return ret; - + } + osRecvMesg(&queue, NULL, 1); return 0; } -void DmaMgr_Start() -{ +void DmaMgr_Start() { const char** name; s32 idx; DmaEntry* iter; if (_dmadataSegmentRomStart) {} // Necessary to match - DmaMgr_DMARomToRam((u32)_dmadataSegmentRomStart, (u32)_dmadataSegmentStart, (u32)_dmadataSegmentRomEnd - (u32)_dmadataSegmentRomStart); + DmaMgr_DMARomToRam((u32)_dmadataSegmentRomStart, (u32)_dmadataSegmentStart, + (u32)_dmadataSegmentRomEnd - (u32)_dmadataSegmentRomStart); osSyncPrintf("dma_rom_ad[]\n"); sDmaMgrDataExistError = 0; @@ -1929,45 +1927,44 @@ void DmaMgr_Start() iter = gDmaDataTable; idx = 0; - while (iter->vromEnd != 0) - { - if (iter->romEnd != 0) + while (iter->vromEnd != 0) { + if (iter->romEnd != 0) { sDmaMgrDataExistError = 1; + } - osSyncPrintf("%3d %08x %08x %08x %08x %08x %c %s\n", - idx, iter->vromStart, iter->vromEnd, iter->romStart, iter->romEnd, - (iter->romEnd != 0) ? iter->romEnd - iter->romStart : iter->vromEnd - iter->vromStart, - (((iter->romEnd != 0) ? iter->romEnd - iter->romStart : 0) > 0x10000) ? '*' : ' ', - name ? *name : ""); + osSyncPrintf( + "%3d %08x %08x %08x %08x %08x %c %s\n", idx, iter->vromStart, iter->vromEnd, iter->romStart, iter->romEnd, + (iter->romEnd != 0) ? iter->romEnd - iter->romStart : iter->vromEnd - iter->vromStart, + (((iter->romEnd != 0) ? iter->romEnd - iter->romStart : 0) > 0x10000) ? '*' : ' ', name ? *name : ""); idx++; iter++; - if (name) + if (name) { name++; + } } - if ((u32)_bootSegmentRomStart != gDmaDataTable[0].vromEnd) - { - osSyncPrintf("_bootSegmentRomStart(%08x) != dma_rom_ad[0].rom_b(%08x)\n", _bootSegmentRomStart, gDmaDataTable[0].vromEnd); + if ((u32)_bootSegmentRomStart != gDmaDataTable[0].vromEnd) { + osSyncPrintf("_bootSegmentRomStart(%08x) != dma_rom_ad[0].rom_b(%08x)\n", _bootSegmentRomStart, + gDmaDataTable[0].vromEnd); Fault_AddHungupAndCrash("../z_std_dma.c", 1055); } - osCreateMesgQueue(&sDmaMgrMsgQueue, sDmaMgrMsgs, sizeof(sDmaMgrMsgs)/sizeof(sDmaMgrMsgs[0])); - StackCheck_Init(&sDmaMgrStackInfo, sDmaMgrStack, sDmaMgrStack+sizeof(sDmaMgrStack), 0, 0x100, "dmamgr"); - osCreateThread(&sDmaMgrThread, 0x12, &DmaMgr_ThreadEntry, 0, sDmaMgrStack+sizeof(sDmaMgrStack) ,0x10); + osCreateMesgQueue(&sDmaMgrMsgQueue, sDmaMgrMsgs, sizeof(sDmaMgrMsgs) / sizeof(sDmaMgrMsgs[0])); + StackCheck_Init(&sDmaMgrStackInfo, sDmaMgrStack, sDmaMgrStack + sizeof(sDmaMgrStack), 0, 0x100, "dmamgr"); + osCreateThread(&sDmaMgrThread, 0x12, &DmaMgr_ThreadEntry, 0, sDmaMgrStack + sizeof(sDmaMgrStack), 0x10); osStartThread(&sDmaMgrThread); } -s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, OSMesgQueue* queue, OSMesg msg, const char* file, s32 line) -{ +s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, OSMesgQueue* queue, OSMesg msg, + const char* file, s32 line) { req->filename = file; req->line = line; DmaMgr_SendRequestImpl(req, ram, vrom, size, unk5, queue, msg); } -s32 DmaMgr_SendRequest1(void* ram0, u32 vrom, u32 size, const char* file, s32 line) -{ +s32 DmaMgr_SendRequest1(void* ram0, u32 vrom, u32 size, const char* file, s32 line) { DmaRequest req; s32 ret; OSMesgQueue queue; @@ -1979,9 +1976,10 @@ s32 DmaMgr_SendRequest1(void* ram0, u32 vrom, u32 size, const char* file, s32 li req.line = line; osCreateMesgQueue(&queue, &msg, 1); ret = DmaMgr_SendRequestImpl(&req, ram, vrom, size, 0, &queue, 0); - if (ret == -1) + if (ret == -1) { return ret; - + } + osRecvMesg(&queue, NULL, 1); return 0; } diff --git a/src/buffers/gfxbuffers.c b/src/buffers/gfxbuffers.c index 6423e4c122..9a538bf311 100644 --- a/src/buffers/gfxbuffers.c +++ b/src/buffers/gfxbuffers.c @@ -4,7 +4,7 @@ u64 gGfxSPTaskOutputBuffer[0x3000]; // 0xC00 bytes -u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE]; +u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE]; // 0x400 bytes u8 gGfxSPTaskStack[0x400]; diff --git a/src/code/TwoHeadArena.c b/src/code/TwoHeadArena.c index b466954428..23cfa00f81 100644 --- a/src/code/TwoHeadArena.c +++ b/src/code/TwoHeadArena.c @@ -1,172 +1,141 @@ #include -void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size) -{ +void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size) { THA_Ct((TwoHeadArena*)thga, start, size); } -void THGA_Dt(TwoHeadGfxArena* thga) -{ +void THGA_Dt(TwoHeadGfxArena* thga) { THA_Dt((TwoHeadArena*)thga); } -u32 THGA_IsCrash(TwoHeadGfxArena* thga) -{ +u32 THGA_IsCrash(TwoHeadGfxArena* thga) { return THA_IsCrash((TwoHeadArena*)thga); } -void THGA_Init(TwoHeadGfxArena* thga) -{ +void THGA_Init(TwoHeadGfxArena* thga) { THA_Init((TwoHeadArena*)thga); } -s32 THGA_GetSize(TwoHeadGfxArena* thga) -{ +s32 THGA_GetSize(TwoHeadGfxArena* thga) { return THA_GetSize((TwoHeadArena*)thga); } -Gfx* THGA_GetHead(TwoHeadGfxArena* thga) -{ +Gfx* THGA_GetHead(TwoHeadGfxArena* thga) { return THA_GetHead((TwoHeadArena*)thga); } -void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start) -{ +void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start) { THA_SetHead((TwoHeadArena*)thga, start); } -Gfx* THGA_GetTail(TwoHeadGfxArena* thga) -{ +Gfx* THGA_GetTail(TwoHeadGfxArena* thga) { return THA_GetTail((TwoHeadArena*)thga); } -Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count) -{ +Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count) { return THA_AllocStart((TwoHeadArena*)thga, count * 8); } -Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga) -{ +Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga) { return THGA_AllocStartArray8(thga, 1); } -Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga) -{ +Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga) { return THGA_AllocStart8(thga); } -Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size) -{ +Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size) { return THA_AllocEnd((TwoHeadArena*)thga, size); } -Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count) -{ +Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count) { return THGA_AllocEnd(thga, count * 0x40); } -Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga) -{ +Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga) { return THGA_AllocEnd(thga, 0x40); } -Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count) -{ +Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count) { return THGA_AllocEnd(thga, count * 0x10); } -Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga) -{ +Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga) { return THGA_AllocEnd(thga, 0x10); } - - - - -void* THA_GetHead(TwoHeadArena* tha) -{ +void* THA_GetHead(TwoHeadArena* tha) { return tha->head; } -void THA_SetHead(TwoHeadArena* tha, void* start) -{ +void THA_SetHead(TwoHeadArena* tha, void* start) { tha->head = start; } -void* THA_GetTail(TwoHeadArena* tha) -{ +void* THA_GetTail(TwoHeadArena* tha) { return tha->tail; } -void* THA_AllocStart(TwoHeadArena* tha, u32 size) -{ +void* THA_AllocStart(TwoHeadArena* tha, u32 size) { void* start = tha->head; tha->head += size; return start; } -void* THA_AllocStart1(TwoHeadArena* tha) -{ +void* THA_AllocStart1(TwoHeadArena* tha) { return THA_AllocStart(tha, 1); } -void* THA_AllocEnd(TwoHeadArena* tha, u32 size) -{ +void* THA_AllocEnd(TwoHeadArena* tha, u32 size) { u32 mask; u32* temp; - if (size == 8) + if (size == 8) { mask = ~7; - else if (size == 4 || size == 12) + } else if (size == 4 || size == 12) { mask = ~3; - else if (size == 2 || size == 6 || size == 10 || size == 12 || size == 14) + } else if (size == 2 || size == 6 || size == 10 || size == 12 || size == 14) { mask = ~1; - else + } else { mask = (size >= 0x10) ? ~0xF : 0; + } temp = (u32*)&tha->tail; // required to match return tha->tail = (void*)(((*temp & mask) - size) & mask); } -void* THA_AllocEndAlign16(TwoHeadArena *tha, u32 size) -{ - void* ret = (void*)(u32)((((u32)tha->tail & ~0xF) - size) & ((~(0xF & 0xFFFFFFFFFFFFFFFF)) & 0xFFFFFFFFu)); // required to match +void* THA_AllocEndAlign16(TwoHeadArena* tha, u32 size) { + void* ret = (void*)(u32)((((u32)tha->tail & ~0xF) - size) & + ((~(0xF & 0xFFFFFFFFFFFFFFFF)) & 0xFFFFFFFFu)); // required to match tha->tail = ret; return ret; } -void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask) -{ +void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask) { void* ret = (void*)((((u32)tha->tail & mask) - size) & mask); tha->tail = ret; return ret; } -s32 THA_GetSize(TwoHeadArena* tha) -{ +s32 THA_GetSize(TwoHeadArena* tha) { return tha->tail - tha->head; } -u32 THA_IsCrash(TwoHeadArena* tha) -{ +u32 THA_IsCrash(TwoHeadArena* tha) { return THA_GetSize(tha) < 0; } -void THA_Init(TwoHeadArena* tha) -{ +void THA_Init(TwoHeadArena* tha) { tha->head = tha->bufp; tha->tail = tha->bufp + tha->size; } -void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size) -{ +void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size) { tha->bufp = ptr; tha->size = size; THA_Init(tha); } -void THA_Dt(TwoHeadArena* tha) -{ +void THA_Dt(TwoHeadArena* tha) { bzero(tha, sizeof(TwoHeadArena)); } diff --git a/src/code/__osMalloc.c b/src/code/__osMalloc.c index 34d602f0ad..d5501c663d 100644 --- a/src/code/__osMalloc.c +++ b/src/code/__osMalloc.c @@ -1,63 +1,53 @@ #include #include -#define FILL_ALLOCBLOCK (1 << 0) -#define FILL_FREEBLOCK (1 << 1) -#define CHECK_FREE_BLOCK (1 << 2) +#define FILL_ALLOCBLOCK (1 << 0) +#define FILL_FREEBLOCK (1 << 1) +#define CHECK_FREE_BLOCK (1 << 2) -#define NODE_MAGIC (0x7373) +#define NODE_MAGIC (0x7373) -#define BLOCK_UNINIT_MAGIC (0xAB) -#define BLOCK_UNINIT_MAGIC_32 (0xABABABAB) -#define BLOCK_ALLOC_MAGIC (0xCD) -#define BLOCK_ALLOC_MAGIC_32 (0xCDCDCDCD) -#define BLOCK_FREE_MAGIC (0xEF) -#define BLOCK_FREE_MAGIC_32 (0xEFEFEFEF) +#define BLOCK_UNINIT_MAGIC (0xAB) +#define BLOCK_UNINIT_MAGIC_32 (0xABABABAB) +#define BLOCK_ALLOC_MAGIC (0xCD) +#define BLOCK_ALLOC_MAGIC_32 (0xCDCDCDCD) +#define BLOCK_FREE_MAGIC (0xEF) +#define BLOCK_FREE_MAGIC_32 (0xEFEFEFEF) OSMesg sArenaLockMsg; u32 __osMalloc_FreeBlockTest_Enable; -bool ArenaImpl_GetFillAllocBlock(Arena* arena) -{ +bool ArenaImpl_GetFillAllocBlock(Arena* arena) { return (arena->flag & FILL_ALLOCBLOCK) != 0; } -bool ArenaImpl_GetFillFreeBlock(Arena* arena) -{ +bool ArenaImpl_GetFillFreeBlock(Arena* arena) { return (arena->flag & FILL_FREEBLOCK) != 0; } -bool ArenaImpl_GetCheckFreeBlock(Arena* arena) -{ +bool ArenaImpl_GetCheckFreeBlock(Arena* arena) { return (arena->flag & CHECK_FREE_BLOCK) != 0; } -void ArenaImpl_SetFillAllocBlock(Arena* arena) -{ +void ArenaImpl_SetFillAllocBlock(Arena* arena) { arena->flag |= FILL_ALLOCBLOCK; } -void ArenaImpl_SetFillFreeBlock(Arena* arena) -{ +void ArenaImpl_SetFillFreeBlock(Arena* arena) { arena->flag |= FILL_FREEBLOCK; } -void ArenaImpl_SetCheckFreeBlock(Arena* arena) -{ +void ArenaImpl_SetCheckFreeBlock(Arena* arena) { arena->flag |= CHECK_FREE_BLOCK; } -void ArenaImpl_UnsetFillAllocBlock(Arena* arena) -{ +void ArenaImpl_UnsetFillAllocBlock(Arena* arena) { arena->flag &= ~FILL_ALLOCBLOCK; } -void ArenaImpl_UnsetFillFreeBlock(Arena* arena) -{ +void ArenaImpl_UnsetFillFreeBlock(Arena* arena) { arena->flag &= ~FILL_FREEBLOCK; } -void ArenaImpl_UnsetCheckFreeBlock(Arena* arena) -{ +void ArenaImpl_UnsetCheckFreeBlock(Arena* arena) { arena->flag &= ~CHECK_FREE_BLOCK; } -void ArenaImpl_SetDebugInfo(ArenaNode* node, const char* file, s32 line, Arena* arena) -{ +void ArenaImpl_SetDebugInfo(ArenaNode* node, const char* file, s32 line, Arena* arena) { node->filename = file; node->line = line; node->threadId = osGetThreadId(NULL); @@ -65,28 +55,23 @@ void ArenaImpl_SetDebugInfo(ArenaNode* node, const char* file, s32 line, Arena* node->time = osGetTime(); } -void ArenaImpl_LockInit(Arena* arena) -{ +void ArenaImpl_LockInit(Arena* arena) { osCreateMesgQueue(&arena->lock, &sArenaLockMsg, 1); } -void ArenaImpl_Lock(Arena* arena) -{ +void ArenaImpl_Lock(Arena* arena) { osSendMesg(&arena->lock, NULL, OS_MESG_BLOCK); } -void ArenaImpl_Unlock(Arena* arena) -{ +void ArenaImpl_Unlock(Arena* arena) { osRecvMesg(&arena->lock, NULL, OS_MESG_BLOCK); } -ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node) -{ +ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node) { ArenaNode* ret; ret = node->next; - if (ret && (!ret || (ret->magic != NODE_MAGIC))) - { + if (ret && (!ret || (ret->magic != NODE_MAGIC))) { osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク発見! (block=%08x)\n" VT_RST, ret); ret = NULL; node->next = NULL; @@ -95,13 +80,11 @@ ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node) return ret; } -ArenaNode* ArenaImpl_GetPrevBlock(ArenaNode* node) -{ +ArenaNode* ArenaImpl_GetPrevBlock(ArenaNode* node) { ArenaNode* ret; ret = node->prev; - if (ret && (!ret || (ret->magic != NODE_MAGIC))) - { + if (ret && (!ret || (ret->magic != NODE_MAGIC))) { osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク発見! (block=%08x)\n" VT_RST, ret); ret = NULL; node->prev = NULL; @@ -110,16 +93,13 @@ ArenaNode* ArenaImpl_GetPrevBlock(ArenaNode* node) return ret; } -ArenaNode* ArenaImpl_GetLastBlock(Arena* arena) -{ +ArenaNode* ArenaImpl_GetLastBlock(Arena* arena) { ArenaNode* ret = NULL; ArenaNode* iter; - if (arena && arena->head && arena->head->magic == NODE_MAGIC) - { + if (arena && arena->head && arena->head->magic == NODE_MAGIC) { iter = arena->head; - while (iter) - { + while (iter) { ret = iter; iter = ArenaImpl_GetNextBlock(iter); } @@ -128,29 +108,25 @@ ArenaNode* ArenaImpl_GetLastBlock(Arena* arena) return ret; } -void __osMallocInit(Arena* arena, void* start, u32 size) -{ +void __osMallocInit(Arena* arena, void* start, u32 size) { bzero(arena, sizeof(Arena)); ArenaImpl_LockInit(arena); __osMallocAddBlock(arena, start, size); arena->isInit = true; } -void __osMallocAddBlock(Arena* arena, void* start, s32 size) -{ +void __osMallocAddBlock(Arena* arena, void* start, s32 size) { s32 diff; s32 size2; ArenaNode* firstNode; ArenaNode* lastNode; - - if (start) - { + + if (start) { firstNode = (ArenaNode*)ALIGN16((u32)start); diff = (s32)firstNode - (s32)start; size2 = (size - diff) & ~0xF; - if (size2 > (s32)sizeof(ArenaNode)) - { - func_80106860(firstNode, BLOCK_UNINIT_MAGIC, size2); //memset + if (size2 > (s32)sizeof(ArenaNode)) { + func_80106860(firstNode, BLOCK_UNINIT_MAGIC, size2); // memset firstNode->next = NULL; firstNode->prev = NULL; firstNode->size = size2 - sizeof(ArenaNode); @@ -158,13 +134,10 @@ void __osMallocAddBlock(Arena* arena, void* start, s32 size) firstNode->magic = NODE_MAGIC; ArenaImpl_Lock(arena); lastNode = ArenaImpl_GetLastBlock(arena); - if (!lastNode) - { + if (!lastNode) { arena->head = firstNode; arena->start = start; - } - else - { + } else { firstNode->prev = lastNode; lastNode->next = firstNode; } @@ -173,53 +146,47 @@ void __osMallocAddBlock(Arena* arena, void* start, s32 size) } } -void ArenaImpl_RemoveAllBlocks(Arena* arena) -{ +void ArenaImpl_RemoveAllBlocks(Arena* arena) { ArenaNode* iter; ArenaNode* next; ArenaImpl_Lock(arena); iter = arena->head; - while (iter) - { + while (iter) { next = ArenaImpl_GetNextBlock(iter); - func_80106860(iter, BLOCK_UNINIT_MAGIC, iter->size + sizeof(ArenaNode)); //memset + func_80106860(iter, BLOCK_UNINIT_MAGIC, iter->size + sizeof(ArenaNode)); // memset iter = next; } ArenaImpl_Unlock(arena); } -void __osMallocCleanup(Arena* arena) -{ +void __osMallocCleanup(Arena* arena) { ArenaImpl_RemoveAllBlocks(arena); bzero(arena, sizeof(*arena)); } -u8 __osMallocIsInitalized(Arena* arena) -{ +u8 __osMallocIsInitalized(Arena* arena) { return arena->isInit; } -void __osMalloc_FreeBlockTest(Arena *arena, ArenaNode *node) -{ - ArenaNode *node2; +void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node) { + ArenaNode* node2; u32* start; u32* end; u32* iter; node2 = node; - if (__osMalloc_FreeBlockTest_Enable) - { + if (__osMalloc_FreeBlockTest_Enable) { start = (u32*)((u32)node + sizeof(ArenaNode)); - end = (u32*)((u32) start + node2->size); + end = (u32*)((u32)start + node2->size); iter = start; - while (iter < end) - { - if (*iter != BLOCK_UNINIT_MAGIC_32 && *iter != BLOCK_FREE_MAGIC_32) - { - osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク検出! (block=%08x s=%08x e=%08x p=%08x)\n" VT_RST, node, start, end, iter); + while (iter < end) { + if (*iter != BLOCK_UNINIT_MAGIC_32 && *iter != BLOCK_FREE_MAGIC_32) { + osSyncPrintf( + VT_COL(RED, WHITE) "緊急事態!メモリリーク検出! (block=%08x s=%08x e=%08x p=%08x)\n" VT_RST, node, + start, end, iter); __osDisplayArena(arena); return; } @@ -228,29 +195,26 @@ void __osMalloc_FreeBlockTest(Arena *arena, ArenaNode *node) } } -void* __osMalloc_NoLockDebug(Arena *arena, u32 size, const char *file, s32 line) -{ - ArenaNode *iter; +void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, s32 line) { + ArenaNode* iter; u32 blockSize; - ArenaNode *newNode; - void *ret; - ArenaNode *next; + ArenaNode* newNode; + void* ret; + ArenaNode* next; ret = NULL; iter = arena->head; size = ALIGN16(size); blockSize = ALIGN16(size) + sizeof(ArenaNode); - while (iter) - { - if (iter->isFree && iter->size >= size) - { - if (arena->flag & CHECK_FREE_BLOCK) + while (iter) { + if (iter->isFree && iter->size >= size) { + if (arena->flag & CHECK_FREE_BLOCK) { __osMalloc_FreeBlockTest(arena, iter); + } - if (blockSize < iter->size) - { - newNode = (ArenaNode *)((u32)iter + blockSize); + if (blockSize < iter->size) { + newNode = (ArenaNode*)((u32)iter + blockSize); newNode->next = ArenaImpl_GetNextBlock(iter); newNode->prev = iter; newNode->size = iter->size - blockSize; @@ -260,15 +224,17 @@ void* __osMalloc_NoLockDebug(Arena *arena, u32 size, const char *file, s32 line) iter->next = newNode; iter->size = size; next = ArenaImpl_GetNextBlock(newNode); - if (next) + if (next) { next->prev = newNode; + } } iter->isFree = false; ArenaImpl_SetDebugInfo(iter, file, line, arena); - ret = (void *)((u32)iter + sizeof(ArenaNode)); - if (arena->flag & FILL_ALLOCBLOCK) + ret = (void*)((u32)iter + sizeof(ArenaNode)); + if (arena->flag & FILL_ALLOCBLOCK) { func_80106860(ret, BLOCK_ALLOC_MAGIC, size); + } break; } @@ -279,8 +245,7 @@ void* __osMalloc_NoLockDebug(Arena *arena, u32 size, const char *file, s32 line) return ret; } -void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line) -{ +void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line) { void* ret; ArenaImpl_Lock(arena); ret = __osMalloc_NoLockDebug(arena, size, file, line); @@ -288,29 +253,27 @@ void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line) return ret; } -void* __osMallocRDebug(Arena *arena, u32 size, const char *file, s32 line) -{ - ArenaNode *iter; - ArenaNode *newNode; +void* __osMallocRDebug(Arena* arena, u32 size, const char* file, s32 line) { + ArenaNode* iter; + ArenaNode* newNode; u32 blockSize; - ArenaNode *next; - void *ret; + ArenaNode* next; + void* ret; ret = NULL; size = ALIGN16(size); ArenaImpl_Lock(arena); - iter = ArenaImpl_GetLastBlock(arena);; - while (iter) - { - if (iter->isFree && iter->size >= size) - { - if (arena->flag & CHECK_FREE_BLOCK) + iter = ArenaImpl_GetLastBlock(arena); + + while (iter) { + if (iter->isFree && iter->size >= size) { + if (arena->flag & CHECK_FREE_BLOCK) { __osMalloc_FreeBlockTest(arena, iter); + } blockSize = ALIGN16(size) + sizeof(ArenaNode); - if (blockSize < iter->size) - { - newNode = (ArenaNode *)((u32)iter + (iter->size - size)); + if (blockSize < iter->size) { + newNode = (ArenaNode*)((u32)iter + (iter->size - size)); newNode->next = ArenaImpl_GetNextBlock(iter); newNode->prev = iter; newNode->size = size; @@ -319,17 +282,19 @@ void* __osMallocRDebug(Arena *arena, u32 size, const char *file, s32 line) iter->next = newNode; iter->size -= blockSize; next = ArenaImpl_GetNextBlock(newNode); - if (next) + if (next) { next->prev = newNode; + } iter = newNode; } iter->isFree = false; ArenaImpl_SetDebugInfo(iter, file, line, arena); - ret = (void *)((u32)iter + sizeof(ArenaNode)); - if (arena->flag & FILL_ALLOCBLOCK) + ret = (void*)((u32)iter + sizeof(ArenaNode)); + if (arena->flag & FILL_ALLOCBLOCK) { func_80106860(ret, BLOCK_ALLOC_MAGIC, size); + } break; } @@ -341,30 +306,27 @@ void* __osMallocRDebug(Arena *arena, u32 size, const char *file, s32 line) return ret; } -void* __osMalloc_NoLock(Arena *arena, u32 size) -{ - ArenaNode *iter; +void* __osMalloc_NoLock(Arena* arena, u32 size) { + ArenaNode* iter; u32 blockSize; - ArenaNode *newNode; - void *ret; - ArenaNode *next; + ArenaNode* newNode; + void* ret; + ArenaNode* next; ret = NULL; iter = arena->head; size = ALIGN16(size); blockSize = ALIGN16(size) + sizeof(ArenaNode); - while (iter) - { + while (iter) { - if (iter->isFree && iter->size >= size) - { - if (arena->flag & CHECK_FREE_BLOCK) + if (iter->isFree && iter->size >= size) { + if (arena->flag & CHECK_FREE_BLOCK) { __osMalloc_FreeBlockTest(arena, iter); + } - if (blockSize < iter->size) - { - newNode = (ArenaNode *)((u32)iter + blockSize); + if (blockSize < iter->size) { + newNode = (ArenaNode*)((u32)iter + blockSize); newNode->next = ArenaImpl_GetNextBlock(iter); newNode->prev = iter; newNode->size = iter->size - blockSize; @@ -374,15 +336,17 @@ void* __osMalloc_NoLock(Arena *arena, u32 size) iter->next = newNode; iter->size = size; next = ArenaImpl_GetNextBlock(newNode); - if (next) + if (next) { next->prev = newNode; + } } iter->isFree = false; ArenaImpl_SetDebugInfo(iter, NULL, 0, arena); - ret = (void *)((u32)iter + sizeof(ArenaNode)); - if (arena->flag & FILL_ALLOCBLOCK) + ret = (void*)((u32)iter + sizeof(ArenaNode)); + if (arena->flag & FILL_ALLOCBLOCK) { func_80106860(ret, BLOCK_ALLOC_MAGIC, size); + } break; } @@ -393,8 +357,7 @@ void* __osMalloc_NoLock(Arena *arena, u32 size) return ret; } -void* __osMalloc(Arena* arena, u32 size) -{ +void* __osMalloc(Arena* arena, u32 size) { void* ret; ArenaImpl_Lock(arena); ret = __osMalloc_NoLock(arena, size); @@ -402,29 +365,27 @@ void* __osMalloc(Arena* arena, u32 size) return ret; } -void* __osMallocR(Arena *arena, u32 size) -{ - ArenaNode *iter; - ArenaNode *newNode; +void* __osMallocR(Arena* arena, u32 size) { + ArenaNode* iter; + ArenaNode* newNode; u32 blockSize; - ArenaNode *next; - void *ret; + ArenaNode* next; + void* ret; ret = NULL; size = ALIGN16(size); ArenaImpl_Lock(arena); - iter = ArenaImpl_GetLastBlock(arena);; - while (iter) - { - if (iter->isFree && iter->size >= size) - { - if (arena->flag & CHECK_FREE_BLOCK) + iter = ArenaImpl_GetLastBlock(arena); + + while (iter) { + if (iter->isFree && iter->size >= size) { + if (arena->flag & CHECK_FREE_BLOCK) { __osMalloc_FreeBlockTest(arena, iter); + } blockSize = ALIGN16(size) + sizeof(ArenaNode); - if (blockSize < iter->size) - { - newNode = (ArenaNode *)((u32)iter + (iter->size - size)); + if (blockSize < iter->size) { + newNode = (ArenaNode*)((u32)iter + (iter->size - size)); newNode->next = ArenaImpl_GetNextBlock(iter); newNode->prev = iter; newNode->size = size; @@ -433,17 +394,19 @@ void* __osMallocR(Arena *arena, u32 size) iter->next = newNode; iter->size -= blockSize; next = ArenaImpl_GetNextBlock(newNode); - if (next) + if (next) { next->prev = newNode; - + } + iter = newNode; } iter->isFree = false; ArenaImpl_SetDebugInfo(iter, NULL, 0, arena); - ret = (void *)((u32)iter + sizeof(ArenaNode)); - if (arena->flag & FILL_ALLOCBLOCK) + ret = (void*)((u32)iter + sizeof(ArenaNode)); + if (arena->flag & FILL_ALLOCBLOCK) { func_80106860(ret, BLOCK_ALLOC_MAGIC, size); + } break; } @@ -455,30 +418,27 @@ void* __osMallocR(Arena *arena, u32 size) return ret; } -void __osFree_NoLock(Arena* arena, void* ptr) -{ +void __osFree_NoLock(Arena* arena, void* ptr) { ArenaNode* node; ArenaNode* next; ArenaNode* prev; ArenaNode* newNext; - if (ptr) - { + if (ptr) { node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); - if (node == NULL || node->magic != NODE_MAGIC) - { - osSyncPrintf(VT_COL(RED, WHITE) "__osFree:不正解放(%08x)\n" VT_RST, ptr); //__osFree: Unauthorized release (%08x) + if (node == NULL || node->magic != NODE_MAGIC) { + osSyncPrintf(VT_COL(RED, WHITE) "__osFree:不正解放(%08x)\n" VT_RST, + ptr); // __osFree: Unauthorized release (%08x) return; } - if (node->isFree) - { - osSyncPrintf(VT_COL(RED, WHITE) "__osFree:二重解放(%08x)\n" VT_RST, ptr); //__osFree: Double release (%08x) + if (node->isFree) { + osSyncPrintf(VT_COL(RED, WHITE) "__osFree:二重解放(%08x)\n" VT_RST, ptr); // __osFree: Double release (%08x) return; } - if (arena != node->arena && arena != NULL) - { - //__osFree:Tried to release in a different way than when it was secured (%08x:%08x) - osSyncPrintf(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, node->arena); + if (arena != node->arena && arena != NULL) { + // __osFree:Tried to release in a different way than when it was secured (%08x:%08x) + osSyncPrintf(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, + node->arena); return; } @@ -486,68 +446,66 @@ void __osFree_NoLock(Arena* arena, void* ptr) prev = ArenaImpl_GetPrevBlock(node); node->isFree = true; ArenaImpl_SetDebugInfo(node, NULL, 0, arena); - if (arena->flag & FILL_FREEBLOCK) - { + if (arena->flag & FILL_FREEBLOCK) { func_80106860((u32)node + sizeof(ArenaNode), BLOCK_FREE_MAGIC, node->size); } newNext = next; - if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree) - { + if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree) { newNext = ArenaImpl_GetNextBlock(next); - if (newNext) + if (newNext) { newNext->prev = node; - + } + node->size += next->size + sizeof(ArenaNode); - if (arena->flag & FILL_FREEBLOCK) + if (arena->flag & FILL_FREEBLOCK) { func_80106860(next, BLOCK_FREE_MAGIC, sizeof(ArenaNode)); + } node->next = newNext; next = newNext; } - if (prev && prev->isFree && (u32)node == (u32)prev + sizeof(ArenaNode) + prev->size) - { - if (next) + if (prev && prev->isFree && (u32)node == (u32)prev + sizeof(ArenaNode) + prev->size) { + if (next) { next->prev = prev; + } prev->next = next; prev->size += node->size + sizeof(ArenaNode); - if (arena->flag & FILL_FREEBLOCK) + if (arena->flag & FILL_FREEBLOCK) { func_80106860(node, BLOCK_FREE_MAGIC, sizeof(ArenaNode)); + } } } } -void __osFree(Arena* arena, void* ptr) -{ +void __osFree(Arena* arena, void* ptr) { ArenaImpl_Lock(arena); __osFree_NoLock(arena, ptr); ArenaImpl_Unlock(arena); } -void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line) -{ +void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line) { ArenaNode* node; ArenaNode* next; ArenaNode* prev; ArenaNode* newNext; - if (ptr) - { + if (ptr) { node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); - if (node == NULL || node->magic != NODE_MAGIC) - { - osSyncPrintf(VT_COL(RED, WHITE) "__osFree:不正解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, line); //__osFree: Unauthorized release (%08x) + if (node == NULL || node->magic != NODE_MAGIC) { + osSyncPrintf(VT_COL(RED, WHITE) "__osFree:不正解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, + line); // __osFree: Unauthorized release (%08x) return; } - if (node->isFree) - { - osSyncPrintf(VT_COL(RED, WHITE) "__osFree:二重解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, line); //__osFree: Double release (%08x) + if (node->isFree) { + osSyncPrintf(VT_COL(RED, WHITE) "__osFree:二重解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, + line); // __osFree: Double release (%08x) return; } - if (arena != node->arena && arena != NULL) - { - //__osFree:Tried to release in a different way than when it was secured (%08x:%08x) - osSyncPrintf(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, node->arena); + if (arena != node->arena && arena != NULL) { + // __osFree:Tried to release in a different way than when it was secured (%08x:%08x) + osSyncPrintf(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, + node->arena); return; } @@ -555,46 +513,45 @@ void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line) prev = ArenaImpl_GetPrevBlock(node); node->isFree = true; ArenaImpl_SetDebugInfo(node, file, line, arena); - if (arena->flag & FILL_FREEBLOCK) - { + if (arena->flag & FILL_FREEBLOCK) { func_80106860((u32)node + sizeof(ArenaNode), BLOCK_FREE_MAGIC, node->size); } newNext = node->next; - if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree) - { + if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree) { newNext = ArenaImpl_GetNextBlock(next); - if (newNext) + if (newNext) { newNext->prev = node; - + } + node->size += next->size + sizeof(ArenaNode); - if (arena->flag & FILL_FREEBLOCK) + if (arena->flag & FILL_FREEBLOCK) { func_80106860(next, BLOCK_FREE_MAGIC, sizeof(ArenaNode)); + } node->next = newNext; next = newNext; } - if (prev && prev->isFree && (u32)node == (u32)prev + sizeof(ArenaNode) + prev->size) - { - if (next) + if (prev && prev->isFree && (u32)node == (u32)prev + sizeof(ArenaNode) + prev->size) { + if (next) { next->prev = prev; + } prev->next = next; prev->size += node->size + sizeof(ArenaNode); - if (arena->flag & FILL_FREEBLOCK) + if (arena->flag & FILL_FREEBLOCK) { func_80106860(node, BLOCK_FREE_MAGIC, sizeof(ArenaNode)); + } } } } -void __osFreeDebug(Arena* arena, void* ptr, const char* file, s32 line) -{ +void __osFreeDebug(Arena* arena, void* ptr, const char* file, s32 line) { ArenaImpl_Lock(arena); __osFree_NoLockDebug(arena, ptr, file, line); ArenaImpl_Unlock(arena); } -void* __osRealloc(Arena* arena, void* ptr, u32 newSize) -{ +void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { void* newAlloc; ArenaNode* node; ArenaNode* next; @@ -611,60 +568,46 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) newSize = ALIGN16(newSize); osSyncPrintf("__osRealloc(%08x, %d)\n", ptr, newSize); ArenaImpl_Lock(arena); - if (!ptr) - { + if (!ptr) { ptr = __osMalloc_NoLock(arena, newSize); - } - else if (!newSize) - { + } else if (!newSize) { __osFree_NoLock(arena, ptr); ptr = NULL; - } - else - { + } else { node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); - if (newSize == node->size) - { - //Does nothing because the memory block size does not change + if (newSize == node->size) { + // Does nothing because the memory block size does not change osSyncPrintf("メモリブロックサイズが変わらないためなにもしません\n"); - } - else if (node->size < newSize) - { + } else if (node->size < newSize) { next = ArenaImpl_GetNextBlock(node); sizeDiff = newSize - node->size; - if ((u32)next == ((u32)node + node->size + sizeof(ArenaNode)) && next->isFree && next->size >= sizeDiff) - { - //Merge because there is a free block after the current memory block + if ((u32)next == ((u32)node + node->size + sizeof(ArenaNode)) && next->isFree && next->size >= sizeDiff) { + // Merge because there is a free block after the current memory block osSyncPrintf("現メモリブロックの後ろにフリーブロックがあるので結合します\n"); next->size -= sizeDiff; overNext = ArenaImpl_GetNextBlock(next); newNext = (ArenaNode*)((u32)next + sizeDiff); - if (overNext) + if (overNext) { overNext->prev = newNext; + } node->next = newNext; node->size = newSize; - func_801068B0(newNext, next, sizeof(ArenaNode)); //memcpy - } - else - { - //Allocate a new memory block and move the contents + func_801068B0(newNext, next, sizeof(ArenaNode)); // memcpy + } else { + // Allocate a new memory block and move the contents osSyncPrintf("新たにメモリブロックを確保して内容を移動します\n"); newAlloc = __osMalloc_NoLock(arena, newSize); - if (newAlloc) - { + if (newAlloc) { bcopy(ptr, newAlloc, node->size); __osFree_NoLock(arena, ptr); } ptr = newAlloc; } - } - else if (newSize < node->size) - { + } else if (newSize < node->size) { next2 = ArenaImpl_GetNextBlock(node); - if (next2 && next2->isFree) - { + if (next2 && next2->isFree) { blockSize = ALIGN16(newSize) + sizeof(ArenaNode); - //Increased free block behind current memory block + // Increased free block behind current memory block osSyncPrintf("現メモリブロックの後ろのフリーブロックを大きくしました\n"); newNext2 = (ArenaNode*)((u32)node + blockSize); localCopy = *next2; @@ -673,13 +616,12 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) node->next = newNext2; node->size = newSize; overNext2 = ArenaImpl_GetNextBlock(newNext2); - if (overNext2) + if (overNext2) { overNext2->prev = newNext2; - } - else if (newSize + sizeof(ArenaNode) < node->size) - { + } + } else if (newSize + sizeof(ArenaNode) < node->size) { blockSize = ALIGN16(newSize) + sizeof(ArenaNode); - //Generated because there is no free block after the current memory block + // Generated because there is no free block after the current memory block osSyncPrintf("現メモリブロックの後ろにフリーブロックがないので生成します\n"); newNext2 = (ArenaNode*)((u32)node + blockSize); newNext2->next = ArenaImpl_GetNextBlock(node); @@ -690,12 +632,11 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) node->next = newNext2; node->size = newSize; overNext2 = ArenaImpl_GetNextBlock(newNext2); - if (overNext2) + if (overNext2) { overNext2->prev = newNext2; - } - else - { - //There is no room to generate free blocks + } + } else { + // There is no room to generate free blocks osSyncPrintf("フリーブロック生成するだけの空きがありません\n"); ptr = NULL; } @@ -706,13 +647,11 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) return ptr; } -void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, s32 line) -{ +void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, s32 line) { return __osRealloc(arena, ptr, newSize); } -void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc) -{ +void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc) { ArenaNode* iter; ArenaImpl_Lock(arena); @@ -722,16 +661,15 @@ void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAll *outAlloc = 0; iter = arena->head; - while (iter) - { - if (iter->isFree) - { + while (iter) { + if (iter->isFree) { *outFree += iter->size; - if (*outMaxFree < iter->size) + if (*outMaxFree < iter->size) { *outMaxFree = iter->size; - } - else + } + } else { *outAlloc += iter->size; + } iter = ArenaImpl_GetNextBlock(iter); } @@ -739,17 +677,15 @@ void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAll ArenaImpl_Unlock(arena); } -void __osDisplayArena(Arena* arena) -{ +void __osDisplayArena(Arena* arena) { u32 freeSize; u32 allocatedSize; u32 maxFree; ArenaNode* iter; ArenaNode* next; - if (!__osMallocIsInitalized(arena)) - { - //Arena is not initalized + if (!__osMallocIsInitalized(arena)) { + // Arena is not initalized osSyncPrintf("アリーナは初期化されていません\n"); return; } @@ -760,40 +696,36 @@ void __osDisplayArena(Arena* arena) freeSize = 0; allocatedSize = 0; - //Arena contents (0x%08x) + // Arena contents (0x%08x) osSyncPrintf("アリーナの内容 (0x%08x)\n", arena); - //Memory node range status size [time s ms us ns: TID: src: line] + // Memory node range status size [time s ms us ns: TID: src: line] osSyncPrintf("メモリブロック範囲 status サイズ [時刻 s ms us ns: TID:src:行]\n"); iter = arena->head; - while (iter) - { - if (iter && iter->magic == NODE_MAGIC) - { + while (iter) { + if (iter && iter->magic == NODE_MAGIC) { next = iter->next; osSyncPrintf("%08x-%08x%c %s %08x", iter, ((u32)iter + sizeof(ArenaNode) + iter->size), - (!next) ? '$' : (iter != next->prev ? '!' : ' '), - iter->isFree ? "空き" : "確保", //? "Free" : "Secure" - iter->size); - - if (!iter->isFree) - osSyncPrintf(" [%016llu:%2d:%s:%d]", (iter->time*64ll)/3ull, iter->threadId, iter->filename ? iter->filename : "**NULL**", iter->line); + (!next) ? '$' : (iter != next->prev ? '!' : ' '), + iter->isFree ? "空き" : "確保", //? "Free" : "Secure" + iter->size); + + if (!iter->isFree) { + osSyncPrintf(" [%016llu:%2d:%s:%d]", (iter->time * 64ll) / 3ull, iter->threadId, + iter->filename ? iter->filename : "**NULL**", iter->line); + } osSyncPrintf("\n"); - if (iter->isFree) - { + if (iter->isFree) { freeSize += iter->size; - if (maxFree < iter->size) + if (maxFree < iter->size) { maxFree = iter->size; - } - else - { + } + } else { allocatedSize += iter->size; } - } - else - { + } else { osSyncPrintf("%08x Block Invalid\n", iter); next = NULL; } @@ -801,15 +733,14 @@ void __osDisplayArena(Arena* arena) iter = next; } - osSyncPrintf("確保ブロックサイズの合計 0x%08x バイト\n", allocatedSize); //Total reserved node size 0x%08x bytes - osSyncPrintf("空きブロックサイズの合計 0x%08x バイト\n", freeSize); //Total free node size 0x%08x bytes - osSyncPrintf("最大空きブロックサイズ 0x%08x バイト\n", maxFree); //Maximum free node size 0x%08x bytes + osSyncPrintf("確保ブロックサイズの合計 0x%08x バイト\n", allocatedSize); // Total reserved node size 0x%08x bytes + osSyncPrintf("空きブロックサイズの合計 0x%08x バイト\n", freeSize); // Total free node size 0x%08x bytes + osSyncPrintf("最大空きブロックサイズ 0x%08x バイト\n", maxFree); // Maximum free node size 0x%08x bytes ArenaImpl_Unlock(arena); } -void ArenaImpl_FaultClient(Arena* arena) -{ +void ArenaImpl_FaultClient(Arena* arena) { u32 freeSize; u32 allocatedSize; u32 maxFree; @@ -817,8 +748,7 @@ void ArenaImpl_FaultClient(Arena* arena) ArenaNode* next; FaultDrawer_Printf("ARENA INFO (0x%08x)\n", arena); - if (!__osMallocIsInitalized(arena)) - { + if (!__osMallocIsInitalized(arena)) { FaultDrawer_Printf("Arena is uninitalized\n", arena); return; } @@ -830,31 +760,23 @@ void ArenaImpl_FaultClient(Arena* arena) FaultDrawer_Printf("Memory Block Region status size\n"); iter = arena->head; - while (iter) - { - if (iter && iter->magic == NODE_MAGIC) - { + while (iter) { + if (iter && iter->magic == NODE_MAGIC) { next = iter->next; FaultDrawer_Printf("%08x-%08x%c %s %08x", iter, ((u32)iter + sizeof(ArenaNode) + iter->size), - (!next) ? '$' : (iter != next->prev ? '!' : ' '), - iter->isFree ? "F" : "A", - iter->size); - + (!next) ? '$' : (iter != next->prev ? '!' : ' '), iter->isFree ? "F" : "A", iter->size); + FaultDrawer_Printf("\n"); - if (iter->isFree) - { + if (iter->isFree) { freeSize += iter->size; - if (maxFree < iter->size) + if (maxFree < iter->size) { maxFree = iter->size; - } - else - { + } + } else { allocatedSize += iter->size; } - } - else - { + } else { FaultDrawer_SetFontColor(0xF801); FaultDrawer_Printf("%08x Block Invalid\n", iter); next = NULL; @@ -869,37 +791,32 @@ void ArenaImpl_FaultClient(Arena* arena) FaultDrawer_Printf("Largest Free Block Size %08x\n", maxFree); } -u32 __osCheckArena(Arena* arena) -{ - ArenaNode *iter; +u32 __osCheckArena(Arena* arena) { + ArenaNode* iter; u32 error; error = 0; ArenaImpl_Lock(arena); - //Checking the contents of the arena. . . (%08x) + // Checking the contents of the arena. . . (%08x) osSyncPrintf("アリーナの内容をチェックしています... (%08x)\n", arena); iter = arena->head; - while (iter) - { - if (iter && iter->magic == NODE_MAGIC) - { - //Oops!! (%08x %08x) + while (iter) { + if (iter && iter->magic == NODE_MAGIC) { + // Oops!! (%08x %08x) osSyncPrintf(VT_COL(RED, WHITE) "おおっと!! (%08x %08x)\n" VT_RST, iter, iter->magic); error = 1; break; } iter = ArenaImpl_GetNextBlock(iter); } - if (!error) - { - //The arena is still going well + if (!error) { + // The arena is still going well osSyncPrintf("アリーナはまだ、いけそうです\n"); } ArenaImpl_Unlock(arena); return error; } -u8 func_800FF334(Arena* arena) -{ +u8 func_800FF334(Arena* arena) { return arena->unk_20; } diff --git a/src/code/audioMgr.c b/src/code/audioMgr.c index a834c746e5..2372355de2 100644 --- a/src/code/audioMgr.c +++ b/src/code/audioMgr.c @@ -14,4 +14,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/audioMgr/func_800C3FC4.s") #pragma GLOBAL_ASM("asm/non_matchings/code/audioMgr/func_800C3FEC.s") - diff --git a/src/code/code_80026B00.c b/src/code/code_80026B00.c index 3cd8d47726..beb5006eed 100644 --- a/src/code/code_80026B00.c +++ b/src/code/code_80026B00.c @@ -1,15 +1,13 @@ #include #include -GlobalContext* func_80026B00(void) -{ +GlobalContext* func_80026B00(void) { return D_80157DA0; } #pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_80026B0C.s") -void func_80026C1C(u8* arg0) -{ +void func_80026C1C(u8* arg0) { arg0[0] = 0; arg0[1] = 0; arg0[2] = 0; diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c index c03b84f3e7..344c4ddb51 100644 --- a/src/code/code_800430A0.c +++ b/src/code/code_800430A0.c @@ -3,59 +3,56 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/code_800430A0/func_800430A0.s") -void func_800432A0(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) -{ - if (func_8003E934(floorPolySource) != 0) - { +void func_800432A0(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) { + if (func_8003E934(floorPolySource) != 0) { s16 v1 = colCtx->dyna.actorMeshArr[floorPolySource].rot2.y - colCtx->dyna.actorMeshArr[floorPolySource].rot1.y; - if (actor->id == 0) + if (actor->id == 0) { ((Player*)actor)->unk_83C += v1; + } actor->shape.rot.y += v1; actor->posRot.rot.y += v1; } } -void func_80043334(CollisionContext* colCtx, Actor* actor, u32 floorPolySource) -{ - if (func_8003E934(floorPolySource) != 0) - { +void func_80043334(CollisionContext* colCtx, Actor* actor, u32 floorPolySource) { + if (func_8003E934(floorPolySource) != 0) { DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource); - if (dynaActor != NULL) - { + if (dynaActor != NULL) { func_800434A8(dynaActor); - if ((actor->flags & 0x4000000) == 0x4000000) + if ((actor->flags & 0x4000000) == 0x4000000) { func_80043538(dynaActor); + } } } } -s32 func_800433A4(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) -{ +s32 func_800433A4(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) { s32 sp24 = 0; DynaPolyActor* dynaActor; - if (func_8003E934(floorPolySource) == 0) + if (func_8003E934(floorPolySource) == 0) { return 0; + } - if ((colCtx->dyna.flags[floorPolySource] & 2) || !(colCtx->dyna.flags[floorPolySource] & 1)) + if ((colCtx->dyna.flags[floorPolySource] & 2) || !(colCtx->dyna.flags[floorPolySource] & 1)) { return 0; + } dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource); - if (dynaActor == NULL) + if (dynaActor == NULL) { return 0; + } - if (dynaActor->unk_15C & 1) - { + if (dynaActor->unk_15C & 1) { func_800430A0(colCtx, floorPolySource, actor); sp24 = 1; } - if (dynaActor->unk_15C & 2) - { + if (dynaActor->unk_15C & 2) { func_800432A0(colCtx, floorPolySource, actor); sp24 = 1; } diff --git a/src/code/code_80043480.c b/src/code/code_80043480.c index 7a040602fc..ddd8d0e994 100644 --- a/src/code/code_80043480.c +++ b/src/code/code_80043480.c @@ -1,8 +1,7 @@ #include #include -void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags) -{ +void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags) { dynaActor->dynaPolyId = -1; dynaActor->unk_15C = flags; dynaActor->unk_160 = 0; @@ -10,77 +9,72 @@ void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags) dynaActor->unk_154 = 0.0f; } -void func_800434A0(DynaPolyActor *dynaActor) -{ +void func_800434A0(DynaPolyActor* dynaActor) { dynaActor->unk_160 = 0; } -void func_800434A8(DynaPolyActor *dynaActor) -{ +void func_800434A8(DynaPolyActor* dynaActor) { dynaActor->unk_160 |= 1; } -void func_800434B8(DynaPolyActor *dynaActor) -{ +void func_800434B8(DynaPolyActor* dynaActor) { dynaActor->unk_160 |= 2; } -void func_800434C8(CollisionContext* colCtx, u32 floorPolySource) -{ - DynaPolyActor *dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource); +void func_800434C8(CollisionContext* colCtx, u32 floorPolySource) { + DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource); - if (dynaActor != NULL) + if (dynaActor != NULL) { func_800434B8(dynaActor); + } } -void func_800434F8(DynaPolyActor* dynaActor) -{ +void func_800434F8(DynaPolyActor* dynaActor) { dynaActor->unk_160 |= 4; } -void func_80043508(CollisionContext* colCtx, u32 floorPolySource) -{ - DynaPolyActor *dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource); +void func_80043508(CollisionContext* colCtx, u32 floorPolySource) { + DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource); - if (dynaActor != NULL) + if (dynaActor != NULL) { func_800434F8(dynaActor); + } } -void func_80043538(DynaPolyActor* dynaActor) -{ +void func_80043538(DynaPolyActor* dynaActor) { dynaActor->unk_160 |= 8; } -s32 func_80043548(DynaPolyActor* dynaActor) -{ - if (dynaActor->unk_160 & 1) +s32 func_80043548(DynaPolyActor* dynaActor) { + if (dynaActor->unk_160 & 1) { return 1; - else + } else { return 0; + } } -s32 func_8004356C(DynaPolyActor* dynaActor) -{ - if (dynaActor->unk_160 & 2) +s32 func_8004356C(DynaPolyActor* dynaActor) { + if (dynaActor->unk_160 & 2) { return 1; - else + } else { return 0; + } } -s32 func_80043590(DynaPolyActor* dynaActor) -{ - if (dynaActor->unk_160 & 4) +s32 func_80043590(DynaPolyActor* dynaActor) { + if (dynaActor->unk_160 & 4) { return 1; - else + } else { return 0; + } } -s32 func_800435B4(DynaPolyActor* dynaActor) -{ - if (dynaActor->unk_160 & 8) +s32 func_800435B4(DynaPolyActor* dynaActor) { + if (dynaActor->unk_160 & 8) { return 1; - else + } else { return 0; + } } #pragma GLOBAL_ASM("asm/non_matchings/code/code_80043480/func_800435D8.s") diff --git a/src/code/code_80069420.c b/src/code/code_80069420.c index f0be5b4c36..ee9a179d7d 100644 --- a/src/code/code_80069420.c +++ b/src/code/code_80069420.c @@ -1,13 +1,11 @@ #include #include -void* MemCopy(void* dest, void* src, s32 size) -{ +void* MemCopy(void* dest, void* src, s32 size) { u8* destu = (u8*)dest; u8* srcu = (u8*)src; - while (size > 0) - { + while (size > 0) { *destu++ = *srcu++; size--; } @@ -15,13 +13,11 @@ void* MemCopy(void* dest, void* src, s32 size) return dest; } -void* MemSet(void* dest, s32 val, s32 size) -{ +void* MemSet(void* dest, s32 val, s32 size) { u8* destu = (u8*)dest; s32 s = size; - while (s > 0) - { + while (s > 0) { *destu++ = val; s--; } diff --git a/src/code/code_8006C360.c b/src/code/code_8006C360.c index fa48f62edd..01cf89b4df 100644 --- a/src/code/code_8006C360.c +++ b/src/code/code_8006C360.c @@ -1,8 +1,7 @@ #include #include -u16 D_8011F3F0[60][9] = -{ +u16 D_8011F3F0[60][9] = { { 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 }, { 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B }, { 0x0000, 0x7128, 0x712B, 0x7128, 0x7128, 0x7129, 0x7128, 0x712B, 0x7128 }, @@ -65,8 +64,7 @@ u16 D_8011F3F0[60][9] = { 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x710C, 0x7105, 0x7107, 0x7107 }, }; -u16 func_8006C360(GlobalContext* globalCtx, u32 idx) -{ +u16 func_8006C360(GlobalContext* globalCtx, u32 idx) { u8 mask = func_8008F080(globalCtx); return D_8011F3F0[idx][mask]; } diff --git a/src/code/code_8006C3A0.c b/src/code/code_8006C3A0.c index 88889621b0..1b7c77c4c1 100644 --- a/src/code/code_8006C3A0.c +++ b/src/code/code_8006C3A0.c @@ -8,4 +8,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C438.s") #pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C4A4.s") - diff --git a/src/code/code_8006C510.c b/src/code/code_8006C510.c index 5568b32e92..20fa80747e 100644 --- a/src/code/code_8006C510.c +++ b/src/code/code_8006C510.c @@ -4,4 +4,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C510/func_8006C510.s") #pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C510/func_8006C5A8.s") - diff --git a/src/code/code_8006EA30.c b/src/code/code_8006EA30.c index f433ed6b08..41104fea7b 100644 --- a/src/code/code_8006EA30.c +++ b/src/code/code_8006EA30.c @@ -5,10 +5,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/code_8006EA30/func_8006ECF4.s") -void func_8006EE48(UNK_TYPE arg0) -{ - +void func_8006EE48(UNK_TYPE arg0) { } #pragma GLOBAL_ASM("asm/non_matchings/code/code_8006EA30/func_8006EE50.s") - diff --git a/src/code/code_8007BF90.c b/src/code/code_8007BF90.c index f947e042b0..c51b222f99 100644 --- a/src/code/code_8007BF90.c +++ b/src/code/code_8007BF90.c @@ -3,8 +3,7 @@ Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1); -f32 func_8007BF90(Vec3f* a, Vec3f* b) -{ +f32 func_8007BF90(Vec3f* a, Vec3f* b) { f32 dx = a->x - b->x; f32 dy = a->y - b->y; f32 dz = a->z - b->z; @@ -12,8 +11,7 @@ f32 func_8007BF90(Vec3f* a, Vec3f* b) return sqrtf(SQ(dx) + SQ(dy) + SQ(dz)); } -f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest) -{ +f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest) { dest->x = a->x - b->x; dest->y = a->y - b->y; dest->z = a->z - b->z; @@ -21,20 +19,17 @@ f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest) return sqrtf(SQ(dest->x) + SQ(dest->y) + SQ(dest->z)); } -f32 func_8007C028(Vec3f* a, Vec3f* b) -{ +f32 func_8007C028(Vec3f* a, Vec3f* b) { return sqrtf(SQ(a->x - b->x) + SQ(a->z - b->z)); } -f32 func_8007C058(f32 arg0, f32 arg1) -{ +f32 func_8007C058(f32 arg0, f32 arg1) { return (arg1 <= fabsf(arg0)) ? arg0 : ((arg0 >= 0) ? arg1 : -arg1); } #pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C0A8.s") -Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b) -{ +Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b) { Vec3f v1; Vec3f v2; f32 temp; @@ -54,8 +49,7 @@ Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b) return dest; } -Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1) -{ +Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1) { Vec3f v; f32 sin4; f32 cos4; @@ -78,8 +72,7 @@ Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1) void func_8007C3F4(struct_80045714* arg0, Vec3f* arg1); -void func_8007C25C(Vec3f* dest, struct_80045714* arg1) -{ +void func_8007C25C(Vec3f* dest, struct_80045714* arg1) { struct_80045714 var; var.unk_00 = arg1->unk_00; @@ -95,8 +88,7 @@ void func_8007C25C(Vec3f* dest, struct_80045714* arg1) void func_8007C29C(struct_80045714* arg0, Vec3f* arg1); -void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b) -{ +void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b) { Vec3f var; var.x = b->x - a->x; @@ -106,8 +98,7 @@ void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b) func_8007C29C(arg0, &var); } -void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b) -{ +void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b) { Vec3f var; var.x = b->x - a->x; @@ -117,8 +108,7 @@ void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b) func_8007C3F4(arg0, &var); } -Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b) -{ +Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b) { Vec3f var; var.x = Math_atan2f(b->z - a->z, b->y - a->y); @@ -133,4 +123,3 @@ Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b) #pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C574.s") #pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C5E0.s") - diff --git a/src/code/code_80097A00.c b/src/code/code_80097A00.c index f30e01f1a5..d709fd8c92 100644 --- a/src/code/code_80097A00.c +++ b/src/code/code_80097A00.c @@ -2,244 +2,77 @@ #include // Bit Flag array in which gBitFlags[n] is literally (1 << n) -u32 gBitFlags[] = -{ - (1 << 0), (1 << 1), (1 << 2), (1 << 3), - (1 << 4), (1 << 5), (1 << 6), (1 << 7), - (1 << 8), (1 << 9), (1 << 10), (1 << 11), - (1 << 12), (1 << 13), (1 << 14), (1 << 15), - (1 << 16), (1 << 17), (1 << 18), (1 << 19), - (1 << 20), (1 << 21), (1 << 22), (1 << 23), - (1 << 24), (1 << 25), (1 << 26), (1 << 27), - (1 << 28), (1 << 29), (1 << 30), (1 << 31), +u32 gBitFlags[] = { + (1 << 0), (1 << 1), (1 << 2), (1 << 3), (1 << 4), (1 << 5), (1 << 6), (1 << 7), + (1 << 8), (1 << 9), (1 << 10), (1 << 11), (1 << 12), (1 << 13), (1 << 14), (1 << 15), + (1 << 16), (1 << 17), (1 << 18), (1 << 19), (1 << 20), (1 << 21), (1 << 22), (1 << 23), + (1 << 24), (1 << 25), (1 << 26), (1 << 27), (1 << 28), (1 << 29), (1 << 30), (1 << 31), }; u16 gEquipMasks[] = { 0x000F, 0x00F0, 0x0F00, 0xF000 }; u16 gEquipNegMasks[] = { 0xFFF0, 0xFF0F, 0xF0FF, 0x0FFF }; -u32 gUpgradeMasks[] = { 0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000 }; -u32 gUpgradeNegMasks[] = { 0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF }; +u32 gUpgradeMasks[] = { + 0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000, +}; +u32 gUpgradeNegMasks[] = { + 0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF, +}; u8 gEquipShifts[] = { 0, 4, 8, 12 }; u8 gUpgradeShifts[] = { 0, 3, 6, 9, 12, 14, 17, 20 }; -u16 gUpgradeCapacities[][4] = -{ - { 0, 30, 40, 50 }, // Quivers - { 0, 20, 30, 40 }, // Bomb Bags - { 0, 0, 0, 0 }, // Unused (Scale) - { 0, 0, 0, 0 }, // Unused (Strength) - { 99, 200, 500, 500 }, // Wallets - { 0, 30, 40, 50 }, // Deku Seed Bullet Bags - { 0, 10, 20, 30 }, // Deku Stick Upgrades - { 0, 20, 30, 40 }, // Deku Nut Upgrades +u16 gUpgradeCapacities[][4] = { + { 0, 30, 40, 50 }, // Quivers + { 0, 20, 30, 40 }, // Bomb Bags + { 0, 0, 0, 0 }, // Unused (Scale) + { 0, 0, 0, 0 }, // Unused (Strength) + { 99, 200, 500, 500 }, // Wallets + { 0, 30, 40, 50 }, // Deku Seed Bullet Bags + { 0, 10, 20, 30 }, // Deku Stick Upgrades + { 0, 20, 30, 40 }, // Deku Nut Upgrades }; u32 D_8012723C[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }; // Unused -u32 D_8012724C[] = { 0, 8, 16, 24 }; // Unused +u32 D_8012724C[] = { 0, 8, 16, 24 }; // Unused // TODO: use symbols for these icon textures once textures are properly in C -u32 gItemIcons[] = -{ - 0x08000000, - 0x08001000, - 0x08002000, - 0x08003000, - 0x08004000, - 0x08005000, - 0x08006000, - 0x08007000, - 0x08008000, - 0x08009000, - 0x0800A000, - 0x0800B000, - 0x0800C000, - 0x0800D000, - 0x0800E000, - 0x0800F000, - 0x08010000, - 0x08011000, - 0x08012000, - 0x08013000, - 0x08014000, - 0x08015000, - 0x08016000, - 0x08017000, - 0x08018000, - 0x08019000, - 0x0801A000, - 0x0801B000, - 0x0801C000, - 0x0801D000, - 0x0801E000, - 0x0801F000, - 0x08020000, - 0x08021000, - 0x08022000, - 0x08023000, - 0x08024000, - 0x08025000, - 0x08026000, - 0x08027000, - 0x08028000, - 0x08029000, - 0x0802A000, - 0x0802B000, - 0x0802C000, - 0x0802D000, - 0x0802E000, - 0x0802F000, - 0x08030000, - 0x08031000, - 0x08032000, - 0x08033000, - 0x08034000, - 0x08035000, - 0x08036000, - 0x08037000, - 0x08038000, - 0x08039000, - 0x0803A000, - 0x0803B000, - 0x0803C000, - 0x0803D000, - 0x0803E000, - 0x0803F000, - 0x08040000, - 0x08041000, - 0x08042000, - 0x08043000, - 0x08044000, - 0x08045000, - 0x08046000, - 0x08047000, - 0x08048000, - 0x08049000, - 0x0804A000, - 0x0804B000, - 0x0804C000, - 0x0804D000, - 0x0804E000, - 0x0804F000, - 0x08050000, - 0x08051000, - 0x08052000, - 0x08053000, - 0x08054000, - 0x08055000, - 0x08056000, - 0x08057000, - 0x08058000, - 0x08059000, - 0x08089440, - 0x08089440, - 0x08089440, - 0x08089440, - 0x08089440, - 0x08089440, - 0x08089440, - 0x08089440, - 0x08089440, - 0x08089440, - 0x08089440, - 0x08089440, - 0x09000000, - 0x09000900, - 0x09001200, - 0x09001B00, - 0x09002400, - 0x09002D00, - 0x09003600, - 0x09003F00, - 0x09004800, - 0x09005100, - 0x09005A00, - 0x09006300, - 0x09006C00, - 0x09007500, - 0x09007E00, - 0x09009000, - 0x09008700, - 0x09007E00, - 0x0900A200, - 0x0900AB00, - 0x0805A000, - 0x0805A900, - 0x0805B200, - 0x02002D40, - 0x02002A40, - 0x02002C40, - 0x02002B40, - 0x02002940, +u32 gItemIcons[] = { + 0x08000000, 0x08001000, 0x08002000, 0x08003000, 0x08004000, 0x08005000, 0x08006000, 0x08007000, 0x08008000, + 0x08009000, 0x0800A000, 0x0800B000, 0x0800C000, 0x0800D000, 0x0800E000, 0x0800F000, 0x08010000, 0x08011000, + 0x08012000, 0x08013000, 0x08014000, 0x08015000, 0x08016000, 0x08017000, 0x08018000, 0x08019000, 0x0801A000, + 0x0801B000, 0x0801C000, 0x0801D000, 0x0801E000, 0x0801F000, 0x08020000, 0x08021000, 0x08022000, 0x08023000, + 0x08024000, 0x08025000, 0x08026000, 0x08027000, 0x08028000, 0x08029000, 0x0802A000, 0x0802B000, 0x0802C000, + 0x0802D000, 0x0802E000, 0x0802F000, 0x08030000, 0x08031000, 0x08032000, 0x08033000, 0x08034000, 0x08035000, + 0x08036000, 0x08037000, 0x08038000, 0x08039000, 0x0803A000, 0x0803B000, 0x0803C000, 0x0803D000, 0x0803E000, + 0x0803F000, 0x08040000, 0x08041000, 0x08042000, 0x08043000, 0x08044000, 0x08045000, 0x08046000, 0x08047000, + 0x08048000, 0x08049000, 0x0804A000, 0x0804B000, 0x0804C000, 0x0804D000, 0x0804E000, 0x0804F000, 0x08050000, + 0x08051000, 0x08052000, 0x08053000, 0x08054000, 0x08055000, 0x08056000, 0x08057000, 0x08058000, 0x08059000, + 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, + 0x08089440, 0x08089440, 0x08089440, 0x09000000, 0x09000900, 0x09001200, 0x09001B00, 0x09002400, 0x09002D00, + 0x09003600, 0x09003F00, 0x09004800, 0x09005100, 0x09005A00, 0x09006300, 0x09006C00, 0x09007500, 0x09007E00, + 0x09009000, 0x09008700, 0x09007E00, 0x0900A200, 0x0900AB00, 0x0805A000, 0x0805A900, 0x0805B200, 0x02002D40, + 0x02002A40, 0x02002C40, 0x02002B40, 0x02002940, }; // Used to map item IDs to inventory slots -u8 gItemSlots[] = -{ - SLOT_STICK, - SLOT_NUT, - SLOT_BOMB, - SLOT_BOW, - SLOT_ARROW_FIRE, - SLOT_DINS_FIRE, - SLOT_SLINGSHOT, - SLOT_OCARINA, - SLOT_OCARINA, - SLOT_BOMBCHU, - SLOT_HOOKSHOT, - SLOT_HOOKSHOT, - SLOT_ARROW_ICE, - SLOT_FARORES_WIND, - SLOT_BOOMERANG, - SLOT_LENS, - SLOT_BEAN, - SLOT_HAMMER, - SLOT_ARROW_LIGHT, - SLOT_NAYRUS_LOVE, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_BOTTLE_1, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_CHILD, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT, - SLOT_TRADE_ADULT +u8 gItemSlots[] = { + SLOT_STICK, SLOT_NUT, SLOT_BOMB, SLOT_BOW, SLOT_ARROW_FIRE, SLOT_DINS_FIRE, + SLOT_SLINGSHOT, SLOT_OCARINA, SLOT_OCARINA, SLOT_BOMBCHU, SLOT_HOOKSHOT, SLOT_HOOKSHOT, + SLOT_ARROW_ICE, SLOT_FARORES_WIND, SLOT_BOOMERANG, SLOT_LENS, SLOT_BEAN, SLOT_HAMMER, + SLOT_ARROW_LIGHT, SLOT_NAYRUS_LOVE, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, + SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, + SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, + SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, + SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, + SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, + SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, }; -void Inventory_ChangeEquipment(s16 equipment, u16 value) -{ +void Inventory_ChangeEquipment(s16 equipment, u16 value) { gSaveContext.equips.equipment &= gEquipNegMasks[equipment]; gSaveContext.equips.equipment |= value << gEquipShifts[equipment]; } -u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) -{ +u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) { Player* player = PLAYER; s32 pad; u16 sp26; @@ -249,18 +82,17 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) // Translates to: "Erasing equipment item = %d zzz=%d" osSyncPrintf("装備アイテム抹消 = %d zzz=%d\n", equipment, sp26); - if (sp26) - { + if (sp26) { sp26 >>= gEquipShifts[equipment]; gSaveContext.equips.equipment &= gEquipNegMasks[equipment]; gSaveContext.equipment ^= gBitFlags[sp26 - 1] << gEquipShifts[equipment]; - if (equipment == EQUIP_TUNIC) + if (equipment == EQUIP_TUNIC) { gSaveContext.equips.equipment |= 0x0100; + } - if (equipment == EQUIP_SWORD) - { + if (equipment == EQUIP_SWORD) { gSaveContext.equips.button_items[0] = ITEM_NONE; gSaveContext.inf_table[29] = 1; } @@ -272,8 +104,7 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) return sp26; } -void Inventory_ChangeUpgrade(s16 upgrade, s16 value) -{ +void Inventory_ChangeUpgrade(s16 upgrade, s16 value) { gSaveContext.upgrades &= gUpgradeNegMasks[upgrade]; gSaveContext.upgrades |= value << gUpgradeShifts[upgrade]; } diff --git a/src/code/code_800A9D40.c b/src/code/code_800A9D40.c index 960994614d..c32d31d4e6 100644 --- a/src/code/code_800A9D40.c +++ b/src/code/code_800A9D40.c @@ -1,23 +1,20 @@ #include #include -typedef struct -{ +typedef struct { /* 0x00 */ OSPiHandle piHandle; /* 0x74 */ OSIoMesg ioMesg; /* 0x8C */ OSMesgQueue mesgQ; } struct_800A9D40; -struct_800A9D40 D_8012A690 = {0}; +struct_800A9D40 D_8012A690 = { 0 }; void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration, - u8 handlePulse, u32 handleSpeed) -{ + u8 handlePulse, u32 handleSpeed) { u32 int_disabled; - OSPiHandle *handle = &D_8012A690.piHandle; - if ((u32) OS_PHYSICAL_TO_K1(addr) != (*handle).baseAddress) - { + OSPiHandle* handle = &D_8012A690.piHandle; + if ((u32)OS_PHYSICAL_TO_K1(addr) != (*handle).baseAddress) { D_8012A690.piHandle.type = handleType; (*handle).baseAddress = OS_PHYSICAL_TO_K1(addr); D_8012A690.piHandle.latency = handleLatency; @@ -37,8 +34,7 @@ void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u } } -void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2) -{ +void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2) { OSMesg mesg; osCreateMesgQueue(&D_8012A690.mesgQ, &mesg, 1); @@ -50,8 +46,7 @@ void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2) osInvalDCache(dramAddr, size); } -void Sram_ReadWrite(UNK_TYPE arg0, UNK_PTR dramAddr, size_t size, UNK_TYPE arg3) -{ +void Sram_ReadWrite(UNK_TYPE arg0, UNK_PTR dramAddr, size_t size, UNK_TYPE arg3) { osSyncPrintf("ssSRAMReadWrite:%08x %08x %08x %d\n", arg0, dramAddr, size, arg3); func_800A9D40(arg0, 3, 1, 5, 0xd, 2, 0xc, 0); func_800A9E14(dramAddr, size, arg3); diff --git a/src/code/code_800A9F30.c b/src/code/code_800A9F30.c index ad603fabeb..ddc8c02238 100644 --- a/src/code/code_800A9F30.c +++ b/src/code/code_800A9F30.c @@ -5,26 +5,23 @@ extern u8 D_80160FD0[]; extern PadMgr gPadMgr; -void func_800A9F30(s32 a, s32 b) -{ +void func_800A9F30(s32 a, s32 b) { func_800D2E30(&D_80160FD0); func_800C7948(a, &D_80160FD0); } -void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) -{ +void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) { s32 temp1, temp2; - if (1000000.0f < a) + if (1000000.0f < a) { temp1 = 1000; - else + } else { temp1 = sqrtf(a); + } - if ((temp1 < 1000) && (b != 0) && (d != 0)) - { + if ((temp1 < 1000) && (b != 0) && (d != 0)) { temp2 = b - (temp1 * 255) / 1000; - if (temp2 > 0) - { + if (temp2 > 0) { D_801610DA = temp2; D_80160FD0[0x10B] = c; D_80160FD0[0x10C] = d; @@ -35,22 +32,19 @@ void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) #pragma GLOBAL_ASM("asm/non_matchings/code/code_800A9F30/func_800AA000.s") // this function is very similar to the one above but has a loop in it I can't figure out -void func_800AA0B4(void) -{ +void func_800AA0B4(void) { func_800D3140(&D_80160FD0); gPadMgr.unk_460 = func_800A9F30; gPadMgr.unk_464 = 0; - if (0) ; // Necessary to match + if (0) {} // Necessary to match } -void func_800AA0F0(void) -{ +void func_800AA0F0(void) { PadMgr* padmgr = &gPadMgr; - if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0)) - { + if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0)) { padmgr->unk_460 = NULL; padmgr->unk_464 = 0; } @@ -58,22 +52,18 @@ void func_800AA0F0(void) func_800D3178(&D_80160FD0); } -u32 func_800AA148(void) -{ +u32 func_800AA148(void) { return ((gPadMgr.unk_2AE[0] ^ 1) == 0); } -void func_800AA15C(void) -{ +void func_800AA15C(void) { D_801610D4 = 2; } -void func_800AA16C(void) -{ +void func_800AA16C(void) { D_801610D4 = 0; } -void func_800AA178(u32 a) -{ +void func_800AA178(u32 a) { D_801610D5 = !!a; } diff --git a/src/code/code_800ACE70.c b/src/code/code_800ACE70.c index 9f606cffac..5bf69cc48b 100644 --- a/src/code/code_800ACE70.c +++ b/src/code/code_800ACE70.c @@ -1,75 +1,63 @@ #include -typedef struct -{ +typedef struct { /* 0x00 */ u32 type; /* 0x04 */ u32 setScissor; - /* 0x08 */ union - { + /* 0x08 */ union { Color_RGBA8 c; u32 rgba; } color; /* 0x0C */ u32 unk_0C; } struct_801664F0; -Gfx D_8012AC00[] = -{ - gsDPSetOtherMode( - G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | - G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2), - gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1), +Gfx D_8012AC00[] = { + gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2), + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), gsDPPipeSync(), gsDPSetBlendColor(0, 0, 0, 8), gsSPEndDisplayList(), }; -Gfx D_8012AC28[] = -{ - gsDPSetOtherMode( - G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | - G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | - GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG,G_BL_CLR_MEM, G_BL_A_MEM) | - GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)), - gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1), +Gfx D_8012AC28[] = { + gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | + GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM) | + GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)), + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), gsSPEndDisplayList(), }; -Gfx D_8012AC40[] = -{ - gsDPSetOtherMode( - G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | - G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) | - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)), +Gfx D_8012AC40[] = { + gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | + GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) | + GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)), - gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1), + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), gsSPEndDisplayList(), }; -Gfx D_8012AC58[] = -{ +Gfx D_8012AC58[] = { gsDPSetCombineLERP(K5, K5, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, K5, K5, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE), - gsDPSetOtherMode( - G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | - G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2), - gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1), - gsDPSetOtherMode( - G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | - G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) | - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)), - gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1), + gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2), + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), + gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | + GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) | + GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)), + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), gsSPEndDisplayList(), }; -//Init func -void func_800ACE70(struct_801664F0* this) -{ +// Init func +void func_800ACE70(struct_801664F0* this) { this->type = 0; this->setScissor = false; this->color.c.r = 0xFF; @@ -78,15 +66,12 @@ void func_800ACE70(struct_801664F0* this) this->color.c.a = 0xFF; } -//Destroy func -void func_800ACE90(struct_801664F0* this) -{ - +// Destroy func +void func_800ACE90(struct_801664F0* this) { } -//Update func -void func_800ACE98(struct_801664F0* this, Gfx** gfxp) -{ +// Update func +void func_800ACE98(struct_801664F0* this, Gfx** gfxp) { Gfx* gfx; gfx = *gfxp; @@ -94,37 +79,27 @@ void func_800ACE98(struct_801664F0* this, Gfx** gfxp) gDPPipeSync(gfx++); gDPSetPrimDepth(gfx++, -1, -1); - if (this->setScissor == true) - { + if (this->setScissor == true) { gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); } - - switch(this->type) - { + + switch (this->type) { case 1: - { gSPDisplayList(gfx++, D_8012AC40); break; - } case 2: - { gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba); gSPDisplayList(gfx++, D_8012AC58); break; - } case 3: - { gDPSetColor(gfx++, G_SETBLENDCOLOR, this->color.rgba); gSPDisplayList(gfx++, D_8012AC00); break; - } case 4: - { gDPSetColor(gfx++, G_SETFOGCOLOR, this->color.rgba); gSPDisplayList(gfx++, D_8012AC28); break; - } - } + } gDPPipeSync(gfx++); *gfxp = gfx; diff --git a/src/code/code_800FBCE0.c b/src/code/code_800FBCE0.c index 2516388830..2c17e6fa28 100644 --- a/src/code/code_800FBCE0.c +++ b/src/code/code_800FBCE0.c @@ -1,10 +1,13 @@ #include -#define printSpStatus(x, name) if (x & SP_STATUS_##name) osSyncPrintf(#name " ") -#define printDpStatus(x, name) if (x & DPC_STATUS_##name) osSyncPrintf(#name " ") +#define printSpStatus(x, name) \ + if (x & SP_STATUS_##name) \ + osSyncPrintf(#name " ") +#define printDpStatus(x, name) \ + if (x & DPC_STATUS_##name) \ + osSyncPrintf(#name " ") -void func_800FBCE0() -{ +void func_800FBCE0() { u32 spStatus = __osSpGetStatus(); u32 dpStatus = osDpGetStatus(); @@ -41,10 +44,9 @@ void func_800FBCE0() osSyncPrintf("\n"); } -void func_800FBFD8() -{ +void func_800FBFD8() { func_800FBCE0(); osDpSetStatus(DPC_SET_FREEZE | DPC_SET_FLUSH); __osSpSetStatus(SP_SET_HALT | SP_SET_SIG2 | SP_CLR_INTR_BREAK); func_800FBCE0(); -} \ No newline at end of file +} diff --git a/src/code/code_800FC620.c b/src/code/code_800FC620.c index 81f0f53e77..b0b16b8b7d 100644 --- a/src/code/code_800FC620.c +++ b/src/code/code_800FC620.c @@ -1,52 +1,44 @@ #include typedef void (*arg3_800FC868)(void*); -typedef void (*arg3_800FC8D8)(void*,u32); -typedef void (*arg3_800FC948)(void*,u32,u32,u32,u32,u32,u32,u32,u32); -typedef void (*arg3_800FCA18)(void*,u32); +typedef void (*arg3_800FC8D8)(void*, u32); +typedef void (*arg3_800FC948)(void*, u32, u32, u32, u32, u32, u32, u32, u32); +typedef void (*arg3_800FCA18)(void*, u32); -typedef struct InitFunc -{ +typedef struct InitFunc { s32 nextOffset; void (*func)(void); } InitFunc; -//.data -void *sInitFuncs = NULL; +// .data +void* sInitFuncs = NULL; -char sNew[4] = -{ - 'n', 'e', 'w', +char sNew[4] = { 'n', 'e', 'w' }; + +char D_80134488[0x18] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00, + 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, }; -char D_80134488[0x18] = -{ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7F, 0x80, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; - -s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, void *allocatedVRamAddr) -{ +s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd, void* allocatedVRamAddr) { u32 pad; u32 end; u32 bssSize; - OverlayRelocationSection *ovl; + OverlayRelocationSection* ovl; u32 relocCnt; u32 ovlOffset; u32 size; - if(gOverlayLogSeverity >= 3) - { + if (gOverlayLogSeverity >= 3) { // Start loading dynamic link function osSyncPrintf("\nダイナミックリンクファンクションのロードを開始します\n"); } - if(gOverlayLogSeverity >= 3) - { + if (gOverlayLogSeverity >= 3) { size = vRomEnd - vRomStart; - //DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x) - osSyncPrintf("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedVRamAddr, (u32)allocatedVRamAddr + size); + // DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x) + osSyncPrintf("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedVRamAddr, + (u32)allocatedVRamAddr + size); } size = vRomEnd - vRomStart; @@ -56,13 +48,12 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi ovlOffset = ((s32*)end)[-1]; ovl = (OverlayRelocationSection*)((u32)end - ovlOffset); - if(gOverlayLogSeverity >= 3) - { - osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovl->textSize, ovl->dataSize, ovl->rodataSize, ovl->bssSize); + if (gOverlayLogSeverity >= 3) { + osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovl->textSize, ovl->dataSize, ovl->rodataSize, + ovl->bssSize); } - if(gOverlayLogSeverity >= 3) - { + if (gOverlayLogSeverity >= 3) { // Relocate osSyncPrintf("リロケーションします\n"); } @@ -70,10 +61,8 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi Overlay_DoRelocation(allocatedVRamAddr, ovl, vRamStart); bssSize = ovl->bssSize; - if(bssSize != 0) - { - if(gOverlayLogSeverity >= 3) - { + if (bssSize != 0) { + if (gOverlayLogSeverity >= 3) { // Clear BSS area (% 08x-% 08x) osSyncPrintf("BSS領域をクリアします(%08x-%08x)\n", end, end + ovl->bssSize); } @@ -85,8 +74,7 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi } size = (u32)&ovl->relocations[ovl->nRelocations] - (u32)ovl; - if(gOverlayLogSeverity >= 3) - { + if (gOverlayLogSeverity >= 3) { // Clear REL area (%08x-%08x) osSyncPrintf("REL領域をクリアします(%08x-%08x)\n", ovl, (u32)ovl + size); } @@ -97,8 +85,7 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi osWritebackDCache(allocatedVRamAddr, size); osInvalICache(allocatedVRamAddr, size); - if(gOverlayLogSeverity >= 3) - { + if (gOverlayLogSeverity >= 3) { // Finish loading dynamic link function osSyncPrintf("ダイナミックリンクファンクションのロードを終了します\n\n"); } @@ -106,10 +93,8 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi } // possibly some kind of new() function -void *func_800FC800(u32 size) -{ - if (size == 0) - { +void* func_800FC800(u32 size) { + if (size == 0) { size = 1; } @@ -117,106 +102,87 @@ void *func_800FC800(u32 size) } // possible some kind of delete() function -void func_800FC83C(void *ptr) -{ - if (ptr != NULL) - { +void func_800FC83C(void* ptr) { + if (ptr != NULL) { __osFree(&gSystemArena, ptr); } } -void func_800FC868(void *blk, u32 nBlk, u32 blkSize, arg3_800FC868 arg3) -{ +void func_800FC868(void* blk, u32 nBlk, u32 blkSize, arg3_800FC868 arg3) { u32 pos; - for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) - { + for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) { arg3((void*)pos); } } -void func_800FC8D8(void *blk, u32 nBlk, s32 blkSize, arg3_800FC8D8 arg3) -{ +void func_800FC8D8(void* blk, u32 nBlk, s32 blkSize, arg3_800FC8D8 arg3) { u32 pos; - for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) - { + for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) { arg3((void*)pos, 2); } } -void *func_800FC948(void *blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3) -{ +void* func_800FC948(void* blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3) { u32 pos; - if (blk == NULL) - { + if (blk == NULL) { blk = func_800FC800(nBlk * blkSize); } - if (blk != NULL && arg3 != NULL) - { + if (blk != NULL && arg3 != NULL) { pos = (u32)blk; - while(pos < (u32)blk + (nBlk * blkSize)) - { + while (pos < (u32)blk + (nBlk * blkSize)) { arg3((void*)pos, 0, 0, 0, 0, 0, 0, 0, 0); pos = (u32)pos + (blkSize & ~0); } - } return blk; } -void func_800FCA18(void *blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg4) -{ +void func_800FCA18(void* blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg4) { u32 pos; - u32 end ; + u32 end; s32 masked_arg2; - if (blk == 0) - { + if (blk == 0) { return; } - if (arg3 != 0) - { + if (arg3 != 0) { end = (u32)blk; masked_arg2 = (s32)(blkSize & ~0); pos = (u32)end + (nBlk * blkSize); - if (masked_arg2) { } + if (masked_arg2) {} - while (pos > end) - { + while (pos > end) { do { pos -= masked_arg2; arg3((void*)pos, 2); } while (0); } - if (!masked_arg2){ } + if (!masked_arg2) {} } - if (arg4 != 0) - { + if (arg4 != 0) { func_800FC83C(blk); } } -void func_800FCB34(void) -{ - InitFunc *initFunc; +void func_800FCB34(void) { + InitFunc* initFunc; u32 nextOffset; - InitFunc *prev; + InitFunc* prev; initFunc = (InitFunc*)&sInitFuncs; nextOffset = initFunc->nextOffset; prev = NULL; - while(nextOffset != 0) - { + while (nextOffset != 0) { initFunc = (InitFunc*)((s32)initFunc + nextOffset); - if(initFunc->func != NULL) - { + if (initFunc->func != NULL) { (*initFunc->func)(); } @@ -228,8 +194,7 @@ void func_800FCB34(void) sInitFuncs = prev; } -void SystemHeap_Init(void *start, u32 size) -{ +void SystemHeap_Init(void* start, u32 size) { SystemArena_Init(start, size); func_800FCB34(); -} \ No newline at end of file +} diff --git a/src/code/code_800FCE80.c b/src/code/code_800FCE80.c index 60afd1dfb7..5180c24447 100644 --- a/src/code/code_800FCE80.c +++ b/src/code/code_800FCE80.c @@ -4,65 +4,47 @@ s32 use_cfrac; -f32 Math_tanf(f32 x) -{ +f32 Math_tanf(f32 x) { f32 sin = sinf(x); f32 cos = cosf(x); return sin / cos; } -f32 Math_floorf(f32 x) -{ +f32 Math_floorf(f32 x) { return floorf(x); } -f32 Math_ceilf(f32 x) -{ +f32 Math_ceilf(f32 x) { return ceilf(x); } -f32 Math_roundf(f32 x) -{ +f32 Math_roundf(f32 x) { return roundf(x); } -f32 Math_truncf(f32 x) -{ +f32 Math_truncf(f32 x) { return truncf(x); } -f32 Math_nearbyintf(f32 x) -{ +f32 Math_nearbyintf(f32 x) { return nearbyintf(x); } /* Arctangent approximation using a Taylor series (one quadrant) */ -f32 Math_atanf_taylor_q(f32 x) -{ - static const f32 coeffs[] = - { - -1.f / 3, - +1.f / 5, - -1.f / 7, - +1.f / 9, - -1.f / 11, - +1.f / 13, - -1.f / 15, - +1.f / 17, - 0.f, +f32 Math_atanf_taylor_q(f32 x) { + static const f32 coeffs[] = { + -1.f / 3, +1.f / 5, -1.f / 7, +1.f / 9, -1.f / 11, +1.f / 13, -1.f / 15, +1.f / 17, 0.f, }; f32 poly = x; f32 sq = SQ(x); f32 exp = x * sq; - const f32 *c = coeffs; + const f32* c = coeffs; f32 term; - while (1) - { + while (1) { term = *c++ * exp; - if (poly + term == poly) - { + if (poly + term == poly) { break; } poly = poly + term; @@ -73,157 +55,107 @@ f32 Math_atanf_taylor_q(f32 x) } /* Ditto for two quadrants */ -f32 Math_atanf_taylor(f32 x) -{ +f32 Math_atanf_taylor(f32 x) { f32 t; f32 q; - if (x > 0.f) - { + if (x > 0.f) { t = x; - } - else if (x < 0.f) - { + } else if (x < 0.f) { t = -x; - } - else if (x == 0.f) - { + } else if (x == 0.f) { return 0.f; - } - else - { + } else { return qNaN0x10000; } - if (t <= M_SQRT2 - 1.f) - { + if (t <= M_SQRT2 - 1.f) { return Math_atanf_taylor_q(x); } - if (t >= M_SQRT2 + 1.f) - { + if (t >= M_SQRT2 + 1.f) { q = M_PI / 2 - Math_atanf_taylor_q(1.f / t); - } - else - { + } else { q = M_PI / 4 - Math_atanf_taylor_q((1.f - t) / (1.f + t)); } - if (x > 0.f) - { + if (x > 0.f) { return q; - } - else - { + } else { return -q; } } /* Arctangent approximation using a continued fraction */ -f32 Math_atanf_cfrac(f32 x) -{ +f32 Math_atanf_cfrac(f32 x) { s32 sector; f32 z; f32 conv; f32 sq; s32 i; - if (x >= -1.f && x <= 1.f) - { + if (x >= -1.f && x <= 1.f) { sector = 0; - } - else if (x > 1.f) - { + } else if (x > 1.f) { sector = 1; x = 1.f / x; - } - else if (x < -1.f) - { + } else if (x < -1.f) { sector = -1; x = 1.f / x; - } - else - { + } else { return qNaN0x10000; } sq = SQ(x); conv = 0.f; z = 8.f; - for (i = 8; i != 0; i--) - { + for (i = 8; i != 0; i--) { conv = SQ(z) * sq / (2.f * z + 1.f + conv); z -= 1.f; } conv = x / (1.f + conv); - if (sector == 0) - { + if (sector == 0) { return conv; - } - else if (sector > 0) - { + } else if (sector > 0) { return M_PI / 2 - conv; - } - else - { + } else { return -M_PI / 2 - conv; } } -f32 Math_atanf(f32 x) -{ - if (use_cfrac == 0) - { +f32 Math_atanf(f32 x) { + if (use_cfrac == 0) { return Math_atanf_taylor(x); - } - else - { + } else { return Math_atanf_cfrac(x); } } -f32 Math_atan2f(f32 y, f32 x) -{ - if (x == 0.f) - { - if (y == 0.f) - { +f32 Math_atan2f(f32 y, f32 x) { + if (x == 0.f) { + if (y == 0.f) { return 0.f; - } - else if (y > 0.f) - { + } else if (y > 0.f) { return M_PI / 2; - } - else if (y < 0.f) - { + } else if (y < 0.f) { return -M_PI / 2; - } - else - { + } else { return qNaN0x10000; } - } - else if (x >= 0.f) - { + } else if (x >= 0.f) { return Math_atanf(y / x); - } - else if (y < 0.f) - { + } else if (y < 0.f) { return Math_atanf(y / x) - M_PI; - } - else - { + } else { return M_PI - Math_atanf(-(y / x)); } } -f32 Math_asinf(f32 x) -{ +f32 Math_asinf(f32 x) { return Math_atan2f(x, sqrtf(1.f - SQ(x))); } -f32 Math_acosf(f32 x) -{ +f32 Math_acosf(f32 x) { return M_PI / 2 - Math_asinf(x); } diff --git a/src/code/db_camera.c b/src/code/db_camera.c index e0580f6b7c..b1e858e638 100644 --- a/src/code/db_camera.c +++ b/src/code/db_camera.c @@ -80,4 +80,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_800B958C.s") #pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_800B9638.s") - diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c index 6e63e1c4a6..789e382af6 100644 --- a/src/code/debug_malloc.c +++ b/src/code/debug_malloc.c @@ -1,131 +1,112 @@ #include -#define LOG_SEVERITY_NOLOG 0 -#define LOG_SEVERITY_ERROR 2 -#define LOG_SEVERITY_VERBOSE 3 +#define LOG_SEVERITY_NOLOG 0 +#define LOG_SEVERITY_ERROR 2 +#define LOG_SEVERITY_VERBOSE 3 s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR; Arena sDebugArena; -void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) -{ - if (!ptr) - { - if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) - { +void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { + if (!ptr) { + if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) { //"%s: %u bytes %s failed\n" osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action); - __osDisplayArena(&sDebugArena); + __osDisplayArena(&sDebugArena); return; } - } - else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) - { + } else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { //"%s: %u bytes %s succeeded\n" osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action); } } -void* DebugArena_Malloc(u32 size) -{ +void* DebugArena_Malloc(u32 size) { void* ptr; ptr = __osMalloc(&sDebugArena, size); - DebugArena_CheckPointer(ptr, size, "debug_malloc", "確保"); //Secure + DebugArena_CheckPointer(ptr, size, "debug_malloc", "確保"); // Secure return ptr; } -void* DebugArena_MallocDebug(u32 size, const char* file, s32 line) -{ +void* DebugArena_MallocDebug(u32 size, const char* file, s32 line) { void* ptr; ptr = __osMallocDebug(&sDebugArena, size, file, line); - DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "確保"); //Secure + DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "確保"); // Secure return ptr; } -void* DebugArena_MallocR(u32 size) -{ +void* DebugArena_MallocR(u32 size) { void* ptr; ptr = __osMallocR(&sDebugArena, size); - DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "確保"); //Secure + DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "確保"); // Secure return ptr; } -void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line) -{ +void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line) { void* ptr; ptr = __osMallocRDebug(&sDebugArena, size, file, line); - DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "確保"); //Secure + DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "確保"); // Secure return ptr; } -void* DebugArena_Realloc(void* ptr, u32 newSize) -{ +void* DebugArena_Realloc(void* ptr, u32 newSize) { ptr = __osRealloc(&sDebugArena, ptr, newSize); DebugArena_CheckPointer(ptr, newSize, "debug_realloc", "再確保"); // Re-securing return ptr; } -void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) -{ +void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) { ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line); DebugArena_CheckPointer(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // Re-securing return ptr; } -void DebugArena_Free(void* ptr) -{ +void DebugArena_Free(void* ptr) { __osFree(&sDebugArena, ptr); } -void DebugArena_FreeDebug(void* ptr, const char* file, s32 line) -{ +void DebugArena_FreeDebug(void* ptr, const char* file, s32 line) { __osFreeDebug(&sDebugArena, ptr, file, line); } -void* DebugArena_Calloc(u32 num, u32 size) -{ +void* DebugArena_Calloc(u32 num, u32 size) { void* ret; u32 n; - - n = num*size; + + n = num * size; ret = __osMalloc(&sDebugArena, n); - if (ret) + if (ret) { bzero(ret, n); + } DebugArena_CheckPointer(ret, n, "debug_calloc", "確保"); return ret; } -void DebugArena_Display() -{ - //Zelda heap display (devs forgot to change "Zelda" to "Debug" apparently) +void DebugArena_Display() { + // Zelda heap display (devs forgot to change "Zelda" to "Debug" apparently) osSyncPrintf("ゼルダヒープ表示\n"); __osDisplayArena(&sDebugArena); } -void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) -{ +void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) { ArenaImpl_GetSizes(&sDebugArena, outMaxFree, outFree, outAlloc); } -void DebugArena_Check() -{ +void DebugArena_Check() { __osCheckArena(&sDebugArena); } -void DebugArena_Init(void* start, u32 size) -{ +void DebugArena_Init(void* start, u32 size) { gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG; __osMallocInit(&sDebugArena, start, size); } -void DebugArena_Cleanup() -{ +void DebugArena_Cleanup() { gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG; __osMallocCleanup(&sDebugArena); } -u8 DebugArena_IsInitalized() -{ +u8 DebugArena_IsInitalized() { return __osMallocIsInitalized(&sDebugArena); } diff --git a/src/code/fault.c b/src/code/fault.c index 4af2d6c606..7884c50578 100644 --- a/src/code/fault.c +++ b/src/code/fault.c @@ -3,9 +3,8 @@ #include #include -//data -const char* sExceptionNames[] = -{ +// data +const char* sExceptionNames[] = { "Interrupt", "TLB modification", "TLB exception on load", @@ -32,7 +31,7 @@ const char* sExceptionNames[] = "Inexact operation", }; -//bss +// bss FaultThreadStruct* sFaultStructPtr; u8 sFaultIsWaitingForInput; char sFaultStack[0x600]; @@ -41,23 +40,22 @@ FaultThreadStruct gFaultStruct; #pragma GLOBAL_ASM("asm/non_matchings/code/fault/pad_800D3F10.s") -void Fault_SleepImpl(u32 duration) -{ +void Fault_SleepImpl(u32 duration) { u64 value = (duration * OS_CPU_COUNTER) / 1000ull; func_800FF3A0(value); } -void Fault_ClientProcessThread(FaultClientContext* ctx) -{ - if (ctx->callback) +void Fault_ClientProcessThread(FaultClientContext* ctx) { + if (ctx->callback) { ctx->ret = ctx->callback(ctx->param0, ctx->param1); + } - if (ctx->queue) + if (ctx->queue) { osSendMesg(ctx->queue, ctx->msg, 1); + } } -void Fault_ProcessClientContext(FaultClientContext* ctx) -{ +void Fault_ProcessClientContext(FaultClientContext* ctx) { OSMesgQueue queue; OSMesg msg; OSMesg recMsg; @@ -72,27 +70,23 @@ void Fault_ProcessClientContext(FaultClientContext* ctx) ctx->queue = &queue; ctx->msg = NULL; - if (sFaultStructPtr->currClientThreadSp != 0) - { + if (sFaultStructPtr->currClientThreadSp != 0) { thread = alloca(sizeof(OSThread)); osCreateThread(thread, 2, Fault_ClientProcessThread, ctx, sFaultStructPtr->currClientThreadSp, 0x7E); osStartThread(thread); - } - else - { + } else { Fault_ClientProcessThread(ctx); } - while (true) - { + while (true) { osSetTimer(&timer, OS_USEC_TO_CYCLES(1000000), 0, &queue, (OSMesg)timerMsgVal); osRecvMesg(&queue, &recMsg, 1); - if (recMsg != (OSMesg)666) + if (recMsg != (OSMesg)666) { break; + } - if (!sFaultIsWaitingForInput) - { + if (!sFaultIsWaitingForInput) { ctx->ret = -1; break; } @@ -100,15 +94,13 @@ void Fault_ProcessClientContext(FaultClientContext* ctx) osStopTimer(&timer); - if (thread != NULL) - { + if (thread != NULL) { osStopThread(thread); osDestroyThread(thread); } } -u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1) -{ +u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1) { FaultClientContext a; a.callback = callback; a.param0 = param0; @@ -120,8 +112,7 @@ u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1) #ifdef NON_MATCHING // minor ordering differences -void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1) -{ +void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1) { OSIntMask mask; u32 alreadyExists; FaultClient* iter; @@ -130,10 +121,8 @@ void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* pa mask = osSetIntMask(1); iter = sFaultStructPtr->clients; - while (iter) - { - if (iter == client) - { + while (iter) { + if (iter == client) { alreadyExists = true; goto end; } @@ -188,8 +177,9 @@ void Fault_RemoveClient(FaultClient* client) { osSetIntMask(mask); - if (listIsEmpty) + if (listIsEmpty) { osSyncPrintf(VT_COL(RED, WHITE) "fault_RemoveClient: %08x リスト不整合です\n" VT_RST, client); + } } #pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_AddAddrConvClient.s") @@ -228,24 +218,23 @@ void Fault_RemoveAddrConvClient(FaultAddrConvClient* client) { osSetIntMask(mask); if (listIsEmpty) { - osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST, client); + osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST, + client); } } -u32 Fault_ConvertAddress(FaultAddrConvClient* client) -{ +u32 Fault_ConvertAddress(FaultAddrConvClient* client) { u32 ret; FaultAddrConvClient* iter = sFaultStructPtr->addrConvClients; - while(iter) - { - if (iter->callback) - { + while (iter) { + if (iter->callback) { ret = Fault_ProcessClient(iter->callback, client, iter->param); - if (ret == -1) + if (ret == -1) { Fault_RemoveAddrConvClient(iter); - else if (ret) + } else if (ret) { return ret; + } } iter = iter->next; } @@ -253,35 +242,29 @@ u32 Fault_ConvertAddress(FaultAddrConvClient* client) return 0; } -void Fault_Sleep(u32 duration) -{ +void Fault_Sleep(u32 duration) { Fault_SleepImpl(duration); } -void Fault_PadCallback(Input* input) -{ - //BUG: this function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C +void Fault_PadCallback(Input* input) { + // BUG: this function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C func_800C7E08(input, 0); } -void Fault_UpdatePadImpl() -{ +void Fault_UpdatePadImpl() { sFaultStructPtr->padCallback(&sFaultStructPtr->padInput); } #ifdef NON_MATCHING // ordering differences and possibly regalloc -u32 Fault_WaitForInputImpl() -{ +u32 Fault_WaitForInputImpl() { u16 kDown; u32 exitDebugger; s32 count = 600; Input* curInput = &sFaultStructPtr->padInput; - while (true) - { - while (true) - { + while (true) { + while (true) { Fault_Sleep(0x10); Fault_UpdatePadImpl(); @@ -316,71 +299,63 @@ u32 Fault_WaitForInputImpl() #pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_WaitForInputImpl.s") #endif -void Fault_WaitForInput() -{ +void Fault_WaitForInput() { sFaultIsWaitingForInput = 1; Fault_WaitForInputImpl(); sFaultIsWaitingForInput = 0; } -void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color) -{ +void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color) { FaultDrawer_DrawRecImpl(x, y, x + w - 1, y + h - 1, color); } -void Fault_FillScreenBlack() -{ +void Fault_FillScreenBlack() { FaultDrawer_SetForeColor(0xFFFF); FaultDrawer_SetBackColor(1); FaultDrawer_FillScreen(); FaultDrawer_SetBackColor(0); } -void Fault_FillScreenRed() -{ +void Fault_FillScreenRed() { FaultDrawer_SetForeColor(0xFFFF); FaultDrawer_SetBackColor(0xF001); FaultDrawer_FillScreen(); FaultDrawer_SetBackColor(0); } -void Fault_DrawCornerRec(u16 color) -{ +void Fault_DrawCornerRec(u16 color) { Fault_DrawRec(0x16, 0x10, 8, 1, color); } -void Fault_PrintFReg(s32 idx, f32* value) -{ +void Fault_PrintFReg(s32 idx, f32* value) { u32 raw = *(u32*)value; s32 v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f; - if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) + if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) { FaultDrawer_Printf("F%02d:%14.7e ", idx, *value); - else + } else { FaultDrawer_Printf("F%02d: %08x(16) ", idx, raw); + } } -void Fault_LogFReg(s32 idx, f32* value) -{ +void Fault_LogFReg(s32 idx, f32* value) { u32 raw = *(u32*)value; s32 v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f; - if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) + if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) { osSyncPrintf("F%02d:%14.7e ", idx, *value); - else + } else { osSyncPrintf("F%02d: %08x(16) ", idx, *(u32*)value); + } } -void Fault_PrintFPCR(u32 value) -{ +void Fault_PrintFPCR(u32 value) { s32 i; u32 flag = 0x20000; FaultDrawer_Printf("FPCSR:%08xH ", value); - for (i = 0; i < 6; i++) - { - if (value & flag) - { - FaultDrawer_Printf("(%s)", sExceptionNames[i+18]); + for (i = 0; i < 6; i++) { + if (value & flag) { + FaultDrawer_Printf("(%s)", sExceptionNames[i + 18]); break; } flag >>= 1; @@ -388,30 +363,28 @@ void Fault_PrintFPCR(u32 value) FaultDrawer_Printf("\n"); } -void Fault_LogFPCR(u32 value) -{ +void Fault_LogFPCR(u32 value) { s32 i; u32 flag = 0x20000; osSyncPrintf("FPCSR:%08xH ", value); - for (i = 0; i < 6; i++) - { - if (value & flag) - { - osSyncPrintf("(%s)\n", sExceptionNames[i+18]); + for (i = 0; i < 6; i++) { + if (value & flag) { + osSyncPrintf("(%s)\n", sExceptionNames[i + 18]); break; } flag >>= 1; } } -void Fault_PrintThreadContext(OSThread* t) -{ - __OSThreadContext *ctx; - s32 causeStrIdx = (s32) ((((u32) t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10; - if (causeStrIdx == 0x17) +void Fault_PrintThreadContext(OSThread* t) { + __OSThreadContext* ctx; + s32 causeStrIdx = (s32)((((u32)t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10; + if (causeStrIdx == 0x17) { causeStrIdx = 0x10; - if (causeStrIdx == 0x1f) + } + if (causeStrIdx == 0x1f) { causeStrIdx = 0x11; + } FaultDrawer_FillScreen(); FaultDrawer_SetCharPad(-2, 4); @@ -462,14 +435,15 @@ void Fault_PrintThreadContext(OSThread* t) FaultDrawer_SetCharPad(0, 0); } -void Fault_LogThreadContext(OSThread* t) -{ - __OSThreadContext *ctx; - s32 causeStrIdx = (s32) ((((u32) t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10; - if (causeStrIdx == 0x17) +void Fault_LogThreadContext(OSThread* t) { + __OSThreadContext* ctx; + s32 causeStrIdx = (s32)((((u32)t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10; + if (causeStrIdx == 0x17) { causeStrIdx = 0x10; - if (causeStrIdx == 0x1f) + } + if (causeStrIdx == 0x1f) { causeStrIdx = 0x11; + } ctx = &t->context; osSyncPrintf("\n"); @@ -515,26 +489,23 @@ void Fault_LogThreadContext(OSThread* t) osSyncPrintf("\n"); } -OSThread* Fault_FindFaultedThread() -{ +OSThread* Fault_FindFaultedThread() { OSThread* iter = func_80104140(); - while (iter->priority != -1) - { - if (iter->priority > 0 && iter->priority < 0x7f && (iter->flags & 3)) + while (iter->priority != -1) { + if (iter->priority > 0 && iter->priority < 0x7f && (iter->flags & 3)) { return iter; + } iter = iter->tlnext; } return NULL; } -void Fault_Wait5Seconds(void) -{ - OSTime start[2]; //to make the function allocate 0x28 bytes of stack instead of 0x20 +void Fault_Wait5Seconds(void) { + OSTime start[2]; // to make the function allocate 0x28 bytes of stack instead of 0x20 start[0] = osGetTime(); - do - { + do { Fault_Sleep(0x10); - } while ((osGetTime() - start[0]) < OS_USEC_TO_CYCLES(5000000)+1); //0xdf84759 + } while ((osGetTime() - start[0]) < OS_USEC_TO_CYCLES(5000000) + 1); // 0xdf84759 sFaultStructPtr->faultActive = true; } @@ -561,7 +532,7 @@ void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) { Fault_FillScreenBlack(); FaultDrawer_SetCharPad(-2, 0); - FaultDrawer_DrawText(0x24, 0x12, "%s %08x", title? title : "PrintDump", alignedAddr); + FaultDrawer_DrawText(0x24, 0x12, "%s %08x", title ? title : "PrintDump", alignedAddr); if (alignedAddr >= (u32*)0x80000000 && alignedAddr < (u32*)0xC0000000) { for (y = 0x1C; y != 0xE2; y += 9) { FaultDrawer_DrawText(0x18, y, "%06x", writeAddr); @@ -577,15 +548,13 @@ void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) { #ifdef NON_MATCHING // saved register and stack usage differences // possibly some minor ordering and regalloc differences -void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) -{ +void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) { Input* curInput = &sFaultStructPtr->padInput; u32 addr = pc; s32 count; s32 off; - while (true) - { + while (true) { if (addr < 0x80000000) addr = 0x80000000; if (addr > 0x807fff00) @@ -595,8 +564,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) Fault_DrawMemDumpPage("Dump", (u32*)addr, 0); count = 600; - while (sFaultStructPtr->faultActive) - { + while (sFaultStructPtr->faultActive) { if (count == 0) return; @@ -607,8 +575,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) sFaultStructPtr->faultActive = false; } - do - { + do { Fault_Sleep(0x10); Fault_UpdatePadImpl(); } while (curInput->padPressed == 0); @@ -652,8 +619,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) #pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_LogStackTrace.s") -void Fault_ResumeThread(OSThread* t) -{ +void Fault_ResumeThread(OSThread* t) { t->context.cause = 0; t->context.fpcsr = 0; t->context.pc += 4; @@ -663,39 +629,39 @@ void Fault_ResumeThread(OSThread* t) osStartThread(t); } -void Fault_CommitFB() -{ +void Fault_CommitFB() { u16* fb; osViSetYScale(1.0f); osViSetMode(&osViModeNtscLan1); - osViSetSpecialFeatures(0x42); //gama_disable|dither_fliter_enable_aa_mode3_disable + osViSetSpecialFeatures(0x42); // gama_disable|dither_fliter_enable_aa_mode3_disable osViBlack(false); - if (sFaultStructPtr->fb) + if (sFaultStructPtr->fb) { fb = sFaultStructPtr->fb; - else - { + } else { fb = (u16*)osViGetNextFramebuffer(); - if ((u32)fb == 0x80000000) + if ((u32)fb == 0x80000000) { fb = (u16*)((osMemSize | 0x80000000) - 0x25800); + } } osViSwapBuffer(fb); FaultDrawer_SetDrawerFB(fb, 0x140, 0xf0); } -void Fault_ProcessClients(void) -{ +void Fault_ProcessClients(void) { FaultClient* iter = sFaultStructPtr->clients; s32 idx = 0; - while(iter) - { - if (iter->callback) - { + while (iter) { + if (iter->callback) { Fault_FillScreenBlack(); FaultDrawer_SetCharPad(-2, 0); - FaultDrawer_Printf("\x1a""8CallBack (%d) %08x %08x %08x\n""\x1a""7", idx++, iter, iter->param1, iter->param2); + FaultDrawer_Printf("\x1a" + "8CallBack (%d) %08x %08x %08x\n" + "\x1a" + "7", + idx++, iter, iter->param1, iter->param2); FaultDrawer_SetCharPad(0, 0); Fault_ProcessClient(iter->callback, iter->param1, iter->param2); Fault_WaitForInput(); @@ -705,45 +671,34 @@ void Fault_ProcessClients(void) } } -void Fault_UpdatePad() -{ +void Fault_UpdatePad() { Fault_UpdatePadImpl(); } #ifdef NON_MATCHING // saved register and stack usage differences -void Fault_ThreadEntry(void* arg) -{ +void Fault_ThreadEntry(void* arg) { OSThread* faultedThread; OSMesg msg; osSetEventMesg(OS_EVENT_CPU_BREAK, &sFaultStructPtr->queue, 1); osSetEventMesg(OS_EVENT_FAULT, &sFaultStructPtr->queue, 2); - while (true) - { - do - { + while (true) { + do { osRecvMesg(&sFaultStructPtr->queue, &msg, 1); - if (msg == (OSMesg)1) - { + if (msg == (OSMesg)1) { sFaultStructPtr->msgId = 1; osSyncPrintf("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n"); - } - else if (1 && msg == (OSMesg)2) - { + } else if (1 && msg == (OSMesg)2) { sFaultStructPtr->msgId = 2; osSyncPrintf("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n"); - } - else if (msg == (OSMesg)3) - { + } else if (msg == (OSMesg)3) { Fault_UpdatePad(); faultedThread = NULL; continue; - } - else - { + } else { sFaultStructPtr->msgId = 3; osSyncPrintf("フォルトマネージャ:不明なメッセージを受信しました\n"); } @@ -751,8 +706,7 @@ void Fault_ThreadEntry(void* arg) faultedThread = __osGetCurrFaultedThread(); osSyncPrintf("__osGetCurrFaultedThread()=%08x\n", faultedThread); - if (faultedThread == NULL) - { + if (faultedThread == NULL) { faultedThread = Fault_FindFaultedThread(); osSyncPrintf("FindFaultedThread()=%08x\n", faultedThread); } @@ -769,8 +723,7 @@ void Fault_ThreadEntry(void* arg) if (sFaultStructPtr->faultActive) Fault_Wait5Seconds(); - else - { + else { Fault_DrawCornerRec(0xF801); Fault_WaitForButtonCombo(); } @@ -779,8 +732,7 @@ void Fault_ThreadEntry(void* arg) FaultDrawer_SetForeColor(0xFFFF); FaultDrawer_SetBackColor(0); - do - { + do { Fault_PrintThreadContext(faultedThread); Fault_LogThreadContext(faultedThread); Fault_WaitForInput(); @@ -799,10 +751,7 @@ void Fault_ThreadEntry(void* arg) Fault_WaitForInput(); } while (!sFaultStructPtr->exitDebugger); - while (!sFaultStructPtr->exitDebugger) - { - - } + while (!sFaultStructPtr->exitDebugger) {} Fault_ResumeThread(faultedThread); } @@ -811,14 +760,12 @@ void Fault_ThreadEntry(void* arg) #pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_ThreadEntry.s") #endif -void Fault_SetFB(void* fb, u16 w, u16 h) -{ +void Fault_SetFB(void* fb, u16 w, u16 h) { sFaultStructPtr->fb = fb; FaultDrawer_SetDrawerFB(fb, w, h); } -void Fault_Start(void) -{ +void Fault_Start(void) { sFaultStructPtr = &gFaultStruct; bzero(sFaultStructPtr, sizeof(FaultThreadStruct)); FaultDrawer_SetDefault(); @@ -832,13 +779,12 @@ void Fault_Start(void) sFaultStructPtr->faultActive = false; gFaultStruct.faultHandlerEnabled = true; osCreateMesgQueue(&sFaultStructPtr->queue, &sFaultStructPtr->msg, 1); - StackCheck_Init(sFaultThreadInfo, &sFaultStack, sFaultStack+sizeof(sFaultStack), 0, 0x100, "fault"); + StackCheck_Init(sFaultThreadInfo, &sFaultStack, sFaultStack + sizeof(sFaultStack), 0, 0x100, "fault"); osCreateThread(&sFaultStructPtr->thread, 2, &Fault_ThreadEntry, 0, sFaultThreadInfo, 0x7f); osStartThread(&sFaultStructPtr->thread); } -void Fault_HangupFaultClient(const char* arg0, const char* arg1) -{ +void Fault_HangupFaultClient(const char* arg0, const char* arg1) { osSyncPrintf("HungUp on Thread %d\n", osGetThreadId(0)); osSyncPrintf("%s\n", arg0 ? arg0 : "(NULL)"); osSyncPrintf("%s\n", arg1 ? arg1 : "(NULL)"); @@ -847,16 +793,14 @@ void Fault_HangupFaultClient(const char* arg0, const char* arg1) FaultDrawer_Printf("%s\n", arg1 ? arg1 : "(NULL)"); } -void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1) -{ +void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1) { FaultClient client; char padd[4]; Fault_AddClient(&client, &Fault_HangupFaultClient, arg0, arg1); - *(u32*)0x11111111 = 0; //trigger an exception + *(u32*)0x11111111 = 0; // trigger an exception } -void Fault_AddHungupAndCrash(const char* filename, u32 line) -{ +void Fault_AddHungupAndCrash(const char* filename, u32 line) { char msg[256]; sprintf(msg, "HungUp %s:%d", filename, line); Fault_AddHungupAndCrashImpl(msg, NULL); diff --git a/src/code/fault_drawer.c b/src/code/fault_drawer.c index 82a7e83b05..8d85af18b3 100644 --- a/src/code/fault_drawer.c +++ b/src/code/fault_drawer.c @@ -2,77 +2,72 @@ #include #include -//rodata +// rodata const u32 sFaultDrawerFont[] = { - 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, - 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, - 0x08BFFB00, 0x0EFFFFC0, 0x0BF00FB0, 0x0FF00330, 0x0FF00FF0, 0x0FF00220, 0x0CFBBF60, 0x0FFCCE20, - 0x0DD44FF0, 0x0FF00220, 0x0FF00FF0, 0x0FF00330, 0x0CFBBF40, 0x0EF77740, 0x00000000, 0x00000000, - 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, - 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, - 0x08BFFB00, 0x000DE000, 0x0BF00FB0, 0x005DE600, 0x0FF00FF0, 0x055CC660, 0x0CFBBF60, 0x773FF377, - 0x0DD44FF0, 0xBB3FF3BB, 0x0FF00FF0, 0x099CCAA0, 0x0CFBBF40, 0x009DEA00, 0x00000000, 0x000DE000, - 0x04C22C40, 0x028D5020, 0x0CCAACC0, 0x21F91710, 0x04C22C40, 0x12493400, 0x00820800, 0x01975110, - 0x088A8880, 0x04615241, 0x00800800, 0x43117530, 0x00A20800, 0x60055600, 0x00000000, 0x04400040, - 0x00221100, 0x00000080, 0x000FB000, 0x00000880, 0x040DA400, 0x00008800, 0x08CDE880, 0x022AA220, - 0x08CDE880, 0x02AA2220, 0x040DA400, 0x0CD10000, 0x000FB000, 0x8C510000, 0x00221100, 0x81100000, - 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, - 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, - 0x00333300, 0x04489980, 0x033CC330, 0x00CD1088, 0x033CC330, 0x02BF62A8, 0x00333320, 0x01104C80, - 0x01100330, 0x0015C800, 0x033CC330, 0x02673220, 0x003FF300, 0x04409900, 0x00880000, 0x00000000, - 0x05DFFD10, 0x07FFFF60, 0x1CE00EC1, 0x0FF00990, 0x1EE11661, 0x0FF00110, 0x1EF45621, 0x0FF66710, - 0x1EF23661, 0x0FF08990, 0x1EF10FE1, 0x0FF00990, 0x16ECCE21, 0x07FBBB20, 0x01111110, 0x00000000, - 0x09B66FD0, 0x27D88E60, 0x0992ED10, 0x2FF02EE0, 0x099AE510, 0x2FF62EE0, 0x099B7510, 0x2FD64EE0, - 0x0DDAE510, 0x2FD04EE0, 0x0DD2ED10, 0x2FD00EE0, 0x09F66F90, 0x27D99F70, 0x00000000, 0x00000000, - 0x07FFFF00, 0x8F711FF0, 0x2FD00FF0, 0x8F711FF0, 0x2FD00770, 0x8E611EE0, 0x27DDDF60, 0x8E691EE0, - 0x27764AA0, 0x8EE99EE0, 0x2FD06E80, 0x8AE7FEA0, 0x07FA8E60, 0x88277A80, 0x00000000, 0x00000000, - 0x077CCFF0, 0x13266011, 0x077CCFF0, 0x03766510, 0x0239D720, 0x04533540, 0x002FF200, 0x01133110, - 0x005FB100, 0x00033000, 0x055EE550, 0x01133110, 0x055EEDD0, 0x02233000, 0x00088880, 0x8AABB888, - 0x00001100, 0x00044510, 0x04623320, 0x00440110, 0x04C89AA0, 0x00EEAB10, 0x0CE66720, 0x0EF55FB0, - 0x0EE00660, 0x0BF62B90, 0x0EE00660, 0x03FC8990, 0x04EEEEA0, 0x00773BB0, 0x00000000, 0x08888800, - 0x09900000, 0x00111000, 0x09922440, 0x00011000, 0x09908800, 0x26EFDE20, 0x099BB540, 0x2EC33CE2, - 0x0D9A2550, 0x2EC33CE2, 0x0DDAA550, 0x2EC33CE2, 0x09D6ED10, 0x26CBBC62, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00011000, 0x05FBFFE0, 0x8E6116E8, 0x0FF40330, 0x8F7117F8, - 0x07FC8B30, 0x8E6996E8, 0x05733BA0, 0x8A6DD6A8, 0x0DD88A20, 0x08A779B2, 0x01100220, 0x00000000, - 0x00000080, 0x8A011000, 0x00000800, 0x80A11000, 0x07744F70, 0x80A99000, 0x0231DF20, 0x84E60004, - 0x0027DA20, 0xC8AA4C40, 0x00573B20, 0x00A11800, 0x05546F50, 0x00A99800, 0x02222080, 0x02001888, + 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, + 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x0EFFFFC0, + 0x0BF00FB0, 0x0FF00330, 0x0FF00FF0, 0x0FF00220, 0x0CFBBF60, 0x0FFCCE20, 0x0DD44FF0, 0x0FF00220, 0x0FF00FF0, + 0x0FF00330, 0x0CFBBF40, 0x0EF77740, 0x00000000, 0x00000000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, + 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, + 0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x000DE000, 0x0BF00FB0, 0x005DE600, 0x0FF00FF0, 0x055CC660, + 0x0CFBBF60, 0x773FF377, 0x0DD44FF0, 0xBB3FF3BB, 0x0FF00FF0, 0x099CCAA0, 0x0CFBBF40, 0x009DEA00, 0x00000000, + 0x000DE000, 0x04C22C40, 0x028D5020, 0x0CCAACC0, 0x21F91710, 0x04C22C40, 0x12493400, 0x00820800, 0x01975110, + 0x088A8880, 0x04615241, 0x00800800, 0x43117530, 0x00A20800, 0x60055600, 0x00000000, 0x04400040, 0x00221100, + 0x00000080, 0x000FB000, 0x00000880, 0x040DA400, 0x00008800, 0x08CDE880, 0x022AA220, 0x08CDE880, 0x02AA2220, + 0x040DA400, 0x0CD10000, 0x000FB000, 0x8C510000, 0x00221100, 0x81100000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, + 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, + 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x00333300, 0x04489980, 0x033CC330, 0x00CD1088, 0x033CC330, + 0x02BF62A8, 0x00333320, 0x01104C80, 0x01100330, 0x0015C800, 0x033CC330, 0x02673220, 0x003FF300, 0x04409900, + 0x00880000, 0x00000000, 0x05DFFD10, 0x07FFFF60, 0x1CE00EC1, 0x0FF00990, 0x1EE11661, 0x0FF00110, 0x1EF45621, + 0x0FF66710, 0x1EF23661, 0x0FF08990, 0x1EF10FE1, 0x0FF00990, 0x16ECCE21, 0x07FBBB20, 0x01111110, 0x00000000, + 0x09B66FD0, 0x27D88E60, 0x0992ED10, 0x2FF02EE0, 0x099AE510, 0x2FF62EE0, 0x099B7510, 0x2FD64EE0, 0x0DDAE510, + 0x2FD04EE0, 0x0DD2ED10, 0x2FD00EE0, 0x09F66F90, 0x27D99F70, 0x00000000, 0x00000000, 0x07FFFF00, 0x8F711FF0, + 0x2FD00FF0, 0x8F711FF0, 0x2FD00770, 0x8E611EE0, 0x27DDDF60, 0x8E691EE0, 0x27764AA0, 0x8EE99EE0, 0x2FD06E80, + 0x8AE7FEA0, 0x07FA8E60, 0x88277A80, 0x00000000, 0x00000000, 0x077CCFF0, 0x13266011, 0x077CCFF0, 0x03766510, + 0x0239D720, 0x04533540, 0x002FF200, 0x01133110, 0x005FB100, 0x00033000, 0x055EE550, 0x01133110, 0x055EEDD0, + 0x02233000, 0x00088880, 0x8AABB888, 0x00001100, 0x00044510, 0x04623320, 0x00440110, 0x04C89AA0, 0x00EEAB10, + 0x0CE66720, 0x0EF55FB0, 0x0EE00660, 0x0BF62B90, 0x0EE00660, 0x03FC8990, 0x04EEEEA0, 0x00773BB0, 0x00000000, + 0x08888800, 0x09900000, 0x00111000, 0x09922440, 0x00011000, 0x09908800, 0x26EFDE20, 0x099BB540, 0x2EC33CE2, + 0x0D9A2550, 0x2EC33CE2, 0x0DDAA550, 0x2EC33CE2, 0x09D6ED10, 0x26CBBC62, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00011000, 0x05FBFFE0, 0x8E6116E8, 0x0FF40330, 0x8F7117F8, 0x07FC8B30, 0x8E6996E8, + 0x05733BA0, 0x8A6DD6A8, 0x0DD88A20, 0x08A779B2, 0x01100220, 0x00000000, 0x00000080, 0x8A011000, 0x00000800, + 0x80A11000, 0x07744F70, 0x80A99000, 0x0231DF20, 0x84E60004, 0x0027DA20, 0xC8AA4C40, 0x00573B20, 0x00A11800, + 0x05546F50, 0x00A99800, 0x02222080, 0x02001888, }; -//data -FaultDrawer sFaultDrawerDefault = -{ - (u16*)0x803DA800, //fb - 320, 240, //w, h - 16, 223, //yStart, yEnd - 22, 297,//xStart, xEnd - 0xFFFF, 0x0000, //foreColor, backColor - 22, 16, //cursorX, cursorY - sFaultDrawerFont, //font +// data +// clang-format off +FaultDrawer sFaultDrawerDefault = { + (u16*)0x803DA800, // fb + 320, 240, // w, h + 16, 223, // yStart, yEnd + 22, 297, // xStart, xEnd + 0xFFFF, 0x0000, // foreColor, backColor + 22, 16, // cursorX, cursorY + sFaultDrawerFont, // font 8, 8, 0, 0, - { //printColors + { // printColors 0x0001, 0xF801, 0x07C1, 0xFFC1, 0x003F, 0xF83F, 0x07FF, 0xFFFF, 0x7BDF, 0xB5AD }, - 0, //escCode - 0, //osSyncPrintfEnabled - NULL, //inputCallback + 0, // escCode + 0, // osSyncPrintfEnabled + NULL, // inputCallback }; +// clang-format on -//bss +// bss FaultDrawer sFaultDrawerStruct; char D_8016B6C0[0x20]; //? unused -void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) -{ +void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) { sFaultDrawerStruct.osSyncPrintfEnabled = enabled; } #ifdef NON_MATCHING -void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 color) -{ - if (sFaultDrawerStruct.w - xstart > 0 && sFaultDrawerStruct.h - ystart > 0) - { +void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 color) { + if (sFaultDrawerStruct.w - xstart > 0 && sFaultDrawerStruct.h - ystart > 0) { s32 x, y; for (y = 0; y <= yend - ystart; y++) @@ -88,8 +83,7 @@ void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 col #ifdef NON_MATCHING // regalloc and minor ordering differences -void FaultDrawer_DrawChar(char c) -{ +void FaultDrawer_DrawChar(char c) { s32 x, y; u32* dataPtr; u16* fb; @@ -102,14 +96,11 @@ void FaultDrawer_DrawChar(char c) if ((sFaultDrawerStruct.xStart <= sFaultDrawerStruct.cursorX) && ((sFaultDrawerStruct.charW + sFaultDrawerStruct.cursorX - 1) <= sFaultDrawerStruct.xEnd) && (sFaultDrawerStruct.yStart <= sFaultDrawerStruct.cursorY) && - ((sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY - 1) <= sFaultDrawerStruct.yEnd)) - { - for (y = 0; y < sFaultDrawerStruct.charH; y++) - { + ((sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY - 1) <= sFaultDrawerStruct.yEnd)) { + for (y = 0; y < sFaultDrawerStruct.charH; y++) { u32 mask = 0x10000000 << (c % 4); u32 data = *dataPtr; - for (x = 0; x < sFaultDrawerStruct.charW; x++) - { + for (x = 0; x < sFaultDrawerStruct.charW; x++) { if (mask & data) fb[x] = sFaultDrawerStruct.foreColor; else if (sFaultDrawerStruct.backColor & 1) @@ -125,93 +116,89 @@ void FaultDrawer_DrawChar(char c) #pragma GLOBAL_ASM("asm/non_matchings/code/fault_drawer/FaultDrawer_DrawChar.s") #endif -s32 FaultDrawer_ColorToPrintColor(u16 color) -{ +s32 FaultDrawer_ColorToPrintColor(u16 color) { s32 i; - for (i = 0; i < 10; i++) - if (color == sFaultDrawerStruct.printColors[i]) + for (i = 0; i < 10; i++) { + if (color == sFaultDrawerStruct.printColors[i]) { return i; + } + } return -1; } -void FaultDrawer_UpdatePrintColor() -{ +void FaultDrawer_UpdatePrintColor() { s32 idx; - if (sFaultDrawerStruct.osSyncPrintfEnabled) - { + if (sFaultDrawerStruct.osSyncPrintfEnabled) { osSyncPrintf(VT_RST); idx = FaultDrawer_ColorToPrintColor(sFaultDrawerStruct.foreColor); - if (idx >= 0 && idx < 8) + if (idx >= 0 && idx < 8) { osSyncPrintf(VT_SGR("3%d"), idx); + } idx = FaultDrawer_ColorToPrintColor(sFaultDrawerStruct.backColor); - if (idx >= 0 && idx < 8) + if (idx >= 0 && idx < 8) { osSyncPrintf(VT_SGR("4%d"), idx); + } } } -void FaultDrawer_SetForeColor(u16 color) -{ +void FaultDrawer_SetForeColor(u16 color) { sFaultDrawerStruct.foreColor = color; FaultDrawer_UpdatePrintColor(); } -void FaultDrawer_SetBackColor(u16 color) -{ +void FaultDrawer_SetBackColor(u16 color) { sFaultDrawerStruct.backColor = color; FaultDrawer_UpdatePrintColor(); } -void FaultDrawer_SetFontColor(u16 color) -{ - FaultDrawer_SetForeColor((u16)(color | 1)); //force alpha to be set +void FaultDrawer_SetFontColor(u16 color) { + FaultDrawer_SetForeColor((u16)(color | 1)); // force alpha to be set } -void FaultDrawer_SetCharPad(s8 padW, s8 padH) -{ +void FaultDrawer_SetCharPad(s8 padW, s8 padH) { sFaultDrawerStruct.charWPad = padW; sFaultDrawerStruct.charHPad = padH; } -void FaultDrawer_SetCursor(s32 x, s32 y) -{ - if (sFaultDrawerStruct.osSyncPrintfEnabled) - osSyncPrintf(VT_CUP("%d", "%d"), (y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad), (x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad)); +void FaultDrawer_SetCursor(s32 x, s32 y) { + if (sFaultDrawerStruct.osSyncPrintfEnabled) { + osSyncPrintf(VT_CUP("%d", "%d"), + (y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad), + (x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad)); + } sFaultDrawerStruct.cursorX = x; sFaultDrawerStruct.cursorY = y; } -void FaultDrawer_FillScreen() -{ - if (sFaultDrawerStruct.osSyncPrintfEnabled) +void FaultDrawer_FillScreen() { + if (sFaultDrawerStruct.osSyncPrintfEnabled) { osSyncPrintf(VT_CLS); + } - FaultDrawer_DrawRecImpl(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart, sFaultDrawerStruct.xEnd, sFaultDrawerStruct.yEnd, sFaultDrawerStruct.backColor | 1); + FaultDrawer_DrawRecImpl(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart, sFaultDrawerStruct.xEnd, + sFaultDrawerStruct.yEnd, sFaultDrawerStruct.backColor | 1); FaultDrawer_SetCursor(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart); } -u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count) -{ - for (count; count != 0; count--, str++) - { +u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count) { + for (count; count != 0; count--, str++) { s32 curXStart; s32 curXEnd; - if (sFaultDrawerStruct.escCode) - { + if (sFaultDrawerStruct.escCode) { sFaultDrawerStruct.escCode = false; - if (*str > 0x30 && *str < 0x3A) + if (*str > 0x30 && *str < 0x3A) { FaultDrawer_SetForeColor(sFaultDrawerStruct.printColors[*str - 0x30]); + } curXStart = sFaultDrawerStruct.cursorX; curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW; - } - else - { - switch (*str) - { + } else { + switch (*str) { case '\n': - if (sFaultDrawerStruct.osSyncPrintfEnabled) + if (sFaultDrawerStruct.osSyncPrintfEnabled) { osSyncPrintf("\n"); + } sFaultDrawerStruct.cursorX = sFaultDrawerStruct.w; curXStart = sFaultDrawerStruct.cursorX; @@ -223,8 +210,9 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count) curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW; break; default: - if (sFaultDrawerStruct.osSyncPrintfEnabled) + if (sFaultDrawerStruct.osSyncPrintfEnabled) { osSyncPrintf("%c", *str); + } FaultDrawer_DrawChar(*str); sFaultDrawerStruct.cursorX += sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad; @@ -234,14 +222,11 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count) } } - if (curXEnd <= curXStart) - { + if (curXEnd <= curXStart) { sFaultDrawerStruct.cursorX = sFaultDrawerStruct.xStart; sFaultDrawerStruct.cursorY += sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad; - if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= sFaultDrawerStruct.cursorY) - { - if (sFaultDrawerStruct.inputCallback) - { + if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= sFaultDrawerStruct.cursorY) { + if (sFaultDrawerStruct.inputCallback) { sFaultDrawerStruct.inputCallback(); FaultDrawer_FillScreen(); } @@ -255,21 +240,18 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count) return arg0; } -void FaultDrawer_VPrintf(const char* str, char* args) //va_list -{ +void FaultDrawer_VPrintf(const char* str, char* args) { // va_list _Printf(&FaultDrawer_FormatStringFunc, &sFaultDrawerStruct, str, args); } -void FaultDrawer_Printf(const char* fmt, ...) -{ +void FaultDrawer_Printf(const char* fmt, ...) { va_list args; va_start(args, fmt); FaultDrawer_VPrintf(fmt, args); } -void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) -{ +void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) { va_list args; va_start(args, fmt); @@ -277,25 +259,21 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) FaultDrawer_VPrintf(fmt, args); } -void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) -{ +void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) { sFaultDrawerStruct.fb = (u16*)fb; sFaultDrawerStruct.w = w; sFaultDrawerStruct.h = h; } -void FaultDrawer_SetInputCallback(void(*callback)()) -{ +void FaultDrawer_SetInputCallback(void (*callback)()) { sFaultDrawerStruct.inputCallback = callback; } -void FaultDrawer_WritebackFBDCache() -{ - osWritebackDCache(sFaultDrawerStruct.fb, sFaultDrawerStruct.w*sFaultDrawerStruct.h*2); +void FaultDrawer_WritebackFBDCache() { + osWritebackDCache(sFaultDrawerStruct.fb, sFaultDrawerStruct.w * sFaultDrawerStruct.h * 2); } -void FaultDrawer_SetDefault() -{ +void FaultDrawer_SetDefault() { bcopy(&sFaultDrawerDefault, &sFaultDrawerStruct, sizeof(FaultDrawer)); sFaultDrawerStruct.fb = (u16*)((osMemSize | 0x80000000) - 0x25800); } diff --git a/src/code/gamealloc.c b/src/code/gamealloc.c index 87a32db16b..9ec6886b2f 100644 --- a/src/code/gamealloc.c +++ b/src/code/gamealloc.c @@ -1,26 +1,22 @@ #include -void GameAlloc_Log(GameAlloc* this) -{ +void GameAlloc_Log(GameAlloc* this) { GameAllocEntry* iter; osSyncPrintf("this = %08x\n", this); iter = this->base.next; - while (iter != &this->base) - { + while (iter != &this->base) { osSyncPrintf("ptr = %08x size = %d\n", iter, iter->size); iter = iter->next; } } -void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line) -{ +void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line) { GameAllocEntry* ptr; - ptr = SystemArena_MallocDebug(size+sizeof(GameAllocEntry), file, line); - if (ptr) - { + ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line); + if (ptr) { ptr->size = size; ptr->prev = this->head; this->head->next = ptr; @@ -28,18 +24,16 @@ void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 lin ptr->next = &this->base; this->base.prev = this->head; return ptr + 1; - } - else + } else { return NULL; + } } -void* GameAlloc_Malloc(GameAlloc* this, u32 size) -{ +void* GameAlloc_Malloc(GameAlloc* this, u32 size) { GameAllocEntry* ptr; - ptr = SystemArena_MallocDebug(size+sizeof(GameAllocEntry), "../gamealloc.c", 93); - if (ptr) - { + ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), "../gamealloc.c", 93); + if (ptr) { ptr->size = size; ptr->prev = this->head; this->head->next = ptr; @@ -47,17 +41,15 @@ void* GameAlloc_Malloc(GameAlloc* this, u32 size) ptr->next = &this->base; this->base.prev = this->head; return ptr + 1; - } - else + } else { return NULL; + } } -void GameAlloc_Free(GameAlloc* this, void* data) -{ +void GameAlloc_Free(GameAlloc* this, void* data) { GameAllocEntry* ptr; - if (data) - { + if (data) { ptr = &((GameAllocEntry*)data)[-1]; LogUtils_CheckNullPointer("ptr->prev", ptr->prev, "../gamealloc.c", 120); LogUtils_CheckNullPointer("ptr->next", ptr->next, "../gamealloc.c", 121); @@ -68,14 +60,12 @@ void GameAlloc_Free(GameAlloc* this, void* data) } } -void GameAlloc_Cleanup(GameAlloc* this) -{ +void GameAlloc_Cleanup(GameAlloc* this) { GameAllocEntry* next; GameAllocEntry* cur; next = this->base.next; - while (&this->base != next) - { + while (&this->base != next) { cur = next; next = next->next; SystemArena_FreeDebug(cur, "../gamealloc.c", 145); @@ -84,11 +74,9 @@ void GameAlloc_Cleanup(GameAlloc* this) this->head = &this->base; this->base.next = &this->base; this->base.prev = &this->base; - } -void GameAlloc_Init(GameAlloc* this) -{ +void GameAlloc_Init(GameAlloc* this) { this->head = &this->base; this->base.next = &this->base; this->base.prev = &this->base; diff --git a/src/code/gfxprint.c b/src/code/gfxprint.c index 340d4702a7..fbcca3cee5 100644 --- a/src/code/gfxprint.c +++ b/src/code/gfxprint.c @@ -1,188 +1,196 @@ #include #include -//.bss +// .bss u8 D_801755F0; -//.data -u16 sGfxPrintFontTLUT[64] = -{ - 0x0000, 0xFFFF, 0x0000, 0xFFFF, - 0x0000, 0xFFFF, 0x0000, 0xFFFF, - 0x0000, 0xFFFF, 0x0000, 0xFFFF, - 0x0000, 0xFFFF, 0x0000, 0xFFFF, - 0x0000, 0x0000, 0xFFFF, 0xFFFF, - 0x0000, 0x0000, 0xFFFF, 0xFFFF, - 0x0000, 0x0000, 0xFFFF, 0xFFFF, - 0x0000, 0x0000, 0xFFFF, 0xFFFF, - 0x0000, 0x0000, 0x0000, 0x0000, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - 0x0000, 0x0000, 0x0000, 0x0000, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, +// .data +u16 sGfxPrintFontTLUT[64] = { + 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, + 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, + 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, }; -u16 sGfxPrintUnkTLUT[16] = -{ - 0xF801, 0xFBC1, 0xFFC1, 0x07C1, - 0x0421, 0x003F, 0x803F, 0xF83F, - 0xF801, 0xFBC1, 0xFFC1, 0x07C1, - 0x0421, 0x003F, 0x803F, 0xF83F, +u16 sGfxPrintUnkTLUT[16] = { + 0xF801, 0xFBC1, 0xFFC1, 0x07C1, 0x0421, 0x003F, 0x803F, 0xF83F, + 0xF801, 0xFBC1, 0xFFC1, 0x07C1, 0x0421, 0x003F, 0x803F, 0xF83F, }; u8 sGfxPrintUnkData[8] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }; -u8 sGfxPrintFontData[(16*256)/2] = -{ - 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, - 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0xBF, 0xFB, 0x00, 0x0E, 0xFF, 0xFF, 0xC0, 0x0B, 0xF0, 0x0F, 0xB0, 0x0F, 0xF0, 0x03, 0x30, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0C, 0xFB, 0xBF, 0x60, 0x0F, 0xFC, 0xCE, 0x20, - 0x0D, 0xD4, 0x4F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x03, 0x30, 0x0C, 0xFB, 0xBF, 0x40, 0x0E, 0xF7, 0x77, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, - 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0xBF, 0xFB, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x0B, 0xF0, 0x0F, 0xB0, 0x00, 0x5D, 0xE6, 0x00, 0x0F, 0xF0, 0x0F, 0xF0, 0x05, 0x5C, 0xC6, 0x60, 0x0C, 0xFB, 0xBF, 0x60, 0x77, 0x3F, 0xF3, 0x77, - 0x0D, 0xD4, 0x4F, 0xF0, 0xBB, 0x3F, 0xF3, 0xBB, 0x0F, 0xF0, 0x0F, 0xF0, 0x09, 0x9C, 0xCA, 0xA0, 0x0C, 0xFB, 0xBF, 0x40, 0x00, 0x9D, 0xEA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xE0, 0x00, - 0x04, 0xC2, 0x2C, 0x40, 0x02, 0x8D, 0x50, 0x20, 0x0C, 0xCA, 0xAC, 0xC0, 0x21, 0xF9, 0x17, 0x10, 0x04, 0xC2, 0x2C, 0x40, 0x12, 0x49, 0x34, 0x00, 0x00, 0x82, 0x08, 0x00, 0x01, 0x97, 0x51, 0x10, - 0x08, 0x8A, 0x88, 0x80, 0x04, 0x61, 0x52, 0x41, 0x00, 0x80, 0x08, 0x00, 0x43, 0x11, 0x75, 0x30, 0x00, 0xA2, 0x08, 0x00, 0x60, 0x05, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x40, - 0x00, 0x22, 0x11, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0F, 0xB0, 0x00, 0x00, 0x00, 0x08, 0x80, 0x04, 0x0D, 0xA4, 0x00, 0x00, 0x00, 0x88, 0x00, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0x2A, 0xA2, 0x20, - 0x08, 0xCD, 0xE8, 0x80, 0x02, 0xAA, 0x22, 0x20, 0x04, 0x0D, 0xA4, 0x00, 0x0C, 0xD1, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0x00, 0x8C, 0x51, 0x00, 0x00, 0x00, 0x22, 0x11, 0x00, 0x81, 0x10, 0x00, 0x00, - 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, - 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x33, 0x33, 0x00, 0x04, 0x48, 0x99, 0x80, 0x03, 0x3C, 0xC3, 0x30, 0x00, 0xCD, 0x10, 0x88, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0xBF, 0x62, 0xA8, 0x00, 0x33, 0x33, 0x20, 0x01, 0x10, 0x4C, 0x80, - 0x01, 0x10, 0x03, 0x30, 0x00, 0x15, 0xC8, 0x00, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0x67, 0x32, 0x20, 0x00, 0x3F, 0xF3, 0x00, 0x04, 0x40, 0x99, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0xDF, 0xFD, 0x10, 0x07, 0xFF, 0xFF, 0x60, 0x1C, 0xE0, 0x0E, 0xC1, 0x0F, 0xF0, 0x09, 0x90, 0x1E, 0xE1, 0x16, 0x61, 0x0F, 0xF0, 0x01, 0x10, 0x1E, 0xF4, 0x56, 0x21, 0x0F, 0xF6, 0x67, 0x10, - 0x1E, 0xF2, 0x36, 0x61, 0x0F, 0xF0, 0x89, 0x90, 0x1E, 0xF1, 0x0F, 0xE1, 0x0F, 0xF0, 0x09, 0x90, 0x16, 0xEC, 0xCE, 0x21, 0x07, 0xFB, 0xBB, 0x20, 0x01, 0x11, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x09, 0xB6, 0x6F, 0xD0, 0x27, 0xD8, 0x8E, 0x60, 0x09, 0x92, 0xED, 0x10, 0x2F, 0xF0, 0x2E, 0xE0, 0x09, 0x9A, 0xE5, 0x10, 0x2F, 0xF6, 0x2E, 0xE0, 0x09, 0x9B, 0x75, 0x10, 0x2F, 0xD6, 0x4E, 0xE0, - 0x0D, 0xDA, 0xE5, 0x10, 0x2F, 0xD0, 0x4E, 0xE0, 0x0D, 0xD2, 0xED, 0x10, 0x2F, 0xD0, 0x0E, 0xE0, 0x09, 0xF6, 0x6F, 0x90, 0x27, 0xD9, 0x9F, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x07, 0xFF, 0xFF, 0x00, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x0F, 0xF0, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x07, 0x70, 0x8E, 0x61, 0x1E, 0xE0, 0x27, 0xDD, 0xDF, 0x60, 0x8E, 0x69, 0x1E, 0xE0, - 0x27, 0x76, 0x4A, 0xA0, 0x8E, 0xE9, 0x9E, 0xE0, 0x2F, 0xD0, 0x6E, 0x80, 0x8A, 0xE7, 0xFE, 0xA0, 0x07, 0xFA, 0x8E, 0x60, 0x88, 0x27, 0x7A, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x07, 0x7C, 0xCF, 0xF0, 0x13, 0x26, 0x60, 0x11, 0x07, 0x7C, 0xCF, 0xF0, 0x03, 0x76, 0x65, 0x10, 0x02, 0x39, 0xD7, 0x20, 0x04, 0x53, 0x35, 0x40, 0x00, 0x2F, 0xF2, 0x00, 0x01, 0x13, 0x31, 0x10, - 0x00, 0x5F, 0xB1, 0x00, 0x00, 0x03, 0x30, 0x00, 0x05, 0x5E, 0xE5, 0x50, 0x01, 0x13, 0x31, 0x10, 0x05, 0x5E, 0xED, 0xD0, 0x02, 0x23, 0x30, 0x00, 0x00, 0x08, 0x88, 0x80, 0x8A, 0xAB, 0xB8, 0x88, - 0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x45, 0x10, 0x04, 0x62, 0x33, 0x20, 0x00, 0x44, 0x01, 0x10, 0x04, 0xC8, 0x9A, 0xA0, 0x00, 0xEE, 0xAB, 0x10, 0x0C, 0xE6, 0x67, 0x20, 0x0E, 0xF5, 0x5F, 0xB0, - 0x0E, 0xE0, 0x06, 0x60, 0x0B, 0xF6, 0x2B, 0x90, 0x0E, 0xE0, 0x06, 0x60, 0x03, 0xFC, 0x89, 0x90, 0x04, 0xEE, 0xEE, 0xA0, 0x00, 0x77, 0x3B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x88, 0x00, - 0x09, 0x90, 0x00, 0x00, 0x00, 0x11, 0x10, 0x00, 0x09, 0x92, 0x24, 0x40, 0x00, 0x01, 0x10, 0x00, 0x09, 0x90, 0x88, 0x00, 0x26, 0xEF, 0xDE, 0x20, 0x09, 0x9B, 0xB5, 0x40, 0x2E, 0xC3, 0x3C, 0xE2, - 0x0D, 0x9A, 0x25, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0xDA, 0xA5, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x09, 0xD6, 0xED, 0x10, 0x26, 0xCB, 0xBC, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x05, 0xFB, 0xFF, 0xE0, 0x8E, 0x61, 0x16, 0xE8, 0x0F, 0xF4, 0x03, 0x30, 0x8F, 0x71, 0x17, 0xF8, - 0x07, 0xFC, 0x8B, 0x30, 0x8E, 0x69, 0x96, 0xE8, 0x05, 0x73, 0x3B, 0xA0, 0x8A, 0x6D, 0xD6, 0xA8, 0x0D, 0xD8, 0x8A, 0x20, 0x08, 0xA7, 0x79, 0xB2, 0x01, 0x10, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x8A, 0x01, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x80, 0xA1, 0x10, 0x00, 0x07, 0x74, 0x4F, 0x70, 0x80, 0xA9, 0x90, 0x00, 0x02, 0x31, 0xDF, 0x20, 0x84, 0xE6, 0x00, 0x04, - 0x00, 0x27, 0xDA, 0x20, 0xC8, 0xAA, 0x4C, 0x40, 0x00, 0x57, 0x3B, 0x20, 0x00, 0xA1, 0x18, 0x00, 0x05, 0x54, 0x6F, 0x50, 0x00, 0xA9, 0x98, 0x00, 0x02, 0x22, 0x20, 0x80, 0x02, 0x00, 0x18, 0x88, - 0x00, 0x04, 0x44, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x0C, 0x44, 0x44, 0x00, 0x00, 0x04, 0x40, 0x00, 0x88, 0xC0, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x0C, 0x46, 0xA4, 0x40, - 0x00, 0x0C, 0xC0, 0x00, 0x08, 0x8E, 0xE0, 0x00, 0x02, 0x08, 0x80, 0x00, 0x80, 0xD0, 0x88, 0x00, 0x28, 0xA8, 0x80, 0x00, 0x88, 0xCD, 0x4C, 0x40, 0x0A, 0x88, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xE0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x00, 0x80, 0x01, 0x06, 0x10, 0x00, 0x56, 0xE7, 0x50, 0x80, 0x02, 0x1F, 0xF1, 0x00, - 0x38, 0x8C, 0xB8, 0x00, 0x0B, 0xF6, 0x0B, 0x00, 0x94, 0xC0, 0x28, 0x00, 0x06, 0x07, 0x6A, 0x00, 0xCB, 0xA6, 0xC8, 0x00, 0x00, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0A, 0x80, 0x00, 0x00, 0x39, 0x14, 0x20, 0x02, 0x22, 0x24, 0x00, 0x08, 0xAE, 0xA8, 0x60, 0x04, 0x28, 0x99, 0x70, 0x07, 0x75, 0xD1, 0x04, 0x0F, 0xB3, 0x33, 0xD0, 0x00, 0xAE, 0xBE, 0xA4, - 0x25, 0x15, 0x20, 0xA0, 0x02, 0x61, 0x0C, 0x02, 0x20, 0x42, 0x08, 0x20, 0x2C, 0x30, 0x14, 0x02, 0x02, 0x28, 0x82, 0x00, 0x03, 0xAC, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x12, 0x00, 0x08, 0x00, 0x28, 0x00, 0x0A, 0xCF, 0xEE, 0x20, 0x0B, 0x62, 0x2E, 0x20, 0x02, 0x10, 0x82, 0x40, 0x01, 0x44, 0xE4, 0x40, 0x03, 0x00, 0x0E, 0x00, 0x8D, 0xEA, 0xAC, 0x00, - 0x02, 0x10, 0x0A, 0x00, 0x01, 0xE0, 0x24, 0x00, 0x0C, 0x21, 0x02, 0x00, 0x09, 0x42, 0x21, 0x00, 0x00, 0xCC, 0xF4, 0x40, 0x02, 0xBF, 0xD4, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x0C, 0xCC, 0xC4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x02, 0xA0, 0x40, - 0x00, 0x0C, 0xC0, 0x00, 0x04, 0xCE, 0x64, 0x40, 0x02, 0x08, 0x80, 0x00, 0x00, 0x90, 0x00, 0x40, 0x28, 0xA8, 0x80, 0x00, 0x08, 0x01, 0x04, 0x00, 0x0A, 0x88, 0x80, 0x00, 0x04, 0x44, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x54, 0x44, 0x00, 0xEE, 0xFE, 0xE0, 0x00, 0x09, 0x3B, 0x3F, 0x00, - 0x21, 0xD8, 0x20, 0x00, 0x00, 0x54, 0x4F, 0x00, 0x18, 0x58, 0x20, 0x00, 0x00, 0x01, 0x86, 0x00, 0xC6, 0x7E, 0x40, 0x00, 0x00, 0xEF, 0x66, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x80, 0x04, 0x00, 0x00, 0xC0, 0x20, 0x00, 0xAA, 0xAA, 0xEA, 0x20, 0xEF, 0xFF, 0xFF, 0x00, 0x80, 0x44, 0x19, 0x30, 0x00, 0x49, 0x24, 0x00, 0xC5, 0x35, 0x1B, 0x10, 0x00, 0x4B, 0x24, 0x00, - 0x01, 0x35, 0xA0, 0x00, 0x8C, 0xA9, 0xAC, 0x80, 0x00, 0x2C, 0x00, 0x00, 0x04, 0x21, 0xA4, 0x00, 0x2A, 0x84, 0x00, 0x00, 0x73, 0x11, 0xF1, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0B, 0x11, 0x19, 0x00, 0x00, 0x40, 0x00, 0x00, 0x8F, 0xEE, 0xEF, 0xE0, 0x0B, 0x76, 0x66, 0xD0, 0x1A, 0x00, 0x0B, 0x40, 0x4C, 0x40, 0x02, 0xD0, 0x28, 0x00, 0x1A, 0x40, 0x01, 0xD0, 0x2C, 0x10, - 0x00, 0x00, 0x38, 0x40, 0x00, 0x40, 0x28, 0x10, 0x00, 0x01, 0xA0, 0x40, 0x00, 0x42, 0x83, 0x00, 0x05, 0xFE, 0x44, 0x40, 0x03, 0xFD, 0x54, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x09, 0x99, 0x9B, 0x00, 0x00, 0x10, 0x20, 0x00, 0x07, 0x26, 0x21, 0x40, 0x2A, 0xFE, 0xEE, 0xA0, 0x8D, 0x8C, 0xA9, 0xC0, 0x00, 0x10, 0x20, 0x80, 0x32, 0x33, 0xB3, 0x60, 0x00, 0x19, 0x28, 0x00, - 0x00, 0x00, 0xA1, 0x40, 0x00, 0x10, 0xB1, 0x00, 0x00, 0x08, 0x34, 0x00, 0x00, 0x1A, 0x08, 0x00, 0x05, 0xF7, 0x40, 0x00, 0x8E, 0xF4, 0x44, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x14, 0x02, 0x80, 0x00, 0x04, 0x00, 0x00, 0x1D, 0x11, 0xDB, 0x00, 0xDD, 0xFD, 0xDD, 0xD0, 0x0C, 0x88, 0x07, 0x00, 0x02, 0x06, 0x00, 0x90, 0x48, 0x00, 0x34, 0x00, 0x2C, 0x04, 0x2C, 0x10, - 0x48, 0x11, 0x21, 0x40, 0x04, 0x84, 0x83, 0x40, 0x59, 0x03, 0x00, 0x50, 0x40, 0x0C, 0x10, 0x60, 0x42, 0xA9, 0x88, 0xC0, 0x40, 0x15, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x11, 0x02, 0x00, 0x40, 0x08, 0x98, 0x88, 0x80, 0x08, 0xF9, 0x98, 0xC0, 0x06, 0x77, 0x75, 0x50, 0x02, 0x0C, 0x05, 0x00, 0x19, 0x98, 0xA8, 0xD0, 0x0B, 0x99, 0xCA, 0x80, 0x04, 0x54, 0x65, 0xC0, - 0x20, 0x08, 0x50, 0x20, 0x00, 0x10, 0x20, 0xC0, 0x31, 0x1C, 0x04, 0x20, 0x00, 0x01, 0x28, 0x40, 0x26, 0x63, 0xBB, 0xE0, 0x26, 0xEF, 0xE6, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0x01, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0F, 0x8A, 0x89, 0x80, 0xC3, 0xF3, 0x11, 0x30, 0x0F, 0x02, 0x01, 0x80, 0xC9, 0xC0, 0x00, 0x30, 0x0F, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30, - 0x0E, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x02, 0x52, 0x80, 0x00, 0x00, 0x03, 0x00, 0x2C, 0xDF, 0xA8, 0x80, 0x02, 0x33, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x88, 0x00, 0x01, 0x02, 0x80, 0x00, 0x03, 0xFF, 0xF7, 0x00, 0x0F, 0x26, 0xE4, 0x72, 0xCC, 0x38, 0x00, 0x40, 0x0C, 0x38, 0x99, 0x00, 0x03, 0x0A, 0x31, 0x50, 0x0C, 0xB1, 0x82, 0x80, - 0x03, 0x28, 0x06, 0x00, 0x87, 0x88, 0x2A, 0xA0, 0x01, 0x05, 0xC2, 0x00, 0x85, 0x82, 0xC2, 0x80, 0x10, 0x00, 0x39, 0x10, 0x08, 0x51, 0xBF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x80, 0x04, 0x00, 0x48, 0x9D, 0xCC, 0x40, 0xC9, 0xE6, 0x7F, 0x40, 0x40, 0x00, 0x94, 0x00, 0x5B, 0x21, 0x0C, 0xB0, 0x48, 0xAE, 0xCC, 0x40, 0xE1, 0x30, 0x0C, 0x30, 0x43, 0x01, 0xA4, 0x00, - 0xE1, 0x24, 0x5D, 0x30, 0x78, 0x8C, 0xD6, 0x10, 0xF1, 0x60, 0x94, 0x70, 0xD0, 0x40, 0x9C, 0x70, 0x0B, 0x8C, 0x53, 0x00, 0x0C, 0x9D, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x39, 0x50, 0x00, 0x00, 0x88, 0xF0, 0x00, 0x2E, 0xAF, 0xC6, 0x00, 0x03, 0x01, 0x77, 0x60, 0x04, 0xF0, 0x41, 0x60, 0x03, 0x92, 0xF8, 0x12, 0x0F, 0xBD, 0x91, 0x40, 0x1B, 0x28, 0x60, 0x92, - 0x70, 0xF4, 0x01, 0xF0, 0x0A, 0xD4, 0x65, 0x82, 0x53, 0xE0, 0x01, 0xE0, 0x04, 0x10, 0x68, 0x60, 0x04, 0x2A, 0xBE, 0x00, 0x00, 0x4F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x3A, 0xEE, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0D, 0x84, 0xA5, 0x00, 0xC1, 0xC2, 0x11, 0x00, 0x45, 0x0E, 0x27, 0x00, 0xD9, 0xC3, 0x00, 0x10, 0x07, 0xF8, 0x8D, 0x20, 0x01, 0x30, 0x00, 0x10, - 0xAC, 0x02, 0x25, 0xA0, 0x01, 0x22, 0x00, 0x10, 0x44, 0x20, 0x16, 0xA0, 0x13, 0x02, 0x00, 0x30, 0x04, 0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +u8 sGfxPrintFontData[(16 * 256) / 2] = { + 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, + 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, + 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xBF, 0xFB, 0x00, 0x0E, 0xFF, 0xFF, 0xC0, 0x0B, 0xF0, 0x0F, 0xB0, + 0x0F, 0xF0, 0x03, 0x30, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0C, 0xFB, 0xBF, 0x60, 0x0F, 0xFC, 0xCE, + 0x20, 0x0D, 0xD4, 0x4F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x03, 0x30, 0x0C, 0xFB, + 0xBF, 0x40, 0x0E, 0xF7, 0x77, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDF, 0xFD, 0x00, 0x0A, + 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, + 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, + 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0xBF, 0xFB, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x0B, 0xF0, 0x0F, 0xB0, 0x00, 0x5D, 0xE6, 0x00, 0x0F, + 0xF0, 0x0F, 0xF0, 0x05, 0x5C, 0xC6, 0x60, 0x0C, 0xFB, 0xBF, 0x60, 0x77, 0x3F, 0xF3, 0x77, 0x0D, 0xD4, 0x4F, 0xF0, + 0xBB, 0x3F, 0xF3, 0xBB, 0x0F, 0xF0, 0x0F, 0xF0, 0x09, 0x9C, 0xCA, 0xA0, 0x0C, 0xFB, 0xBF, 0x40, 0x00, 0x9D, 0xEA, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x04, 0xC2, 0x2C, 0x40, 0x02, 0x8D, 0x50, 0x20, 0x0C, 0xCA, + 0xAC, 0xC0, 0x21, 0xF9, 0x17, 0x10, 0x04, 0xC2, 0x2C, 0x40, 0x12, 0x49, 0x34, 0x00, 0x00, 0x82, 0x08, 0x00, 0x01, + 0x97, 0x51, 0x10, 0x08, 0x8A, 0x88, 0x80, 0x04, 0x61, 0x52, 0x41, 0x00, 0x80, 0x08, 0x00, 0x43, 0x11, 0x75, 0x30, + 0x00, 0xA2, 0x08, 0x00, 0x60, 0x05, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x40, 0x00, 0x22, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0F, 0xB0, 0x00, 0x00, 0x00, 0x08, 0x80, 0x04, 0x0D, 0xA4, 0x00, 0x00, 0x00, + 0x88, 0x00, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0x2A, 0xA2, 0x20, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0xAA, 0x22, 0x20, 0x04, + 0x0D, 0xA4, 0x00, 0x0C, 0xD1, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0x00, 0x8C, 0x51, 0x00, 0x00, 0x00, 0x22, 0x11, 0x00, + 0x81, 0x10, 0x00, 0x00, 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, + 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56, + 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, + 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x00, 0x04, 0x48, 0x99, 0x80, + 0x03, 0x3C, 0xC3, 0x30, 0x00, 0xCD, 0x10, 0x88, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0xBF, 0x62, 0xA8, 0x00, 0x33, 0x33, + 0x20, 0x01, 0x10, 0x4C, 0x80, 0x01, 0x10, 0x03, 0x30, 0x00, 0x15, 0xC8, 0x00, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0x67, + 0x32, 0x20, 0x00, 0x3F, 0xF3, 0x00, 0x04, 0x40, 0x99, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, + 0xDF, 0xFD, 0x10, 0x07, 0xFF, 0xFF, 0x60, 0x1C, 0xE0, 0x0E, 0xC1, 0x0F, 0xF0, 0x09, 0x90, 0x1E, 0xE1, 0x16, 0x61, + 0x0F, 0xF0, 0x01, 0x10, 0x1E, 0xF4, 0x56, 0x21, 0x0F, 0xF6, 0x67, 0x10, 0x1E, 0xF2, 0x36, 0x61, 0x0F, 0xF0, 0x89, + 0x90, 0x1E, 0xF1, 0x0F, 0xE1, 0x0F, 0xF0, 0x09, 0x90, 0x16, 0xEC, 0xCE, 0x21, 0x07, 0xFB, 0xBB, 0x20, 0x01, 0x11, + 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x09, 0xB6, 0x6F, 0xD0, 0x27, 0xD8, 0x8E, 0x60, 0x09, 0x92, 0xED, 0x10, 0x2F, + 0xF0, 0x2E, 0xE0, 0x09, 0x9A, 0xE5, 0x10, 0x2F, 0xF6, 0x2E, 0xE0, 0x09, 0x9B, 0x75, 0x10, 0x2F, 0xD6, 0x4E, 0xE0, + 0x0D, 0xDA, 0xE5, 0x10, 0x2F, 0xD0, 0x4E, 0xE0, 0x0D, 0xD2, 0xED, 0x10, 0x2F, 0xD0, 0x0E, 0xE0, 0x09, 0xF6, 0x6F, + 0x90, 0x27, 0xD9, 0x9F, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x00, 0x8F, 0x71, + 0x1F, 0xF0, 0x2F, 0xD0, 0x0F, 0xF0, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x07, 0x70, 0x8E, 0x61, 0x1E, 0xE0, 0x27, + 0xDD, 0xDF, 0x60, 0x8E, 0x69, 0x1E, 0xE0, 0x27, 0x76, 0x4A, 0xA0, 0x8E, 0xE9, 0x9E, 0xE0, 0x2F, 0xD0, 0x6E, 0x80, + 0x8A, 0xE7, 0xFE, 0xA0, 0x07, 0xFA, 0x8E, 0x60, 0x88, 0x27, 0x7A, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x7C, 0xCF, 0xF0, 0x13, 0x26, 0x60, 0x11, 0x07, 0x7C, 0xCF, 0xF0, 0x03, 0x76, 0x65, 0x10, 0x02, 0x39, + 0xD7, 0x20, 0x04, 0x53, 0x35, 0x40, 0x00, 0x2F, 0xF2, 0x00, 0x01, 0x13, 0x31, 0x10, 0x00, 0x5F, 0xB1, 0x00, 0x00, + 0x03, 0x30, 0x00, 0x05, 0x5E, 0xE5, 0x50, 0x01, 0x13, 0x31, 0x10, 0x05, 0x5E, 0xED, 0xD0, 0x02, 0x23, 0x30, 0x00, + 0x00, 0x08, 0x88, 0x80, 0x8A, 0xAB, 0xB8, 0x88, 0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x45, 0x10, 0x04, 0x62, 0x33, + 0x20, 0x00, 0x44, 0x01, 0x10, 0x04, 0xC8, 0x9A, 0xA0, 0x00, 0xEE, 0xAB, 0x10, 0x0C, 0xE6, 0x67, 0x20, 0x0E, 0xF5, + 0x5F, 0xB0, 0x0E, 0xE0, 0x06, 0x60, 0x0B, 0xF6, 0x2B, 0x90, 0x0E, 0xE0, 0x06, 0x60, 0x03, 0xFC, 0x89, 0x90, 0x04, + 0xEE, 0xEE, 0xA0, 0x00, 0x77, 0x3B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x88, 0x00, 0x09, 0x90, 0x00, 0x00, + 0x00, 0x11, 0x10, 0x00, 0x09, 0x92, 0x24, 0x40, 0x00, 0x01, 0x10, 0x00, 0x09, 0x90, 0x88, 0x00, 0x26, 0xEF, 0xDE, + 0x20, 0x09, 0x9B, 0xB5, 0x40, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0x9A, 0x25, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0xDA, + 0xA5, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x09, 0xD6, 0xED, 0x10, 0x26, 0xCB, 0xBC, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, + 0x05, 0xFB, 0xFF, 0xE0, 0x8E, 0x61, 0x16, 0xE8, 0x0F, 0xF4, 0x03, 0x30, 0x8F, 0x71, 0x17, 0xF8, 0x07, 0xFC, 0x8B, + 0x30, 0x8E, 0x69, 0x96, 0xE8, 0x05, 0x73, 0x3B, 0xA0, 0x8A, 0x6D, 0xD6, 0xA8, 0x0D, 0xD8, 0x8A, 0x20, 0x08, 0xA7, + 0x79, 0xB2, 0x01, 0x10, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8A, 0x01, 0x10, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x80, 0xA1, 0x10, 0x00, 0x07, 0x74, 0x4F, 0x70, 0x80, 0xA9, 0x90, 0x00, 0x02, 0x31, 0xDF, 0x20, + 0x84, 0xE6, 0x00, 0x04, 0x00, 0x27, 0xDA, 0x20, 0xC8, 0xAA, 0x4C, 0x40, 0x00, 0x57, 0x3B, 0x20, 0x00, 0xA1, 0x18, + 0x00, 0x05, 0x54, 0x6F, 0x50, 0x00, 0xA9, 0x98, 0x00, 0x02, 0x22, 0x20, 0x80, 0x02, 0x00, 0x18, 0x88, 0x00, 0x04, + 0x44, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x0C, 0x44, 0x44, 0x00, 0x00, 0x04, 0x40, 0x00, 0x88, + 0xC0, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x0C, 0x46, 0xA4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x08, 0x8E, 0xE0, 0x00, + 0x02, 0x08, 0x80, 0x00, 0x80, 0xD0, 0x88, 0x00, 0x28, 0xA8, 0x80, 0x00, 0x88, 0xCD, 0x4C, 0x40, 0x0A, 0x88, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xE0, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x88, 0x00, 0x80, 0x01, 0x06, 0x10, 0x00, 0x56, 0xE7, 0x50, 0x80, 0x02, 0x1F, 0xF1, 0x00, 0x38, + 0x8C, 0xB8, 0x00, 0x0B, 0xF6, 0x0B, 0x00, 0x94, 0xC0, 0x28, 0x00, 0x06, 0x07, 0x6A, 0x00, 0xCB, 0xA6, 0xC8, 0x00, + 0x00, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x80, 0x00, 0x00, 0x39, 0x14, + 0x20, 0x02, 0x22, 0x24, 0x00, 0x08, 0xAE, 0xA8, 0x60, 0x04, 0x28, 0x99, 0x70, 0x07, 0x75, 0xD1, 0x04, 0x0F, 0xB3, + 0x33, 0xD0, 0x00, 0xAE, 0xBE, 0xA4, 0x25, 0x15, 0x20, 0xA0, 0x02, 0x61, 0x0C, 0x02, 0x20, 0x42, 0x08, 0x20, 0x2C, + 0x30, 0x14, 0x02, 0x02, 0x28, 0x82, 0x00, 0x03, 0xAC, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x12, 0x00, 0x08, 0x00, 0x28, 0x00, 0x0A, 0xCF, 0xEE, 0x20, 0x0B, 0x62, 0x2E, 0x20, 0x02, 0x10, 0x82, + 0x40, 0x01, 0x44, 0xE4, 0x40, 0x03, 0x00, 0x0E, 0x00, 0x8D, 0xEA, 0xAC, 0x00, 0x02, 0x10, 0x0A, 0x00, 0x01, 0xE0, + 0x24, 0x00, 0x0C, 0x21, 0x02, 0x00, 0x09, 0x42, 0x21, 0x00, 0x00, 0xCC, 0xF4, 0x40, 0x02, 0xBF, 0xD4, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x0C, 0xCC, 0xC4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x02, 0xA0, + 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x04, 0xCE, 0x64, 0x40, 0x02, 0x08, 0x80, 0x00, 0x00, 0x90, 0x00, 0x40, 0x28, 0xA8, + 0x80, 0x00, 0x08, 0x01, 0x04, 0x00, 0x0A, 0x88, 0x80, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x54, 0x44, 0x00, + 0xEE, 0xFE, 0xE0, 0x00, 0x09, 0x3B, 0x3F, 0x00, 0x21, 0xD8, 0x20, 0x00, 0x00, 0x54, 0x4F, 0x00, 0x18, 0x58, 0x20, + 0x00, 0x00, 0x01, 0x86, 0x00, 0xC6, 0x7E, 0x40, 0x00, 0x00, 0xEF, 0x66, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0xC0, 0x20, 0x00, 0xAA, 0xAA, 0xEA, 0x20, 0xEF, 0xFF, 0xFF, 0x00, 0x80, + 0x44, 0x19, 0x30, 0x00, 0x49, 0x24, 0x00, 0xC5, 0x35, 0x1B, 0x10, 0x00, 0x4B, 0x24, 0x00, 0x01, 0x35, 0xA0, 0x00, + 0x8C, 0xA9, 0xAC, 0x80, 0x00, 0x2C, 0x00, 0x00, 0x04, 0x21, 0xA4, 0x00, 0x2A, 0x84, 0x00, 0x00, 0x73, 0x11, 0xF1, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x11, 0x19, 0x00, 0x00, 0x40, 0x00, 0x00, 0x8F, 0xEE, + 0xEF, 0xE0, 0x0B, 0x76, 0x66, 0xD0, 0x1A, 0x00, 0x0B, 0x40, 0x4C, 0x40, 0x02, 0xD0, 0x28, 0x00, 0x1A, 0x40, 0x01, + 0xD0, 0x2C, 0x10, 0x00, 0x00, 0x38, 0x40, 0x00, 0x40, 0x28, 0x10, 0x00, 0x01, 0xA0, 0x40, 0x00, 0x42, 0x83, 0x00, + 0x05, 0xFE, 0x44, 0x40, 0x03, 0xFD, 0x54, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x99, 0x9B, + 0x00, 0x00, 0x10, 0x20, 0x00, 0x07, 0x26, 0x21, 0x40, 0x2A, 0xFE, 0xEE, 0xA0, 0x8D, 0x8C, 0xA9, 0xC0, 0x00, 0x10, + 0x20, 0x80, 0x32, 0x33, 0xB3, 0x60, 0x00, 0x19, 0x28, 0x00, 0x00, 0x00, 0xA1, 0x40, 0x00, 0x10, 0xB1, 0x00, 0x00, + 0x08, 0x34, 0x00, 0x00, 0x1A, 0x08, 0x00, 0x05, 0xF7, 0x40, 0x00, 0x8E, 0xF4, 0x44, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x02, 0x80, 0x00, 0x04, 0x00, 0x00, 0x1D, 0x11, 0xDB, 0x00, 0xDD, 0xFD, 0xDD, + 0xD0, 0x0C, 0x88, 0x07, 0x00, 0x02, 0x06, 0x00, 0x90, 0x48, 0x00, 0x34, 0x00, 0x2C, 0x04, 0x2C, 0x10, 0x48, 0x11, + 0x21, 0x40, 0x04, 0x84, 0x83, 0x40, 0x59, 0x03, 0x00, 0x50, 0x40, 0x0C, 0x10, 0x60, 0x42, 0xA9, 0x88, 0xC0, 0x40, + 0x15, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x02, 0x00, 0x40, 0x08, 0x98, 0x88, 0x80, + 0x08, 0xF9, 0x98, 0xC0, 0x06, 0x77, 0x75, 0x50, 0x02, 0x0C, 0x05, 0x00, 0x19, 0x98, 0xA8, 0xD0, 0x0B, 0x99, 0xCA, + 0x80, 0x04, 0x54, 0x65, 0xC0, 0x20, 0x08, 0x50, 0x20, 0x00, 0x10, 0x20, 0xC0, 0x31, 0x1C, 0x04, 0x20, 0x00, 0x01, + 0x28, 0x40, 0x26, 0x63, 0xBB, 0xE0, 0x26, 0xEF, 0xE6, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x01, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0F, 0x8A, 0x89, 0x80, 0xC3, 0xF3, 0x11, 0x30, 0x0F, 0x02, 0x01, 0x80, + 0xC9, 0xC0, 0x00, 0x30, 0x0F, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, + 0x30, 0x0E, 0x02, 0x52, 0x80, 0x00, 0x00, 0x03, 0x00, 0x2C, 0xDF, 0xA8, 0x80, 0x02, 0x33, 0x30, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x88, 0x00, 0x01, 0x02, 0x80, 0x00, 0x03, 0xFF, 0xF7, 0x00, 0x0F, + 0x26, 0xE4, 0x72, 0xCC, 0x38, 0x00, 0x40, 0x0C, 0x38, 0x99, 0x00, 0x03, 0x0A, 0x31, 0x50, 0x0C, 0xB1, 0x82, 0x80, + 0x03, 0x28, 0x06, 0x00, 0x87, 0x88, 0x2A, 0xA0, 0x01, 0x05, 0xC2, 0x00, 0x85, 0x82, 0xC2, 0x80, 0x10, 0x00, 0x39, + 0x10, 0x08, 0x51, 0xBF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x48, 0x9D, + 0xCC, 0x40, 0xC9, 0xE6, 0x7F, 0x40, 0x40, 0x00, 0x94, 0x00, 0x5B, 0x21, 0x0C, 0xB0, 0x48, 0xAE, 0xCC, 0x40, 0xE1, + 0x30, 0x0C, 0x30, 0x43, 0x01, 0xA4, 0x00, 0xE1, 0x24, 0x5D, 0x30, 0x78, 0x8C, 0xD6, 0x10, 0xF1, 0x60, 0x94, 0x70, + 0xD0, 0x40, 0x9C, 0x70, 0x0B, 0x8C, 0x53, 0x00, 0x0C, 0x9D, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x39, 0x50, 0x00, 0x00, 0x88, 0xF0, 0x00, 0x2E, 0xAF, 0xC6, 0x00, 0x03, 0x01, 0x77, 0x60, 0x04, 0xF0, + 0x41, 0x60, 0x03, 0x92, 0xF8, 0x12, 0x0F, 0xBD, 0x91, 0x40, 0x1B, 0x28, 0x60, 0x92, 0x70, 0xF4, 0x01, 0xF0, 0x0A, + 0xD4, 0x65, 0x82, 0x53, 0xE0, 0x01, 0xE0, 0x04, 0x10, 0x68, 0x60, 0x04, 0x2A, 0xBE, 0x00, 0x00, 0x4F, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3A, 0xEE, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0D, 0x84, 0xA5, + 0x00, 0xC1, 0xC2, 0x11, 0x00, 0x45, 0x0E, 0x27, 0x00, 0xD9, 0xC3, 0x00, 0x10, 0x07, 0xF8, 0x8D, 0x20, 0x01, 0x30, + 0x00, 0x10, 0xAC, 0x02, 0x25, 0xA0, 0x01, 0x22, 0x00, 0x10, 0x44, 0x20, 0x16, 0xA0, 0x13, 0x02, 0x00, 0x30, 0x04, + 0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -#define gDPSetPrimColorMod(pkt, m, l, rgba) \ -_DW({ \ - Gfx *_g = (Gfx *)(pkt); \ - \ - _g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | \ - _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \ - _g->words.w1 = (rgba); \ -}) +#define gDPSetPrimColorMod(pkt, m, l, rgba) \ + _DW({ \ + Gfx* _g = (Gfx*)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \ + _g->words.w1 = (rgba); \ + }) #ifdef NON_MATCHING // regalloc and minor ordering differences -void GfxPrint_InitDlist(GfxPrint* this) -{ +void GfxPrint_InitDlist(GfxPrint* this) { s32 width = 16; s32 height = 256; s32 i; gDPPipeSync(this->dlist++); gDPSetOtherMode(this->dlist++, - G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | - G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_IA16 | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2); - gDPSetCombineLERP(this->dlist++, - 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, - 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0); + gDPSetCombineLERP(this->dlist++, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0); gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK, 1, sGfxPrintFontData); - gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK, - 0, 0, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); gDPLoadSync(this->dlist++); - gDPLoadBlock(this->dlist++, G_TX_LOADTILE, 0, 0, - (((width)*(height) + G_IM_SIZ_4b_INCR) >> G_IM_SIZ_4b_SHIFT) - 1, - CALC_DXT(width, G_IM_SIZ_4b_BYTES)); + gDPLoadBlock(this->dlist++, G_TX_LOADTILE, 0, 0, (((width) * (height) + G_IM_SIZ_4b_INCR) >> G_IM_SIZ_4b_SHIFT) - 1, + CALC_DXT(width, G_IM_SIZ_4b_BYTES)); gDPPipeSync(this->dlist++); - gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, - 1, 0, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); - gDPSetTileSize(this->dlist++, G_TX_RENDERTILE, 0, 0, - ((width)-1) << G_TEXTURE_IMAGE_FRAC, + gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTileSize(this->dlist++, G_TX_RENDERTILE, 0, 0, ((width)-1) << G_TEXTURE_IMAGE_FRAC, ((height)-1) << G_TEXTURE_IMAGE_FRAC); gDPLoadTLUT(this->dlist++, 64, 256, sGfxPrintFontTLUT); - for (i = 1; i < 4; i++) - { - gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, - 1, 0, i * 2, i, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + for (i = 1; i < 4; i++) { + gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2, i, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); gDPSetTileSize(this->dlist++, i * 2, 0, 0, 60, 1020); } gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color); gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, sGfxPrintUnkData); - gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, - 1, 0, G_TX_LOADTILE, 0 , - G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD); + gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 3, + G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD); gDPLoadSync(this->dlist++); gDPLoadTile(this->dlist++, G_TX_LOADTILE, 0, 0, 2, 28); gDPPipeSync(this->dlist++); - gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, - 1, 0, 1, 4, - G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD, + gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD); gDPSetTileSize(this->dlist++, 1, 0, 0, 4, 28); gDPLoadTLUT(this->dlist++, 16, 320, sGfxPrintUnkTLUT); - for (i = 1; i < 4; i++) - { - gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, - 1, 0, i * 2 + 1, 4, - G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD); + for (i = 1; i < 4; i++) { + gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2 + 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 3, + G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD); gDPSetTileSize(this->dlist++, i * 2 + 1, 0, 0, 4, 28); } } @@ -190,8 +198,7 @@ void GfxPrint_InitDlist(GfxPrint* this) #pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_InitDlist.s") #endif -void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a) -{ +void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a) { this->color.r = r; this->color.g = g; this->color.b = b; @@ -200,89 +207,61 @@ void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a) gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color); } - -void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y) -{ +void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y) { this->posX = this->baseX + (x << 2); this->posY = this->baseY + (y << 2); } -void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y) -{ +void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y) { GfxPrint_SetPosPx(this, x << 3, y << 3); } -void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y) -{ +void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y) { this->baseX = x << 2; this->baseY = y << 2; } #ifdef NON_MATCHING // regalloc and ordering differences -void GfxPrint_PrintCharImpl(GfxPrint* this, char c) -{ - if (this->flag & GFXPRINT_UPDATE_MODE) - { +void GfxPrint_PrintCharImpl(GfxPrint* this, char c) { + if (this->flag & GFXPRINT_UPDATE_MODE) { this->flag &= ~GFXPRINT_UPDATE_MODE; gDPPipeSync(this->dlist++); - if (this->flag & GFXPRINT_USE_RGBA16) - { + if (this->flag & GFXPRINT_USE_RGBA16) { gDPSetTextureLUT(this->dlist++, G_TT_RGBA16); gDPSetCycleType(this->dlist++, G_CYC_2CYCLE); gDPSetRenderMode(this->dlist++, G_RM_OPA_CI, G_RM_XLU_SURF2); - gDPSetCombineLERP(this->dlist++, - TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, - 0, 0, 0, COMBINED, 0, 0, 0, COMBINED); - } - else - { + gDPSetCombineLERP(this->dlist++, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, + COMBINED); + } else { gDPSetTextureLUT(this->dlist++, G_TT_IA16); gDPSetCycleType(this->dlist++, G_CYC_1CYCLE); gDPSetRenderMode(this->dlist++, G_RM_XLU_SURF, G_RM_XLU_SURF2); - gDPSetCombineLERP(this->dlist++, - TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, - TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0); + gDPSetCombineLERP(this->dlist++, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, + TEXEL0); } } - if (this->flag & GFXPRINT_FLAG4) - { + if (this->flag & GFXPRINT_FLAG4) { gDPSetPrimColorMod(this->dlist++, 0, 0, 0); if (this->flag & GFXPRINT_FLAG64) - gSPTextureRectangle(this->dlist++, - (this->posX + 4) << 1, (this->posY + 4) << 1, - (this->posX + 4 + 32) << 1, (this->posY + 4 + 32) << 1, - c * 2, - (u16)(c & 4) * 64, (u16)(c >> 3) * 256, - 512, 512); + gSPTextureRectangle(this->dlist++, (this->posX + 4) << 1, (this->posY + 4) << 1, (this->posX + 4 + 32) << 1, + (this->posY + 4 + 32) << 1, c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 512, 512); else - gSPTextureRectangle(this->dlist++, - this->posX + 4, this->posY + 4, - this->posX + 4 + 32, this->posY + 4 + 32, - c * 2, - (u16)(c & 4) * 64, (u16)(c >> 3) * 256, - 1024, 1024); + gSPTextureRectangle(this->dlist++, this->posX + 4, this->posY + 4, this->posX + 4 + 32, this->posY + 4 + 32, + c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024); gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color); } if (this->flag & GFXPRINT_FLAG64) - gSPTextureRectangle(this->dlist++, - (this->posX) << 1, (this->posY) << 1, - (this->posX + 32) << 1, (this->posY + 32) << 1, - c * 2, - (u16)(c & 4) * 64, (u16)(c >> 3) * 256, - 512, 512); + gSPTextureRectangle(this->dlist++, (this->posX) << 1, (this->posY) << 1, (this->posX + 32) << 1, + (this->posY + 32) << 1, c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 512, 512); else - gSPTextureRectangle(this->dlist++, - this->posX, this->posY, - this->posX + 32, this->posY + 32, - c * 2, - (u16)(c & 4) * 64, (u16)(c >> 3) * 256, - 1024, 1024); + gSPTextureRectangle(this->dlist++, this->posX, this->posY, this->posX + 32, this->posY + 32, c * 2, + (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024); this->posX += 32; } @@ -290,33 +269,24 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, char c) #pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_PrintCharImpl.s") #endif -void GfxPrint_PrintChar(GfxPrint* this, u8 c) -{ +void GfxPrint_PrintChar(GfxPrint* this, u8 c) { u8 charParam = c; - if (c == ' ') - { + if (c == ' ') { this->posX += 0x20; - } - else if (c > 0x20 && c < 0x7F) - { + } else if (c > 0x20 && c < 0x7F) { GfxPrint_PrintCharImpl(this, charParam); - } - else if (c >= 0xA0 && c < 0xE0) - { - if (this->flag & GFXPRINT_FLAG1) - { - if (c < 0xC0) + } else if (c >= 0xA0 && c < 0xE0) { + if (this->flag & GFXPRINT_FLAG1) { + if (c < 0xC0) { charParam = c - 0x20; - else + } else { charParam = c + 0x20; + } } GfxPrint_PrintCharImpl(this, charParam); - } - else - { - switch (c) - { + } else { + switch (c) { case 0: break; case '\n': @@ -325,8 +295,7 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c) this->posX = this->baseX; break; case '\t': - do - { + do { GfxPrint_PrintCharImpl(this, 0x20); } while ((this->posX - this->baseX) % 256); break; @@ -351,32 +320,28 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c) } } -void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount) -{ +void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount) { const char* str = (const char*)buffer; size_t count = charSize * charCount; - while (count) - { + while (count) { GfxPrint_PrintChar(this, *str++); count--; } } -void GfxPrint_PrintString(GfxPrint* this, const char* str) -{ - while (*str) +void GfxPrint_PrintString(GfxPrint* this, const char* str) { + while (*str) { GfxPrint_PrintChar(this, *(str++)); + } } -GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size) -{ +GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size) { GfxPrint_PrintStringWithSize(this, str, sizeof(char), size); return this; } -void GfxPrint_Ctor(GfxPrint* this) -{ +void GfxPrint_Ctor(GfxPrint* this) { this->flag &= ~GFXPRINT_OPEN; this->callback = &GfxPrint_Callback; @@ -392,31 +357,27 @@ void GfxPrint_Ctor(GfxPrint* this) this->flag |= GFXPRINT_FLAG4; this->flag |= GFXPRINT_UPDATE_MODE; - if ((D_801755F0 & GFXPRINT_FLAG64)) + if ((D_801755F0 & GFXPRINT_FLAG64)) { this->flag |= GFXPRINT_FLAG64; //? dsdx/dtdy - else + } else { this->flag &= ~GFXPRINT_FLAG64; + } } -void GfxPrint_Dtor(GfxPrint* this) -{ - +void GfxPrint_Dtor(GfxPrint* this) { } -void GfxPrint_Open(GfxPrint* this, Gfx* dlist) -{ - if (!(this->flag & GFXPRINT_OPEN)) - { +void GfxPrint_Open(GfxPrint* this, Gfx* dlist) { + if (!(this->flag & GFXPRINT_OPEN)) { this->flag |= GFXPRINT_OPEN; this->dlist = dlist; GfxPrint_InitDlist(this); - } - else + } else { osSyncPrintf("gfxprint_open:2重オープンです\n"); + } } -Gfx* GfxPrint_Close(GfxPrint* this) -{ +Gfx* GfxPrint_Close(GfxPrint* this) { Gfx* ret; this->flag &= ~GFXPRINT_OPEN; @@ -426,13 +387,11 @@ Gfx* GfxPrint_Close(GfxPrint* this) return ret; } -void GfxPrint_VPrintf(GfxPrint *this, const char *fmt, va_list args) -{ +void GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) { func_800FF340(&this->callback, fmt, args); } -void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) -{ +void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) { va_list args; va_start(args, fmt); diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c index eb7eb780b1..35be0e3535 100644 --- a/src/code/irqmgr.c +++ b/src/code/irqmgr.c @@ -6,18 +6,17 @@ volatile OSTime sIrqMgrResetTime = 0; volatile OSTime sIrqMgrRetraceTime = 0; u32 sIrqMgrRetraceCount = 0; -#define RETRACE_MSG 666 -#define PRE_NMI_MSG 669 -#define PRENMI450_MSG 671 -#define PRENMI480_MSG 672 -#define PRENMI500_MSG 673 +#define RETRACE_MSG 666 +#define PRE_NMI_MSG 669 +#define PRENMI450_MSG 671 +#define PRENMI480_MSG 672 +#define PRENMI500_MSG 673 -#define STATUS_IDLE 0 -#define STATUS_PRENMI 1 -#define STATUS_NMI 2 +#define STATUS_IDLE 0 +#define STATUS_PRENMI 1 +#define STATUS_NMI 2 -void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ) -{ +void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ) { u32 prevMask; LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 96); @@ -32,15 +31,16 @@ void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ) osSetIntMask(prevMask); - if (this->resetStatus > STATUS_IDLE) - osSendMesg(c->queue, (OSMesg)&this->prenmiMsg, OS_MESG_NOBLOCK); + if (this->resetStatus > STATUS_IDLE) { + osSendMesg(c->queue, (OSMesg) & this->prenmiMsg, OS_MESG_NOBLOCK); + } - if (this->resetStatus >= STATUS_NMI) - osSendMesg(c->queue, (OSMesg)&this->nmiMsg, OS_MESG_NOBLOCK); + if (this->resetStatus >= STATUS_NMI) { + osSendMesg(c->queue, (OSMesg) & this->nmiMsg, OS_MESG_NOBLOCK); + } } -void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c) -{ +void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c) { IrqMgrClient* iter; IrqMgrClient* lastIter; u32 prevMask; @@ -50,17 +50,16 @@ void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c) LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 129); LogUtils_CheckNullPointer("c", c, "../irqmgr.c", 130); - + prevMask = osSetIntMask(1); - while (iter) - { - if (iter == c) - { - if (lastIter) + while (iter) { + if (iter == c) { + if (lastIter) { lastIter->prev = c->prev; - else + } else { this->clients = c->prev; + } break; } lastIter = iter; @@ -70,160 +69,150 @@ void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c) osSetIntMask(prevMask); } -void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg) -{ +void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg) { IrqMgrClient* iter; iter = this->clients; - while(iter) - { - if (iter->queue->validCount >= iter->queue->msgCount) - //irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d - osSyncPrintf(VT_COL(RED, WHITE) "irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, iter->queue, iter->queue->validCount); - else + while (iter) { + if (iter->queue->validCount >= iter->queue->msgCount) { + // irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d + osSyncPrintf( + VT_COL(RED, WHITE) "irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, + iter->queue, iter->queue->validCount); + } else { osSendMesg(iter->queue, msg, OS_MESG_NOBLOCK); - + } + iter = iter->prev; } } -void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg) -{ +void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg) { IrqMgrClient* iter; iter = this->clients; - while(iter) - { - if (iter->queue->validCount >= iter->queue->msgCount) - //irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d - osSyncPrintf(VT_COL(RED, WHITE) "irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, iter->queue, iter->queue->validCount); - else - //mistake? the function's name suggests it would use osJamMesg + while (iter) { + if (iter->queue->validCount >= iter->queue->msgCount) { + // irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d + osSyncPrintf( + VT_COL(RED, WHITE) "irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, + iter->queue, iter->queue->validCount); + } else { + // mistake? the function's name suggests it would use osJamMesg osSendMesg(iter->queue, msg, OS_MESG_NOBLOCK); - + } + iter = iter->prev; } } -void IrqMgr_HandlePreNMI(IrqMgr *this) -{ - u64 temp = STATUS_PRENMI; //required to match +void IrqMgr_HandlePreNMI(IrqMgr* this) { + u64 temp = STATUS_PRENMI; // required to match gIrqMgrResetStatus = temp; this->resetStatus = STATUS_PRENMI; sIrqMgrResetTime = this->resetTime = osGetTime(); osSetTimer(&this->timer, OS_USEC_TO_CYCLES(450000), 0ull, &this->queue, (OSMesg)PRENMI450_MSG); - IrqMgr_JamMesgForClient(this, (OSMesg)&this->prenmiMsg); + IrqMgr_JamMesgForClient(this, (OSMesg) & this->prenmiMsg); } -void IrqMgr_CheckStack() -{ - osSyncPrintf("irqmgr.c: PRENMIから0.5秒経過\n"); //0.5 seconds after PRENMI - if (StackCheck_Check(NULL) == 0) - { - osSyncPrintf("スタックは大丈夫みたいです\n"); //The stack looks ok - } - else - { +void IrqMgr_CheckStack() { + osSyncPrintf("irqmgr.c: PRENMIから0.5秒経過\n"); // 0.5 seconds after PRENMI + if (StackCheck_Check(NULL) == 0) { + osSyncPrintf("スタックは大丈夫みたいです\n"); // The stack looks ok + } else { osSyncPrintf("%c", 7); osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("スタックがオーバーフローしたか危険な状態です\n"); //Stack overflow or dangerous - osSyncPrintf("早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n"); //Increase stack size early or don't consume stack + osSyncPrintf("スタックがオーバーフローしたか危険な状態です\n"); // Stack overflow or dangerous + osSyncPrintf( + "早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n"); // Increase stack size early or + // don't consume stack osSyncPrintf(VT_RST); } } -void IrqMgr_HandlePRENMI450(IrqMgr* this) -{ - u64 temp = STATUS_NMI; //required to match +void IrqMgr_HandlePRENMI450(IrqMgr* this) { + u64 temp = STATUS_NMI; // required to match gIrqMgrResetStatus = temp; this->resetStatus = STATUS_NMI; osSetTimer(&this->timer, OS_USEC_TO_CYCLES(30000), 0ull, &this->queue, (OSMesg)PRENMI480_MSG); - IrqMgr_SendMesgForClient(this, (OSMesg)&this->nmiMsg); + IrqMgr_SendMesgForClient(this, (OSMesg) & this->nmiMsg); } -void IrqMgr_HandlePRENMI480(IrqMgr* this) -{ +void IrqMgr_HandlePRENMI480(IrqMgr* this) { u32 ret; osSetTimer(&this->timer, OS_USEC_TO_CYCLES(20000), 0ull, &this->queue, (OSMesg)PRENMI500_MSG); - ret = func_801031F0(); //osAfterPreNMI - if (ret) - { - osSyncPrintf("osAfterPreNMIが %d を返しました!?\n", ret); //osAfterPreNMI returned %d !? + ret = func_801031F0(); // osAfterPreNMI + if (ret) { + osSyncPrintf("osAfterPreNMIが %d を返しました!?\n", ret); // osAfterPreNMI returned %d !? osSetTimer(&this->timer, OS_USEC_TO_CYCLES(1000), 0ull, &this->queue, (OSMesg)PRENMI480_MSG); } } -void IrqMgr_HandlePRENMI500(IrqMgr* this) -{ +void IrqMgr_HandlePRENMI500(IrqMgr* this) { IrqMgr_CheckStack(); } -void IrqMgr_HandleRetrace(IrqMgr* this) -{ - if (sIrqMgrRetraceTime == 0ull) - { - if (this->retraceTime == 0) +void IrqMgr_HandleRetrace(IrqMgr* this) { + if (sIrqMgrRetraceTime == 0ull) { + if (this->retraceTime == 0) { this->retraceTime = osGetTime(); - else + } else { sIrqMgrRetraceTime = osGetTime() - this->retraceTime; + } } sIrqMgrRetraceCount++; - IrqMgr_SendMesgForClient(this, (OSMesg)&this->retraceMsg); + IrqMgr_SendMesgForClient(this, (OSMesg) & this->retraceMsg); } -void IrqMgr_ThreadEntry(void* arg0) -{ +void IrqMgr_ThreadEntry(void* arg0) { OSMesg msg; IrqMgr* this; u8 exit; this = (IrqMgr*)arg0; msg = 0; - osSyncPrintf("IRQマネージャスレッド実行開始\n"); //Start IRQ manager thread execution + osSyncPrintf("IRQマネージャスレッド実行開始\n"); // Start IRQ manager thread execution exit = false; - while (!exit) - { + while (!exit) { osRecvMesg(&this->queue, &msg, OS_MESG_BLOCK); - switch ((u32)msg) - { + switch ((u32)msg) { case RETRACE_MSG: IrqMgr_HandleRetrace(this); break; case PRE_NMI_MSG: osSyncPrintf("PRE_NMI_MSG\n"); - osSyncPrintf("スケジューラ:PRE_NMIメッセージを受信\n"); //Scheduler: Receives PRE_NMI message + osSyncPrintf("スケジューラ:PRE_NMIメッセージを受信\n"); // Scheduler: Receives PRE_NMI message IrqMgr_HandlePreNMI(this); break; case PRENMI450_MSG: osSyncPrintf("PRENMI450_MSG\n"); - osSyncPrintf("スケジューラ:PRENMI450メッセージを受信\n"); //Scheduler: Receives PRENMI450 message + osSyncPrintf("スケジューラ:PRENMI450メッセージを受信\n"); // Scheduler: Receives PRENMI450 message IrqMgr_HandlePRENMI450(this); break; case PRENMI480_MSG: osSyncPrintf("PRENMI480_MSG\n"); - osSyncPrintf("スケジューラ:PRENMI480メッセージを受信\n"); //Scheduler: Receives PRENMI480 message + osSyncPrintf("スケジューラ:PRENMI480メッセージを受信\n"); // Scheduler: Receives PRENMI480 message IrqMgr_HandlePRENMI480(this); break; case PRENMI500_MSG: osSyncPrintf("PRENMI500_MSG\n"); - osSyncPrintf("スケジューラ:PRENMI500メッセージを受信\n"); //Scheduler: Receives PRENMI500 message + osSyncPrintf("スケジューラ:PRENMI500メッセージを受信\n"); // Scheduler: Receives PRENMI500 message exit = true; IrqMgr_HandlePRENMI500(this); break; default: - osSyncPrintf("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n", msg); //Unexpected message received + osSyncPrintf("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n", + msg); // Unexpected message received break; - } } - osSyncPrintf("IRQマネージャスレッド実行終了\n"); //End of IRQ manager thread execution + osSyncPrintf("IRQマネージャスレッド実行終了\n"); // End of IRQ manager thread execution } -void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount) -{ +void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount) { LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 346); LogUtils_CheckNullPointer("stack", stack, "../irqmgr.c", 347); this->clients = NULL; diff --git a/src/code/listalloc.c b/src/code/listalloc.c index 20cc88e1c1..b7d97281c7 100644 --- a/src/code/listalloc.c +++ b/src/code/listalloc.c @@ -1,64 +1,66 @@ #include -ListAlloc* ListAlloc_Init(ListAlloc* this) -{ +ListAlloc* ListAlloc_Init(ListAlloc* this) { this->prev = NULL; this->next = NULL; return this; } -void* ListAlloc_Alloc(ListAlloc* this, u32 size) -{ +void* ListAlloc_Alloc(ListAlloc* this, u32 size) { ListAlloc* ptr; ListAlloc* next; - + ptr = SystemArena_MallocDebug(size + sizeof(ListAlloc), "../listalloc.c", 40); - if (!ptr) + if (!ptr) { return NULL; + } next = this->next; - if (next) + if (next) { next->next = ptr; - + } + ptr->prev = next; ptr->next = NULL; this->next = ptr; - if (!this->prev) + if (!this->prev) { this->prev = ptr; + } return (u8*)ptr + sizeof(ListAlloc); } -void ListAlloc_Free(ListAlloc* this, void* data) -{ +void ListAlloc_Free(ListAlloc* this, void* data) { ListAlloc* ptr; ptr = &((ListAlloc*)data)[-1]; - if (ptr->prev) + if (ptr->prev) { ptr->prev->next = ptr->next; + } - if (ptr->next) + if (ptr->next) { ptr->next->prev = ptr->prev; + } - if (this->prev == ptr) + if (this->prev == ptr) { this->prev = ptr->next; + } - if (this->next == ptr) + if (this->next == ptr) { this->next = ptr->prev; + } SystemArena_FreeDebug(ptr, "../listalloc.c", 72); } -void ListAlloc_FreeAll(ListAlloc* this) -{ +void ListAlloc_FreeAll(ListAlloc* this) { ListAlloc* iter; iter = this->prev; - while (iter) - { + while (iter) { ListAlloc_Free(this, (u8*)iter + sizeof(ListAlloc)); iter = this->prev; } diff --git a/src/code/loadfragment2.c b/src/code/loadfragment2.c index b47bae4c11..2a304bbeb8 100644 --- a/src/code/loadfragment2.c +++ b/src/code/loadfragment2.c @@ -1,20 +1,18 @@ #include -void *Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd) -{ - void *allocatedVRamAddr; +void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd) { + void* allocatedVRamAddr; allocatedVRamAddr = SystemArena_MallocRDebug((s32)vRamEnd - (s32)vRamStart, "../loadfragment2.c", 31); - if(gOverlayLogSeverity >= 3) - { - osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr, ((u32)vRamEnd - (u32)vRamStart) + (u32)allocatedVRamAddr, (u32)vRamStart - (u32)allocatedVRamAddr); + if (gOverlayLogSeverity >= 3) { + osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr, + ((u32)vRamEnd - (u32)vRamStart) + (u32)allocatedVRamAddr, (u32)vRamStart - (u32)allocatedVRamAddr); } - if(allocatedVRamAddr != NULL) - { + if (allocatedVRamAddr != NULL) { Overlay_Load(vRomStart, vRomEnd, vRamStart, vRamEnd, allocatedVRamAddr); } return allocatedVRamAddr; -} \ No newline at end of file +} diff --git a/src/code/logseverity.c b/src/code/logseverity.c index b62552e1b7..25bc68c46f 100644 --- a/src/code/logseverity.c +++ b/src/code/logseverity.c @@ -1,3 +1,3 @@ #include -s32 gOverlayLogSeverity = 2; \ No newline at end of file +s32 gOverlayLogSeverity = 2; diff --git a/src/code/main.c b/src/code/main.c index 987654a416..5e2b9a89e9 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -23,21 +23,19 @@ StackEntry sSchedStackInfo; StackEntry sAudioStackInfo; StackEntry sPadMgrStackInfo; StackEntry sIrqMgrStackInfo; -u8 gAudioMgr[0x298]; //type should be AudioMgr +u8 gAudioMgr[0x298]; // type should be AudioMgr OSMesgQueue sSiIntMsgQ; OSMesg sSiIntMsgBuf[1]; - -void Main_LogSystemHeap() -{ +void Main_LogSystemHeap() { osSyncPrintf(VT_FGCOL(GREEN)); - //System heap size% 08x (% dKB) Start address% 08x - osSyncPrintf("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024, gSystemHeap); + // System heap size% 08x (% dKB) Start address% 08x + osSyncPrintf("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024, + gSystemHeap); osSyncPrintf(VT_RST); } -void Main(void* arg0) -{ +void Main(void* arg0) { IrqMgrClient irqClient; OSMesgQueue irqMgrMsgQ; OSMesg irqMgrMsgBuf[60]; @@ -45,9 +43,9 @@ void Main(void* arg0) u32 fb; s32 debugHeap; s32 debugHeapSize; - s16 *msg; + s16* msg; - osSyncPrintf("mainproc 実行開始\n"); //Start running + osSyncPrintf("mainproc 実行開始\n"); // Start running gScreenWidth = SCREEN_WIDTH; gScreenHeight = SCREEN_HEIGHT; gAppNmiBufferPtr = (PreNmiBuff*)osAppNmiBuffer; @@ -57,15 +55,12 @@ void Main(void* arg0) sysHeap = (u32)gSystemHeap; fb = SysCfb_GetFbPtr(0); gSystemHeapSize = (fb - sysHeap); - osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", sysHeap, fb, gSystemHeapSize); //System heap initalization - SystemHeap_Init(sysHeap, gSystemHeapSize); //initializes the system heap - if (osMemSize >= 0x800000U) - { + osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", sysHeap, fb, gSystemHeapSize); // System heap initalization + SystemHeap_Init(sysHeap, gSystemHeapSize); // initializes the system heap + if (osMemSize >= 0x800000U) { debugHeap = SysCfb_GetFbEnd(); - debugHeapSize = (s32) (0x80600000 - debugHeap); - } - else - { + debugHeapSize = (s32)(0x80600000 - debugHeap); + } else { debugHeapSize = 0x400; debugHeap = SystemArena_MallocDebug(debugHeapSize, "../main.c", 0x235); } @@ -81,43 +76,42 @@ void Main(void* arg0) Main_LogSystemHeap(); osCreateMesgQueue(&irqMgrMsgQ, irqMgrMsgBuf, 0x3c); - StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack+sizeof(sIrqMgrStack), 0, 0x100, "irqmgr"); + StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack + sizeof(sIrqMgrStack), 0, 0x100, "irqmgr"); IrqMgr_Create(&gIrqMgr, &sGraphStackInfo, 0x11, 1); - osSyncPrintf("タスクスケジューラの初期化\n"); //Initialize the task scheduler - StackCheck_Init(&sSchedStackInfo, sSchedStack, sSchedStack+sizeof(sSchedStack), 0, 0x100, "sched"); + osSyncPrintf("タスクスケジューラの初期化\n"); // Initialize the task scheduler + StackCheck_Init(&sSchedStackInfo, sSchedStack, sSchedStack + sizeof(sSchedStack), 0, 0x100, "sched"); func_800C9874(&gSchedContext, &sAudioStack, 0xf, D_80013960, 1, &gIrqMgr); IrqMgr_AddClient(&gIrqMgr, &irqClient, &irqMgrMsgQ); - StackCheck_Init(&sAudioStackInfo, sAudioStack, sAudioStack+sizeof(sAudioStack), 0, 0x100, "audio"); - func_800C3FEC(&gAudioMgr, sAudioStack+sizeof(sAudioStack), 0xc, 0xa, &gSchedContext, &gIrqMgr); + StackCheck_Init(&sAudioStackInfo, sAudioStack, sAudioStack + sizeof(sAudioStack), 0, 0x100, "audio"); + func_800C3FEC(&gAudioMgr, sAudioStack + sizeof(sAudioStack), 0xc, 0xa, &gSchedContext, &gIrqMgr); - StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, sPadMgrStack+sizeof(sPadMgrStack), 0, 0x100, "padmgr"); + StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, sPadMgrStack + sizeof(sPadMgrStack), 0, 0x100, "padmgr"); PadMgr_Init(&gPadMgr, &sSiIntMsgQ, &gIrqMgr, 7, 0xe, &sIrqMgrStack); func_800C3FC4(&gAudioMgr); - StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack+sizeof(sGraphStack), 0, 0x100, "graph"); - osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack+sizeof(sGraphStack), 0xb); + StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack + sizeof(sGraphStack), 0, 0x100, "graph"); + osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack + sizeof(sGraphStack), 0xb); osStartThread(&sGraphThread); osSetThreadPri(0, 0xf); - while (true) - { + while (true) { msg = NULL; osRecvMesg(&irqMgrMsgQ, &msg, OS_MESG_BLOCK); - if (msg == NULL) + if (msg == NULL) { break; - if (*msg == OS_SC_PRE_NMI_MSG) - { - osSyncPrintf("main.c: リセットされたみたいだよ\n"); //Looks like it's been reset + } + if (*msg == OS_SC_PRE_NMI_MSG) { + osSyncPrintf("main.c: リセットされたみたいだよ\n"); // Looks like it's been reset PreNmiBuff_SetReset(gAppNmiBufferPtr); } } - osSyncPrintf("mainproc 後始末\n"); //Cleanup + osSyncPrintf("mainproc 後始末\n"); // Cleanup osDestroyThread(&sGraphThread); func_800FBFD8(); - osSyncPrintf("mainproc 実行終了\n"); //End of execution + osSyncPrintf("mainproc 実行終了\n"); // End of execution } diff --git a/src/code/padmgr.c b/src/code/padmgr.c index 163e546b14..5cc539dbf0 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -8,50 +8,53 @@ s32 D_8012D280 = 1; -OSMesgQueue* PadMgr_LockGetControllerQueue(PadMgr* padmgr) -{ +OSMesgQueue* PadMgr_LockGetControllerQueue(PadMgr* padmgr) { OSMesgQueue* ctrlrqueue = NULL; - if (D_8012D280 > 2) - //EUC-JP: ロック待ち | Waiting for lock - osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, &ctrlrqueue); + if (D_8012D280 > 2) { + // EUC-JP: ロック待ち | Waiting for lock + osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL), + padmgr->queue1.validCount, padmgr, &padmgr->queue1, &ctrlrqueue); + } osRecvMesg(&padmgr->queue1, &ctrlrqueue, OS_MESG_BLOCK); - if (D_8012D280 > 2) - //EUC-JP: をロックしました | Locked - osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, ctrlrqueue); + if (D_8012D280 > 2) { + // EUC-JP: をロックしました | Locked + osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL), + padmgr->queue1.validCount, ctrlrqueue); + } return ctrlrqueue; } -void PadMgr_UnlockReleaseControllerQueue(PadMgr* padmgr, OSMesgQueue* ctrlrqueue) -{ - if (D_8012D280 > 2) - //EUC-JP: ロック解除します | Unlock - osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue); +void PadMgr_UnlockReleaseControllerQueue(PadMgr* padmgr, OSMesgQueue* ctrlrqueue) { + if (D_8012D280 > 2) { + // EUC-JP: ロック解除します | Unlock + osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL), + padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue); + } osSendMesg(&padmgr->queue1, ctrlrqueue, OS_MESG_BLOCK); - if (D_8012D280 > 2) - //EUC-JP: ロック解除しました | Unlocked - osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue); + if (D_8012D280 > 2) { + // EUC-JP: ロック解除しました | Unlocked + osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL), + padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue); + } } -void PadMgr_Lock2(PadMgr* padmgr) -{ +void PadMgr_Lock2(PadMgr* padmgr) { osRecvMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK); } -void PadMgr_Unlock2(PadMgr* padmgr) -{ +void PadMgr_Unlock2(PadMgr* padmgr) { osSendMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK); } #ifdef NON_MATCHING // regalloc and minor ordering differences -void func_800C740C(PadMgr* padmgr) -{ +void func_800C740C(PadMgr* padmgr) { static u32 D_8012D284 = 0; static u32 D_8016A4F0; s32 temp; @@ -65,54 +68,39 @@ void func_800C740C(PadMgr* padmgr) ctrlrqueue = PadMgr_LockGetControllerQueue(padmgr); var1 = 0; - for (i = 0; i < 4; i++) - { - if (padmgr->unk_2AA[i] != 0) - { - if (padmgr->pad_status[i].status & 1) - { - if (padmgr->unk_2AE[i] == temp) - { - if (padmgr->unk_2B2[i] != 0) - { - if (padmgr->unk_2B6[i] < 3) - { + for (i = 0; i < 4; i++) { + if (padmgr->unk_2AA[i] != 0) { + if (padmgr->pad_status[i].status & 1) { + if (padmgr->unk_2AE[i] == temp) { + if (padmgr->unk_2B2[i] != 0) { + if (padmgr->unk_2B6[i] < 3) { osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック ぶるぶるぶるぶる"); osSyncPrintf(VT_RST); - if (osSetVibration(&padmgr->unk_controller[i], temp) != 0) - { + if (osSetVibration(&padmgr->unk_controller[i], temp) != 0) { padmgr->unk_2AE[i] = 0; osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました"); osSyncPrintf(VT_RST); - } - else - { + } else { padmgr->unk_2B6[i] = 3; } var1 = 1; } - } - else - { - if (padmgr->unk_2B6[i] != 0) - { + } else { + if (padmgr->unk_2B6[i] != 0) { osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止"); osSyncPrintf(VT_RST); - if (osSetVibration(&padmgr->unk_controller[i], 0) != 0) - { + if (osSetVibration(&padmgr->unk_controller[i], 0) != 0) { padmgr->unk_2AE[i] = 0; osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました"); osSyncPrintf(VT_RST); - } - else - { + } else { padmgr->unk_2B6[i]--; } @@ -120,22 +108,17 @@ void func_800C740C(PadMgr* padmgr) } } } - } - else - { - if (padmgr->unk_2AE[i] != 0) - { - if (padmgr->unk_2AE[i] == 1) - { + } else { + if (padmgr->unk_2AE[i] != 0) { + if (padmgr->unk_2AE[i] == 1) { osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックが抜かれたようです"); osSyncPrintf(VT_RST); padmgr->unk_2AE[i] = 0; - } - else - { + } else { osSyncPrintf(VT_FGCOL(YELLOW)); - osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックではないコントローラパックが抜かれたようです"); + osSyncPrintf("padmgr: %dコン: %s\n", i + 1, + "振動パックではないコントローラパックが抜かれたようです"); osSyncPrintf(VT_RST); padmgr->unk_2AE[i] = 0; } @@ -144,29 +127,22 @@ void func_800C740C(PadMgr* padmgr) } } - if (!var1) - { + if (!var1) { var3 = D_8016A4F0 % 4; - if ((padmgr->unk_2AA[var3] != 0) && (padmgr->pad_status[var3].status & 1) && (padmgr->unk_2AE[var3] != 1)) - { + if ((padmgr->unk_2AA[var3] != 0) && (padmgr->pad_status[var3].status & 1) && (padmgr->unk_2AE[var3] != 1)) { var4 = osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[var3], var3); - if (var4 == 0) - { + if (var4 == 0) { padmgr->unk_2AE[var3] = 1; osSetVibration(&padmgr->unk_controller[var3], 1); osSetVibration(&padmgr->unk_controller[var3], 0); osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("padmgr: %dコン: %s\n", var3 + 1, "振動パックを認識しました"); osSyncPrintf(VT_RST); - } - else if (var4 == 11) - { + } else if (var4 == 11) { padmgr->unk_2AE[var3] = 2; - } - else if (var4 == 4) - { + } else if (var4 == 4) { LogUtils_LogThreadId("../padmgr.c", 282); osSyncPrintf("++errcnt = %d\n", ++D_8012D284); osSyncPrintf(VT_FGCOL(YELLOW)); @@ -185,22 +161,18 @@ u32 D_8016A4F0; #pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C740C.s") #endif -//func_800A2300 in 1.0 -void func_800C7818(PadMgr* padmgr) -{ +// func_800A2300 in 1.0 +void func_800C7818(PadMgr* padmgr) { s32 i; OSMesgQueue* ctrlrqueue; ctrlrqueue = PadMgr_LockGetControllerQueue(padmgr); - for (i = 0; i < 4; i++) - { - if (osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[i], i) == 0) - { - if ((gFaultStruct.msgId == 0) && (padmgr->unk_45D != 0)) - { + for (i = 0; i < 4; i++) { + if (osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[i], i) == 0) { + if ((gFaultStruct.msgId == 0) && (padmgr->unk_45D != 0)) { osSyncPrintf(VT_FGCOL(YELLOW)); - //EUC-JP: コン | 'Con'? , EUC-JP: 振動パック 停止 | Stop vibration pack + // EUC-JP: コン | 'Con'? , EUC-JP: 振動パック 停止 | Stop vibration pack osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止"); osSyncPrintf(VT_RST); } @@ -212,13 +184,11 @@ void func_800C7818(PadMgr* padmgr) PadMgr_UnlockReleaseControllerQueue(padmgr, ctrlrqueue); } -void func_800C7928(PadMgr* padmgr) -{ +void func_800C7928(PadMgr* padmgr) { padmgr->unk_45C = 3; } -void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2) -{ +void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2) { padmgr->unk_2B2[a1] = a2; padmgr->unk_45D = 0xF0; } @@ -226,8 +196,7 @@ void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2) #ifdef NON_MATCHING // minor ordering difference // 800A23CC in 1.0 -void func_800C7948(PadMgr* padmgr, u8* a1) -{ +void func_800C7948(PadMgr* padmgr, u8* a1) { padmgr->unk_2B2[0] = a1[0]; padmgr->unk_2B2[1] = a1[1]; padmgr->unk_2B2[2] = a1[2]; @@ -243,46 +212,45 @@ void func_800C7948(PadMgr* padmgr, u8* a1) #pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C7C14.s") -void func_800C7DD0(PadMgr* padmgr) -{ +void func_800C7DD0(PadMgr* padmgr) { osSyncPrintf("padmgr_HandlePreNMI()\n"); padmgr->unk_45E = 1; func_800C7928(padmgr); } #pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C7E08.s") -//void func_800C7E08(Input*, u32); +// void func_800C7E08(Input*, u32); -//800A2918 in 1.0 -void PadMgr_Run(PadMgr* padmgr) -{ +// 800A2918 in 1.0 +void PadMgr_Run(PadMgr* padmgr) { s16* mesg; s32 bVar2; mesg = NULL; - //EUC-JP: コントローラスレッド実行開始 | Start of controller thread execution + // EUC-JP: コントローラスレッド実行開始 | Start of controller thread execution osSyncPrintf("コントローラスレッド実行開始\n"); bVar2 = 0; - while (bVar2 == 0) - { - if ((D_8012D280 > 2) && (padmgr->queue3.validCount == 0)) - //EUC-JP: コントローラスレッドイベント待ち | Waiting for controller thread event - osSyncPrintf("コントローラスレッドイベント待ち %lld\n" , (osGetTime() * 64) / 3000); + while (bVar2 == 0) { + if ((D_8012D280 > 2) && (padmgr->queue3.validCount == 0)) { + // EUC-JP: コントローラスレッドイベント待ち | Waiting for controller thread event + osSyncPrintf("コントローラスレッドイベント待ち %lld\n", (osGetTime() * 64) / 3000); + } osRecvMesg(&padmgr->queue3, &mesg, OS_MESG_BLOCK); LogUtils_CheckNullPointer("msg", mesg, "../padmgr.c", 563); - switch (*mesg) - { + switch (*mesg) { case OS_SC_RETRACE_MSG: - if (D_8012D280 > 2) + if (D_8012D280 > 2) { osSyncPrintf("padmgr_HandleRetraceMsg START %lld\n", (osGetTime() * 64) / 3000); + } func_800C7C14(padmgr); - if (D_8012D280 > 2) + if (D_8012D280 > 2) { osSyncPrintf("padmgr_HandleRetraceMsg END %lld\n", (osGetTime() * 64) / 3000); + } break; case OS_SC_PRE_NMI_MSG: @@ -295,14 +263,13 @@ void PadMgr_Run(PadMgr* padmgr) } IrqMgr_RemoveClient(padmgr->unk_78, &padmgr->unk_70); - //EUC-JP: コントローラスレッド実行終了 | Controller thread execution end + // EUC-JP: コントローラスレッド実行終了 | Controller thread execution end osSyncPrintf("コントローラスレッド実行終了\n"); } -//func_800A2A14 in 1.0 -void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* ctrlrqueue, UNK_TYPE arg2, OSId id, OSPri priority, void* stack) -{ - //EUC-JP: パッドマネージャ作成 | Create pad manager +// func_800A2A14 in 1.0 +void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* ctrlrqueue, UNK_TYPE arg2, OSId id, OSPri priority, void* stack) { + // EUC-JP: パッドマネージャ作成 | Create pad manager osSyncPrintf("パッドマネージャ作成 padmgr_Create()\n"); bzero(padmgr, sizeof(PadMgr)); padmgr->unk_78 = arg2; diff --git a/src/code/relocation.c b/src/code/relocation.c index 6e429742cd..80839b9d99 100644 --- a/src/code/relocation.c +++ b/src/code/relocation.c @@ -1,3 +1,3 @@ #include -#pragma GLOBAL_ASM("asm/non_matchings/code/relocation/Overlay_DoRelocation.s") \ No newline at end of file +#pragma GLOBAL_ASM("asm/non_matchings/code/relocation/Overlay_DoRelocation.s") diff --git a/src/code/sched.c b/src/code/sched.c index dcf38e22b9..af971ff2e2 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -4,14 +4,13 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C82A0.s") -void func_800C84E4(SchedContext* sc, UNK_TYPE arg1) -{ - if (sc->unk_24C != 0) - { +void func_800C84E4(SchedContext* sc, UNK_TYPE arg1) { + if (sc->unk_24C != 0) { sc->unk_24C = 0; - if (gIrqMgrResetStatus == 0) + if (gIrqMgrResetStatus == 0) { ViConfig_UpdateVi(0); + } } func_800C82A0(arg1); @@ -19,26 +18,25 @@ void func_800C84E4(SchedContext* sc, UNK_TYPE arg1) #pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C8534.s") -void func_800C87CC(SchedContext* sc) -{ +void func_800C87CC(SchedContext* sc) { ViConfig_UpdateVi(1); } #pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C87F0.s") -void func_800C8910(SchedContext* sc) -{ - if (!(sc->curRSPTask->state & 0x10)) - { - if (sc->curRSPTask->list.t.type == M_AUDTASK) +void func_800C8910(SchedContext* sc) { + if (!(sc->curRSPTask->state & 0x10)) { + if (sc->curRSPTask->list.t.type == M_AUDTASK) { __assert("sc->curRSPTask->list.t.type != M_AUDTASK", "../sched.c", 496); + } sc->curRSPTask->state |= 0x10; osSpTaskYield(); - if (D_8012D290 != 0) + if (D_8012D290 != 0) { osSyncPrintf("%08d:osSpTaskYield\n", (u32)((osGetTime() * 64) / 3000)); + } } } @@ -46,39 +44,37 @@ void func_800C8910(SchedContext* sc) #pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C8A94.s") -typedef struct -{ - /* 0x00 */ char unk_00[0x04]; - /* 0x00 */ u32 unk_04; - /* 0x00 */ u32 unk_08; +typedef struct { + /* 0x00 */ char unk_00[0x04]; + /* 0x00 */ u32 unk_04; + /* 0x00 */ u32 unk_08; /* 0x0C */ UNK_TYPE unk_0C; - /* 0x10 */ char unk_10[0x40]; + /* 0x10 */ char unk_10[0x40]; /* 0x50 */ OSMesgQueue* msgQ; - /* 0x54 */ OSMesg msg; + /* 0x54 */ OSMesg msg; } struct_800C8C40; -void func_800C8BC4(SchedContext* sc, struct_800C8C40* arg1) -{ - if (sc->pendingSwapBuf1 == 0) - { +void func_800C8BC4(SchedContext* sc, struct_800C8C40* arg1) { + if (sc->pendingSwapBuf1 == 0) { sc->pendingSwapBuf1 = arg1->unk_0C; LogUtils_CheckValidPointer("sc->pending_swapbuffer1", sc->pendingSwapBuf1, "../sched.c", 618); - if ((sc->unk_240 == NULL) || (sc->unk_240->unk_12 < 1)) + if ((sc->unk_240 == NULL) || (sc->unk_240->unk_12 < 1)) { func_800C84E4(sc, arg1->unk_0C); + } } } -u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1) -{ - if (!(arg1->unk_04 & 3)) - { - if (arg1->msgQ != NULL) +u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1) { + if (!(arg1->unk_04 & 3)) { + if (arg1->msgQ != NULL) { osSendMesg(arg1->msgQ, arg1->msg, OS_MESG_BLOCK); + } - if (arg1->unk_08 & 0x40) + if (arg1->unk_08 & 0x40) { func_800C8BC4(sc, arg1); + } return 1; } @@ -96,18 +92,17 @@ u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1) #pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C94B4.s") -void func_800C95F8(OSMesgQueue* mq) -{ - if (D_8012D290 != 0) +void func_800C95F8(OSMesgQueue* mq) { + if (D_8012D290 != 0) { osSyncPrintf("osScKickEntryMsg\n"); + } osSendMesg(mq, 670, OS_MESG_BLOCK); } #pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C9644.s") -void func_800C9874(SchedContext* sc, void* stack, OSPri priority, UNK_TYPE arg3, UNK_TYPE arg4, UNK_TYPE arg5) -{ +void func_800C9874(SchedContext* sc, void* stack, OSPri priority, UNK_TYPE arg3, UNK_TYPE arg4, UNK_TYPE arg5) { bzero(sc, sizeof(SchedContext)); sc->unk_24C = 1; osCreateMesgQueue(&sc->interruptQ, sc->intBuf, 8); diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c index 3c5cecf9c2..ec5e93b070 100644 --- a/src/code/speed_meter.c +++ b/src/code/speed_meter.c @@ -1,36 +1,30 @@ #include #include -typedef struct -{ +typedef struct { /* 0x00 */ char unk_00[0x18]; - /* 0x18 */ s32 unk_18; - /* 0x1C */ s32 unk_1C; + /* 0x18 */ s32 unk_18; + /* 0x1C */ s32 unk_1C; } struct_801664D0; // size = 0x20 extern struct_801664D0 D_801664D0; -void func_800C9940(struct_801664D0* arg0, u32 arg1, u32 arg2) -{ +void func_800C9940(struct_801664D0* arg0, u32 arg1, u32 arg2) { LogUtils_CheckNullPointer("this", arg0, "../speed_meter.c", 181); arg0->unk_18 = arg1; arg0->unk_1C = arg2; } -void func_800C9998(struct_801664D0* arg0) -{ +void func_800C9998(struct_801664D0* arg0) { func_800C9940(arg0, 0x20, 0x16); } -void func_800C99BC(struct_801664D0* arg0) -{ - +void func_800C99BC(struct_801664D0* arg0) { } #pragma GLOBAL_ASM("asm/non_matchings/code/speed_meter/func_800C99C4.s") -typedef struct -{ +typedef struct { /* 0x00 */ u32 unk_00; /* 0x04 */ u32 unk_04; /* 0x08 */ u16 unk_08; @@ -41,8 +35,8 @@ typedef struct /* 0x18 */ u32 unk_18; } struct_800C9E08; -void func_800C9E08(struct_800C9E08* arg0, u32 arg1, u32 arg2, u16 arg3, u16 arg4, u32 arg5, u32 arg6, u32 arg7, u32 arg8) -{ +void func_800C9E08(struct_800C9E08* arg0, u32 arg1, u32 arg2, u16 arg3, u16 arg4, u32 arg5, u32 arg6, u32 arg7, + u32 arg8) { arg0->unk_00 = arg1; arg0->unk_04 = arg2; arg0->unk_08 = arg3; diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c index 182e53f4d3..454b63a58d 100644 --- a/src/code/sys_cfb.c +++ b/src/code/sys_cfb.c @@ -1,66 +1,55 @@ #include -volatile u32 sSysCfbFbPtr[2]; //may not be volatile but it currently gets SysCfb_Init closer from matching +volatile u32 sSysCfbFbPtr[2]; // may not be volatile but it currently gets SysCfb_Init closer from matching u32 sSysCfbEnd; -//small reaordering +// small reaordering #ifdef NON_MATCHING -void SysCfb_Init(s32 n64dd) -{ - if (osMemSize >= 0x800000U) - { - //8MB or more memory is installed +void SysCfb_Init(s32 n64dd) { + if (osMemSize >= 0x800000U) { + // 8MB or more memory is installed osSyncPrintf("8Mバイト以上のメモリが搭載されています\n"); - if (n64dd == 1) - { - //RAM 8M mode (N64DD compatible) + if (n64dd == 1) { + // RAM 8M mode (N64DD compatible) osSyncPrintf("RAM 8M mode (N64DD対応)\n"); sSysCfbEnd = 0x805FB000; - } - else - { - //The margin for this version is% dK bytes + } else { + // The margin for this version is% dK bytes osSyncPrintf("このバージョンのマージンは %dK バイトです\n", (0x4BC00 / 1024)); sSysCfbEnd = 0x8044BE80; } - } - else if (osMemSize >= 0x400000U) - { + } else if (osMemSize >= 0x400000U) { sSysCfbEnd = 0x80400000; osSyncPrintf("RAM4M mode\n"); - } - else - { + } else { LogUtils_HungupThread("../sys_cfb.c", 0x162); } sSysCfbEnd &= ~0x3f; - //The final address used by the system is% 08x + // The final address used by the system is% 08x osSyncPrintf("システムが使用する最終アドレスは %08x です\n", sSysCfbEnd); - sSysCfbFbPtr[0] = sSysCfbEnd - (SCREEN_WIDTH*SCREEN_HEIGHT*4); - sSysCfbFbPtr[1] = sSysCfbEnd - (SCREEN_WIDTH*SCREEN_HEIGHT*2); - //Frame buffer addresses are% 08x and% 08x + sSysCfbFbPtr[0] = sSysCfbEnd - (SCREEN_WIDTH * SCREEN_HEIGHT * 4); + sSysCfbFbPtr[1] = sSysCfbEnd - (SCREEN_WIDTH * SCREEN_HEIGHT * 2); + // Frame buffer addresses are% 08x and% 08x osSyncPrintf("フレームバッファのアドレスは %08x と %08x です\n", sSysCfbFbPtr[0], sSysCfbFbPtr[1]); } #else #pragma GLOBAL_ASM("asm/non_matchings/code/sys_cfb/SysCfb_Init.s") #endif -void SysCfb_Reset() -{ +void SysCfb_Reset() { sSysCfbFbPtr[0] = 0; sSysCfbFbPtr[1] = 0; sSysCfbEnd = 0; } -u32 SysCfb_GetFbPtr(s32 idx) -{ - if (idx < 2) +u32 SysCfb_GetFbPtr(s32 idx) { + if (idx < 2) { return sSysCfbFbPtr[idx]; + } return 0; } -u32 SysCfb_GetFbEnd() -{ +u32 SysCfb_GetFbEnd() { return sSysCfbEnd; -} \ No newline at end of file +} diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index 75afbc5ee3..b300f189d1 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -1,83 +1,74 @@ #include #include -Mtx gMtxClear = -{ +// clang-format off +Mtx gMtxClear = { 65536, 0, 1, 0, 0, 65536, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, }; -MtxF gMtxFClear = -{ +MtxF gMtxFClear = { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, }; +// clang-format on -MtxF* sMatrixStack; // "Matrix_stack" +MtxF* sMatrixStack; // "Matrix_stack" MtxF* sCurrentMatrix; // "Matrix_now" -void Matrix_Init(GameState* gameState) -{ +void Matrix_Init(GameState* gameState) { sCurrentMatrix = Game_Alloc(gameState, 20 * sizeof(MtxF), "../sys_matrix.c", 153); sMatrixStack = sCurrentMatrix; } -void Matrix_Push(void) -{ +void Matrix_Push(void) { Matrix_MtxFCopy(sCurrentMatrix + 1, sCurrentMatrix); sCurrentMatrix++; } -void Matrix_Pull(void) -{ +void Matrix_Pull(void) { sCurrentMatrix--; - if (sCurrentMatrix < sMatrixStack) + if (sCurrentMatrix < sMatrixStack) { __assert("Matrix_now >= Matrix_stack", "../sys_matrix.c", 176); + } } -void Matrix_Get(MtxF* dest) -{ +void Matrix_Get(MtxF* dest) { Matrix_MtxFCopy(dest, sCurrentMatrix); } -void Matrix_Put(MtxF* src) -{ +void Matrix_Put(MtxF* src) { Matrix_MtxFCopy(sCurrentMatrix, src); } -MtxF* Matrix_GetCurrent(void) -{ +MtxF* Matrix_GetCurrent(void) { return sCurrentMatrix; } -void Matrix_Mult(MtxF* mf, u8 mode) -{ +void Matrix_Mult(MtxF* mf, u8 mode) { MtxF* cmf = Matrix_GetCurrent(); - if (mode == MTXMODE_APPLY) + if (mode == MTXMODE_APPLY) { func_800A6FA0(cmf, mf, cmf); - else + } else { Matrix_MtxFCopy(sCurrentMatrix, mf); + } } #ifdef NON_MATCHING // minor ordering and regalloc differences -void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) -{ +void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) { MtxF* cmf = sCurrentMatrix; - if (mode == MTXMODE_APPLY) - { + if (mode == MTXMODE_APPLY) { cmf->wx += cmf->xx * x + cmf->yx * y + cmf->zx * z; cmf->wy += cmf->xy * x + cmf->yy * y + cmf->zy * z; cmf->wz += cmf->xz * x + cmf->yz * y + cmf->zz * z; cmf->ww += cmf->xw * x + cmf->yw * y + cmf->zw * z; - } - else - { + } else { func_800A7A24(cmf, x, y, z); } } @@ -85,12 +76,10 @@ void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) #pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_Translate.s") #endif -void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode) -{ +void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode) { MtxF* cmf = sCurrentMatrix; - if (mode == MTXMODE_APPLY) - { + if (mode == MTXMODE_APPLY) { cmf->xx *= x; cmf->xy *= x; cmf->xz *= x; @@ -103,25 +92,20 @@ void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode) cmf->xw *= x; cmf->yw *= y; cmf->zw *= z; - } - else - { + } else { func_800A76A4(cmf, x, y, z); } } -void Matrix_RotateX(f32 x, u8 mode) -{ +void Matrix_RotateX(f32 x, u8 mode) { MtxF* cmf; f32 sin; f32 cos; f32 temp1; f32 temp2; - if (mode == MTXMODE_APPLY) - { - if (x != 0) - { + if (mode == MTXMODE_APPLY) { + if (x != 0) { cmf = sCurrentMatrix; sin = sinf(x); @@ -147,18 +131,13 @@ void Matrix_RotateX(f32 x, u8 mode) cmf->yw = temp1 * cos + temp2 * sin; cmf->zw = temp2 * cos - temp1 * sin; } - } - else - { + } else { cmf = sCurrentMatrix; - if (x != 0) - { + if (x != 0) { sin = sinf(x); cos = cosf(x); - } - else - { + } else { sin = 0.0f; cos = 1.0f; } @@ -182,18 +161,15 @@ void Matrix_RotateX(f32 x, u8 mode) } } -void Matrix_RotateY(f32 y, u8 mode) -{ +void Matrix_RotateY(f32 y, u8 mode) { MtxF* cmf; f32 sin; f32 cos; f32 temp1; f32 temp2; - if (mode == MTXMODE_APPLY) - { - if (y != 0) - { + if (mode == MTXMODE_APPLY) { + if (y != 0) { cmf = sCurrentMatrix; sin = sinf(y); @@ -219,18 +195,13 @@ void Matrix_RotateY(f32 y, u8 mode) cmf->xw = temp1 * cos - temp2 * sin; cmf->zw = temp1 * sin + temp2 * cos; } - } - else - { + } else { cmf = sCurrentMatrix; - if (y != 0) - { + if (y != 0) { sin = sinf(y); cos = cosf(y); - } - else - { + } else { sin = 0.0f; cos = 1.0f; } @@ -254,18 +225,15 @@ void Matrix_RotateY(f32 y, u8 mode) } } -void Matrix_RotateZ(f32 z, u8 mode) -{ +void Matrix_RotateZ(f32 z, u8 mode) { MtxF* cmf; f32 sin; f32 cos; f32 temp1; f32 temp2; - if (mode == MTXMODE_APPLY) - { - if (z != 0) - { + if (mode == MTXMODE_APPLY) { + if (z != 0) { cmf = sCurrentMatrix; sin = sinf(z); @@ -291,18 +259,13 @@ void Matrix_RotateZ(f32 z, u8 mode) cmf->xw = temp1 * cos + temp2 * sin; cmf->yw = temp2 * cos - temp1 * sin; } - } - else - { + } else { cmf = sCurrentMatrix; - if (z != 0) - { + if (z != 0) { sin = sinf(z); cos = cosf(z); - } - else - { + } else { sin = 0.0f; cos = 1.0f; } @@ -326,16 +289,14 @@ void Matrix_RotateZ(f32 z, u8 mode) } } -void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode) -{ +void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode) { MtxF* cmf = sCurrentMatrix; f32 temp1; f32 temp2; f32 sin; f32 cos; - if (mode == MTXMODE_APPLY) - { + if (mode == MTXMODE_APPLY) { sin = Math_Sins(z); cos = Math_Coss(z); @@ -359,8 +320,7 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode) cmf->xw = temp1 * cos + temp2 * sin; cmf->yw = temp2 * cos - temp1 * sin; - if (y != 0) - { + if (y != 0) { sin = Math_Sins(y); cos = Math_Coss(y); @@ -385,8 +345,7 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode) cmf->zw = temp1 * sin + temp2 * cos; } - if (x != 0) - { + if (x != 0) { sin = Math_Sins(x); cos = Math_Coss(x); @@ -410,15 +369,12 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode) cmf->yw = temp1 * cos + temp2 * sin; cmf->zw = temp2 * cos - temp1 * sin; } - } - else - { + } else { func_800A7704(cmf, x, y, z); } } -void func_800D1340(Vec3f* arg0, Vec3s* arg1) -{ +void func_800D1340(Vec3f* arg0, Vec3s* arg1) { MtxF* cmf = sCurrentMatrix; f32 sin; f32 cos; @@ -452,8 +408,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1) cmf->xw = temp1 * cos + temp2 * sin; cmf->yw = temp2 * cos - temp1 * sin; - if (arg1->y != 0) - { + if (arg1->y != 0) { sin = Math_Sins(arg1->y); cos = Math_Coss(arg1->y); @@ -478,8 +433,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1) cmf->zw = temp1 * sin + temp2 * cos; } - if (arg1->x != 0) - { + if (arg1->x != 0) { sin = Math_Sins(arg1->x); cos = Math_Coss(arg1->x); @@ -507,8 +461,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1) #ifdef NON_MATCHING // regalloc differences -void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) -{ +void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) { MtxF* cmf = sCurrentMatrix; f32 sp30; f32 sp2C; @@ -528,8 +481,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) cmf->zw = 0.0f; cmf->ww = 1.0f; - if (vec->x != 0) - { + if (vec->x != 0) { sp24 = Math_Sins(vec->x); sp28 = Math_Coss(vec->x); @@ -539,9 +491,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) cmf->yz = sp2C * sp24; cmf->zx = sp30 * sp28; cmf->yx = sp30 * sp24; - } - else - { + } else { cmf->zz = sp2C; cmf->zx = sp30; cmf->zy = 0.0f; @@ -550,8 +500,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) cmf->yy = 1.0f; } - if (vec->z != 0) - { + if (vec->z != 0) { sp24 = Math_Sins(vec->z); sp28 = Math_Coss(vec->z); @@ -568,9 +517,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) sp2C = cmf->yy; cmf->xy = sp2C * sp24; cmf->yy = sp2C * sp28; - } - else - { + } else { cmf->xy = 0.0f; } } @@ -580,74 +527,73 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) #ifdef NON_MATCHING // mostly regalloc differences -Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) -{ +Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) { u16* m1 = (u16*)&dest->m[0][0]; u16* m2 = (u16*)&dest->m[2][0]; s32 temp; temp = src->xx * 65536.0f; - m1[0] = (temp >> 0x10) & 0xFFFF;; + m1[0] = (temp >> 0x10) & 0xFFFF; m2[0] = temp & 0xFFFF; temp = src->xy * 65536.0f; - m1[1] = (temp >> 0x10) & 0xFFFF;; + m1[1] = (temp >> 0x10) & 0xFFFF; m2[1] = temp & 0xFFFF; temp = src->xz * 65536.0f; - m1[2] = (temp >> 0x10) & 0xFFFF;; + m1[2] = (temp >> 0x10) & 0xFFFF; m2[2] = temp & 0xFFFF; temp = src->xw * 65536.0f; - m1[3] = (temp >> 0x10) & 0xFFFF;; + m1[3] = (temp >> 0x10) & 0xFFFF; m2[3] = temp & 0xFFFF; temp = src->yx * 65536.0f; - m1[4] = (temp >> 0x10) & 0xFFFF;; + m1[4] = (temp >> 0x10) & 0xFFFF; m2[4] = temp & 0xFFFF; temp = src->yy * 65536.0f; - m1[5] = (temp >> 0x10) & 0xFFFF;; + m1[5] = (temp >> 0x10) & 0xFFFF; m2[5] = temp & 0xFFFF; temp = src->yz * 65536.0f; - m1[6] = (temp >> 0x10) & 0xFFFF;; + m1[6] = (temp >> 0x10) & 0xFFFF; m2[6] = temp & 0xFFFF; temp = src->yw * 65536.0f; - m1[7] = (temp >> 0x10) & 0xFFFF;; + m1[7] = (temp >> 0x10) & 0xFFFF; m2[7] = temp & 0xFFFF; temp = src->zx * 65536.0f; - m1[8] = (temp >> 0x10) & 0xFFFF;; + m1[8] = (temp >> 0x10) & 0xFFFF; m2[8] = temp & 0xFFFF; temp = src->zy * 65536.0f; - m1[9] = (temp >> 0x10) & 0xFFFF;; + m1[9] = (temp >> 0x10) & 0xFFFF; m2[9] = temp & 0xFFFF; temp = src->zz * 65536.0f; - m1[10] = (temp >> 0x10) & 0xFFFF;; + m1[10] = (temp >> 0x10) & 0xFFFF; m2[10] = temp & 0xFFFF; temp = src->zw * 65536.0f; - m1[11] = (temp >> 0x10) & 0xFFFF;; + m1[11] = (temp >> 0x10) & 0xFFFF; m2[11] = temp & 0xFFFF; temp = src->wx * 65536.0f; - m1[12] = (temp >> 0x10) & 0xFFFF;; + m1[12] = (temp >> 0x10) & 0xFFFF; m2[12] = temp & 0xFFFF; temp = src->wy * 65536.0f; - m1[13] = (temp >> 0x10) & 0xFFFF;; + m1[13] = (temp >> 0x10) & 0xFFFF; m2[13] = temp & 0xFFFF; temp = src->wz * 65536.0f; - m1[14] = (temp >> 0x10) & 0xFFFF;; + m1[14] = (temp >> 0x10) & 0xFFFF; m2[14] = temp & 0xFFFF; temp = src->ww * 65536.0f; - m1[15] = (temp >> 0x10) & 0xFFFF;; + m1[15] = (temp >> 0x10) & 0xFFFF; m2[15] = temp & 0xFFFF; return dest; @@ -656,23 +602,19 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) #pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_MtxFToMtx.s") #endif -Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) -{ +Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) { return Matrix_MtxFToMtx(Matrix_CheckFloats(sCurrentMatrix, file, line), dest); } -Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) -{ +Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) { return Matrix_ToMtx(Graph_Alloc(gfxCtx, sizeof(Mtx)), file, line); } -Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) -{ +Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) { return Matrix_MtxFToMtx(src, Graph_Alloc(gfxCtx, sizeof(Mtx))); } -void Matrix_MultVec3f(Vec3f* src, Vec3f* dest) -{ +void Matrix_MultVec3f(Vec3f* src, Vec3f* dest) { MtxF* cmf = sCurrentMatrix; dest->x = cmf->wx + (cmf->xx * src->x + cmf->yx * src->y + cmf->zx * src->z); @@ -680,8 +622,7 @@ void Matrix_MultVec3f(Vec3f* src, Vec3f* dest) dest->z = cmf->wz + (cmf->xz * src->x + cmf->yz * src->y + cmf->zz * src->z); } -void Matrix_MtxFCopy(MtxF* dest, MtxF* src) -{ +void Matrix_MtxFCopy(MtxF* dest, MtxF* src) { dest->xx = src->xx; dest->xy = src->xy; dest->xz = src->xz; @@ -716,8 +657,7 @@ void Matrix_MtxFCopy(MtxF* dest, MtxF* src) dest->ww = src->ww; } -void Matrix_MtxToMtxF(Mtx* src, MtxF* dest) -{ +void Matrix_MtxToMtxF(Mtx* src, MtxF* dest) { u16* m1 = (u16*)&src->m[0][0]; u16* m2 = (u16*)&src->m[2][0]; @@ -739,15 +679,13 @@ void Matrix_MtxToMtxF(Mtx* src, MtxF* dest) dest->ww = ((m1[15] << 0x10) | m2[15]) * (1 / 65536.0f); } -void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf) -{ +void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf) { dest->x = mf->wx + (mf->xx * src->x + mf->yx * src->y + mf->zx * src->z); dest->y = mf->wy + (mf->xy * src->x + mf->yy * src->y + mf->zy * src->z); dest->z = mf->wz + (mf->xz * src->x + mf->yz * src->y + mf->zz * src->z); } -void Matrix_Reverse(MtxF* mf) -{ +void Matrix_Reverse(MtxF* mf) { f32 temp; temp = mf->xy; @@ -764,8 +702,7 @@ void Matrix_Reverse(MtxF* mf) } #ifdef NON_MATCHING -void func_800D1FD4(MtxF* mf) -{ +void func_800D1FD4(MtxF* mf) { MtxF* cmf = sCurrentMatrix; f32 temp; @@ -790,12 +727,10 @@ void func_800D1FD4(MtxF* mf) #ifdef NON_MATCHING // same differences as func_800D2264 -void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag) -{ +void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag) { vec->x = Math_atan2f(-mf->zy, sqrtf(SQ(mf->zx) + SQ(mf->zz))) * (32768 / M_PI); - if ((vec->x == 0x4000) || (vec->x == -0x4000)) - { + if ((vec->x == 0x4000) || (vec->x == -0x4000)) { vec->z = 0; vec->y = Math_atan2f(-mf->xz, mf->xx) * (32768 / M_PI); return; @@ -806,8 +741,9 @@ void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag) if (!flag) vec->z = Math_atan2f(mf->xy, mf->yy) * (32768 / M_PI); else - vec->z = Math_atan2f(mf->xy / sqrtf(SQ(mf->xx) + SQ(mf->xz) + SQ(mf->xy)), - mf->yy / sqrtf(SQ(mf->yx) + SQ(mf->yz) + SQ(mf->yy))) * (32768 / M_PI); + vec->z = Math_atan2f(mf->xy / sqrtf(SQ(mf->xx) + SQ(mf->xz) + SQ(mf->xy)), + mf->yy / sqrtf(SQ(mf->yx) + SQ(mf->yz) + SQ(mf->yy))) * + (32768 / M_PI); } #else #pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D20CC.s") @@ -815,12 +751,10 @@ void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag) #ifdef NON_MATCHING // same differences as func_800D20CC -void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag) -{ +void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag) { vec->y = Math_atan2f(-mf->xz, sqrtf(SQ(mf->xx) + SQ(mf->xy))) * (32768 / M_PI); - if ((vec->y == 0x4000) || (vec->y == -0x4000)) - { + if ((vec->y == 0x4000) || (vec->y == -0x4000)) { vec->x = 0; vec->z = Math_atan2f(-mf->yx, mf->yy) * (32768 / M_PI); return; @@ -831,8 +765,9 @@ void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag) if (!flag) vec->x = Math_atan2f(mf->yz, mf->zz) * (32768 / M_PI); else - vec->x = Math_atan2f(mf->yz / sqrtf(SQ(mf->yx) + SQ(mf->yy) + SQ(mf->yz)), - mf->zz / sqrtf(SQ(mf->zx) + SQ(mf->zy) + SQ(mf->zz))) * (32768 / M_PI); + vec->x = Math_atan2f(mf->yz / sqrtf(SQ(mf->yx) + SQ(mf->yy) + SQ(mf->yz)), + mf->zz / sqrtf(SQ(mf->zx) + SQ(mf->zy) + SQ(mf->zz))) * + (32768 / M_PI); } #else #pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D2264.s") @@ -840,8 +775,7 @@ void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag) #ifdef NON_MATCHING // regalloc differences -void func_800D23FC(f32 f, Vec3f* vec, u8 mode) -{ +void func_800D23FC(f32 f, Vec3f* vec, u8 mode) { MtxF* cmf; f32 sin; f32 cos; @@ -851,10 +785,8 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode) f32 temp3; f32 temp4; - if (mode == MTXMODE_APPLY) - { - if (f != 0) - { + if (mode == MTXMODE_APPLY) { + if (f != 0) { cmf = sCurrentMatrix; sin = sinf(f); @@ -884,13 +816,10 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode) cmf->yz = temp2 * cos + vec->y * temp4 + sin * (temp3 * vec->x - temp1 * vec->z); cmf->zz = temp3 * cos + vec->z * temp4 + sin * (temp1 * vec->y - temp2 * vec->x); } - } - else - { + } else { cmf = sCurrentMatrix; - if (f != 0) - { + if (f != 0) { sin = sinf(f); cos = cosf(f); rCos = 1.0f - cos; @@ -921,9 +850,7 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode) cmf->wy = 0.0f; cmf->wz = 0.0f; cmf->ww = 1.0f; - } - else - { + } else { cmf->xy = 0.0f; cmf->xz = 0.0f; cmf->xw = 0.0f; @@ -947,17 +874,16 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode) #pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D23FC.s") #endif -MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line) -{ +MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line) { s32 i, j; - for (i = 0; i < 4; i++) - { - for (j = 0; j < 4; j++) - { - if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f)) - { - osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| %12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n", file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz, mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww); + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f)) { + osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| " + "%12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n", + file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz, + mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww); Fault_AddHungupAndCrash(file, line); } } @@ -966,8 +892,7 @@ MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line) return mf; } -void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4) -{ +void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { mf->xy = 0.0f; mf->xz = 0.0f; mf->xw = 0.0f; @@ -986,16 +911,14 @@ void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4) mf->ww = 1.0f; } -void func_800D2A98(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) -{ +void func_800D2A98(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { MtxF mf; func_800D2A34(&mf, arg1, arg2, arg3, arg4); func_801064E0(&mf, mtx); } -void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) -{ +void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { u16* m1 = (u16*)&mtx->m[0][0]; u16* m2 = (u16*)&mtx->m[2][0]; u32 temp; @@ -1047,8 +970,7 @@ void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) m2[15] = 0; } -void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) -{ +void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { u16* m1 = (u16*)&mtx->m[0][0]; u16* m2 = (u16*)&mtx->m[2][0]; u32 temp; @@ -1102,8 +1024,7 @@ void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f #ifdef NON_MATCHING // minor ordering and regalloc differences -void func_800D2CEC(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) -{ +void func_800D2CEC(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { u16* m1 = (u16*)&mtx->m[0][0]; u16* m2 = (u16*)&mtx->m[2][0]; u32 temp; diff --git a/src/code/sys_ucode.c b/src/code/sys_ucode.c index 0bd1690905..f23c7239a0 100644 --- a/src/code/sys_ucode.c +++ b/src/code/sys_ucode.c @@ -1,21 +1,17 @@ #include -u32 SysUcode_GetUCodeBoot() -{ +u32 SysUcode_GetUCodeBoot() { return &D_80009320; } -u32 SysUcode_GetUcodeBootSize() -{ +u32 SysUcode_GetUcodeBootSize() { return (u32)&D_800093F0 - (u32)&D_80009320; } -u32 SysUcode_GetUcode() -{ +u32 SysUcode_GetUcode() { return D_8012DBA0; } -u32 SysUcode_GetUcodeData() -{ +u32 SysUcode_GetUcodeData() { return D_8012DBA4; } diff --git a/src/code/system_malloc.c b/src/code/system_malloc.c index d7c91bbf38..3c75b60654 100644 --- a/src/code/system_malloc.c +++ b/src/code/system_malloc.c @@ -1,131 +1,112 @@ #include -#define LOG_SEVERITY_NOLOG 0 -#define LOG_SEVERITY_ERROR 2 -#define LOG_SEVERITY_VERBOSE 3 +#define LOG_SEVERITY_NOLOG 0 +#define LOG_SEVERITY_ERROR 2 +#define LOG_SEVERITY_VERBOSE 3 s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; Arena gSystemArena; -void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) -{ - if (!ptr) - { - if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) - { +void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { + if (!ptr) { + if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) { //"%s: %u bytes %s failed\n" osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action); __osDisplayArena(&gSystemArena); return; } - } - else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) - { + } else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { //"%s: %u bytes %s succeeded\n" osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action); } } -void* SystemArena_Malloc(u32 size) -{ +void* SystemArena_Malloc(u32 size) { void* ptr; ptr = __osMalloc(&gSystemArena, size); - SystemArena_CheckPointer(ptr, size, "malloc", "確保"); //Secure + SystemArena_CheckPointer(ptr, size, "malloc", "確保"); // Secure return ptr; } -void* SystemArena_MallocDebug(u32 size, const char* file, s32 line) -{ +void* SystemArena_MallocDebug(u32 size, const char* file, s32 line) { void* ptr; ptr = __osMallocDebug(&gSystemArena, size, file, line); - SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "確保"); //Secure + SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "確保"); // Secure return ptr; } -void* SystemArena_MallocR(u32 size) -{ +void* SystemArena_MallocR(u32 size) { void* ptr; ptr = __osMallocR(&gSystemArena, size); - SystemArena_CheckPointer(ptr, size, "malloc_r", "確保"); //Secure + SystemArena_CheckPointer(ptr, size, "malloc_r", "確保"); // Secure return ptr; } -void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line) -{ +void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line) { void* ptr; ptr = __osMallocRDebug(&gSystemArena, size, file, line); - SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "確保"); //Secure + SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "確保"); // Secure return ptr; } -void* SystemArena_Realloc(void* ptr, u32 newSize) -{ +void* SystemArena_Realloc(void* ptr, u32 newSize) { ptr = __osRealloc(&gSystemArena, ptr, newSize); SystemArena_CheckPointer(ptr, newSize, "realloc", "再確保"); // Re-securing return ptr; } -void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) -{ +void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) { ptr = __osReallocDebug(&gSystemArena, ptr, newSize, file, line); SystemArena_CheckPointer(ptr, newSize, "realloc_DEBUG", "再確保"); // Re-securing return ptr; } -void SystemArena_Free(void* ptr) -{ +void SystemArena_Free(void* ptr) { __osFree(&gSystemArena, ptr); } -void SystemArena_FreeDebug(void* ptr, const char* file, s32 line) -{ +void SystemArena_FreeDebug(void* ptr, const char* file, s32 line) { __osFreeDebug(&gSystemArena, ptr, file, line); } -void* SystemArena_Calloc(u32 num, u32 size) -{ +void* SystemArena_Calloc(u32 num, u32 size) { void* ret; u32 n; - n = num*size; + n = num * size; ret = __osMalloc(&gSystemArena, n); - if (ret) + if (ret) { bzero(ret, n); + } SystemArena_CheckPointer(ret, n, "calloc", "確保"); return ret; } -void SystemArena_Display() -{ - //System heap display +void SystemArena_Display() { + // System heap display osSyncPrintf("システムヒープ表示\n"); __osDisplayArena(&gSystemArena); } -void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) -{ +void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) { ArenaImpl_GetSizes(&gSystemArena, outMaxFree, outFree, outAlloc); } -void SystemArena_Check() -{ +void SystemArena_Check() { __osCheckArena(&gSystemArena); } -void SystemArena_Init(void* start, u32 size) -{ +void SystemArena_Init(void* start, u32 size) { gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; __osMallocInit(&gSystemArena, start, size); } -void SystemArena_Cleanup() -{ +void SystemArena_Cleanup() { gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; __osMallocCleanup(&gSystemArena); } -u8 SystemArena_IsInitalized() -{ +u8 SystemArena_IsInitalized() { return __osMallocIsInitalized(&gSystemArena); } diff --git a/src/code/title_setup.c b/src/code/title_setup.c index b0c3e76f99..827987d33c 100644 --- a/src/code/title_setup.c +++ b/src/code/title_setup.c @@ -1,21 +1,17 @@ #include -void TitleSetup_InitImpl(GameState* gameState) -{ - //Zelda common data initalization +void TitleSetup_InitImpl(GameState* gameState) { + // Zelda common data initalization osSyncPrintf("ゼルダ共通データ初期化\n"); SaveContext_Init(); gameState->running = false; SET_NEXT_GAMESTATE(gameState, Title_Init, TitleContext); } -void TitleSetup_Destroy(GameState* gameState) -{ - +void TitleSetup_Destroy(GameState* gameState) { } -void TitleSetup_Init(GameState* gameState) -{ +void TitleSetup_Init(GameState* gameState) { gameState->destroy = TitleSetup_Destroy; TitleSetup_InitImpl(gameState); -} \ No newline at end of file +} diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c index 2117a771a0..ab09cbac5a 100644 --- a/src/code/z_DLF.c +++ b/src/code/z_DLF.c @@ -2,109 +2,110 @@ #include #include -void Overlay_LoadGameState(GameStateOverlay* overlayEntry) -{ - if (overlayEntry->loadedRamAddr != NULL) - { +void Overlay_LoadGameState(GameStateOverlay* overlayEntry) { + if (overlayEntry->loadedRamAddr != NULL) { // Translates to: "ALREADY LINKED" osSyncPrintf("既にリンクされています\n"); return; } - if (overlayEntry->vramStart == 0) + if (overlayEntry->vramStart == 0) { overlayEntry->unk_28 = 0; - else - { + } else { overlayEntry->loadedRamAddr = Overlay_AllocateAndLoad(overlayEntry->vromStart, overlayEntry->vromEnd, overlayEntry->vramStart, overlayEntry->vramEnd); - if (overlayEntry->loadedRamAddr == NULL) - { + if (overlayEntry->loadedRamAddr == NULL) { // Translates to: "LOADING FAILED" osSyncPrintf("ロードに失敗しました\n"); return; } osSyncPrintf(VT_FGCOL(GREEN)); - osSyncPrintf("OVL(d):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", - overlayEntry->vramStart, overlayEntry->vramEnd, + osSyncPrintf("OVL(d):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", overlayEntry->vramStart, overlayEntry->vramEnd, overlayEntry->loadedRamAddr, (u32)overlayEntry->loadedRamAddr + (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart, - (u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr, - ""); + (u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr, ""); osSyncPrintf(VT_RST); - if (overlayEntry->unk_14 != NULL) + if (overlayEntry->unk_14 != NULL) { overlayEntry->unk_14 = (void*)((u32)overlayEntry->unk_14 - (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->unk_14 = NULL; + } - if (overlayEntry->init != NULL) + if (overlayEntry->init != NULL) { overlayEntry->init = (void*)((u32)overlayEntry->init - (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->init = NULL; + } - if (overlayEntry->destroy != NULL) + if (overlayEntry->destroy != NULL) { overlayEntry->destroy = (void*)((u32)overlayEntry->destroy - (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->destroy = NULL; + } - if (overlayEntry->unk_20 != NULL) + if (overlayEntry->unk_20 != NULL) { overlayEntry->unk_20 = (void*)((u32)overlayEntry->unk_20 - (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->unk_20 = NULL; + } - if (overlayEntry->unk_24 != NULL) + if (overlayEntry->unk_24 != NULL) { overlayEntry->unk_24 = (void*)((u32)overlayEntry->unk_24 - (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->unk_24 = NULL; + } overlayEntry->unk_28 = 0; } } -void Overlay_FreeGameState(GameStateOverlay* overlayEntry) -{ - if (overlayEntry->loadedRamAddr != NULL) - { +void Overlay_FreeGameState(GameStateOverlay* overlayEntry) { + if (overlayEntry->loadedRamAddr != NULL) { s32 temp = overlayEntry->unk_28 != 0 ? -1 : 0; - if (temp == 0) - { - if (overlayEntry->unk_14 != NULL) + if (temp == 0) { + if (overlayEntry->unk_14 != NULL) { overlayEntry->unk_14 = (void*)((u32)overlayEntry->unk_14 + (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->unk_14 = NULL; + } - if (overlayEntry->init != NULL) + if (overlayEntry->init != NULL) { overlayEntry->init = (void*)((u32)overlayEntry->init + (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->init = NULL; + } - if (overlayEntry->destroy != NULL) + if (overlayEntry->destroy != NULL) { overlayEntry->destroy = (void*)((u32)overlayEntry->destroy + (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->destroy = NULL; + } - if (overlayEntry->unk_20 != NULL) + if (overlayEntry->unk_20 != NULL) { overlayEntry->unk_20 = (void*)((u32)overlayEntry->unk_20 + (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->unk_20 = NULL; + } - if (overlayEntry->unk_24 != NULL) + if (overlayEntry->unk_24 != NULL) { overlayEntry->unk_24 = (void*)((u32)overlayEntry->unk_24 + (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)); - else + } else { overlayEntry->unk_24 = NULL; + } SystemArena_FreeDebug(overlayEntry->loadedRamAddr, "../z_DLF.c", 149); overlayEntry->loadedRamAddr = NULL; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 958cc4dad2..be598da4a1 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2,57 +2,54 @@ #include #include -void ActorShape_Init(ActorShape* shape, f32 arg1, void* shadowDrawFunc, f32 arg3) -{ +void ActorShape_Init(ActorShape* shape, f32 arg1, void* shadowDrawFunc, f32 arg3) { shape->unk_08 = arg1; shape->shadowDrawFunc = shadowDrawFunc; shape->unk_10 = arg3; shape->unk_14 = -1; } -void func_8002B200(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx, u32 dlist, Color_RGBA8* color) -{ +void func_8002B200(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx, u32 dlist, Color_RGBA8* color) { f32 temp1; f32 temp2; MtxF sp60; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - if (actor->floorPoly != NULL) - { + if (actor->floorPoly != NULL) { temp1 = actor->posRot.pos.y - actor->unk_80; - if (temp1 >= -50.0f && temp1 < 500.0f) - { + if (temp1 >= -50.0f && temp1 < 500.0f) { gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 1553); gfxCtx->polyOpa.p = func_80093774(gfxCtx->polyOpa.p, 0x2C); - gDPSetCombineLERP(gfxCtx->polyOpa.p++, - 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, - 0, 0, 0, COMBINED, 0, 0, 0, COMBINED); + gDPSetCombineLERP(gfxCtx->polyOpa.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, + 0, COMBINED); temp1 = (temp1 < 0.0f) ? 0.0f : ((temp1 > 150.0f) ? 150.0f : temp1); temp2 = 1.0f - (temp1 * (1.f / 350)); - if (color != NULL) + if (color != NULL) { gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, color->r, color->g, color->b, (u32)(actor->shape.unk_14 * temp2) & 0xFF); - else - gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, 0, 0, 0, - (u32)(actor->shape.unk_14 * temp2) & 0xFF); + } else { + gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, 0, 0, 0, (u32)(actor->shape.unk_14 * temp2) & 0xFF); + } func_80038A28(actor->floorPoly, actor->posRot.pos.x, actor->unk_80, actor->posRot.pos.z, &sp60); Matrix_Put(&sp60); - if (dlist != (u32)&D_04049210) + if (dlist != (u32)&D_04049210) { Matrix_RotateY(actor->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); + } temp2 = (1.0f - (temp1 * (1.f / 350))) * actor->shape.unk_10; Matrix_Scale(actor->scale.x * temp2, 1.0f, actor->scale.z * temp2, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1588), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1588), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, dlist); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 1594); @@ -60,25 +57,21 @@ void func_8002B200(Actor* actor, LightMapper* lightMapper, GlobalContext* global } } -void ActorShadow_DrawFunc_Circle(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) -{ +void ActorShadow_DrawFunc_Circle(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) { func_8002B200(actor, lightMapper, globalCtx, &D_04049210, NULL); } Color_RGBA8 D_80115F80 = { 0xFF, 0xFF, 0xFF, 0xFF }; -void ActorShadow_DrawFunc_WhiteCircle(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) -{ +void ActorShadow_DrawFunc_WhiteCircle(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) { func_8002B200(actor, lightMapper, globalCtx, &D_04049210, &D_80115F80); } -void ActorShadow_DrawFunc_Squiggly(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) -{ +void ActorShadow_DrawFunc_Squiggly(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) { func_8002B200(actor, lightMapper, globalCtx, &D_04049AD0, NULL); } -void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6) -{ +void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; f32 sp58; Gfx* gfxArr[7]; @@ -95,7 +88,8 @@ void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, Matrix_RotateY(sp58, MTXMODE_APPLY); Matrix_Scale(arg5, 1.0f, arg5 * arg6, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1687), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1687), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, &D_04048180); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 1693); @@ -103,8 +97,7 @@ void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, #ifdef NON_MATCHING // this function still needs a lot of work -void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) -{ +void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) { GraphicsContext* gfxCtx; MtxF spE8; Vec2f spE0; @@ -129,8 +122,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa temp_f20 = actor->posRot.pos.y - actor->unk_80; - if (temp_f20 > 20.0f) - { + if (temp_f20 > 20.0f) { temp_10 = actor->shape.unk_10; actor->shape.unk_10 *= 0.3f; temp_14 = actor->shape.unk_14; @@ -140,8 +132,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa actor->shape.unk_14 = temp_14; } - if (temp_f20 < 200.0f) - { + if (temp_f20 < 200.0f) { spAC = &spE0.x; gfxCtx = globalCtx->state.gfxCtx; temp_s6 = lightMapper->numLights - 2; @@ -153,8 +144,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa phi_s7 = &actor->unk_CC; - for (index = 0; index < 2; index++) - { + for (index = 0; index < 2; index++) { phi_s7->y += 50.0f; *spAC = func_800BFCB8(globalCtx, &spE8, phi_s7); phi_s7->y -= 50.0f; @@ -163,8 +153,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa phi_f2 = phi_s7->y - *spAC; - if ((phi_f2 >= -1.0f) && (phi_f2 < 500.0f)) - { + if ((phi_f2 >= -1.0f) && (phi_f2 < 500.0f)) { phi_s0 = lightMapper->lights; if (phi_f2 <= 0.0f) @@ -183,13 +172,10 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa phi_s2 = 0; - for (phi_s1 = 0; phi_s1 < temp_s6; phi_s1++) - { - if (phi_s0->l.dir[1] > 0) - { + for (phi_s1 = 0; phi_s1 < temp_s6; phi_s1++) { + if (phi_s0->l.dir[1] > 0) { temp_lo = ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2]); - if (temp_lo > 0) - { + if (temp_lo > 0) { func_8002B66C(globalCtx, phi_s0, &spE8, temp_lo, temp_f24, temp_f22_2, temp_f20_2); phi_s2 += temp_lo; } @@ -197,11 +183,10 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa phi_s0++; } - for (phi_s1 = 0; phi_s1 < 2; phi_s1++) - { - if (phi_s0->l.dir[1] > 0) - { - temp_a3 = (ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2])) - (phi_s2 * 8); + for (phi_s1 = 0; phi_s1 < 2; phi_s1++) { + if (phi_s0->l.dir[1] > 0) { + temp_a3 = (ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2])) - + (phi_s2 * 8); if (temp_a3 > 0) func_8002B66C(globalCtx, phi_s0, &spE8, temp_a3, temp_f24, temp_f22_2, temp_f20_2); } @@ -215,8 +200,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa if (!(actor->bgCheckFlags & 1)) actor->shape.unk_15 = 0; - else if (actor->shape.unk_15 == 3) - { + else if (actor->shape.unk_15 == 3) { temp_f0 = actor->unk_CC.y - actor->unk_D8.y; if ((spE0.x + temp_f0) < (spE0.y - temp_f0)) actor->shape.unk_15 = 2; @@ -231,28 +215,25 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s") #endif -void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, UNK_PTR arg3, s32 arg4, UNK_PTR arg5) -{ - if (arg1 == arg2) +void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, UNK_PTR arg3, s32 arg4, UNK_PTR arg5) { + if (arg1 == arg2) { Matrix_MultVec3f(arg3, &actor->unk_CC); - else if (arg1 == arg4) + } else if (arg1 == arg4) { Matrix_MultVec3f(arg5, &actor->unk_D8); + } } -void func_8002BE04(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, f32* arg3) -{ +void func_8002BE04(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, f32* arg3) { func_800A6E10(&globalCtx->mf_11D60, arg1, arg2, arg3); *arg3 = (*arg3 < 1.0f) ? 1.0f : (1.0f / *arg3); } -typedef struct -{ +typedef struct { /* 0x00 */ Color_RGBA8 inner; /* 0x04 */ Color_RGBA8 outer; } NaviColor; // size = 0x8 -NaviColor sNaviColorList[] = -{ +NaviColor sNaviColorList[] = { { { 0x00, 0xFF, 0x00, 0xFF }, { 0x00, 0xFF, 0x00, 0x00 } }, { { 0x00, 0xFF, 0x00, 0xFF }, { 0x00, 0xFF, 0x00, 0x00 } }, { { 0xFF, 0xFF, 0xFF, 0xFF }, { 0x00, 0x00, 0xFF, 0x00 } }, @@ -269,21 +250,18 @@ NaviColor sNaviColorList[] = }; // unused -Gfx D_80115FF0[] = -{ +Gfx D_80115FF0[] = { gsSPEndDisplayList(), }; -void func_8002BE64(TargetContext* targetCtx, s32 index, f32 arg2, f32 arg3, f32 arg4) -{ +void func_8002BE64(TargetContext* targetCtx, s32 index, f32 arg2, f32 arg3, f32 arg4) { targetCtx->arr_50[index].pos.x = arg2; targetCtx->arr_50[index].pos.y = arg3; targetCtx->arr_50[index].pos.z = arg4; targetCtx->arr_50[index].unk_0C = targetCtx->unk_44; } -void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globalCtx) -{ +void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globalCtx) { TargetContextEntry* entry; NaviColor* naviColor; s32 i; @@ -295,8 +273,7 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globa naviColor = &sNaviColorList[actorType]; entry = &targetCtx->arr_50[0]; - for (i = 0; i < ARRAY_COUNT(targetCtx->arr_50); i++) - { + for (i = 0; i < ARRAY_COUNT(targetCtx->arr_50); i++) { func_8002BE64(targetCtx, i, 0.0f, 0.0f, 0.0f); entry->color.r = naviColor->inner.r; entry->color.g = naviColor->inner.g; @@ -305,8 +282,7 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globa } } -void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorType, GlobalContext* globalCtx) -{ +void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorType, GlobalContext* globalCtx) { NaviColor* naviColor = &sNaviColorList[actorType]; targetCtx->naviRefPos.x = actor->posRot2.pos.x; targetCtx->naviRefPos.y = actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y); @@ -321,8 +297,7 @@ void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorType, Global targetCtx->naviOuter.a = naviColor->outer.a; } -void func_8002C0C0(TargetContext* targetCtx, Actor* actor, GlobalContext* globalCtx) -{ +void func_8002C0C0(TargetContext* targetCtx, Actor* actor, GlobalContext* globalCtx) { targetCtx->arrowPointedActor = NULL; targetCtx->targetedActor = NULL; targetCtx->unk_40 = 0.0f; @@ -336,8 +311,7 @@ void func_8002C0C0(TargetContext* targetCtx, Actor* actor, GlobalContext* global #ifdef NON_MATCHING // this function still needs some work -void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) -{ +void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { Actor* actor; Player* player; GraphicsContext* gfxCtx; @@ -356,10 +330,9 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) Vec3f* vec; gfxCtx = globalCtx->state.gfxCtx; - func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 2029); + func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 2029); - if (targetCtx->unk_48 != 0) - { + if (targetCtx->unk_48 != 0) { player = PLAYER; spCE = 0xFF; @@ -370,13 +343,10 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) else spB8 = 3; - if (targetCtx->targetedActor != NULL) - { + if (targetCtx->targetedActor != NULL) { Math_Vec3f_Copy(&targetCtx->targetCenterPos, &targetCtx->targetedActor->posRot2.pos); var1 = (500.0f - targetCtx->unk_44) / 420.0f; - } - else - { + } else { targetCtx->unk_48 -= 0x78; if (targetCtx->unk_48 < 0) targetCtx->unk_48 = 0; @@ -399,16 +369,13 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) func_8002BE64(targetCtx, targetCtx->unk_4C, spBC.x, spBC.y, spBC.z); - if ((!(player->stateFlags1 & 0x40)) || (targetCtx->targetedActor != player->unk_664)) - { + if ((!(player->stateFlags1 & 0x40)) || (targetCtx->targetedActor != player->unk_664)) { gfxCtx->overlay.p = func_80093774(gfxCtx->overlay.p, 0x39); - for (spB0 = 0, spAC = targetCtx->unk_4C; spB0 < spB8; spB0++) - { + for (spB0 = 0, spAC = targetCtx->unk_4C; spB0 < spB8; spB0++) { entry = &targetCtx->arr_50[spAC]; - if (entry->unk_0C < 500.0f) - { + if (entry->unk_0C < 500.0f) { if (entry->unk_0C <= 120.0f) var2 = 0.15f; else @@ -417,17 +384,17 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) Matrix_Translate(entry->pos.x, entry->pos.y, 0.0f, MTXMODE_NEW); Matrix_Scale(var2, 0.15f, 1.0f, MTXMODE_APPLY); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - entry->color.r, entry->color.g, entry->color.b, (u8)spCE); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, entry->color.r, entry->color.g, entry->color.b, + (u8)spCE); Matrix_RotateZ((targetCtx->unk_4B & 0x7F) * (M_PI / 64), MTXMODE_APPLY); - for (i = 0; i < 4; i++) - { + for (i = 0; i < 4; i++) { Matrix_RotateZ(M_PI / 2, MTXMODE_APPLY); Matrix_Push(); Matrix_Translate(entry->unk_0C, entry->unk_0C, 0.0f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 2116), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 2116), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->overlay.p++, &D_0404D450); Matrix_Pull(); } @@ -442,25 +409,19 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) } actor = targetCtx->unk_94; - if ((actor != NULL) && !(actor->flags & 0x8000000)) - { + if ((actor != NULL) && !(actor->flags & 0x8000000)) { NaviColor* naviColor = &sNaviColorList[actor->type]; gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0x7); - Matrix_Translate(actor->posRot2.pos.x, - actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y) + 17.0f, - actor->posRot2.pos.z, - MTXMODE_NEW); + Matrix_Translate(actor->posRot2.pos.x, actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y) + 17.0f, + actor->posRot2.pos.z, MTXMODE_NEW); Matrix_RotateY((f32)((u16)(globalCtx->gameplayFrames * 3000)) * (M_PI / 32768), MTXMODE_APPLY); - Matrix_Scale((iREG(27) + 35) / 1000.0f, - (iREG(28) + 60) / 1000.0f, - (iREG(29) + 50) / 1000.0f, - MTXMODE_APPLY); + Matrix_Scale((iREG(27) + 35) / 1000.0f, (iREG(28) + 60) / 1000.0f, (iREG(29) + 50) / 1000.0f, MTXMODE_APPLY); - gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, - naviColor->inner.r, naviColor->inner.g, naviColor->inner.b, 0xFF); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 2153), G_MTX_MODELVIEW | G_MTX_LOAD); + gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, naviColor->inner.r, naviColor->inner.g, naviColor->inner.b, 0xFF); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 2153), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, &D_0400CB70); } @@ -470,8 +431,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_8002C124.s") #endif -void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, GlobalContext* globalCtx) -{ +void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, GlobalContext* globalCtx) { s32 pad; Actor* unkActor; s32 actorType; @@ -487,39 +447,37 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl unkActor = NULL; - if ((player->unk_664 != NULL) && (player->unk_84B[player->unk_846] == 2)) + if ((player->unk_664 != NULL) && (player->unk_84B[player->unk_846] == 2)) { targetCtx->unk_94 = NULL; - else - { + } else { func_80032AF0(globalCtx, &globalCtx->actorCtx, &unkActor, player); targetCtx->unk_94 = unkActor; } - if (targetCtx->unk_8C != NULL) - { + if (targetCtx->unk_8C != NULL) { unkActor = targetCtx->unk_8C; targetCtx->unk_8C = NULL; - } - else if (actorArg != NULL) + } else if (actorArg != NULL) { unkActor = actorArg; + } - if (unkActor != NULL) + if (unkActor != NULL) { actorType = unkActor->type; - else + } else { actorType = player->actor.type; + } - if ((unkActor != targetCtx->arrowPointedActor) || (actorType != targetCtx->activeType)) - { + if ((unkActor != targetCtx->arrowPointedActor) || (actorType != targetCtx->activeType)) { targetCtx->arrowPointedActor = unkActor; targetCtx->activeType = actorType; targetCtx->unk_40 = 1.0f; } - if (unkActor == NULL) + if (unkActor == NULL) { unkActor = &player->actor; + } - if (Math_ApproxF(&targetCtx->unk_40, 0.0f, 0.25f) == 0) - { + if (Math_ApproxF(&targetCtx->unk_40, 0.0f, 0.25f) == 0) { temp1 = 0.25f / targetCtx->unk_40; temp2 = unkActor->posRot.pos.x - targetCtx->naviRefPos.x; temp3 = (unkActor->posRot.pos.y + (unkActor->unk_4C * unkActor->scale.y)) - targetCtx->naviRefPos.y; @@ -527,26 +485,25 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl targetCtx->naviRefPos.x += temp2 * temp1; targetCtx->naviRefPos.y += temp3 * temp1; targetCtx->naviRefPos.z += temp4 * temp1; - } - else + } else { func_8002BF60(targetCtx, unkActor, actorType, globalCtx); - - if ((actorArg != NULL) && (targetCtx->unk_4B == 0)) - { - func_8002BE04(globalCtx, &actorArg->posRot2.pos, &sp50, &sp4C); - if (((sp50.z <= 0.0f) || (1.0f <= fabsf(sp50.x * sp4C))) || (1.0f <= fabsf(sp50.y * sp4C))) - actorArg = NULL; } - if (actorArg != NULL) - { - if (actorArg != targetCtx->targetedActor) - { + if ((actorArg != NULL) && (targetCtx->unk_4B == 0)) { + func_8002BE04(globalCtx, &actorArg->posRot2.pos, &sp50, &sp4C); + if (((sp50.z <= 0.0f) || (1.0f <= fabsf(sp50.x * sp4C))) || (1.0f <= fabsf(sp50.y * sp4C))) { + actorArg = NULL; + } + } + + if (actorArg != NULL) { + if (actorArg != targetCtx->targetedActor) { func_8002BE98(targetCtx, actorArg->type, globalCtx); targetCtx->targetedActor = actorArg; - if (actorArg->id == ACTOR_EN_BOOM) + if (actorArg->id == ACTOR_EN_BOOM) { targetCtx->unk_48 = 0; + } lockOnSfxId = ((actorArg->flags & 5) == 5) ? NA_SE_SY_LOCK_ON : NA_SE_SY_LOCK_ON_HUMAN; func_80078884(lockOnSfxId); @@ -556,21 +513,17 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl targetCtx->targetCenterPos.y = actorArg->posRot.pos.y - (actorArg->shape.unk_08 * actorArg->scale.y); targetCtx->targetCenterPos.z = actorArg->posRot.pos.z; - if (targetCtx->unk_4B == 0) - { + if (targetCtx->unk_4B == 0) { temp5 = (500.0f - targetCtx->unk_44) * 3.0f; temp6 = (temp5 < 30.0f) ? 30.0f : ((100.0f < temp5) ? 100.0f : temp5); - if (Math_ApproxF(&targetCtx->unk_44, 80.0f, temp6) != 0) + if (Math_ApproxF(&targetCtx->unk_44, 80.0f, temp6) != 0) { targetCtx->unk_4B++; - } - else - { + } + } else { targetCtx->unk_4B = (targetCtx->unk_4B + 3) | 0x80; targetCtx->unk_44 = 120.0f; } - } - else - { + } else { targetCtx->targetedActor = NULL; Math_ApproxF(&targetCtx->unk_44, 500.0f, 80.0f); } @@ -579,166 +532,155 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl /** * Tests if current scene switch flag is set. */ -s32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag) -{ - if (flag < 0x20) +s32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag) { + if (flag < 0x20) { return globalCtx->actorCtx.flags.swch & (1 << flag); - else + } else { return globalCtx->actorCtx.flags.tempSwch & (1 << flag); + } } /** * Sets current scene switch flag. */ -void Flags_SetSwitch(GlobalContext* globalCtx, s32 flag) -{ - if (flag < 0x20) +void Flags_SetSwitch(GlobalContext* globalCtx, s32 flag) { + if (flag < 0x20) { globalCtx->actorCtx.flags.swch |= (1 << flag); - else + } else { globalCtx->actorCtx.flags.tempSwch |= (1 << flag); + } } /** * Unsets current scene switch flag. */ -void Flags_UnsetSwitch(GlobalContext* globalCtx, s32 flag) -{ - if (flag < 0x20) +void Flags_UnsetSwitch(GlobalContext* globalCtx, s32 flag) { + if (flag < 0x20) { globalCtx->actorCtx.flags.swch &= ~(1 << flag); - else + } else { globalCtx->actorCtx.flags.tempSwch &= ~(1 << flag); + } } /** * Tests if current scene unknown flag is set. */ -s32 Flags_GetUnknown(GlobalContext* globalCtx, s32 flag) -{ - if (flag < 0x20) +s32 Flags_GetUnknown(GlobalContext* globalCtx, s32 flag) { + if (flag < 0x20) { return globalCtx->actorCtx.flags.unk0 & (1 << flag); - else + } else { return globalCtx->actorCtx.flags.unk1 & (1 << flag); + } } /** * Sets current scene unknown flag. */ -void Flags_SetUnknown(GlobalContext* globalCtx, s32 flag) -{ - if (flag < 0x20) +void Flags_SetUnknown(GlobalContext* globalCtx, s32 flag) { + if (flag < 0x20) { globalCtx->actorCtx.flags.unk0 |= (1 << flag); - else + } else { globalCtx->actorCtx.flags.unk1 |= (1 << flag); + } } /** * Unsets current scene unknown flag. */ -void Flags_UnsetUnknown(GlobalContext* globalCtx, s32 flag) -{ - if (flag < 0x20) +void Flags_UnsetUnknown(GlobalContext* globalCtx, s32 flag) { + if (flag < 0x20) { globalCtx->actorCtx.flags.unk0 &= ~(1 << flag); - else + } else { globalCtx->actorCtx.flags.unk1 &= ~(1 << flag); + } } /** * Tests if current scene chest flag is set. */ -s32 Flags_GetTreasure(GlobalContext* globalCtx, s32 flag) -{ +s32 Flags_GetTreasure(GlobalContext* globalCtx, s32 flag) { return globalCtx->actorCtx.flags.chest & (1 << flag); } /** * Sets current scene chest flag. */ -void Flags_SetTreasure(GlobalContext* globalCtx, s32 flag) -{ +void Flags_SetTreasure(GlobalContext* globalCtx, s32 flag) { globalCtx->actorCtx.flags.chest |= (1 << flag); } /** * Tests if current scene clear flag is set. */ -s32 Flags_GetClear(GlobalContext* globalCtx, s32 flag) -{ +s32 Flags_GetClear(GlobalContext* globalCtx, s32 flag) { return globalCtx->actorCtx.flags.clear & (1 << flag); } /** * Sets current scene clear flag. */ -void Flags_SetClear(GlobalContext* globalCtx, s32 flag) -{ +void Flags_SetClear(GlobalContext* globalCtx, s32 flag) { globalCtx->actorCtx.flags.clear |= (1 << flag); } /** * Unsets current scene clear flag. */ -void Flags_UnsetClear(GlobalContext* globalCtx, s32 flag) -{ +void Flags_UnsetClear(GlobalContext* globalCtx, s32 flag) { globalCtx->actorCtx.flags.clear &= ~(1 << flag); } /** * Tests if current scene temp clear flag is set. */ -s32 Flags_GetTempClear(GlobalContext* globalCtx, s32 flag) -{ +s32 Flags_GetTempClear(GlobalContext* globalCtx, s32 flag) { return globalCtx->actorCtx.flags.tempClear & (1 << flag); } /** * Sets current scene temp clear flag. */ -void Flags_SetTempClear(GlobalContext* globalCtx, s32 flag) -{ +void Flags_SetTempClear(GlobalContext* globalCtx, s32 flag) { globalCtx->actorCtx.flags.tempClear |= 1 << flag; } /** * Unsets current scene temp clear flag. */ -void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag) -{ +void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag) { globalCtx->actorCtx.flags.tempClear &= ~(1 << flag); } /** * Tests if current scene collectible flag is set. */ -s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag) -{ - if (flag < 0x20) +s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag) { + if (flag < 0x20) { return globalCtx->actorCtx.flags.collect & (1 << flag); - else + } else { return globalCtx->actorCtx.flags.tempCollect & (1 << flag); + } } /** * Sets current scene collectible flag. */ -void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag) -{ - if (flag != 0) - { - if (flag < 0x20) +void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag) { + if (flag != 0) { + if (flag < 0x20) { globalCtx->actorCtx.flags.collect |= 1 << flag; - else + } else { globalCtx->actorCtx.flags.tempCollect |= 1 << flag; + } } } -void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) -{ +void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) { titleCtx->delayA = titleCtx->delayB = titleCtx->unk_E = titleCtx->unk_C = 0; } -void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, - s16 arg3, s16 arg4, u8 arg5, u8 arg6) -{ +void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s16 arg3, s16 arg4, + u8 arg5, u8 arg6) { titleCtx->texture = texture; titleCtx->unk_4 = arg3; titleCtx->unk_6 = arg4; @@ -748,14 +690,14 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx titleCtx->delayB = 0; } -void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, - s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7) -{ +void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s32 arg3, s32 arg4, + s32 arg5, s32 arg6, s32 arg7) { Scene* loadedScene = globalCtx->loadedScene; u32 size = loadedScene->titleVromEnd - loadedScene->titleVromStart; - if ((size != 0) && (size <= 0x3000)) + if ((size != 0) && (size <= 0x3000)) { DmaMgr_SendRequest1(texture, loadedScene->titleVromStart, size, "../z_actor.c", 2765); + } titleCtx->texture = texture; titleCtx->unk_4 = arg3; @@ -766,17 +708,12 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt titleCtx->delayB = arg7; } -void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) -{ - if (DECR(titleCtx->delayB) == 0) - { - if (DECR(titleCtx->delayA) == 0) - { +void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) { + if (DECR(titleCtx->delayB) == 0) { + if (DECR(titleCtx->delayA) == 0) { Math_ApproxS(&titleCtx->unk_C, 0, 30); Math_ApproxS(&titleCtx->unk_E, 0, 70); - } - else - { + } else { Math_ApproxS(&titleCtx->unk_C, 255, 10); Math_ApproxS(&titleCtx->unk_E, 255, 20); } @@ -785,8 +722,7 @@ void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) #ifdef NON_MATCHING // major ordering and stack usage differences -void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) -{ +void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { s32 spCC; s32 spC8; s32 unk1; @@ -799,8 +735,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) Gfx* gfxArr[4]; s32 sp38; - if (titleCtx->unk_C != 0) - { + if (titleCtx->unk_C != 0) { spCC = titleCtx->unk_8; spC8 = titleCtx->unk_9; spC0 = (titleCtx->unk_4 * 4) - (spCC * 2); @@ -819,41 +754,25 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) gfxCtx->overlay.p = func_80093808(gfxCtx->overlay.p); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - (u8)titleCtx->unk_E, (u8)titleCtx->unk_E, - (u8)titleCtx->unk_E, (u8)titleCtx->unk_C); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, (u8)titleCtx->unk_E, (u8)titleCtx->unk_E, (u8)titleCtx->unk_E, + (u8)titleCtx->unk_C); - gDPLoadTextureBlock(gfxCtx->overlay.p++, - titleCtx->texture + spB0, - G_IM_FMT_IA, - G_IM_SIZ_8b, - spCC, spC8, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gfxCtx->overlay.p++, titleCtx->texture + spB0, G_IM_FMT_IA, G_IM_SIZ_8b, spCC, spC8, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); - gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB8, - ((sp38 * 2) + spC0) - 4, spB8 - 1, G_TX_RENDERTILE, - 0, 0, 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB8, ((sp38 * 2) + spC0) - 4, spB8 - 1, G_TX_RENDERTILE, 0, 0, + 1024, 1024); spC8 = titleCtx->unk_9 - spC8; - if (spC8 > 0) - { - gDPLoadTextureBlock(gfxCtx->overlay.p++, - titleCtx->texture + spB0 + 0x1000, - G_IM_FMT_IA, - G_IM_SIZ_8b, - spCC, spC8, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, + if (spC8 > 0) { + gDPLoadTextureBlock(gfxCtx->overlay.p++, titleCtx->texture + spB0 + 0x1000, G_IM_FMT_IA, G_IM_SIZ_8b, spCC, + spC8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB4, - ((sp38 * 2) + spC0) - 4, spB4 - 1, G_TX_RENDERTILE, - 0, 0, 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB4, ((sp38 * 2) + spC0) - 4, spB4 - 1, G_TX_RENDERTILE, 0, + 0, 1024, 1024); } func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 2880); @@ -863,11 +782,8 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/TitleCard_Draw.s") #endif -s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx) -{ - if ((globalCtx->actorCtx.titleCtx.delayB != 0) || - (globalCtx->actorCtx.titleCtx.unk_C != 0)) - { +s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx) { + if ((globalCtx->actorCtx.titleCtx.delayB != 0) || (globalCtx->actorCtx.titleCtx.unk_C != 0)) { titleCtx->delayA = 0; titleCtx->delayB = 0; return 0; @@ -876,20 +792,17 @@ s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx) return 1; } -void Actor_Kill(Actor* actor) -{ +void Actor_Kill(Actor* actor) { actor->draw = NULL; actor->update = NULL; actor->flags &= ~0x1; } -void Actor_InitPosRot(Actor* actor) -{ +void Actor_InitPosRot(Actor* actor) { actor->posRot = actor->initPosRot; } -void Actor_SetHeight(Actor* actor, f32 offset) -{ +void Actor_SetHeight(Actor* actor, f32 offset) { actor->posRot2.pos.x = actor->posRot.pos.x; actor->posRot2.pos.y = actor->posRot.pos.y + offset; actor->posRot2.pos.z = actor->posRot.pos.z; @@ -899,30 +812,25 @@ void Actor_SetHeight(Actor* actor, f32 offset) actor->posRot2.rot.z = actor->posRot.rot.z; } -void func_8002D5F4(Actor* actor) -{ +void func_8002D5F4(Actor* actor) { actor->posRot.rot = actor->shape.rot; } -void func_8002D610(Actor* actor) -{ +void func_8002D610(Actor* actor) { actor->shape.rot = actor->posRot.rot; } -void Actor_SetScale(Actor* actor, f32 scale) -{ +void Actor_SetScale(Actor* actor, f32 scale) { actor->scale.z = scale; actor->scale.y = scale; actor->scale.x = scale; } -void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor) -{ +void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor) { gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[actor->objBankIndex].segment); } -void Actor_Init(Actor* actor, GlobalContext* globalCtx) -{ +void Actor_Init(Actor* actor, GlobalContext* globalCtx) { Actor_InitPosRot(actor); func_8002D610(actor); Actor_SetHeight(actor, 0.0f); @@ -938,26 +846,21 @@ void Actor_Init(Actor* actor, GlobalContext* globalCtx) func_80061E48(&actor->sub_98); actor->floorPolySource = 0x32; ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f); - if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) - { + if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { Actor_SetObjectDependency(globalCtx, actor); actor->init(actor, globalCtx); actor->init = NULL; } } -void Actor_Destroy(Actor* actor, GlobalContext* globalCtx) -{ +void Actor_Destroy(Actor* actor, GlobalContext* globalCtx) { ActorOverlay* overlayEntry; char* name; - if (actor->destroy != NULL) - { + if (actor->destroy != NULL) { actor->destroy(actor, globalCtx); actor->destroy = NULL; - } - else - { + } else { overlayEntry = actor->overlayEntry; name = overlayEntry->name != NULL ? overlayEntry->name : ""; @@ -966,52 +869,46 @@ void Actor_Destroy(Actor* actor, GlobalContext* globalCtx) } } -void func_8002D7EC(Actor* actor) -{ +void func_8002D7EC(Actor* actor) { f32 speedRate = R_UPDATE_RATE * 0.5f; actor->posRot.pos.x += (actor->velocity.x * speedRate) + actor->sub_98.displacement.x; actor->posRot.pos.y += (actor->velocity.y * speedRate) + actor->sub_98.displacement.y; actor->posRot.pos.z += (actor->velocity.z * speedRate) + actor->sub_98.displacement.z; } -void func_8002D868(Actor* actor) -{ +void func_8002D868(Actor* actor) { actor->velocity.x = Math_Sins(actor->posRot.rot.y) * actor->speedXZ; actor->velocity.z = Math_Coss(actor->posRot.rot.y) * actor->speedXZ; actor->velocity.y += actor->gravity; - if (actor->velocity.y < actor->minVelocityY) + if (actor->velocity.y < actor->minVelocityY) { actor->velocity.y = actor->minVelocityY; + } } -void Actor_MoveForward(Actor* actor) -{ +void Actor_MoveForward(Actor* actor) { func_8002D868(actor); func_8002D7EC(actor); } -void func_8002D908(Actor* actor) -{ +void func_8002D908(Actor* actor) { f32 sp24 = Math_Coss(actor->posRot.rot.x) * actor->speedXZ; actor->velocity.x = Math_Sins(actor->posRot.rot.y) * sp24; actor->velocity.y = Math_Sins(actor->posRot.rot.x) * actor->speedXZ; actor->velocity.z = Math_Coss(actor->posRot.rot.y) * sp24; } -void func_8002D97C(Actor* actor) -{ +void func_8002D97C(Actor* actor) { func_8002D908(actor); func_8002D7EC(actor); } -void func_8002D9A4(Actor* actor, f32 arg1) -{ +void func_8002D9A4(Actor* actor, f32 arg1) { actor->speedXZ = Math_Coss(actor->posRot.rot.x) * arg1; actor->velocity.y = -Math_Sins(actor->posRot.rot.x) * arg1; } -void func_8002D9F8(Actor* actor, UNK_PTR arg1) -{ +void func_8002D9F8(Actor* actor, UNK_PTR arg1) { Vec3f sp1C; func_800A54FC(arg1, &sp1C, actor->shape.rot.y, actor); actor->posRot.pos.x += sp1C.x * actor->scale.x; @@ -1019,58 +916,47 @@ void func_8002D9F8(Actor* actor, UNK_PTR arg1) actor->posRot.pos.z += sp1C.z * actor->scale.z; } -s16 func_8002DA78(Actor* actorA, Actor* actorB) -{ +s16 func_8002DA78(Actor* actorA, Actor* actorB) { return Math_Vec3f_Yaw(&actorA->posRot.pos, &actorB->posRot.pos); } -s16 func_8002DA9C(Actor* actorA, Actor* actorB) -{ +s16 func_8002DA9C(Actor* actorA, Actor* actorB) { return Math_Vec3f_Yaw(&actorA->posRot2.pos, &actorB->posRot2.pos); } -s16 func_8002DAC0(Actor* actor, Vec3f* arg1) -{ +s16 func_8002DAC0(Actor* actor, Vec3f* arg1) { return Math_Vec3f_Yaw(&actor->posRot.pos, arg1); } -s16 func_8002DAE0(Actor* actorA, Actor* actorB) -{ +s16 func_8002DAE0(Actor* actorA, Actor* actorB) { return Math_Vec3f_Pitch(&actorA->posRot.pos, &actorB->posRot.pos); } -s16 func_8002DB04(Actor* actorA, Actor* actorB) -{ +s16 func_8002DB04(Actor* actorA, Actor* actorB) { return Math_Vec3f_Pitch(&actorA->posRot2.pos, &actorB->posRot2.pos); } -s16 func_8002DB28(Actor* actor, Vec3f* arg1) -{ +s16 func_8002DB28(Actor* actor, Vec3f* arg1) { return Math_Vec3f_Pitch(&actor->posRot.pos, arg1); } -f32 func_8002DB48(Actor* actorA, Actor* actorB) -{ +f32 func_8002DB48(Actor* actorA, Actor* actorB) { return Math_Vec3f_DistXYZ(&actorA->posRot.pos, &actorB->posRot.pos); } -f32 func_8002DB6C(Actor* actor, Vec3f* arg1) -{ +f32 func_8002DB6C(Actor* actor, Vec3f* arg1) { return Math_Vec3f_DistXYZ(&actor->posRot.pos, arg1); } -f32 func_8002DB8C(Actor* actorA, Actor* actorB) -{ +f32 func_8002DB8C(Actor* actorA, Actor* actorB) { return Math_Vec3f_DistXZ(&actorA->posRot.pos, &actorB->posRot.pos); } -f32 func_8002DBB0(Actor* actor, Vec3f* arg1) -{ +f32 func_8002DBB0(Actor* actor, Vec3f* arg1) { return Math_Vec3f_DistXZ(&actor->posRot.pos, arg1); } -void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) -{ +void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) { f32 cosRot2Y; f32 sinRot2Y; f32 deltaX; @@ -1086,72 +972,64 @@ void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) result->y = arg2->y - actor->posRot.pos.y; } -f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) -{ +f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) { return actorB->posRot.pos.y - actorA->posRot.pos.y; } -f32 func_8002DC84(Player* player) -{ +f32 func_8002DC84(Player* player) { f32 offset = (player->stateFlags1 & 0x800000) ? 32.0f : 0.0f; - if (LINK_IS_ADULT) + if (LINK_IS_ADULT) { return offset + 68.0f; - else + } else { return offset + 44.0f; + } } -f32 func_8002DCE4(Player* player) -{ - if (player->stateFlags1 & 0x800000) +f32 func_8002DCE4(Player* player) { + if (player->stateFlags1 & 0x800000) { return 8.0f; - else if (player->stateFlags1 & 0x8000000) + } else if (player->stateFlags1 & 0x8000000) { return (R_RUN_SPEED_LIMIT / 100.0f) * 0.6f; - else + } else { return R_RUN_SPEED_LIMIT / 100.0f; + } } -s32 func_8002DD6C(Player* player) -{ +s32 func_8002DD6C(Player* player) { return player->stateFlags1 & 0x8; } -s32 func_8002DD78(Player* player) -{ +s32 func_8002DD78(Player* player) { return func_8002DD6C(player) && player->unk_834; } -s32 func_8002DDA8(GlobalContext* globalCtx) -{ +s32 func_8002DDA8(GlobalContext* globalCtx) { Player* player = PLAYER; return (player->stateFlags1 & 0x800) || func_8002DD78(player); } -s32 func_8002DDE4(GlobalContext* globalCtx) -{ +s32 func_8002DDE4(GlobalContext* globalCtx) { Player* player = PLAYER; return player->stateFlags2 & 0x8; } -s32 func_8002DDF4(GlobalContext* globalCtx) -{ +s32 func_8002DDF4(GlobalContext* globalCtx) { Player* player = PLAYER; return player->stateFlags2 & 0x1000; } -typedef struct -{ - /* 0x000 */ Actor actor; - /* 0x14C */ char unk_14C[0xB4]; - /* 0x200 */ Actor* unk_200; - /* 0x204 */ f32 unk_204; - /* 0x208 */ f32 unk_208; - /* 0x20C */ f32 unk_20C; - /* 0x210 */ s16 unk_210; +typedef struct { + /* 0x000 */ Actor actor; + /* 0x14C */ char unk_14C[0xB4]; + /* 0x200 */ Actor* unk_200; + /* 0x204 */ f32 unk_204; + /* 0x208 */ f32 unk_208; + /* 0x20C */ f32 unk_20C; + /* 0x210 */ s16 unk_210; } ActorArmsHook; -void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) -{ +void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) { ActorArmsHook* hookActor; hookActor = (ActorArmsHook*)Actor_Find(&globalCtx->actorCtx, 0x0066, ACTORTYPE_ITEMACTION); @@ -1163,31 +1041,27 @@ void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) actorA->flags &= ~0x2000; } -void func_8002DE74(GlobalContext* globalCtx, Player* player) -{ - if ((globalCtx->roomCtx.curRoom.unk_03 != 4) && func_800C0CB8(globalCtx)) +void func_8002DE74(GlobalContext* globalCtx, Player* player) { + if ((globalCtx->roomCtx.curRoom.unk_03 != 4) && func_800C0CB8(globalCtx)) { func_8005A77C(func_800C04A4(globalCtx, 0), 6); + } } -void func_8002DECC(GlobalContext* globalCtx, Player* player, Actor* actor) -{ +void func_8002DECC(GlobalContext* globalCtx, Player* player, Actor* actor) { player->rideActor = actor; player->stateFlags1 |= 0x800000; actor->attachedB = &player->actor; } -s32 func_8002DEEC(Player* player) -{ +s32 func_8002DEEC(Player* player) { return (player->stateFlags1 & 0x20000080) || player->action; } -void func_8002DF18(GlobalContext* globalCtx, ActorContext* actorCtx) -{ +void func_8002DF18(GlobalContext* globalCtx, ActorContext* actorCtx) { func_8006DC68(globalCtx, actorCtx); } -u32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 newAction) -{ +u32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 newAction) { Player* player = PLAYER; player->action = newAction; player->unk_448 = actor; @@ -1196,8 +1070,7 @@ u32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 newAction) return 1; } -s32 func_8002DF54(GlobalContext* globalCtx, Actor* actor, u8 arg2) -{ +s32 func_8002DF54(GlobalContext* globalCtx, Actor* actor, u8 arg2) { Player* player = PLAYER; func_8002DF38(globalCtx, actor, arg2); player->unk_46A = 1; @@ -1205,96 +1078,91 @@ s32 func_8002DF54(GlobalContext* globalCtx, Actor* actor, u8 arg2) return 1; } -void func_8002DF90(DynaPolyActor* dynaActor) -{ +void func_8002DF90(DynaPolyActor* dynaActor) { dynaActor->unk_154 = 0.0f; dynaActor->unk_150 = 0.0f; } -void func_8002DFA4(DynaPolyActor* dynaActor, f32 arg1, s16 arg2) -{ +void func_8002DFA4(DynaPolyActor* dynaActor, f32 arg1, s16 arg2) { dynaActor->unk_150 += arg1; dynaActor->unk_158 = arg2; } -s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx) -{ +s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx) { Player* player = PLAYER; s16 var = (s16)(actor->rotTowardsLinkY + 0x8000) - player->actor.shape.rot.y; - if (ABS(var) < arg1) + if (ABS(var) < arg1) { return 1; + } return 0; } -s32 func_8002E020(Actor* actorA, Actor* actorB, s16 arg2) -{ +s32 func_8002E020(Actor* actorA, Actor* actorB, s16 arg2) { s16 var = (s16)(func_8002DA78(actorA, actorB) + 0x8000) - actorB->shape.rot.y; - if (ABS(var) < arg2) + if (ABS(var) < arg2) { return 1; + } return 0; } -s32 func_8002E084(Actor* actor, s16 arg1) -{ +s32 func_8002E084(Actor* actor, s16 arg1) { s16 var = actor->rotTowardsLinkY - actor->shape.rot.y; - if (ABS(var) < arg1) + if (ABS(var) < arg1) { return 1; + } return 0; } -s32 func_8002E0D0(Actor* actorA, Actor* actorB, s16 arg2) -{ +s32 func_8002E0D0(Actor* actorA, Actor* actorB, s16 arg2) { s16 var = func_8002DA78(actorA, actorB) - actorA->shape.rot.y; - if (ABS(var) < arg2) + if (ABS(var) < arg2) { return 1; + } return 0; } -s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2) -{ +s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2) { s16 var = actor->rotTowardsLinkY - actor->shape.rot.y; - if (ABS(var) < arg2) - { + if (ABS(var) < arg2) { f32 xyzDistanceFromLink = sqrtf(SQ(actor->xzDistanceFromLink) + SQ(actor->yDistanceFromLink)); - if (xyzDistanceFromLink < arg1) + if (xyzDistanceFromLink < arg1) { return 1; + } } return 0; } -s32 func_8002E1A8(Actor* actorA, Actor* actorB, f32 arg2, s16 arg3) -{ - if (func_8002DB48(actorA, actorB) < arg2) - { +s32 func_8002E1A8(Actor* actorA, Actor* actorB, f32 arg2, s16 arg3) { + if (func_8002DB48(actorA, actorB) < arg2) { s16 var = func_8002DA78(actorA, actorB) - actorA->shape.rot.y; - if (ABS(var) < arg3) + if (ABS(var) < arg3) { return 1; + } } return 0; } -s32 func_8002E234(Actor* actor, f32 arg1, s32 arg2) -{ - if ((actor->bgCheckFlags & 0x1) && (arg1 < -11.0f)) - { +s32 func_8002E234(Actor* actor, f32 arg1, s32 arg2) { + if ((actor->bgCheckFlags & 0x1) && (arg1 < -11.0f)) { actor->bgCheckFlags &= ~0x1; actor->bgCheckFlags |= 0x4; - if ((actor->velocity.y < 0.0f) && (arg2 & 0x10)) + if ((actor->velocity.y < 0.0f) && (arg2 & 0x10)) { actor->velocity.y = 0.0f; + } return 0; } @@ -1305,8 +1173,7 @@ s32 func_8002E234(Actor* actor, f32 arg1, s32 arg2) UNK_TYPE D_8015BBA0; u32 D_8015BBA4; -s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) -{ +s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) { f32 sp34; u32 sp30; @@ -1315,25 +1182,22 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) actor->unk_80 = func_8003CA0C(globalCtx, &globalCtx->colCtx, &actor->floorPoly, &sp30, actor, arg2); actor->bgCheckFlags &= ~0x0086; - if (actor->unk_80 <= -32000.0f) + if (actor->unk_80 <= -32000.0f) { return func_8002E234(actor, -32000.0f, arg3); + } sp34 = actor->unk_80 - actor->posRot.pos.y; actor->floorPolySource = sp30; - if (sp34 >= 0.0f) - { + if (sp34 >= 0.0f) { actor->bgCheckFlags |= 0x80; - if (actor->bgCheckFlags & 0x10) - { - if (sp30 != D_8015BBA4) - { - if (sp34 > 15.0f) + if (actor->bgCheckFlags & 0x10) { + if (sp30 != D_8015BBA4) { + if (sp34 > 15.0f) { actor->bgCheckFlags |= 0x100; - } - else - { + } + } else { actor->posRot.pos.x = actor->pos4.x; actor->posRot.pos.z = actor->pos4.z; } @@ -1341,23 +1205,22 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) actor->posRot.pos.y = actor->unk_80; - if (actor->velocity.y <= 0.0f) - { - if (!(actor->bgCheckFlags & 0x1)) + if (actor->velocity.y <= 0.0f) { + if (!(actor->bgCheckFlags & 0x1)) { actor->bgCheckFlags |= 0x2; - else if ((arg3 & 0x8) && (actor->gravity < 0.0f)) + } else if ((arg3 & 0x8) && (actor->gravity < 0.0f)) { actor->velocity.y = -4.0f; - else + } else { actor->velocity.y = 0.0f; + } actor->bgCheckFlags |= 0x1; func_80043334(&globalCtx->colCtx, actor, actor->floorPolySource); } - } - else - { - if ((actor->bgCheckFlags & 0x1) && (sp34 >= -11.0f)) + } else { + if ((actor->bgCheckFlags & 0x1) && (sp34 >= -11.0f)) { func_80043334(&globalCtx->colCtx, actor, actor->floorPolySource); + } return func_8002E234(actor, sp34, arg3); } @@ -1365,8 +1228,7 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) return 1; } -void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5) -{ +void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5) { f32 sp74; s32 pad; Vec3f sp64; @@ -1379,58 +1241,50 @@ void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f sp74 = actor->posRot.pos.y - actor->pos4.y; - if ((actor->floorPolySource != 0x32) && (actor->bgCheckFlags & 1)) + if ((actor->floorPolySource != 0x32) && (actor->bgCheckFlags & 1)) { func_800433A4(&globalCtx->colCtx, actor->floorPolySource, actor); + } - if (arg5 & 1) - { - if ((!(arg5 & 0x80) && func_8003D52C(&globalCtx->colCtx, &sp64, &actor->posRot.pos, - &actor->pos4, arg3, &actor->wallPoly, &sp60, actor, arg2)) || - ((arg5 & 0x80) && func_8003D594(&globalCtx->colCtx, &sp64, &actor->posRot.pos, - &actor->pos4, arg3, &actor->wallPoly, &sp60, actor, arg2))) - { + if (arg5 & 1) { + if ((!(arg5 & 0x80) && func_8003D52C(&globalCtx->colCtx, &sp64, &actor->posRot.pos, &actor->pos4, arg3, + &actor->wallPoly, &sp60, actor, arg2)) || + ((arg5 & 0x80) && func_8003D594(&globalCtx->colCtx, &sp64, &actor->posRot.pos, &actor->pos4, arg3, + &actor->wallPoly, &sp60, actor, arg2))) { sp5C = actor->wallPoly; Math_Vec3f_Copy(&actor->posRot.pos, &sp64); actor->unk_7E = atan2s(sp5C->norm.z, sp5C->norm.x); actor->bgCheckFlags |= 8; actor->wallPolySource = sp60; - } - else + } else { actor->bgCheckFlags &= ~8; + } } sp64.x = actor->posRot.pos.x; sp64.z = actor->posRot.pos.z; - if (arg5 & 2) - { + if (arg5 & 2) { sp64.y = actor->pos4.y + 10.0f; - if (func_8003D7A0(&globalCtx->colCtx, &sp58, &sp64, (arg4 + sp74) - 10.0f, &D_8015BBA0, &D_8015BBA4, actor)) - { + if (func_8003D7A0(&globalCtx->colCtx, &sp58, &sp64, (arg4 + sp74) - 10.0f, &D_8015BBA0, &D_8015BBA4, actor)) { actor->bgCheckFlags |= 0x10; actor->posRot.pos.y = (sp58 + sp74) - 10.0f; - } - else + } else { actor->bgCheckFlags &= ~0x10; + } } - if (arg5 & 4) - { + if (arg5 & 4) { sp64.y = actor->pos4.y; func_8002E2AC(globalCtx, actor, &sp64, arg5); sp50 = actor->posRot.pos.y; - if (func_8004213C(globalCtx, &globalCtx->colCtx, actor->posRot.pos.x, actor->posRot.pos.z, &sp50, &sp54)) - { + if (func_8004213C(globalCtx, &globalCtx->colCtx, actor->posRot.pos.x, actor->posRot.pos.z, &sp50, &sp54)) { actor->unk_84 = sp50 - actor->posRot.pos.y; - if (actor->unk_84 < 0.0f) + if (actor->unk_84 < 0.0f) { actor->bgCheckFlags &= ~0x60; - else - { - if (!(actor->bgCheckFlags & 0x20)) - { + } else { + if (!(actor->bgCheckFlags & 0x20)) { actor->bgCheckFlags |= 0x40; - if (!(arg5 & 0x40)) - { + if (!(arg5 & 0x40)) { sp44.x = actor->posRot.pos.x; sp44.y = sp50; sp44.z = actor->posRot.pos.z; @@ -1441,9 +1295,7 @@ void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f } actor->bgCheckFlags |= 0x20; } - } - else - { + } else { actor->bgCheckFlags &= ~0x60; actor->unk_84 = -32000.0f; } @@ -1452,8 +1304,7 @@ void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f s32 D_8015BBA8[16]; -Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx, Gfx* gfx, Hilite** hilite) -{ +Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx, Gfx* gfx, Hilite** hilite) { Gfx* lookAt; f32 correctedEyeX; @@ -1463,20 +1314,15 @@ Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* *hilite = Graph_Alloc(gfxCtx, sizeof(Hilite)); - if (HREG(80) == 6) + if (HREG(80) == 6) { osSyncPrintf("z_actor.c 3529 eye=[%f(%f) %f %f] object=[%f %f %f] light_direction=[%f %f %f]\n", - (f64)correctedEyeX, (f64)eye->x, (f64)eye->y, (f64)eye->z, - (f64)object->x, (f64)object->y, (f64) object->z, - (f64)lightDir->x, (f64)lightDir->y, (f64)lightDir->z); + (f64)correctedEyeX, (f64)eye->x, (f64)eye->y, (f64)eye->z, (f64)object->x, (f64)object->y, + (f64)object->z, (f64)lightDir->x, (f64)lightDir->y, (f64)lightDir->z); + } func_800ABE74(correctedEyeX, eye->y, eye->z); - func_80103A70(&D_8015BBA8, lookAt, *hilite, - correctedEyeX, eye->y, eye->z, - object->x, object->y, object->z, - 0.0f, 1.0f, 0.0f, - lightDir->x, lightDir->y, lightDir->z, - lightDir->x, lightDir->y, lightDir->z, - 0x10, 0x10); + func_80103A70(&D_8015BBA8, lookAt, *hilite, correctedEyeX, eye->y, eye->z, object->x, object->y, object->z, 0.0f, + 1.0f, 0.0f, lightDir->x, lightDir->y, lightDir->z, lightDir->x, lightDir->y, lightDir->z, 0x10, 0x10); gSPLookAt(gfx++, lookAt); gDPSetHilite1Tile(gfx++, 1, *hilite, 0x10, 0x10); @@ -1484,8 +1330,7 @@ Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* return gfx; } -Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx) -{ +Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx) { Hilite* hilite; Gfx* gfxArr[5]; @@ -1496,8 +1341,7 @@ Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContex return hilite; } -Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx) -{ +Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx) { Hilite* hilite; Gfx* gfxArr[5]; @@ -1508,8 +1352,7 @@ Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContex return hilite; } -void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) -{ +void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) { Hilite* hilite; Vec3f lightDir; Gfx* displayListHead; @@ -1521,14 +1364,14 @@ void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) lightDir.y = globalCtx->unk_10A4F; lightDir.z = globalCtx->unk_10A50; - if (HREG(80) == 6) - osSyncPrintf("z_actor.c 3637 game_play->view.eye=[%f(%f) %f %f]\n", - (f64)globalCtx->view.eye.x, (f64)globalCtx->view.eye.y, (f64)globalCtx->view.eye.z); + if (HREG(80) == 6) { + osSyncPrintf("z_actor.c 3637 game_play->view.eye=[%f(%f) %f %f]\n", (f64)globalCtx->view.eye.x, + (f64)globalCtx->view.eye.y, (f64)globalCtx->view.eye.z); + } hilite = func_8002EABC(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); - if (flag != 0) - { + if (flag != 0) { displayList = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Gfx)); displayListHead = displayList; @@ -1543,8 +1386,7 @@ void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) } } -void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) -{ +void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) { Hilite* hilite; Vec3f lightDir; Gfx* displayListHead; @@ -1558,8 +1400,7 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) hilite = func_8002EB44(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); - if (flag != 0) - { + if (flag != 0) { displayList = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Gfx)); displayListHead = displayList; @@ -1574,22 +1415,19 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) } } -PosRot* func_8002EEE4(PosRot* arg0, Actor* actor) -{ +PosRot* func_8002EEE4(PosRot* arg0, Actor* actor) { *arg0 = actor->posRot2; return arg0; } -PosRot* func_8002EF14(PosRot* arg0, Actor* actor) -{ +PosRot* func_8002EF14(PosRot* arg0, Actor* actor) { *arg0 = actor->posRot; return arg0; } -PosRot* func_8002EF44(PosRot* arg0, Actor* actor) -{ +PosRot* func_8002EF44(PosRot* arg0, Actor* actor) { PosRot sp1C; Math_Vec3f_Copy(&sp1C.pos, &actor->posRot.pos); @@ -1601,16 +1439,14 @@ PosRot* func_8002EF44(PosRot* arg0, Actor* actor) #ifdef NON_MATCHING // single regalloc difference -f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) -{ +f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) { s16 var; s16 abs_var; var = (s16)(actor->rotTowardsLinkY - 0x8000) - arg2; abs_var = ABS(var); - if (player->unk_664 != NULL) - { + if (player->unk_664 != NULL) { if ((abs_var > 0x4000) || (actor->flags & 0x8000000)) return FLT_MAX; else @@ -1627,48 +1463,38 @@ extern f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2); #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_8002EFC0.s") #endif -typedef struct -{ +typedef struct { f32 unk_0, unk_4; } struct_80115FF8; // size = 0x8 -struct_80115FF8 D_80115FF8[] = -{ - { 4900.0f, 0.5f }, - { 28900.0f, 0.6666667f }, - { 78400.0f, 0.05f }, - { 122500.0f, 0.6666667f }, - { 490000.0f, 0.6666667f }, - { 1000000.0f, 0.6666667f }, - { 10000.0f, 0.94905096f }, - { 19600.0f, 0.85714287f }, - { 57600.0f, 0.41666666f }, - { 78400.0f, 0.001f }, +struct_80115FF8 D_80115FF8[] = { + { 4900.0f, 0.5f }, { 28900.0f, 0.6666667f }, { 78400.0f, 0.05f }, { 122500.0f, 0.6666667f }, + { 490000.0f, 0.6666667f }, { 1000000.0f, 0.6666667f }, { 10000.0f, 0.94905096f }, { 19600.0f, 0.85714287f }, + { 57600.0f, 0.41666666f }, { 78400.0f, 0.001f }, }; -u32 func_8002F090(Actor* actor, f32 arg1) -{ +u32 func_8002F090(Actor* actor, f32 arg1) { return arg1 < D_80115FF8[actor->unk_1F].unk_0; } -s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) -{ +s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) { s16 var; s16 abs_var; f32 dist; - if ((actor->update == NULL) || !(actor->flags & 1)) + if ((actor->update == NULL) || !(actor->flags & 1)) { return 1; + } - if (!flag) - { + if (!flag) { var = (s16)(actor->rotTowardsLinkY - 0x8000) - player->actor.shape.rot.y; abs_var = ABS(var); - if ((player->unk_664 == NULL) && (abs_var > 0x2AAA)) + if ((player->unk_664 == NULL) && (abs_var > 0x2AAA)) { dist = FLT_MAX; - else + } else { dist = actor->waterSurfaceDist; + } return !func_8002F090(actor, D_80115FF8[actor->unk_1F].unk_4 * dist); } @@ -1676,10 +1502,8 @@ s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) return 0; } -u32 func_8002F194(Actor* actor, GlobalContext* globalCtx) -{ - if (actor->flags & 0x100) - { +u32 func_8002F194(Actor* actor, GlobalContext* globalCtx) { + if (actor->flags & 0x100) { actor->flags &= ~0x100; return 1; } @@ -1687,18 +1511,16 @@ u32 func_8002F194(Actor* actor, GlobalContext* globalCtx) return 0; } -s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u32 arg4) -{ +s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u32 arg4) { Player* player = PLAYER; // This is convoluted but it seems like it must be a single if statement to match - if ((player->actor.flags & 0x100) || - ((arg4 != 0) && func_8008E988(globalCtx)) || + if ((player->actor.flags & 0x100) || ((arg4 != 0) && func_8008E988(globalCtx)) || ((actor->unk_10C == 0) && - ((arg3 < fabsf(actor->yDistanceFromLink)) || - (player->unk_698 < actor->xzDistanceFromLink) || - (arg2 < actor->xzDistanceFromLink)))) + ((arg3 < fabsf(actor->yDistanceFromLink)) || (player->unk_698 < actor->xzDistanceFromLink) || + (arg2 < actor->xzDistanceFromLink)))) { return 0; + } player->unk_694 = actor; player->unk_698 = actor->xzDistanceFromLink; @@ -1707,38 +1529,33 @@ s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u3 return 1; } -s32 func_8002F298(Actor* actor, GlobalContext* globalCtx, f32 arg2, u32 arg3) -{ +s32 func_8002F298(Actor* actor, GlobalContext* globalCtx, f32 arg2, u32 arg3) { return func_8002F1C4(actor, globalCtx, arg2, arg2, arg3); } -s32 func_8002F2CC(Actor* actor, GlobalContext* globalCtx, f32 arg2) -{ +s32 func_8002F2CC(Actor* actor, GlobalContext* globalCtx, f32 arg2) { return func_8002F298(actor, globalCtx, arg2, 0); } -s32 func_8002F2F4(Actor* actor, GlobalContext* globalCtx) -{ +s32 func_8002F2F4(Actor* actor, GlobalContext* globalCtx) { f32 var1 = 50.0f + actor->sub_98.unk_10; return func_8002F2CC(actor, globalCtx, var1); } -u32 func_8002F334(Actor* actor, GlobalContext* globalCtx) -{ - if (func_8010BDBC(&globalCtx->msgCtx) == 2) +u32 func_8002F334(Actor* actor, GlobalContext* globalCtx) { + if (func_8010BDBC(&globalCtx->msgCtx) == 2) { return 1; - else + } else { return 0; + } } -s8 func_8002F368(GlobalContext* globalCtx) -{ +s8 func_8002F368(GlobalContext* globalCtx) { Player* player = PLAYER; return player->exchangeItemId; } -void func_8002F374(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3) -{ +void func_8002F374(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3) { Vec3f sp1C; f32 sp18; @@ -1747,31 +1564,26 @@ void func_8002F374(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3) *arg3 = sp1C.y * sp18 * -120.0f + 120.0f; } -u32 func_8002F410(Actor* actor, GlobalContext* globalCtx) -{ - if (actor->attachedA != NULL) +u32 func_8002F410(Actor* actor, GlobalContext* globalCtx) { + if (actor->attachedA != NULL) { return 1; - else + } else { return 0; + } } -s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) -{ +s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) { Player* player = PLAYER; s16 var; s32 abs_var; - if (!(player->stateFlags1 & 0x3C7080) && func_8008F29C(player) < 0) - { + if (!(player->stateFlags1 & 0x3C7080) && func_8008F29C(player) < 0) { if ((((player->heldActor != NULL) || (actor == player->unk_694)) && (getItemId > 0) && (getItemId < 0x7E)) || - (!(player->stateFlags1 & 0x20000800))) - { - if ((actor->xzDistanceFromLink < xzRange) && (fabsf(actor->yDistanceFromLink) < yRange)) - { + (!(player->stateFlags1 & 0x20000800))) { + if ((actor->xzDistanceFromLink < xzRange) && (fabsf(actor->yDistanceFromLink) < yRange)) { var = actor->rotTowardsLinkY - player->actor.shape.rot.y; abs_var = ABS(var); - if ((getItemId != 0) || (player->getItemDirection < abs_var)) - { + if ((getItemId != 0) || (player->getItemDirection < abs_var)) { player->getItemId = getItemId; player->interactRangeActor = actor; player->getItemDirection = abs_var; @@ -1784,30 +1596,26 @@ s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzR return 0; } -void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId) -{ +void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId) { func_8002F434(actor, globalCtx, getItemId, 50.0f, 10.0f); } -void func_8002F580(Actor* actor, GlobalContext* globalCtx) -{ +void func_8002F580(Actor* actor, GlobalContext* globalCtx) { func_8002F554(actor, globalCtx, 0); } -u32 func_8002F5A0(Actor* actor, GlobalContext* globalCtx) -{ - if (actor->attachedA == NULL) +u32 func_8002F5A0(Actor* actor, GlobalContext* globalCtx) { + if (actor->attachedA == NULL) { return 1; - else + } else { return 0; + } } -void func_8002F5C4(Actor* actorA, Actor* actorB, GlobalContext* globalCtx) -{ +void func_8002F5C4(Actor* actorA, Actor* actorB, GlobalContext* globalCtx) { Actor* actorAttachedA = actorA->attachedA; - if (actorAttachedA->id == ACTOR_PLAYER) - { + if (actorAttachedA->id == ACTOR_PLAYER) { Player* player = (Player*)actorAttachedA; player->heldActor = actorB; player->interactRangeActor = actorB; @@ -1818,28 +1626,26 @@ void func_8002F5C4(Actor* actorA, Actor* actorB, GlobalContext* globalCtx) actorA->attachedA = NULL; } -void func_8002F5F0(Actor* actor, GlobalContext* globalCtx) -{ +void func_8002F5F0(Actor* actor, GlobalContext* globalCtx) { Player* player = PLAYER; - if (actor->waterSurfaceDist < player->unk_6A4) + if (actor->waterSurfaceDist < player->unk_6A4) { player->unk_6A4 = actor->waterSurfaceDist; + } } -u32 func_8002F618(GlobalContext* globalCtx, Actor* actor) -{ - if (actor->attachedB != NULL) +u32 func_8002F618(GlobalContext* globalCtx, Actor* actor) { + if (actor->attachedB != NULL) { return 1; - else + } else { return 0; + } } -u32 func_8002F63C(GlobalContext* globalCtx, Actor* actor, s32 arg2) -{ +u32 func_8002F63C(GlobalContext* globalCtx, Actor* actor, s32 arg2) { Player* player = PLAYER; - if (!(player->stateFlags1 & 0x003C7880)) - { + if (!(player->stateFlags1 & 0x003C7880)) { player->rideActor = actor; player->unk_43C = arg2; return 1; @@ -1848,16 +1654,15 @@ u32 func_8002F63C(GlobalContext* globalCtx, Actor* actor, s32 arg2) return 0; } -u32 func_8002F674(GlobalContext* globalCtx, Actor* actor) -{ - if (actor->attachedB == NULL) +u32 func_8002F674(GlobalContext* globalCtx, Actor* actor) { + if (actor->attachedB == NULL) { return 1; - else + } else { return 0; + } } -void func_8002F698(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) -{ +void func_8002F698(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) { Player* player = PLAYER; player->unk_8A0 = arg6; player->unk_8A1 = arg5; @@ -1866,97 +1671,84 @@ void func_8002F698(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 a player->unk_8A8 = arg4; } -void func_8002F6D4(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5) -{ +void func_8002F6D4(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5) { func_8002F698(globalCtx, arg1, arg2, arg3, arg4, 2, arg5); } -void func_8002F71C(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4) -{ +void func_8002F71C(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4) { func_8002F6D4(globalCtx, arg1, arg2, arg3, arg4, 0); } -void func_8002F758(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5) -{ +void func_8002F758(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5) { func_8002F698(globalCtx, arg1, arg2, arg3, arg4, 1, arg5); } -void func_8002F7A0(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4) -{ +void func_8002F7A0(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4) { func_8002F758(globalCtx, arg1, arg2, arg3, arg4, 0); } -void func_8002F7DC(Actor* actor, u16 sfxId) -{ +void func_8002F7DC(Actor* actor, u16 sfxId) { Audio_PlaySoundGeneral(sfxId, &actor->unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -void Audio_PlayActorSound2(Actor* actor, u16 sfxId) -{ +void Audio_PlayActorSound2(Actor* actor, u16 sfxId) { func_80078914(&actor->unk_E4, sfxId); } -void func_8002F850(GlobalContext* globalCtx, Actor* actor) -{ +void func_8002F850(GlobalContext* globalCtx, Actor* actor) { s32 sfxId; - if (actor->bgCheckFlags & 0x20) - { - if (actor->unk_84 < 20.0f) + if (actor->bgCheckFlags & 0x20) { + if (actor->unk_84 < 20.0f) { sfxId = NA_SE_PL_WALK_WATER0; - else + } else { sfxId = NA_SE_PL_WALK_WATER1; - } - else + } + } else { sfxId = func_80041F34(&globalCtx->colCtx, actor->floorPoly, actor->floorPolySource, actor); + } func_80078914(&actor->unk_E4, NA_SE_EV_BOMB_BOUND); func_80078914(&actor->unk_E4, sfxId + 0x800); } -void func_8002F8F0(Actor* actor, u16 sfxId) -{ +void func_8002F8F0(Actor* actor, u16 sfxId) { actor->soundEffect = sfxId; actor->flags |= 0x80000; actor->flags &= ~0x10300000; } -void func_8002F91C(Actor* actor, u16 sfxId) -{ +void func_8002F91C(Actor* actor, u16 sfxId) { actor->soundEffect = sfxId; actor->flags |= 0x100000; actor->flags &= ~0x10280000; } -void func_8002F948(Actor* actor, u16 sfxId) -{ +void func_8002F948(Actor* actor, u16 sfxId) { actor->soundEffect = sfxId; actor->flags |= 0x200000; actor->flags &= ~0x10180000; } -void func_8002F974(Actor* actor, u16 sfxId) -{ +void func_8002F974(Actor* actor, u16 sfxId) { actor->flags &= ~0x10380000; actor->soundEffect = sfxId; } -void func_8002F994(Actor* actor, s32 sfxId) -{ +void func_8002F994(Actor* actor, s32 sfxId) { actor->flags |= 0x10000000; actor->flags &= ~0x00380000; - if (sfxId < NA_SE_PL_LAND_GRASS) + if (sfxId < NA_SE_PL_LAND_GRASS) { actor->soundEffect = NA_SE_PL_WALK_DIRT; - else if (sfxId < NA_SE_PL_DIVE_BUBBLE) + } else if (sfxId < NA_SE_PL_DIVE_BUBBLE) { actor->soundEffect = NA_SE_PL_WALK_CONCRETE; - else + } else { actor->soundEffect = NA_SE_PL_WALK_SAND; + } } -s32 func_8002F9EC(GlobalContext* globalCtx, Actor* actor, UNK_TYPE arg2, UNK_TYPE arg3, UNK_TYPE arg4) -{ - if (func_80041D4C(&globalCtx->colCtx, arg2, arg3) == 8) - { +s32 func_8002F9EC(GlobalContext* globalCtx, Actor* actor, UNK_TYPE arg2, UNK_TYPE arg3, UNK_TYPE arg4) { + if (func_80041D4C(&globalCtx->colCtx, arg2, arg3) == 8) { globalCtx->unk_11D30[0] = 1; func_8005DFAC(globalCtx, 0, arg4); Audio_PlayActorSound2(actor, NA_SE_IT_WALL_HIT_BUYO); @@ -1972,12 +1764,10 @@ z_Light* D_8015BC10; s32 D_8015BC14; f32 D_8015BC18; -void func_8002FA60(GlobalContext* globalCtx) -{ +void func_8002FA60(GlobalContext* globalCtx) { Vec3f lightPos; - if (gSaveContext.fw.set) - { + if (gSaveContext.fw.set) { gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0x28; gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = gSaveContext.fw.pos_x; gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = gSaveContext.fw.pos_y; @@ -1988,9 +1778,7 @@ void func_8002FA60(GlobalContext* globalCtx) gSaveContext.respawn[RESPAWN_MODE_TOP].room_index = gSaveContext.fw.room_index; gSaveContext.respawn[RESPAWN_MODE_TOP].temp_swch_flags = gSaveContext.fw.temp_swch_flags; gSaveContext.respawn[RESPAWN_MODE_TOP].temp_collect_flags = gSaveContext.fw.temp_collect_flags; - } - else - { + } else { gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0; gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = 0.0f; gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = 0.0f; @@ -2015,8 +1803,7 @@ Color_RGB8 D_80116064 = { 0x64, 0xC8, 0x00 }; #ifdef NON_MATCHING // this function still needs a lot of work -void func_8002FBAC(GlobalContext* globalCtx) -{ +void func_8002FBAC(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* gfxArr[6]; Vec3f lightPos; @@ -2042,8 +1829,7 @@ void func_8002FBAC(GlobalContext* globalCtx) func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 5308); - if (gSaveContext.respawn[RESPAWN_MODE_TOP].data != 0) - { + if (gSaveContext.respawn[RESPAWN_MODE_TOP].data != 0) { if (LINK_IS_ADULT) spD8 = 80.0f; else @@ -2054,39 +1840,34 @@ void func_8002FBAC(GlobalContext* globalCtx) temp_a3 = gSaveContext.respawn[RESPAWN_MODE_TOP].data - 0x28; - if (temp_a3 < 0) - { + if (temp_a3 < 0) { gSaveContext.respawn[RESPAWN_MODE_TOP].data++; spD4 = ABS(gSaveContext.respawn[RESPAWN_MODE_TOP].data) * 0.025f; D_8015BC14 = 60; D_8015BC18 = 1.0f; - } - else if (D_8015BC14 != 0) - { + } else if (D_8015BC14 != 0) { D_8015BC14--; - } - else if (D_8015BC18 > 0.0f) - { + } else if (D_8015BC18 > 0.0f) { spC0 = D_8015BC18; temp_ret = Math_Vec3f_DistXYZAndStoreDiff(&gSaveContext.respawn[RESPAWN_MODE_DOWN].pos, - &gSaveContext.respawn[RESPAWN_MODE_TOP].pos, - &spB4); + &gSaveContext.respawn[RESPAWN_MODE_TOP].pos, &spB4); - if (temp_ret < 20.0f) - { + if (temp_ret < 20.0f) { D_8015BC18 = 0.0f; - Math_Vec3f_Copy(&gSaveContext.respawn[RESPAWN_MODE_TOP].pos, &gSaveContext.respawn[RESPAWN_MODE_DOWN].pos); - } - else - { + Math_Vec3f_Copy(&gSaveContext.respawn[RESPAWN_MODE_TOP].pos, + &gSaveContext.respawn[RESPAWN_MODE_DOWN].pos); + } else { sp9C = (1.0f / D_8015BC18) * temp_ret; phi_f14 = 20.0f / sp9C; phi_f14 = (phi_f14 < 0.05f) ? 0.05f : phi_f14; Math_ApproxF(&D_8015BC18, 0.0f, phi_f14); temp_f2 = ((D_8015BC18 / spC0) * temp_ret) / temp_ret; - gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.x + (spB4.x * temp_f2); - gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.y + (spB4.y * temp_f2); - gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.z + (spB4.z * temp_f2); + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = + gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.x + (spB4.x * temp_f2); + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = + gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.y + (spB4.y * temp_f2); + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z = + gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.z + (spB4.z * temp_f2); temp_f12 = sp9C * 0.5f; temp_f14 = temp_ret - temp_f12; spD8 += sqrtf((temp_f12 * temp_f12) - (temp_f14 * temp_f14)) * 0.2f; @@ -2099,21 +1880,17 @@ void func_8002FBAC(GlobalContext* globalCtx) func_80028BB0(globalCtx, &spA4, &D_80116048, &D_80116054, &D_80116060, &D_80116064, 1000, 0x10); - if (D_8015BC18 == 0.0f) - { + if (D_8015BC18 == 0.0f) { gSaveContext.respawn[RESPAWN_MODE_TOP] = gSaveContext.respawn[RESPAWN_MODE_DOWN]; gSaveContext.respawn[RESPAWN_MODE_TOP].player_params = 0x06FF; gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0x28; } gSaveContext.respawn[RESPAWN_MODE_TOP].pos = gSaveContext.respawn[RESPAWN_MODE_TOP].pos; - } - else if (temp_a3 > 0) - { + } else if (temp_a3 > 0) { temp_f12 = temp_a3 * 0.1f; - if (temp_f12 < 1.0f) - { + if (temp_f12 < 1.0f) { sp7C.x = globalCtx->view.eye.x; sp7C.y = globalCtx->view.eye.y - spD8; sp7C.z = globalCtx->view.eye.z; @@ -2129,14 +1906,11 @@ void func_8002FBAC(GlobalContext* globalCtx) spD0 = 0xFF - (((temp_a3 * 0x10) - temp_a3) * 2); - if (spD0 < 0) - { + if (spD0 < 0) { gSaveContext.fw.set = 0; gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0; spD0 = 0; - } - else - { + } else { gSaveContext.respawn[RESPAWN_MODE_TOP].data++; } @@ -2145,33 +1919,33 @@ void func_8002FBAC(GlobalContext* globalCtx) if ((globalCtx->csCtx.state == 0) && (gSaveContext.respawn[RESPAWN_MODE_TOP].entrance_index == gSaveContext.entrance_index) && - (globalCtx->roomCtx.curRoom.num == gSaveContext.respawn[RESPAWN_MODE_TOP].room_index)) - { + (globalCtx->roomCtx.curRoom.num == gSaveContext.respawn[RESPAWN_MODE_TOP].room_index)) { gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0x19); Matrix_Translate(gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x, gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y + spD8, - gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z, - MTXMODE_NEW); + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z, MTXMODE_NEW); Matrix_Scale(0.025f * spD4, 0.025f * spD4, 0.025f * spD4, MTXMODE_APPLY); Matrix_Mult(&globalCtx->mf_11D60, MTXMODE_APPLY); Matrix_Push(); gDPPipeSync(gfxCtx->polyXlu.p++); - gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0xFF, 0xFF, 0xC8, spD0); + gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0xFF, 0xFF, 0xC8, spD0); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x64, 0xC8, 0x00, 0xFF); phi_f10 = (globalCtx->gameplayFrames * 1500) & 0xFFFF; Matrix_RotateZ((phi_f10 * M_PI) / 32768.0f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 5458), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 5458), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, &D_04010130); Matrix_Pull(); phi_f6 = ~((globalCtx->gameplayFrames * 1200) & 0xFFFF); Matrix_RotateZ((phi_f6 * M_PI) / 32768.0f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 5463), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 5463), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, &D_04010130); } @@ -2179,7 +1953,8 @@ void func_8002FBAC(GlobalContext* globalCtx) lightPos.y = gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y + spD8; lightPos.z = gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z; - Lights_InitType0PositionalLight(&D_8015BC00, lightPos.x, lightPos.y, lightPos.z, 0xFF, 0xFF, 0xFF, 500.0f * spD4); + Lights_InitType0PositionalLight(&D_8015BC00, lightPos.x, lightPos.y, lightPos.z, 0xFF, 0xFF, 0xFF, + 500.0f * spD4); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 5474); } @@ -2188,22 +1963,18 @@ void func_8002FBAC(GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_8002FBAC.s") #endif -void func_80030488(GlobalContext* globalCtx) -{ +void func_80030488(GlobalContext* globalCtx) { Lights_Remove(globalCtx, &globalCtx->lightCtx, D_8015BC10); } -void func_800304B0(GlobalContext* globalCtx) -{ - if (globalCtx->actorCtx.unk_03 != 0) - { +void func_800304B0(GlobalContext* globalCtx) { + if (globalCtx->actorCtx.unk_03 != 0) { globalCtx->actorCtx.unk_03 = 0; func_800876C8(globalCtx); } } -void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorEntry) -{ +void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorEntry) { ActorOverlay* overlayEntry; SaveSceneFlags* saveSceneFlags; s32 i; @@ -2217,8 +1988,7 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* Matrix_MtxFCopy(&globalCtx->mf_11D60, &gMtxFClear); overlayEntry = &gActorOverlayTable[0]; - for (i = 0; i < ARRAY_COUNT(gActorOverlayTable); i++) - { + for (i = 0; i < ARRAY_COUNT(gActorOverlayTable); i++) { overlayEntry->loadedRamAddr = NULL; overlayEntry->nbLoaded = 0; overlayEntry++; @@ -2238,24 +2008,12 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* func_8002FA60(globalCtx); } -u32 D_80116068[] = -{ - 0x100000C0, - 0x100000C0, - 0x00000000, - 0x100004C0, - 0x00000080, - 0x300000C0, - 0x10000080, - 0x00000000, - 0x300000C0, - 0x100004C0, - 0x00000000, - 0x100000C0, +u32 D_80116068[] = { + 0x100000C0, 0x100000C0, 0x00000000, 0x100004C0, 0x00000080, 0x300000C0, + 0x10000080, 0x00000000, 0x300000C0, 0x100004C0, 0x00000000, 0x100000C0, }; -void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) -{ +void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { Actor* refActor; Actor* actor; Player* player; @@ -2268,91 +2026,79 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) player = PLAYER; - if (0) - { + if (0) { // This assert is optimized out but it exists due to its presence in rodata - if (gMaxProfile != ACTOR_DLF_MAX) + if (gMaxProfile != ACTOR_DLF_MAX) { __assert("MaxProfile == ACTOR_DLF_MAX", "../z_actor.c", UNK_LINE); + } } sp74 = NULL; unkFlag = 0; - if (globalCtx->nbSetupActors != 0) - { + if (globalCtx->nbSetupActors != 0) { actorEntry = &globalCtx->setupActorList[0]; - for (i = 0; i < globalCtx->nbSetupActors; i++) + for (i = 0; i < globalCtx->nbSetupActors; i++) { Actor_SpawnEntry(&globalCtx->actorCtx, actorEntry++, globalCtx); + } globalCtx->nbSetupActors = 0; } - if (actorCtx->unk_02 != 0) + if (actorCtx->unk_02 != 0) { actorCtx->unk_02--; + } - if (KREG(0) == -100) - { + if (KREG(0) == -100) { refActor = &PLAYER->actor; KREG(0) = 0; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, - refActor->posRot.pos.x, refActor->posRot.pos.y + 100.0f, refActor->posRot.pos.z, - 0, 0, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, refActor->posRot.pos.x, + refActor->posRot.pos.y + 100.0f, refActor->posRot.pos.z, 0, 0, 0, 1); } sp80 = &D_80116068[0]; - if (player->stateFlags2 & 0x8000000) + if (player->stateFlags2 & 0x8000000) { unkFlag = 0x2000000; + } - if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x600)) + if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x600)) { sp74 = player->unk_694; + } - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, sp80++) - { + for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, sp80++) { unkCondition = (*sp80 & player->stateFlags1); actor = actorCtx->actorList[i].first; - while (actor != NULL) - { - if (actor->posRot.pos.y < -25000.0f) + while (actor != NULL) { + if (actor->posRot.pos.y < -25000.0f) { actor->posRot.pos.y = -25000.0f; + } actor->soundEffect = 0; - if (actor->init != NULL) - { - if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) - { + if (actor->init != NULL) { + if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { Actor_SetObjectDependency(globalCtx, actor); actor->init(actor, globalCtx); actor->init = NULL; } actor = actor->next; - } - else if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) - { + } else if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { Actor_Kill(actor); actor = actor->next; - } - else if ((unkFlag && !(actor->flags & unkFlag)) || - (!unkFlag && unkCondition && - (sp74 != actor) && (actor != player->unk_68C) && - (actor != player->heldActor) && (&player->actor != actor->attachedA))) - { + } else if ((unkFlag && !(actor->flags & unkFlag)) || + (!unkFlag && unkCondition && (sp74 != actor) && (actor != player->unk_68C) && + (actor != player->heldActor) && (&player->actor != actor->attachedA))) { func_80061E8C(&actor->sub_98); actor = actor->next; - } - else if (actor->update == NULL) - { - if (!actor->activelyDrawn) + } else if (actor->update == NULL) { + if (!actor->activelyDrawn) { actor = Actor_Delete(&globalCtx->actorCtx, actor, globalCtx); - else - { + } else { Actor_Destroy(actor, globalCtx); actor = actor->next; } - } - else - { + } else { Math_Vec3f_Copy(&actor->pos4, &actor->posRot.pos); actor->xzDistanceFromLink = func_8002DB8C(actor, &player->actor); actor->yDistanceFromLink = Actor_HeightDiff(actor, &player->actor); @@ -2361,19 +2107,21 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) actor->rotTowardsLinkY = func_8002DA78(actor, &player->actor); actor->flags &= ~0x1000000; - if ((DECR(actor->freeze) == 0) && (actor->flags & 0x50)) - { - if (actor == player->unk_664) + if ((DECR(actor->freeze) == 0) && (actor->flags & 0x50)) { + if (actor == player->unk_664) { actor->unk_10C = 1; - else + } else { actor->unk_10C = 0; + } - if ((actor->unk_10D != 0) && (player->unk_664 == NULL)) + if ((actor->unk_10D != 0) && (player->unk_664 == NULL)) { actor->unk_10D = 0; + } Actor_SetObjectDependency(globalCtx, actor); - if (actor->unk_114 != 0) + if (actor->unk_114 != 0) { actor->unk_114--; + } actor->update(actor, globalCtx); func_8003F8EC(globalCtx, &globalCtx->colCtx.dyna, actor); } @@ -2384,23 +2132,21 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) } } - if (i == ACTORTYPE_BG) + if (i == ACTORTYPE_BG) { func_8003F984(globalCtx, &globalCtx->colCtx.dyna); + } } actor = player->unk_664; - if ((actor != NULL) && (actor->update == NULL)) - { + if ((actor != NULL) && (actor->update == NULL)) { actor = NULL; func_8008EDF0(player); } - if ((actor == NULL) || (player->unk_66C < 5)) - { + if ((actor == NULL) || (player->unk_66C < 5)) { actor = NULL; - if (actorCtx->targetCtx.unk_4B != 0) - { + if (actorCtx->targetCtx.unk_4B != 0) { actorCtx->targetCtx.unk_4B = 0; func_80078884(NA_SE_SY_LOCK_OFF); } @@ -2411,13 +2157,11 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) func_8003FB64(globalCtx, &globalCtx->colCtx.dyna); } -void Actor_FaultPrint(Actor* actor, char* command) -{ +void Actor_FaultPrint(Actor* actor, char* command) { ActorOverlay* overlayEntry; char* name; - if ((actor == NULL) || (actor->overlayEntry == NULL)) - { + if ((actor == NULL) || (actor->overlayEntry == NULL)) { FaultDrawer_SetCursor(48, 24); FaultDrawer_Printf("ACTOR NAME is NULL"); } @@ -2428,16 +2172,16 @@ void Actor_FaultPrint(Actor* actor, char* command) // Translates to: "ACTOR NAME(%08x:%s)" osSyncPrintf("アクターの名前(%08x:%s)\n", actor, name); - if (command != NULL) + if (command != NULL) { // Translates to: "COMMAND:%s" osSyncPrintf("コメント:%s\n", command); + } FaultDrawer_SetCursor(48, 24); FaultDrawer_Printf("ACTOR NAME %08x:%s", actor, name); } -void Actor_Draw(GlobalContext* globalCtx, Actor* actor) -{ +void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { FaultClient faultClient; LightMapper* lightMapper; GraphicsContext* gfxCtx; @@ -2455,20 +2199,14 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) func_8007A474(lightMapper, globalCtx->lightCtx.lightsHead, (actor->flags & 0x400000) ? NULL : &actor->posRot.pos); func_80079EFC(lightMapper, globalCtx->state.gfxCtx); - if (actor->flags & 0x1000) - { + if (actor->flags & 0x1000) { camera = &globalCtx->cameraCtx.activeCameras[0]; func_800D1694(actor->posRot.pos.x + camera->unk_80.x, - actor->posRot.pos.y + (f32)((actor->shape.unk_08 * actor->scale.y) + camera->unk_80.y), - actor->posRot.pos.z + camera->unk_80.z, - &actor->shape.rot); - } - else - { - func_800D1694(actor->posRot.pos.x, - actor->posRot.pos.y + (actor->shape.unk_08 * actor->scale.y), - actor->posRot.pos.z, - &actor->shape.rot); + actor->posRot.pos.y + (f32)((actor->shape.unk_08 * actor->scale.y) + camera->unk_80.y), + actor->posRot.pos.z + camera->unk_80.z, &actor->shape.rot); + } else { + func_800D1694(actor->posRot.pos.x, actor->posRot.pos.y + (actor->shape.unk_08 * actor->scale.y), + actor->posRot.pos.z, &actor->shape.rot); } Matrix_Scale(actor->scale.x, actor->scale.y, actor->scale.z, MTXMODE_APPLY); @@ -2477,70 +2215,64 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) gSPSegment(gfxCtx->polyOpa.p++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment); gSPSegment(gfxCtx->polyXlu.p++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment); - if (actor->unk_114 != 0) - { + if (actor->unk_114 != 0) { // Must be inline data to match Color_RGBA8 sp2C = { 0x00, 0x00, 0x00, 0xFF }; - if (actor->unk_112 & 0x8000) + if (actor->unk_112 & 0x8000) { sp2C.r = sp2C.g = sp2C.b = ((actor->unk_112 & 0x1F00) >> 5) | 7; - else if (actor->unk_112 & 0x4000) + } else if (actor->unk_112 & 0x4000) { sp2C.r = ((actor->unk_112 & 0x1F00) >> 5) | 7; - else + } else { sp2C.b = ((actor->unk_112 & 0x1F00) >> 5) | 7; + } - if (actor->unk_112 & 0x2000) + if (actor->unk_112 & 0x2000) { func_80026860(globalCtx, &sp2C, actor->unk_114, actor->unk_112 & 0xFF); - else + } else { func_80026400(globalCtx, &sp2C, actor->unk_114, actor->unk_112 & 0xFF); + } } actor->draw(actor, globalCtx); - if (actor->unk_114 != 0) - { - if (actor->unk_112 & 0x2000) + if (actor->unk_114 != 0) { + if (actor->unk_112 & 0x2000) { func_80026A6C(globalCtx); - else + } else { func_80026608(globalCtx); + } } - if (actor->shape.shadowDrawFunc != NULL) + if (actor->shape.shadowDrawFunc != NULL) { actor->shape.shadowDrawFunc(actor, lightMapper, globalCtx); + } func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 6119); Fault_RemoveClient(&faultClient); } -void func_80030ED8(Actor* actor) -{ - if (actor->flags & 0x80000) +void func_80030ED8(Actor* actor) { + if (actor->flags & 0x80000) { Audio_PlaySoundGeneral(actor->soundEffect, &actor->unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - else if (actor->flags & 0x100000) + } else if (actor->flags & 0x100000) { func_80078884(actor->soundEffect); - else if (actor->flags & 0x200000) + } else if (actor->flags & 0x200000) { func_800788CC(actor->soundEffect); - else if (actor->flags & 0x10000000) + } else if (actor->flags & 0x10000000) { func_800F4C58(&D_801333D4, 0x2021, (s8)(actor->soundEffect - 1)); - else + } else { func_80078914(&actor->unk_E4, actor->soundEffect); + } } -void func_80030FA8(GraphicsContext* gfxCtx) -{ +void func_80030FA8(GraphicsContext* gfxCtx) { Gfx* gfxArr[5]; func_800C6AC4(gfxArr, gfxCtx, "../z_actor.c", 6161); - gDPLoadTextureBlock(gfxCtx->polyXlu.p++, - &D_0401E370, - G_IM_FMT_I, - G_IM_SIZ_8b, - 64, 64, - 0, - G_TX_MIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_CLAMP, - 6, 6, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gfxCtx->polyXlu.p++, &D_0401E370, G_IM_FMT_I, G_IM_SIZ_8b, 64, 64, 0, G_TX_MIRROR | G_TX_CLAMP, + G_TX_MIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD); gDPSetTileSize(gfxCtx->polyXlu.p++, G_TX_RENDERTILE, 384, 224, 892, 732); gSPTextureRectangle(gfxCtx->polyXlu.p++, 0, 0, 1280, 960, G_TX_RENDERTILE, 2240, 1600, 576, 597); @@ -2549,8 +2281,7 @@ void func_80030FA8(GraphicsContext* gfxCtx) func_800C6B54(gfxArr, gfxCtx, "../z_actor.c", 6183); } -void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invisibleActors) -{ +void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invisibleActors) { Actor** invisibleActor; GraphicsContext* gfxCtx; s32 i; @@ -2565,26 +2296,21 @@ void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invi gDPPipeSync(gfxCtx->polyXlu.p++); - if (globalCtx->roomCtx.curRoom.showInvisActors == 0) - { + if (globalCtx->roomCtx.curRoom.showInvisActors == 0) { gDPSetOtherMode(gfxCtx->polyXlu.p++, - G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | - G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PRIM | Z_UPD | G_RM_CLD_SURF | G_RM_CLD_SURF2); gDPSetCombineMode(gfxCtx->polyXlu.p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0xFF, 0x00, 0x00, 0xFF); - } - else - { + } else { gDPSetOtherMode(gfxCtx->polyXlu.p++, - G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | - G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_THRESHOLD | G_ZS_PRIM | Z_UPD | - IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | - GBL_c1(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA) | - GBL_c2(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA)); - gDPSetCombineLERP(gfxCtx->polyXlu.p++, - PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0, PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0, + G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_THRESHOLD | G_ZS_PRIM | Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | + GBL_c1(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA) | + GBL_c2(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA)); + gDPSetCombineLERP(gfxCtx->polyXlu.p++, PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0, PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0, PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0, PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0xFF, 0x4A, 0x4A, 0x4A, 0x4A); } @@ -2597,8 +2323,7 @@ void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invi gDma1p(gfxCtx->polyOpa.p++, G_NOOP, "魔法のメガネ 見えないActor表示 START", nbInvisibleActors, 2); invisibleActor = &invisibleActors[0]; - for (i = 0; i < nbInvisibleActors; i++) - { + for (i = 0; i < nbInvisibleActors; i++) { // Translates to: "MAGIC LENS INVISIBLE ACTOR DISPLAY" gDma1p(gfxCtx->polyOpa.p++, G_NOOP, "魔法のメガネ 見えないActor表示", i, 2); Actor_Draw(globalCtx, *(invisibleActor++)); @@ -2607,16 +2332,15 @@ void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invi // Translates to: "MAGIC LENS INVISIBLE ACTOR DISPLAY END" gDma1p(gfxCtx->polyOpa.p++, G_NOOP, "魔法のメガネ 見えないActor表示 END", nbInvisibleActors, 2); - if (globalCtx->roomCtx.curRoom.showInvisActors != 0) - { + if (globalCtx->roomCtx.curRoom.showInvisActors != 0) { // Translates to: "BLUE SPECTACLES (EXTERIOR)" gDma1p(gfxCtx->polyOpa.p++, G_NOOP, "青い眼鏡(外側)", 0, 2); gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetOtherMode(gfxCtx->polyXlu.p++, - G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | - G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2); gDPSetCombineMode(gfxCtx->polyXlu.p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0xFF, 0x00, 0x00, 0xFF); @@ -2633,30 +2357,26 @@ void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invi func_800C6B54(gfxArr, gfxCtx, "../z_actor.c", 6284); } -s32 func_800314B0(GlobalContext* globalCtx, Actor* actor) -{ +s32 func_800314B0(GlobalContext* globalCtx, Actor* actor) { return func_800314D4(globalCtx, actor, &actor->unk_E4, actor->unk_F0); } -s32 func_800314D4(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3) -{ +s32 func_800314D4(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3) { f32 var; - if ((arg2->z > -actor->unk_F8) && (arg2->z < (actor->unk_F4 + actor->unk_F8))) - { + if ((arg2->z > -actor->unk_F8) && (arg2->z < (actor->unk_F4 + actor->unk_F8))) { var = (arg3 < 1.0f) ? 1.0f : 1.0f / arg3; - if ((((fabsf(arg2->x) - actor->unk_F8) * var) < 1.0f) && - (((arg2->y + actor->unk_FC) * var) > -1.0f) && - (((arg2->y - actor->unk_F8) * var) < 1.0f)) + if ((((fabsf(arg2->x) - actor->unk_F8) * var) < 1.0f) && (((arg2->y + actor->unk_FC) * var) > -1.0f) && + (((arg2->y - actor->unk_F8) * var) < 1.0f)) { return 1; + } } return 0; } -void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) -{ +void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { s32 invisibleActorCounter; Actor* invisibleActors[INVISIBLE_ACTOR_MAX]; ActorListEntry* actorListEntry; @@ -2667,18 +2387,16 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) ActorOverlay* overlayEntry; char* actorName; - gfxCtx = globalCtx->state.gfxCtx; + gfxCtx = globalCtx->state.gfxCtx; invisibleActorCounter = 0; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 6336); actorListEntry = &actorCtx->actorList[0]; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, actorListEntry++) - { + for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, actorListEntry++) { actor = actorListEntry->first; - while (actor != NULL) - { + while (actor != NULL) { overlayEntry = actor->overlayEntry; actorName = overlayEntry->name != NULL ? overlayEntry->name : ""; @@ -2687,55 +2405,38 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) HREG(66) = i; - if ((HREG(64) != 1) || - ((HREG(65) != -1) && (HREG(65) != HREG(66))) || - (HREG(68) == 0)) - { + if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(68) == 0)) { func_800A6E10(&globalCtx->mf_11D60, &actor->posRot.pos, &actor->unk_E4, &actor->unk_F0); } - if ((HREG(64) != 1) || - ((HREG(65) != -1) && (HREG(65) != HREG(66))) || - (HREG(69) == 0)) - { - if (actor->soundEffect != 0) + if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(69) == 0)) { + if (actor->soundEffect != 0) { func_80030ED8(actor); + } } - if ((HREG(64) != 1) || - ((HREG(65) != -1) && (HREG(65) != HREG(66))) || - (HREG(70) == 0)) - { - if (func_800314B0(globalCtx, actor)) + if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(70) == 0)) { + if (func_800314B0(globalCtx, actor)) { actor->flags |= 0x40; - else + } else { actor->flags &= ~0x40; + } } actor->activelyDrawn = 0; - if ((HREG(64) != 1) || - ((HREG(65) != -1) && (HREG(65) != HREG(66))) || - (HREG(71) == 0)) - { - if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & 0x60)) - { + if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) { + if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & 0x60)) { if ((actor->flags & 0x80) && - ((globalCtx->roomCtx.curRoom.showInvisActors == 0) || - (globalCtx->actorCtx.unk_03 != 0) || - (actor->room != globalCtx->roomCtx.curRoom.num))) - { - if (invisibleActorCounter >= INVISIBLE_ACTOR_MAX) + ((globalCtx->roomCtx.curRoom.showInvisActors == 0) || (globalCtx->actorCtx.unk_03 != 0) || + (actor->room != globalCtx->roomCtx.curRoom.num))) { + if (invisibleActorCounter >= INVISIBLE_ACTOR_MAX) { __assert("invisible_actor_counter < INVISIBLE_ACTOR_MAX", "../z_actor.c", 6464); + } invisibleActors[invisibleActorCounter] = actor; invisibleActorCounter++; - } - else - { - if ((HREG(64) != 1) || - ((HREG(65) != -1) && (HREG(65) != HREG(66))) || - (HREG(72) == 0)) - { + } else { + if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(72) == 0)) { Actor_Draw(globalCtx, actor); actor->activelyDrawn = 1; } @@ -2747,48 +2448,50 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) } } - if ((HREG(64) != 1) || (HREG(73) != 0)) + if ((HREG(64) != 1) || (HREG(73) != 0)) { func_80026E74(globalCtx->state.gfxCtx); + } - if ((HREG(64) != 1) || (HREG(74) != 0)) + if ((HREG(64) != 1) || (HREG(74) != 0)) { func_80027BDC(globalCtx); + } - if ((HREG(64) != 1) || (HREG(72) != 0)) - { - if (globalCtx->actorCtx.unk_03 != 0) - { + if ((HREG(64) != 1) || (HREG(72) != 0)) { + if (globalCtx->actorCtx.unk_03 != 0) { func_8003115C(globalCtx, invisibleActorCounter, invisibleActors); - if ((globalCtx->csCtx.state != 0) || func_8008E988(globalCtx)) + if ((globalCtx->csCtx.state != 0) || func_8008E988(globalCtx)) { func_800304B0(globalCtx); + } } } func_8002FBAC(globalCtx); - if (IREG(32) == 0) + if (IREG(32) == 0) { func_8007ABBC(globalCtx); + } - if ((HREG(64) != 1) || (HREG(75) != 0)) + if ((HREG(64) != 1) || (HREG(75) != 0)) { TitleCard_Draw(globalCtx, &actorCtx->titleCtx); + } - if ((HREG(64) != 1) || (HREG(76) != 0)) + if ((HREG(64) != 1) || (HREG(76) != 0)) { func_8005D62C(globalCtx, &globalCtx->sub_11E60); + } func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 6563); } -void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx) -{ +void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) - { + for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { actor = actorCtx->actorList[i].first; - while (actor != NULL) - { - if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) + while (actor != NULL) { + if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { Actor_Kill(actor); + } actor = actor->next; } } @@ -2796,47 +2499,38 @@ void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx) u8 sEnemyActorTypes[] = { ACTORTYPE_ENEMY, ACTORTYPE_BOSS }; -void Actor_FreezeAllEnemies(GlobalContext* globalCtx, ActorContext* actorCtx, s32 freezeValue) -{ +void Actor_FreezeAllEnemies(GlobalContext* globalCtx, ActorContext* actorCtx, s32 freezeValue) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(sEnemyActorTypes); i++) - { + for (i = 0; i < ARRAY_COUNT(sEnemyActorTypes); i++) { actor = actorCtx->actorList[sEnemyActorTypes[i]].first; - while (actor != NULL) - { + while (actor != NULL) { actor->freeze = freezeValue; actor = actor->next; } } } -void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) -{ +void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) - { + for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { actor = actorCtx->actorList[i].first; - while (actor != NULL) - { - if ((actor->room >= 0) && - (actor->room != globalCtx->roomCtx.curRoom.num) && - (actor->room != globalCtx->roomCtx.prevRoom.num)) - { - if (!actor->activelyDrawn) + while (actor != NULL) { + if ((actor->room >= 0) && (actor->room != globalCtx->roomCtx.curRoom.num) && + (actor->room != globalCtx->roomCtx.prevRoom.num)) { + if (!actor->activelyDrawn) { actor = Actor_Delete(actorCtx, actor, globalCtx); - else - { + } else { Actor_Kill(actor); Actor_Destroy(actor, globalCtx); actor = actor->next; } - } - else + } else { actor = actor->next; + } } } @@ -2846,27 +2540,24 @@ void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) globalCtx->msgCtx.unk_E3F4 = 0; } -void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) -{ +void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) - { + for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { actor = actorCtx->actorList[i].first; - while (actor != NULL) - { + while (actor != NULL) { Actor_Delete(actorCtx, actor, globalCtx); actor = actorCtx->actorList[i].first; } } - if (HREG(20) != 0) + if (HREG(20) != 0) { // Translates to: "ABSOLUTE MAGIC FIELD DEALLOCATION" osSyncPrintf("絶対魔法領域解放\n"); + } - if (actorCtx->absoluteSpace != NULL) - { + if (actorCtx->absoluteSpace != NULL) { ZeldaArena_FreeDebug(actorCtx->absoluteSpace, "../z_actor.c", 6731); actorCtx->absoluteSpace = NULL; } @@ -2880,8 +2571,7 @@ void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) * Adds a given actor instance at the front of the actor list of the specified type. * Also sets the actor instance as being of that type. */ -void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType) -{ +void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType) { Actor* prevFirstActor; actorToAdd->type = actorType; @@ -2890,8 +2580,9 @@ void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType actorCtx->actorList[actorType].length++; prevFirstActor = actorCtx->actorList[actorType].first; - if (prevFirstActor != NULL) + if (prevFirstActor != NULL) { prevFirstActor->prev = actorToAdd; + } actorCtx->actorList[actorType].first = actorToAdd; actorToAdd->next = prevFirstActor; @@ -2901,81 +2592,75 @@ void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType * Removes a given actor instance from its actor list. * Also sets the temp clear flag of the current room if the actor removed was the last enemy loaded. */ -Actor* Actor_RemoveFromTypeList(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove) -{ +Actor* Actor_RemoveFromTypeList(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove) { Actor* newFirstActor; actorCtx->total--; actorCtx->actorList[actorToRemove->type].length--; - if (actorToRemove->prev != NULL) + if (actorToRemove->prev != NULL) { actorToRemove->prev->next = actorToRemove->next; - else + } else { actorCtx->actorList[actorToRemove->type].first = actorToRemove->next; + } newFirstActor = actorToRemove->next; - if (newFirstActor != NULL) + if (newFirstActor != NULL) { newFirstActor->prev = actorToRemove->prev; + } actorToRemove->next = NULL; actorToRemove->prev = NULL; - if ((actorToRemove->room == globalCtx->roomCtx.curRoom.num) && - (actorToRemove->type == ACTORTYPE_ENEMY) && - (actorCtx->actorList[ACTORTYPE_ENEMY].length == 0)) - { + if ((actorToRemove->room == globalCtx->roomCtx.curRoom.num) && (actorToRemove->type == ACTORTYPE_ENEMY) && + (actorCtx->actorList[ACTORTYPE_ENEMY].length == 0)) { Flags_SetTempClear(globalCtx, globalCtx->roomCtx.curRoom.num); } return newFirstActor; } -void Actor_FreeOverlay(ActorOverlay* actorOverlay) -{ +void Actor_FreeOverlay(ActorOverlay* actorOverlay) { osSyncPrintf(VT_FGCOL(CYAN)); - if (actorOverlay->nbLoaded == 0) - { - if (HREG(20) != 0) + if (actorOverlay->nbLoaded == 0) { + if (HREG(20) != 0) { // Translates to: "ACTOR CLIENT IS NOW 0" osSyncPrintf("アクタークライアントが0になりました\n"); + } - if (actorOverlay->loadedRamAddr != NULL) - { - if (actorOverlay->allocType & ALLOCTYPE_PERMANENT) - { - if (HREG(20) != 0) + if (actorOverlay->loadedRamAddr != NULL) { + if (actorOverlay->allocType & ALLOCTYPE_PERMANENT) { + if (HREG(20) != 0) { // Translates to: "OVERLAY WILL NOT BE DEALLOCATED" osSyncPrintf("オーバーレイ解放しません\n"); - } - else if (actorOverlay->allocType & ALLOCTYPE_ABSOLUTE) - { - if (HREG(20) != 0) + } + } else if (actorOverlay->allocType & ALLOCTYPE_ABSOLUTE) { + if (HREG(20) != 0) { // Translates to: "ABSOLUTE MAGIC FIELD RESERVED, SO DEALLOCATION WILL NOT OCCUR" osSyncPrintf("絶対魔法領域確保なので解放しません\n"); + } actorOverlay->loadedRamAddr = NULL; - } - else - { - if (HREG(20) != 0) + } else { + if (HREG(20) != 0) { // Translates to: "OVERLAY DEALLOCATED" osSyncPrintf("オーバーレイ解放します\n"); + } ZeldaArena_FreeDebug(actorOverlay->loadedRamAddr, "../z_actor.c", 6834); actorOverlay->loadedRamAddr = NULL; } } - } - else if (HREG(20) != 0) + } else if (HREG(20) != 0) { // Translates to: "%d OF ACTOR CLIENT REMAINS" osSyncPrintf("アクタークライアントはあと %d 残っています\n", actorOverlay->nbLoaded); + } osSyncPrintf(VT_RST); } -Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, - f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params) -{ +Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, f32 posX, f32 posY, f32 posZ, + s16 rotX, s16 rotY, s16 rotZ, s16 params) { s32 pad; Actor* actor; ActorInit* actorInit; @@ -2987,132 +2672,126 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId overlayEntry = &gActorOverlayTable[actorId]; - if (actorId >= ACTOR_DLF_MAX) + if (actorId >= ACTOR_DLF_MAX) { __assert("profile < ACTOR_DLF_MAX", "../z_actor.c", 6883); + } name = overlayEntry->name != NULL ? overlayEntry->name : ""; overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart; - if (HREG(20) != 0) + if (HREG(20) != 0) { // Translates to: "ACTOR CLASS ADDITION [%d:%s]" osSyncPrintf("アクタークラス追加 [%d:%s]\n", actorId, name); + } - if (actorCtx->total > ACTOR_NUMBER_MAX) - { + if (actorCtx->total > ACTOR_NUMBER_MAX) { // Translates to: "Actor SET NUMBER EXCEEDED" osSyncPrintf(VT_COL(YELLOW, BLACK) "Actorセット数オーバー\n" VT_RST); return NULL; } - if (overlayEntry->vramStart == 0) - { - if (HREG(20) != 0) + if (overlayEntry->vramStart == 0) { + if (HREG(20) != 0) { // Translates to: "NOT AN OVERLAY" osSyncPrintf("オーバーレイではありません\n"); + } actorInit = overlayEntry->initInfo; - } - else - { - if (overlayEntry->loadedRamAddr != NULL) - { - if (HREG(20) != 0) + } else { + if (overlayEntry->loadedRamAddr != NULL) { + if (HREG(20) != 0) { // Translates to: "ALREADY LOADED" osSyncPrintf("既にロードされています\n"); - } - else - { - if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) - { - if (overlaySize > AM_FIELD_SIZE) + } + } else { + if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) { + if (overlaySize > AM_FIELD_SIZE) { __assert("actor_segsize <= AM_FIELD_SIZE", "../z_actor.c", 6934); + } - if (actorCtx->absoluteSpace == NULL) - { + if (actorCtx->absoluteSpace == NULL) { // Translates to: "AMF: ABSOLUTE MAGIC FIELD" actorCtx->absoluteSpace = ZeldaArena_MallocRDebug(AM_FIELD_SIZE, "AMF:絶対魔法領域", 0); - if (HREG(20) != 0) + if (HREG(20) != 0) { // Translates to: "ABSOLUTE MAGIC FIELD RESERVATION - %d BYTES RESERVED" osSyncPrintf("絶対魔法領域確保 %d バイト確保\n", AM_FIELD_SIZE); + } } overlayEntry->loadedRamAddr = actorCtx->absoluteSpace; - } - else if (overlayEntry->allocType & ALLOCTYPE_PERMANENT) + } else if (overlayEntry->allocType & ALLOCTYPE_PERMANENT) { overlayEntry->loadedRamAddr = ZeldaArena_MallocRDebug(overlaySize, name, 0); - else + } else { overlayEntry->loadedRamAddr = ZeldaArena_MallocDebug(overlaySize, name, 0); + } - if (overlayEntry->loadedRamAddr == NULL) - { + if (overlayEntry->loadedRamAddr == NULL) { // Translates to: "CANNOT RESERVE ACTOR PROGRAM MEMORY" osSyncPrintf(VT_COL(RED, WHITE) "Actorプログラムメモリが確保できません\n" VT_RST); return NULL; } - Overlay_Load(overlayEntry->vromStart, overlayEntry->vromEnd, - overlayEntry->vramStart, overlayEntry->vramEnd, - overlayEntry->loadedRamAddr); + Overlay_Load(overlayEntry->vromStart, overlayEntry->vromEnd, overlayEntry->vramStart, overlayEntry->vramEnd, + overlayEntry->loadedRamAddr); osSyncPrintf(VT_FGCOL(GREEN)); - osSyncPrintf("OVL(a):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", - overlayEntry->vramStart, overlayEntry->vramEnd, - overlayEntry->loadedRamAddr, + osSyncPrintf("OVL(a):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", overlayEntry->vramStart, + overlayEntry->vramEnd, overlayEntry->loadedRamAddr, (u32)overlayEntry->loadedRamAddr + (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart, - (u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr, - name); + (u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr, name); osSyncPrintf(VT_RST); overlayEntry->nbLoaded = 0; } - actorInit = (ActorInit*)((u32)(overlayEntry->initInfo != NULL ? - (ActorInit*)((u32)overlayEntry->initInfo - (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)) : - NULL)); + actorInit = + (ActorInit*)((u32)(overlayEntry->initInfo != NULL + ? (ActorInit*)((u32)overlayEntry->initInfo - (s32)((u32)overlayEntry->vramStart - + (u32)overlayEntry->loadedRamAddr)) + : NULL)); } objBankIndex = Object_GetIndex(&globalCtx->objectCtx, actorInit->objectId); if ((objBankIndex < 0) || - ((actorInit->type == ACTORTYPE_ENEMY) && (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)))) - { + ((actorInit->type == ACTORTYPE_ENEMY) && (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)))) { // Translates to: "NO DATA BANK!! (profilep->bank=%d)" - osSyncPrintf(VT_COL(RED, WHITE) "データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n" VT_RST, objBankIndex, actorInit->objectId); + osSyncPrintf(VT_COL(RED, WHITE) "データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n" VT_RST, + objBankIndex, actorInit->objectId); Actor_FreeOverlay(overlayEntry); return NULL; } actor = ZeldaArena_MallocDebug(actorInit->instanceSize, name, 1); - if (actor == NULL) - { + if (actor == NULL) { // Translates to: "ACTOR CLASS CANNOT BE RESERVED! %s " - osSyncPrintf(VT_COL(RED, WHITE) "Actorクラス確保できません! %s <サイズ=%dバイト>\n", VT_RST, name, actorInit->instanceSize); + osSyncPrintf(VT_COL(RED, WHITE) "Actorクラス確保できません! %s <サイズ=%dバイト>\n", VT_RST, name, + actorInit->instanceSize); Actor_FreeOverlay(overlayEntry); return NULL; } - if (overlayEntry->nbLoaded >= 255) + if (overlayEntry->nbLoaded >= 255) { __assert("actor_dlftbl->clients < 255", "../z_actor.c", 7031); + } overlayEntry->nbLoaded++; - if (HREG(20) != 0) + if (HREG(20) != 0) { // Translates to: "ACTOR CLIENT No. %d" osSyncPrintf("アクタークライアントは %d 個目です\n", overlayEntry->nbLoaded); + } Lib_MemSet(actor, actorInit->instanceSize, 0); actor->overlayEntry = overlayEntry; actor->id = actorInit->id; actor->flags = actorInit->flags; - if (actorInit->id == ACTOR_EN_PART) - { + if (actorInit->id == ACTOR_EN_PART) { actor->objBankIndex = rotZ; rotZ = 0; - } - else - { + } else { actor->objBankIndex = objBankIndex; } @@ -3138,26 +2817,24 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId return actor; } -Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId, - f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params) -{ - Actor* spawnedActor = Actor_Spawn(actorCtx, globalCtx, actorId, - posX, posY, posZ, - rotX, rotY, rotZ, params); - if (spawnedActor == NULL) +Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId, f32 posX, + f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params) { + Actor* spawnedActor = Actor_Spawn(actorCtx, globalCtx, actorId, posX, posY, posZ, rotX, rotY, rotZ, params); + if (spawnedActor == NULL) { return NULL; + } attachedTo->attachedB = spawnedActor; spawnedActor->attachedA = attachedTo; - if (spawnedActor->room >= 0) + if (spawnedActor->room >= 0) { spawnedActor->room = attachedTo->room; + } return spawnedActor; } -void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx) -{ +void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx) { TransitionActorEntry* transitionActor; u8 nbTransitionActors; s32 i; @@ -3165,20 +2842,16 @@ void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCt transitionActor = globalCtx->transitionActorList; nbTransitionActors = globalCtx->nbTransitionActors; - for (i = 0; i < nbTransitionActors; i++) - { - if (transitionActor->id >= 0) - { + for (i = 0; i < nbTransitionActors; i++) { + if (transitionActor->id >= 0) { if (((transitionActor->frontRoom >= 0) && ((transitionActor->frontRoom == globalCtx->roomCtx.curRoom.num) || (transitionActor->frontRoom == globalCtx->roomCtx.prevRoom.num))) || ((transitionActor->backRoom >= 0) && ((transitionActor->backRoom == globalCtx->roomCtx.curRoom.num) || - (transitionActor->backRoom == globalCtx->roomCtx.prevRoom.num)))) - { - Actor_Spawn(actorCtx, globalCtx, (s16)(transitionActor->id & 0x1FFF), - transitionActor->pos.x, transitionActor->pos.y, transitionActor->pos.z, - 0, transitionActor->rotY, 0, + (transitionActor->backRoom == globalCtx->roomCtx.prevRoom.num)))) { + Actor_Spawn(actorCtx, globalCtx, (s16)(transitionActor->id & 0x1FFF), transitionActor->pos.x, + transitionActor->pos.y, transitionActor->pos.z, 0, transitionActor->rotY, 0, (i << 0xA) + transitionActor->params); transitionActor->id = -transitionActor->id; @@ -3189,16 +2862,12 @@ void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCt } } -Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx) -{ - return Actor_Spawn(actorCtx, globalCtx, actorEntry->id, - actorEntry->pos.x, actorEntry->pos.y, actorEntry->pos.z, - actorEntry->rot.x, actorEntry->rot.y, actorEntry->rot.z, - actorEntry->params); +Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx) { + return Actor_Spawn(actorCtx, globalCtx, actorEntry->id, actorEntry->pos.x, actorEntry->pos.y, actorEntry->pos.z, + actorEntry->rot.x, actorEntry->rot.y, actorEntry->rot.z, actorEntry->params); } -Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx) -{ +Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx) { char* name; Player* player; Actor* newFirstActor; @@ -3209,24 +2878,27 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC overlayEntry = actor->overlayEntry; name = overlayEntry->name != NULL ? overlayEntry->name : ""; - if (HREG(20) != 0) + if (HREG(20) != 0) { // Translates to: "ACTOR CLASS DELETED [%s]" osSyncPrintf("アクタークラス削除 [%s]\n", name); + } - if ((player != NULL) && (actor == player->unk_664)) - { + if ((player != NULL) && (actor == player->unk_664)) { func_8008EDF0(player); func_8005A444(func_800C04A4(globalCtx, func_800C030C(globalCtx)), 0); } - if (actor == actorCtx->targetCtx.arrowPointedActor) + if (actor == actorCtx->targetCtx.arrowPointedActor) { actorCtx->targetCtx.arrowPointedActor = NULL; + } - if (actor == actorCtx->targetCtx.unk_8C) + if (actor == actorCtx->targetCtx.unk_8C) { actorCtx->targetCtx.unk_8C = NULL; + } - if (actor == actorCtx->targetCtx.unk_90) + if (actor == actorCtx->targetCtx.unk_90) { actorCtx->targetCtx.unk_90 = NULL; + } func_800F89E8(&actor->unk_E4); Actor_Destroy(actor, globalCtx); @@ -3235,19 +2907,19 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC ZeldaArena_FreeDebug(actor, "../z_actor.c", 7242); - if (overlayEntry->vramStart == 0) - { - if (HREG(20) != 0) + if (overlayEntry->vramStart == 0) { + if (HREG(20) != 0) { // Translates to: "NOT AN OVERLAY" osSyncPrintf("オーバーレイではありません\n"); - } - else - { - if (overlayEntry->loadedRamAddr == NULL) + } + } else { + if (overlayEntry->loadedRamAddr == NULL) { __assert("actor_dlftbl->allocp != NULL", "../z_actor.c", 7251); + } - if (overlayEntry->nbLoaded <= 0) + if (overlayEntry->nbLoaded <= 0) { __assert("actor_dlftbl->clients > 0", "../z_actor.c", 7252); + } overlayEntry->nbLoaded--; Actor_FreeOverlay(overlayEntry); @@ -3256,8 +2928,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC return newFirstActor; } -s32 func_80032880(GlobalContext* globalCtx, Actor* actor) -{ +s32 func_80032880(GlobalContext* globalCtx, Actor* actor) { s16 sp1E; s16 sp1C; @@ -3273,49 +2944,37 @@ f32 D_8015BBF4; s32 D_8015BBF8; s16 D_8015BBFC; -void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* player, u32 actorType) -{ +void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* player, u32 actorType) { f32 var; Actor* actor; Actor* sp84; - CollisionPoly *sp80; + CollisionPoly* sp80; UNK_TYPE sp7C; Vec3f sp70; actor = actorCtx->actorList[actorType].first; sp84 = player->unk_664; - while (actor != NULL) - { - if ((actor->update != NULL) && ((Player*)actor != player) && ((actor->flags & 1) == 1)) - { - if ((actorType == ACTORTYPE_ENEMY) && ((actor->flags & 5) == 5) && - (actor->waterSurfaceDist < 250000.0f) && (actor->waterSurfaceDist < D_8015BBF4)) - { - actorCtx->targetCtx.unk_90 = actor; - D_8015BBF4 = actor->waterSurfaceDist; + while (actor != NULL) { + if ((actor->update != NULL) && ((Player*)actor != player) && ((actor->flags & 1) == 1)) { + if ((actorType == ACTORTYPE_ENEMY) && ((actor->flags & 5) == 5) && (actor->waterSurfaceDist < 250000.0f) && + (actor->waterSurfaceDist < D_8015BBF4)) { + actorCtx->targetCtx.unk_90 = actor; + D_8015BBF4 = actor->waterSurfaceDist; } - if (actor != sp84) - { + if (actor != sp84) { var = func_8002EFC0(actor, player, D_8015BBFC); - if ((var < D_8015BBF0) && - func_8002F090(actor, var) && - func_80032880(globalCtx, actor) && - (!func_8003DD6C(&globalCtx->colCtx, &player->actor.posRot2.pos, - &actor->posRot2.pos, &sp70, &sp80, 1, 1, 1, 1, &sp7C) || - func_80042048(&globalCtx->colCtx, sp80, sp7C))) - { - if (actor->unk_10D != 0) - { - if (actor->unk_10D < D_8015BBF8) - { + if ((var < D_8015BBF0) && func_8002F090(actor, var) && func_80032880(globalCtx, actor) && + (!func_8003DD6C(&globalCtx->colCtx, &player->actor.posRot2.pos, &actor->posRot2.pos, &sp70, &sp80, + 1, 1, 1, 1, &sp7C) || + func_80042048(&globalCtx->colCtx, sp80, sp7C))) { + if (actor->unk_10D != 0) { + if (actor->unk_10D < D_8015BBF8) { D_8015BBEC = actor; D_8015BBF8 = actor->unk_10D; } - } - else - { + } else { D_8015BBE8 = actor; D_8015BBF0 = var; } @@ -3327,24 +2986,12 @@ void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* pla } } -u8 D_801160A0[] = -{ - ACTORTYPE_BOSS, - ACTORTYPE_ENEMY, - ACTORTYPE_BG, - ACTORTYPE_EXPLOSIVES, - ACTORTYPE_NPC, - ACTORTYPE_ITEMACTION, - ACTORTYPE_CHEST, - ACTORTYPE_SWITCH, - ACTORTYPE_PROP, - ACTORTYPE_MISC, - ACTORTYPE_DOOR, - ACTORTYPE_SWITCH, +u8 D_801160A0[] = { + ACTORTYPE_BOSS, ACTORTYPE_ENEMY, ACTORTYPE_BG, ACTORTYPE_EXPLOSIVES, ACTORTYPE_NPC, ACTORTYPE_ITEMACTION, + ACTORTYPE_CHEST, ACTORTYPE_SWITCH, ACTORTYPE_PROP, ACTORTYPE_MISC, ACTORTYPE_DOOR, ACTORTYPE_SWITCH, }; -Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player) -{ +Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player) { s32 i; u8* entry; @@ -3352,33 +2999,30 @@ Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** a D_8015BBF0 = D_8015BBF4 = FLT_MAX; D_8015BBF8 = 0x7FFFFFFF; - if (!func_8008E988(globalCtx)) - { + if (!func_8008E988(globalCtx)) { entry = &D_801160A0[0]; actorCtx->targetCtx.unk_90 = NULL; D_8015BBFC = player->actor.shape.rot.y; - for (i = 0; i < 3; i++) - { + for (i = 0; i < 3; i++) { func_800328D4(globalCtx, actorCtx, player, *entry); entry++; } - if (D_8015BBE8 == NULL) - { - for (i; i < ARRAY_COUNT(D_801160A0); i++) - { + if (D_8015BBE8 == NULL) { + for (i; i < ARRAY_COUNT(D_801160A0); i++) { func_800328D4(globalCtx, actorCtx, player, *entry); entry++; } } } - if (D_8015BBE8 == 0) + if (D_8015BBE8 == 0) { *actorPtr = D_8015BBEC; - else + } else { *actorPtr = D_8015BBE8; + } return *actorPtr; } @@ -3386,84 +3030,77 @@ Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** a /** * Finds the first actor instance of a specified id and type if there is one. */ -Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType) -{ +Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType) { Actor* actor = actorCtx->actorList[actorType].first; - while (actor != NULL) - { - if (actorId == actor->id) + while (actor != NULL) { + if (actorId == actor->id) { return actor; + } actor = actor->next; } return NULL; } -void func_80032C7C(GlobalContext* globalCtx, Actor* actor) -{ +void func_80032C7C(GlobalContext* globalCtx, Actor* actor) { globalCtx->actorCtx.unk_00 = 5; Audio_PlaySoundAtPosition(globalCtx, &actor->posRot.pos, 0x14, NA_SE_EN_LAST_DAMAGE); } -s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) -{ - if (DECR(arg0[1]) == 0) +s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) { + if (DECR(arg0[1]) == 0) { arg0[1] = Math_Rand_S16Offset(arg1, arg2); + } - if ((arg0[1] - arg3) > 0) + if ((arg0[1] - arg3) > 0) { arg0[0] = 0; - else if (((arg0[1] - arg3) > -2) || (arg0[1] < 2)) + } else if (((arg0[1] - arg3) > -2) || (arg0[1] < 2)) { arg0[0] = 1; - else + } else { arg0[0] = 2; - - return arg0[0]; -} - -s16 func_80032D60(s16* arg0, s16 arg1, s16 arg2, s16 arg3) -{ - if (DECR(arg0[1]) == 0) - { - arg0[1] = Math_Rand_S16Offset(arg1, arg2); - arg0[0]++; - - if ((arg0[0] % 3) == 0) - arg0[0] = (s32)(Math_Rand_ZeroOne() * arg3) * 3; } return arg0[0]; } -typedef struct -{ +s16 func_80032D60(s16* arg0, s16 arg1, s16 arg2, s16 arg3) { + if (DECR(arg0[1]) == 0) { + arg0[1] = Math_Rand_S16Offset(arg1, arg2); + arg0[0]++; + + if ((arg0[0] % 3) == 0) { + arg0[0] = (s32)(Math_Rand_ZeroOne() * arg3) * 3; + } + } + + return arg0[0]; +} + +typedef struct { /* 0x00 */ MtxF* unk_00; /* 0x04 */ s16* unk_04; - /* 0x08 */ s16 unk_08; + /* 0x08 */ s16 unk_08; /* 0x0A */ char unk_0A[0x02]; /* 0x0C */ s32* unk_0C; - /* 0x10 */ s32 unk_10; - /* 0x14 */ s32 unk_14; + /* 0x10 */ s32 unk_10; + /* 0x14 */ s32 unk_14; } struct_80032E24; -void func_80032E24(struct_80032E24* arg0, s32 arg1, GlobalContext* globalCtx) -{ +void func_80032E24(struct_80032E24* arg0, s32 arg1, GlobalContext* globalCtx) { u32 sp28; u32 sp24; u32 sp20; sp28 = (arg1 * sizeof(*arg0->unk_00)) + sizeof(*arg0->unk_00); arg0->unk_00 = ZeldaArena_MallocDebug(sp28, "../z_actor.c", 7540); - if (arg0->unk_00 != NULL) - { + if (arg0->unk_00 != NULL) { sp24 = (arg1 * sizeof(*arg0->unk_0C)) + sizeof(*arg0->unk_0C); arg0->unk_0C = ZeldaArena_MallocDebug(sp24, "../z_actor.c", 7543); - if (arg0->unk_0C != NULL) - { + if (arg0->unk_0C != NULL) { sp20 = (arg1 * sizeof(*arg0->unk_04)) + sizeof(*arg0->unk_04); arg0->unk_04 = ZeldaArena_MallocDebug(sp20, "../z_actor.c", 7546); - if (arg0->unk_04 != NULL) - { + if (arg0->unk_04 != NULL) { Lib_MemSet(arg0->unk_00, sp28, 0); Lib_MemSet(arg0->unk_0C, sp24, 0); Lib_MemSet(arg0->unk_04, sp20, 0); @@ -3473,35 +3110,35 @@ void func_80032E24(struct_80032E24* arg0, s32 arg1, GlobalContext* globalCtx) } } - if (arg0->unk_00 != NULL) + if (arg0->unk_00 != NULL) { ZeldaArena_FreeDebug(arg0->unk_00, "../z_actor.c", 7558); + } - if (arg0->unk_0C != NULL) + if (arg0->unk_0C != NULL) { ZeldaArena_FreeDebug(arg0->unk_0C, "../z_actor.c", 7561); + } - if (arg0->unk_04 != NULL) + if (arg0->unk_04 != NULL) { ZeldaArena_FreeDebug(arg0->unk_04, "../z_actor.c", 7564); + } } -void func_80032F54(struct_80032E24* arg0, s32 arg1, s32 arg2, s32 arg3, u32 arg4, s32* arg5, s16 arg6) -{ +void func_80032F54(struct_80032E24* arg0, s32 arg1, s32 arg2, s32 arg3, u32 arg4, s32* arg5, s16 arg6) { GlobalContext* globalCtx = func_80026B00(); - if ((globalCtx->actorCtx.unk_00 == 0) && (arg0->unk_10 > 0)) - { - if ((arg1 >= arg2) && (arg3 >= arg1) && (*arg5 != 0)) - { + if ((globalCtx->actorCtx.unk_00 == 0) && (arg0->unk_10 > 0)) { + if ((arg1 >= arg2) && (arg3 >= arg1) && (*arg5 != 0)) { arg0->unk_0C[arg0->unk_10] = *arg5; Matrix_Get(&arg0->unk_00[arg0->unk_10]); arg0->unk_04[arg0->unk_10] = arg6; arg0->unk_10++; } - if (arg1 != arg0->unk_14) + if (arg1 != arg0->unk_14) { arg0->unk_08++; + } - if (arg0->unk_08 >= arg4) - { + if (arg0->unk_08 >= arg4) { arg0->unk_08 = arg0->unk_10 - 1; arg0->unk_10 = -1; } @@ -3510,45 +3147,41 @@ void func_80032F54(struct_80032E24* arg0, s32 arg1, s32 arg2, s32 arg3, u32 arg4 arg0->unk_14 = arg1; } -typedef struct -{ - /* 0x000 */ Actor actor; - /* 0x14C */ u8 unk_14C; - /* 0x14E */ s16 unk_14E; - /* 0x150 */ s32 unk_150; - /* 0x154 */ f32 unk_154; - /* 0x158 */ f32 unk_158; +typedef struct { + /* 0x000 */ Actor actor; + /* 0x14C */ u8 unk_14C; + /* 0x14E */ s16 unk_14E; + /* 0x150 */ s32 unk_150; + /* 0x154 */ f32 unk_154; + /* 0x158 */ f32 unk_158; } ActorEnPart; -s32 func_8003305C(Actor* actor, struct_80032E24* arg1, GlobalContext* globalCtx, s16 params) -{ +s32 func_8003305C(Actor* actor, struct_80032E24* arg1, GlobalContext* globalCtx, s16 params) { ActorEnPart* spawnedEnPart; MtxF* mtx; s16 objBankIndex; - if (arg1->unk_10 != -1) + if (arg1->unk_10 != -1) { return 0; + } - while (arg1->unk_08 > 0) - { + while (arg1->unk_08 > 0) { Matrix_Put(&arg1->unk_00[arg1->unk_08]); Matrix_Scale(1.0f / actor->scale.x, 1.0f / actor->scale.y, 1.0f / actor->scale.z, MTXMODE_APPLY); Matrix_Get(&arg1->unk_00[arg1->unk_08]); - if (1) // Necessary to match - { - if (arg1->unk_04[arg1->unk_08] >= 0) + if (1) { // Necessary to match + if (arg1->unk_04[arg1->unk_08] >= 0) { objBankIndex = arg1->unk_04[arg1->unk_08]; - else + } else { objBankIndex = actor->objBankIndex; + } } mtx = &arg1->unk_00[arg1->unk_08]; spawnedEnPart = (ActorEnPart*)Actor_SpawnAttached(&globalCtx->actorCtx, actor, globalCtx, ACTOR_EN_PART, - mtx->wx, mtx->wy, mtx->wz, - 0, 0, objBankIndex, params); - if (spawnedEnPart != NULL) - { + mtx->wx, mtx->wy, mtx->wz, 0, 0, objBankIndex, params); + if (spawnedEnPart != NULL) { func_800D20CC(&arg1->unk_00[arg1->unk_08], &spawnedEnPart->actor.shape.rot, 0); spawnedEnPart->unk_150 = arg1->unk_0C[arg1->unk_08]; spawnedEnPart->actor.scale = actor->scale; @@ -3565,8 +3198,8 @@ s32 func_8003305C(Actor* actor, struct_80032E24* arg1, GlobalContext* globalCtx, return 1; } -void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 arg6, s16 arg7, u8 arg8) -{ +void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 arg6, + s16 arg7, u8 arg8) { Vec3f sp9C; Vec3f sp90 = { 0.0f, 0.0f, 0.0f }; Vec3f sp84 = { 0.0f, 0.3f, 0.0f }; @@ -3577,26 +3210,25 @@ void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3 sp9C.y = actor->unk_80; sp84.y += (Math_Rand_ZeroOne() - 0.5f) * 0.2f; - for (i = arg4; i >= 0; i--) - { + for (i = arg4; i >= 0; i--) { sp9C.x = (func_800CA720(var) * arg3) + arg2->x; sp9C.z = (func_800CA774(var) * arg3) + arg2->z; sp84.x = (Math_Rand_ZeroOne() - 0.5f) * arg5; sp84.z = (Math_Rand_ZeroOne() - 0.5f) * arg5; - if (arg6 == 0) + if (arg6 == 0) { func_8002857C(globalCtx, &sp9C, &sp90, &sp84); - else if (arg8 != 0) + } else if (arg8 != 0) { func_800286CC(globalCtx, &sp9C, &sp90, &sp84, arg6, arg7); - else + } else { func_8002865C(globalCtx, &sp9C, &sp90, &sp84, arg6, arg7); + } var += 6.28f / (arg4 + 1.0f); } } -void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5, u8 arg6) -{ +void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5, u8 arg6) { Vec3f sp94; Vec3f sp88 = { 0.0f, 0.0f, 0.0f }; Vec3f sp7C = { 0.0f, 0.3f, 0.0f }; @@ -3604,8 +3236,7 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1 u32 var2; s32 i; - for (i = arg3; i >= 0; i--) - { + for (i = arg3; i >= 0; i--) { sp94.x = arg1->x + ((Math_Rand_ZeroOne() - 0.5f) * arg2); sp94.y = arg1->y + ((Math_Rand_ZeroOne() - 0.5f) * arg2); sp94.z = arg1->z + ((Math_Rand_ZeroOne() - 0.5f) * arg2); @@ -3613,17 +3244,16 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1 var = (s16)((Math_Rand_ZeroOne() * arg4) * 0.2f) + arg4; var2 = arg6; - if (var2 != 0) + if (var2 != 0) { func_800286CC(globalCtx, &sp94, &sp88, &sp7C, var, arg5); - else + } else { func_8002865C(globalCtx, &sp94, &sp88, &sp7C, var, arg5); + } } } -Actor* func_80033640(GlobalContext* globalCtx, Collider* collider) -{ - if ((collider->collideFlags & 0x2) && (collider->ac->type == ACTORTYPE_EXPLOSIVES)) - { +Actor* func_80033640(GlobalContext* globalCtx, Collider* collider) { + if ((collider->collideFlags & 0x2) && (collider->ac->type == ACTORTYPE_EXPLOSIVES)) { collider->collideFlags &= ~0x2; return collider->ac; } @@ -3631,22 +3261,18 @@ Actor* func_80033640(GlobalContext* globalCtx, Collider* collider) return NULL; } -Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor) -{ +Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor) { Actor* actor = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; - while (actor != NULL) - { - if ((actor == explosiveActor) || (actor->params != 1)) - { + while (actor != NULL) { + if ((actor == explosiveActor) || (actor->params != 1)) { actor = actor->next; - } - else - { - if (func_8002DB48(explosiveActor, actor) <= (actor->shape.rot.z * 10) + 80.0f) + } else { + if (func_8002DB48(explosiveActor, actor) <= (actor->shape.rot.z * 10) + 80.0f) { return actor; - else + } else { actor = actor->next; + } } } @@ -3657,21 +3283,18 @@ Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor) * Dynamically changes the type of a given actor instance. * This is done by moving it to the corresponding type list and setting its type variable accordingly. */ -void Actor_ChangeType(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorType) -{ +void Actor_ChangeType(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorType) { Actor_RemoveFromTypeList(globalCtx, actorCtx, actor); Actor_AddToTypeList(actorCtx, actor, actorType); } -typedef struct -{ - /* 0x000 */ Actor actor; - /* 0x14C */ char unk_14C[0xC4]; - /* 0x210 */ s16 unk_210; +typedef struct { + /* 0x000 */ Actor actor; + /* 0x14C */ char unk_14C[0xC4]; + /* 0x210 */ s16 unk_210; } Actor_80033780; -Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2) -{ +Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2) { Actor_80033780* itemActor; Vec3f spA8; f32 deltaX; @@ -3682,19 +3305,15 @@ Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg Actor* actor; actor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; - while (actor != NULL) - { - if (((actor->id != ACTOR_ARMS_HOOK) && (actor->id != ACTOR_EN_ARROW)) || (actor == refActor)) + while (actor != NULL) { + if (((actor->id != ACTOR_ARMS_HOOK) && (actor->id != ACTOR_EN_ARROW)) || (actor == refActor)) { actor = actor->next; - else - { + } else { itemActor = (Actor_80033780*)actor; - if ((arg2 < Math_Vec3f_DistXYZ(&refActor->posRot.pos, &itemActor->actor.posRot.pos)) || (itemActor->unk_210 == 0)) - { + if ((arg2 < Math_Vec3f_DistXYZ(&refActor->posRot.pos, &itemActor->actor.posRot.pos)) || + (itemActor->unk_210 == 0)) { actor = actor->next; - } - else - { + } else { deltaX = Math_Sins(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f); deltaY = itemActor->actor.velocity.y + (itemActor->actor.gravity * 10.0f); deltaZ = Math_Coss(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f); @@ -3703,11 +3322,12 @@ Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg spA8.y = itemActor->actor.posRot.pos.y + deltaY; spA8.z = itemActor->actor.posRot.pos.z + deltaZ; - if (func_80062ECC(refActor->sub_98.unk_10, refActor->sub_98.unk_12, 0.0f, - &refActor->posRot.pos, &itemActor->actor.posRot.pos, &spA8, &sp90, &sp84)) + if (func_80062ECC(refActor->sub_98.unk_10, refActor->sub_98.unk_12, 0.0f, &refActor->posRot.pos, + &itemActor->actor.posRot.pos, &spA8, &sp90, &sp84)) { return itemActor; - else + } else { actor = actor->next; + } } } } @@ -3718,12 +3338,10 @@ Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg /** * Sets the actor's text id with a dynamic prefix based on the current scene. */ -void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 baseTextId) -{ +void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 baseTextId) { s16 prefix; - switch (globalCtx->sceneNum) - { + switch (globalCtx->sceneNum) { case SCENE_YDAN: case SCENE_YDAN_BOSS: case SCENE_MORIBOSSROOM: @@ -3797,8 +3415,7 @@ void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 baseTex actor->textId = prefix | baseTextId; } -s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) -{ +s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) { s16 ret; s16 sp44; f32 sp40; @@ -3820,36 +3437,32 @@ s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) return ret; } -s32 func_80033A84(GlobalContext* globalCtx, Actor* actor) -{ +s32 func_80033A84(GlobalContext* globalCtx, Actor* actor) { Player* player = PLAYER; - if ((player->stateFlags1 & 0x10) && (actor->unk_10C != 0)) + if ((player->stateFlags1 & 0x10) && (actor->unk_10C != 0)) { return 1; - else + } else { return 0; + } } -s32 func_80033AB8(GlobalContext* globalCtx, Actor* actor) -{ +s32 func_80033AB8(GlobalContext* globalCtx, Actor* actor) { Player* player = PLAYER; - if ((player->stateFlags1 & 0x10) && (actor->unk_10C == 0)) + if ((player->stateFlags1 & 0x10) && (actor->unk_10C == 0)) { return 1; - else + } else { return 0; + } } -f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) -{ +f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) { f32 ret = 0.0f; - if (arg4 <= Math_Vec3f_DistXYZ(arg0, arg1)) - { + if (arg4 <= Math_Vec3f_DistXYZ(arg0, arg1)) { ret = Math_SmoothScaleMaxMinF(&arg1->x, arg0->x, arg2, arg3, 0.0f); ret += Math_SmoothScaleMaxMinF(&arg1->y, arg0->y, arg2, arg3, 0.0f); ret += Math_SmoothScaleMaxMinF(&arg1->z, arg0->z, arg2, arg3, 0.0f); - } - else if (arg5 < Math_Vec3f_DistXYZ(arg0, arg1)) - { + } else if (arg5 < Math_Vec3f_DistXYZ(arg0, arg1)) { ret = Math_SmoothScaleMaxMinF(&arg1->x, arg0->x, arg2, arg3, 0.0f); ret += Math_SmoothScaleMaxMinF(&arg1->y, arg0->y, arg2, arg3, 0.0f); ret += Math_SmoothScaleMaxMinF(&arg1->z, arg0->z, arg2, arg3, 0.0f); @@ -3858,8 +3471,7 @@ f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar return ret; } -void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx) -{ +void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx) { MtxF sp60; f32 var; Vec3f sp50; @@ -3869,7 +3481,7 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx) func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8120); - if (0) ; // Necessary to match + if (0) {} // Necessary to match gfxCtx->polyOpa.p = func_80093774(gfxCtx->polyOpa.p, 0x2C); @@ -3881,60 +3493,55 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx) var = func_8003C8EC(globalCtx, &globalCtx->colCtx, &sp4C, &sp50); - if (sp4C != NULL) - { + if (sp4C != NULL) { func_80038A28(sp4C, arg0->x, var, arg0->z, &sp60); Matrix_Put(&sp60); - } - else + } else { Matrix_Translate(arg0->x, arg0->y, arg0->z, MTXMODE_NEW); + } Matrix_Scale(arg1->x, 1.0f, arg1->z, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8149), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8149), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, &D_04049210); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8155); } -void func_80033DB8(GlobalContext* globalCtx, s16 arg1, s16 arg2) -{ +void func_80033DB8(GlobalContext* globalCtx, s16 arg1, s16 arg2) { s16 var = func_80092F88(&globalCtx->cameraCtx.activeCameras[0], 3); func_80092DAC(var, 20000); func_80092E70(var, arg1, 0, 0, 0); func_80092DF0(var, arg2); } -void func_80033E1C(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3) -{ +void func_80033E1C(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3) { s16 var = func_80092F88(&globalCtx->cameraCtx.activeCameras[0], 3); func_80092DAC(var, arg3); func_80092E70(var, arg1, 0, 0, 0); func_80092DF0(var, arg2); } -void func_80033E88(Actor* actor, GlobalContext* globalCtx, s16 arg2, s16 arg3) -{ - if (arg2 >= 5) +void func_80033E88(Actor* actor, GlobalContext* globalCtx, s16 arg2, s16 arg3) { + if (arg2 >= 5) { func_800AA000(actor->waterSurfaceDist, 0xFF, 0x14, 0x96); - else + } else { func_800AA000(actor->waterSurfaceDist, 0xB4, 0x14, 0x64); + } func_80033DB8(globalCtx, arg2, arg3); } -f32 Math_Rand_ZeroFloat(f32 f) -{ +f32 Math_Rand_ZeroFloat(f32 f) { return Math_Rand_ZeroOne() * f; } -f32 Math_Rand_CenteredFloat(f32 f) -{ +f32 Math_Rand_CenteredFloat(f32 f) { return (Math_Rand_ZeroOne() - 0.5f) * f; } -typedef struct -{ +typedef struct { /* 0x00 */ f32 unk_00; /* 0x04 */ f32 unk_04; /* 0x08 */ f32 unk_08; @@ -3944,15 +3551,13 @@ typedef struct /* 0x18 */ u32 unk_18; } struct_801160DC; // size = 0x1C -struct_801160DC D_801160DC[3] = -{ - { 0.54f, 6000.0f, 5000.0f, 1.0f, 0.0f, 0x050011F0, 0x05001100 }, - { 0.644f, 12000.0f, 8000.0f, 1.0f, 0.0f, 0x06001530, 0x06001400 }, - { 0.64000005f, 8500.0f, 8000.0f, 1.75f, 0.1f, 0x050011F0, 0x05001100 }, +struct_801160DC D_801160DC[3] = { + { 0.54f, 6000.0f, 5000.0f, 1.0f, 0.0f, 0x050011F0, 0x05001100 }, + { 0.644f, 12000.0f, 8000.0f, 1.0f, 0.0f, 0x06001530, 0x06001400 }, + { 0.64000005f, 8500.0f, 8000.0f, 1.75f, 0.1f, 0x050011F0, 0x05001100 }, }; -void func_80033F54(GlobalContext* globalCtx, s32 arg1, s32 arg2) -{ +void func_80033F54(GlobalContext* globalCtx, s32 arg1, s32 arg2) { struct_801160DC* entry; s32 i; MtxF spB0; @@ -3975,22 +3580,24 @@ void func_80033F54(GlobalContext* globalCtx, s32 arg1, s32 arg2) temp1 = sinf(entry->unk_00 - var) * -(10 - arg1) * 0.1f * entry->unk_04; temp2 = cosf(entry->unk_00 - var) * (10 - arg1) * 0.1f * entry->unk_04; - for (i = 0; i < 4; i++) - { + for (i = 0; i < 4; i++) { Matrix_Put(&spB0); Matrix_RotateZ(var, MTXMODE_APPLY); Matrix_Translate(temp1, temp2, 0.0f, MTXMODE_APPLY); - if (entry->unk_0C != 1.0f) + if (entry->unk_0C != 1.0f) { Matrix_Scale(entry->unk_0C, entry->unk_0C, entry->unk_0C, MTXMODE_APPLY); + } - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8299), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8299), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, entry->unk_14); - if (i % 2) + if (i % 2) { temp3 = entry->unk_00 + entry->unk_00; - else + } else { temp3 = M_PI - (entry->unk_00 + entry->unk_00); + } var += temp3; } @@ -3998,28 +3605,27 @@ void func_80033F54(GlobalContext* globalCtx, s32 arg1, s32 arg2) Matrix_Put(&spB0); Matrix_Scale(arg1 * 0.1f, arg1 * 0.1f, arg1 * 0.1f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8314), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8314), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, entry->unk_18); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8319); } -void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1) -{ +void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1) { func_80062D60(globalCtx, arg1); } -void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4) -{ - if ((arg1 == 0x8000) && !(arg2 & 0x8000)) +void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { + if ((arg1 == 0x8000) && !(arg2 & 0x8000)) { Audio_PlayActorSound2(actor, NA_SE_EN_LIGHT_ARROW_HIT); + } actor->unk_112 = arg1 | arg3 | ((arg2 & 0xF8) << 5) | arg4; actor->unk_114 = arg4; } -Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) -{ +Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) { Vec3f lightDir; lightDir.x = globalCtx->unk_10A4E; @@ -4029,8 +3635,7 @@ Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) return func_8002EABC(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); } -Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx) -{ +Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx) { Vec3f lightDir; lightDir.x = globalCtx->unk_10A4E; @@ -4040,91 +3645,87 @@ Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx) return func_8002EB44(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); } -s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*)) -{ +s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), + s16 (*unkFunc2)(GlobalContext*, Actor*)) { s16 sp26; s16 sp24; - if (func_8002F194(actor, globalCtx)) - { + if (func_8002F194(actor, globalCtx)) { *arg2 = 1; return 1; } - if (*arg2 != 0) - { + if (*arg2 != 0) { *arg2 = unkFunc2(globalCtx, actor); return 0; } func_8002F374(globalCtx, actor, &sp26, &sp24); - if ((sp26 < 0) || (sp26 > 0x140) || (sp24 < 0) || (sp24 > 0xF0)) + if ((sp26 < 0) || (sp26 > 0x140) || (sp24 < 0) || (sp24 > 0xF0)) { return 0; + } - if (!func_8002F2CC(actor, globalCtx, arg3)) + if (!func_8002F2CC(actor, globalCtx, arg3)) { return 0; + } actor->textId = unkFunc1(globalCtx, actor); return 0; } -typedef struct -{ - /* 0x00 */ s16 unk_00; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ s16 unk_0A; +typedef struct { + /* 0x00 */ s16 unk_00; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; /* 0x0C */ char unk_0C[0x2]; - /* 0x0E */ s16 unk_0E; - /* 0x10 */ s16 unk_10; + /* 0x0E */ s16 unk_0E; + /* 0x10 */ s16 unk_10; /* 0x12 */ char unk_12[0x2]; - /* 0x14 */ f32 unk_14; + /* 0x14 */ f32 unk_14; /* 0x18 */ Vec3f unk_18; } struct_80034A14_arg1; -typedef struct -{ - /* 0x00 */ s16 unk_00; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ s16 unk_0A; - /* 0x0C */ u8 unk_0C; +typedef struct { + /* 0x00 */ s16 unk_00; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ u8 unk_0C; } struct_80116130_0; // size = 0x10 -typedef struct -{ +typedef struct { /* 0x00 */ struct_80116130_0 sub_00; - /* 0x10 */ f32 unk_10; - /* 0x14 */ s16 unk_14; + /* 0x10 */ f32 unk_10; + /* 0x14 */ s16 unk_14; } struct_80116130; // size = 0x18 -struct_80116130 D_80116130[13] = -{ +struct_80116130 D_80116130[13] = { { { 0x2AA8, 0xF1C8, 0x18E2, 0x1554, 0x0000, 0x0000, 1 }, 170.0f, 0x3FFC }, { { 0x2AA8, 0xEAAC, 0x1554, 0x1554, 0xF8E4, 0x0E38, 1 }, 170.0f, 0x3FFC }, { { 0x31C4, 0xE390, 0x0E38, 0x0E38, 0xF1C8, 0x071C, 1 }, 170.0f, 0x3FFC }, { { 0x1554, 0xF1C8, 0x0000, 0x071C, 0xF8E4, 0x0000, 1 }, 170.0f, 0x3FFC }, { { 0x2AA8, 0xF8E4, 0x071C, 0x0E38, 0xD558, 0x2AA8, 1 }, 170.0f, 0x3FFC }, { { 0x0000, 0xE390, 0x2AA8, 0x3FFC, 0xF1C8, 0x0E38, 1 }, 170.0f, 0x3FFC }, - { { 0x2AA8, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 }, - { { 0x2AA8, 0xF1C8, 0x0000, 0x0E38, 0x0000, 0x1C70, 1 }, 0.0f, 0x0000 }, - { { 0x2AA8, 0xF1C8, 0xF1C8, 0x0000, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 }, - { { 0x071C, 0xF1C8, 0x0E38, 0x1C70, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 }, - { { 0x0E38, 0xF1C8, 0x0000, 0x1C70, 0x0000, 0x0E38, 1 }, 0.0f, 0x0000 }, - { { 0x2AA8, 0xE390, 0x1C70, 0x0E38, 0xF1C8, 0x0E38, 1 }, 0.0f, 0x0000 }, - { { 0x18E2, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xF1C8, 0x0000, 0x0E38, 0x0000, 0x1C70, 1 }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xF1C8, 0xF1C8, 0x0000, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 }, + { { 0x071C, 0xF1C8, 0x0E38, 0x1C70, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 }, + { { 0x0E38, 0xF1C8, 0x0000, 0x1C70, 0x0000, 0x0E38, 1 }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xE390, 0x1C70, 0x0E38, 0xF1C8, 0x0E38, 1 }, 0.0f, 0x0000 }, + { { 0x18E2, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 }, }; #ifdef NON_MATCHING // this function still needs a lot of work -void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7, u8 arg8) -{ +void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7, + u8 arg8) { s16 sp46; s16 sp44; s16 temp1; @@ -4166,25 +3767,24 @@ void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3, #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800344BC.s") #endif -s16 func_800347E8(s16 arg0) -{ +s16 func_800347E8(s16 arg0) { return D_80116130[arg0].unk_14; } -s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3, s16 arg4) -{ +s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3, s16 arg4) { s32 pad; s16 var; s16 abs_var; - if (arg4 != 0) + if (arg4 != 0) { return arg4; + } - if (arg1->unk_00 != 0) + if (arg1->unk_00 != 0) { return 4; + } - if (arg2 < Math_Vec3f_DistXYZ(&actor->posRot.pos, &arg1->unk_18)) - { + if (arg2 < Math_Vec3f_DistXYZ(&actor->posRot.pos, &arg1->unk_18)) { arg1->unk_04 = 0; arg1->unk_06 = 0; return 1; @@ -4192,18 +3792,17 @@ s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3, var = Math_Vec3f_Yaw(&actor->posRot.pos, &arg1->unk_18); abs_var = ABS((s16)((f32)var - actor->shape.rot.y)); - if (arg3 >= abs_var) - { + if (arg3 >= abs_var) { arg1->unk_04 = 0; arg1->unk_06 = 0; return 2; } - if (DECR(arg1->unk_04) != 0) + if (DECR(arg1->unk_04) != 0) { return arg1->unk_02; + } - switch (arg1->unk_06) - { + switch (arg1->unk_06) { case 0: case 2: arg1->unk_04 = Math_Rand_S16Offset(30, 30); @@ -4218,16 +3817,14 @@ s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3, return 4; } -void func_80034A14(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3) -{ +void func_80034A14(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3) { struct_80116130_0 sp38; arg1->unk_02 = func_80034810(actor, arg1, D_80116130[arg2].unk_10, D_80116130[arg2].unk_14, arg3); sp38 = D_80116130[arg2].sub_00; - switch (arg1->unk_02) - { + switch (arg1->unk_02) { case 1: sp38.unk_00 = 0; sp38.unk_04 = 0; @@ -4240,12 +3837,11 @@ void func_80034A14(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3) sp38.unk_0C = 0; } - func_800344BC(actor, arg1, sp38.unk_00, sp38.unk_04, sp38.unk_02, - sp38.unk_06, sp38.unk_0A, sp38.unk_08, sp38.unk_0C); + func_800344BC(actor, arg1, sp38.unk_00, sp38.unk_04, sp38.unk_02, sp38.unk_06, sp38.unk_0A, sp38.unk_08, + sp38.unk_0C); } -Gfx* func_80034B28(GraphicsContext* gfxCtx) -{ +Gfx* func_80034B28(GraphicsContext* gfxCtx) { Gfx* displayList; displayList = Graph_Alloc(gfxCtx, sizeof(Gfx)); @@ -4256,8 +3852,7 @@ Gfx* func_80034B28(GraphicsContext* gfxCtx) #ifdef NON_MATCHING // doesn't generate the 2 useless move instructions before returning -Gfx* func_80034B54(GraphicsContext* gfxCtx) -{ +Gfx* func_80034B54(GraphicsContext* gfxCtx) { Gfx* displayList; Gfx* displayListHead; @@ -4265,10 +3860,10 @@ Gfx* func_80034B54(GraphicsContext* gfxCtx) displayListHead = displayList; gDPSetRenderMode(displayListHead++, - AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | - GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA), - AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); + AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA), + AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); gSPEndDisplayList(displayListHead); @@ -4278,8 +3873,8 @@ Gfx* func_80034B54(GraphicsContext* gfxCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_80034B54.s") #endif -void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha) -{ +void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, + s16 alpha) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; @@ -4292,14 +3887,14 @@ void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc gDPPipeSync(gfxCtx->polyOpa.p++); gSPSegment(gfxCtx->polyOpa.p++, 0x0C, func_80034B28(globalCtx->state.gfxCtx)); - gfxCtx->polyOpa.p = func_800A273C(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl, - skelAnime->dListCount, unkFunc1, unkFunc2, actor, gfxCtx->polyOpa.p); + gfxCtx->polyOpa.p = func_800A273C(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl, skelAnime->dListCount, + unkFunc1, unkFunc2, actor, gfxCtx->polyOpa.p); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8860); } -void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha) -{ +void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, + s16 alpha) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; @@ -4311,29 +3906,26 @@ void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x00, 0x00, 0x00, alpha); gSPSegment(gfxCtx->polyXlu.p++, 0x0C, func_80034B54(globalCtx->state.gfxCtx)); - gfxCtx->polyXlu.p = func_800A273C(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl, - skelAnime->dListCount, unkFunc1, unkFunc2, actor, gfxCtx->polyXlu.p); + gfxCtx->polyXlu.p = func_800A273C(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl, skelAnime->dListCount, + unkFunc1, unkFunc2, actor, gfxCtx->polyXlu.p); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8904); } -s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) -{ +s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) { Player* player = PLAYER; f32 var; - if ((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) + if ((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) { var = Math_Vec3f_DistXYZ(&actor->posRot.pos, &globalCtx->view.eye) * 0.25f; - else + } else { var = Math_Vec3f_DistXYZ(&actor->posRot.pos, &player->actor.posRot.pos); + } - if (arg3 < var) - { + if (arg3 < var) { actor->flags &= ~1; Math_SmoothScaleMaxMinS(&arg2, 0, 6, 0x14, 1); - } - else - { + } else { actor->flags |= 1; Math_SmoothScaleMaxMinS(&arg2, 0xFF, 6, 0x14, 1); } @@ -4341,67 +3933,53 @@ s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) return arg2; } -void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2) -{ +void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2) { f32 frameCount; arg1 += arg2; - if (arg1->frameCount > 0.0f) + if (arg1->frameCount > 0.0f) { frameCount = arg1->frameCount; - else + } else { frameCount = SkelAnime_GetFrameCount(arg1->animation); + } - SkelAnime_ChangeAnimation(skelAnime, arg1->animation, arg1->playbackSpeed, - arg1->unk_08, frameCount, arg1->unk_10, arg1->transitionRate); + SkelAnime_ChangeAnimation(skelAnime, arg1->animation, arg1->playbackSpeed, arg1->unk_08, frameCount, arg1->unk_10, + arg1->transitionRate); } -void func_80034F54(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3) -{ +void func_80034F54(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3) { u32 frames = globalCtx->gameplayFrames; s32 i; - for (i = 0; i < arg3; i++) - { + for (i = 0; i < arg3; i++) { arg1[i] = (0x814 + 50 * i) * frames; arg2[i] = (0x940 + 50 * i) * frames; } } -void Actor_Noop(Actor* actor, GlobalContext* globalCtx) -{ - +void Actor_Noop(Actor* actor, GlobalContext* globalCtx) { } -s32 func_80035124(Actor* actor, GlobalContext* globalCtx) -{ +s32 func_80035124(Actor* actor, GlobalContext* globalCtx) { s32 ret = 0; - switch (actor->params) - { + switch (actor->params) { case 0: - if (func_8002F410(actor, globalCtx)) - { + if (func_8002F410(actor, globalCtx)) { actor->params = 1; - } - else if (!(actor->bgCheckFlags & 1)) - { + } else if (!(actor->bgCheckFlags & 1)) { Actor_MoveForward(actor); Math_SmoothScaleMaxMinF(&actor->speedXZ, 0.0f, 1.0f, 0.1f, 0.0f); - } - else if ((actor->bgCheckFlags & 2) && (actor->velocity.y < -4.0f)) - { + } else if ((actor->bgCheckFlags & 2) && (actor->velocity.y < -4.0f)) { ret = 1; - } - else - { + } else { actor->shape.rot.x = actor->shape.rot.z = 0; func_8002F580(actor, globalCtx); } break; case 1: - if (func_8002F5A0(actor, globalCtx)) - { + if (func_8002F5A0(actor, globalCtx)) { actor->params = 0; } break; @@ -4414,8 +3992,7 @@ s32 func_80035124(Actor* actor, GlobalContext* globalCtx) #include "z_cheap_proc.c" -u8 func_800353E8(GlobalContext* globalCtx) -{ +u8 func_800353E8(GlobalContext* globalCtx) { Player* player = PLAYER; return player->unk_845; } @@ -4424,30 +4001,25 @@ u8 func_800353E8(GlobalContext* globalCtx) * Finds the first actor instance of a specified id and type within a given range from an actor if there is one. * If the id provided is -1, this will look for any actor of the specified type rather than a specific id. */ -Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range) -{ +Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range) { Actor* actor = globalCtx->actorCtx.actorList[actorType].first; - while (actor != NULL) - { - if (actor == refActor || ((actorId != -1) && (actorId != actor->id))) - { + while (actor != NULL) { + if (actor == refActor || ((actorId != -1) && (actorId != actor->id))) { actor = actor->next; - } - else - { - if (func_8002DB48(refActor, actor) <= range) + } else { + if (func_8002DB48(refActor, actor) <= range) { return actor; - else + } else { actor = actor->next; + } } } return NULL; } -s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5) -{ +s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5) { Player* player = PLAYER; s16 var1; s16 var2; @@ -4455,15 +4027,15 @@ s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s var1 = (s16)(actor->rotTowardsLinkY + 0x8000) - player->actor.shape.rot.y; var2 = actor->rotTowardsLinkY - arg5; - if ((actor->xzDistanceFromLink <= range) && (player->swordState != 0) && - (arg4 >= ABS(var1)) && (arg3 >= ABS(var2))) + if ((actor->xzDistanceFromLink <= range) && (player->swordState != 0) && (arg4 >= ABS(var1)) && + (arg3 >= ABS(var2))) { return 1; - else + } else { return 0; + } } -void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3) -{ +void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3) { Color_RGB8 color1; Color_RGB8 color2; @@ -4482,150 +4054,107 @@ Vec3f D_80116268 = { 0.0f, -1.5f, 0.0f }; Vec3f D_80116274 = { 0.0f, -0.2f, 0.0f }; // unused -Gfx D_80116280[] = -{ - gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | - CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | - GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA), - AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | - CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)), +Gfx D_80116280[] = { + gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA), + AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)), gsDPSetAlphaCompare(G_AC_THRESHOLD), gsSPEndDisplayList(), }; -void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1) -{ +void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1) { func_8003555C(globalCtx, arg1, &D_80116268, &D_80116274); } -u8 func_800355E4(GlobalContext* globalCtx, ColliderCylinderInit* colCylinderInit) -{ +u8 func_800355E4(GlobalContext* globalCtx, ColliderCylinderInit* colCylinderInit) { Player* player = PLAYER; - if ((colCylinderInit->inner.toucherDamage & 0x08) && (player->swordState != 0) && (player->swordAnimation == 0x16)) + if ((colCylinderInit->inner.toucherDamage & 0x08) && (player->swordState != 0) && + (player->swordAnimation == 0x16)) { return 1; - else + } else { return 0; + } } -u8 Actor_ApplyDamage(Actor* actor) -{ - if (actor->sub_98.damage >= actor->sub_98.health) +u8 Actor_ApplyDamage(Actor* actor) { + if (actor->sub_98.damage >= actor->sub_98.health) { actor->sub_98.health = 0; - else + } else { actor->sub_98.health -= actor->sub_98.damage; + } return actor->sub_98.health; } -void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag) -{ - if (colBody->colliding == NULL) - { +void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag) { + if (colBody->colliding == NULL) { actor->unk_116 = 0x00; - } - else if (freezeFlag && (colBody->colliding->toucher.flags & 0x10060000)) - { + } else if (freezeFlag && (colBody->colliding->toucher.flags & 0x10060000)) { actor->freeze = colBody->colliding->toucher.damage; actor->unk_116 = 0x00; - } - else if (colBody->colliding->toucher.flags & 0x0800) - { + } else if (colBody->colliding->toucher.flags & 0x0800) { actor->unk_116 = 0x01; - } - else if (colBody->colliding->toucher.flags & 0x1000) - { + } else if (colBody->colliding->toucher.flags & 0x1000) { actor->unk_116 = 0x02; - } - else if (colBody->colliding->toucher.flags & 0x4000) - { + } else if (colBody->colliding->toucher.flags & 0x4000) { actor->unk_116 = 0x04; - } - else if (colBody->colliding->toucher.flags & 0x8000) - { + } else if (colBody->colliding->toucher.flags & 0x8000) { actor->unk_116 = 0x08; - } - else if ((colBody->colliding->toucher.flags << 0xF) < 0) - { + } else if ((colBody->colliding->toucher.flags << 0xF) < 0) { actor->unk_116 = 0x10; - } - else if (colBody->colliding->toucher.flags & 0x2000) - { + } else if (colBody->colliding->toucher.flags & 0x2000) { actor->unk_116 = 0x20; - } - else if ((colBody->colliding->toucher.flags << 0xC) < 0) - { - if (freezeFlag) + } else if ((colBody->colliding->toucher.flags << 0xC) < 0) { + if (freezeFlag) { actor->freeze = colBody->colliding->toucher.damage; + } actor->unk_116 = 0x40; - } - else - { + } else { actor->unk_116 = 0x00; } } -void func_8003573C(Actor* actor, ColliderBody* colBody, s32 freezeFlag) -{ +void func_8003573C(Actor* actor, ColliderBody* colBody, s32 freezeFlag) { ColliderBody* curColBody; s32 flag; s32 i; actor->unk_116 = 0x00; - for (i = colBody->unk_18 - 1; i >= 0; i--) - { + for (i = colBody->unk_18 - 1; i >= 0; i--) { curColBody = &colBody->colBuf[i].c; - if (curColBody->colliding == NULL) - { + if (curColBody->colliding == NULL) { flag = 0x00; - } - else if (freezeFlag && (curColBody->colliding->toucher.flags & 0x10060000)) - { + } else if (freezeFlag && (curColBody->colliding->toucher.flags & 0x10060000)) { actor->freeze = curColBody->colliding->toucher.damage; flag = 0x00; - } - else if (curColBody->colliding->toucher.flags & 0x0800) - { + } else if (curColBody->colliding->toucher.flags & 0x0800) { flag = 0x01; - } - else if (curColBody->colliding->toucher.flags & 0x1000) - { + } else if (curColBody->colliding->toucher.flags & 0x1000) { flag = 0x02; - } - else if (curColBody->colliding->toucher.flags & 0x4000) - { + } else if (curColBody->colliding->toucher.flags & 0x4000) { flag = 0x04; - } - else if (curColBody->colliding->toucher.flags & 0x8000) - { + } else if (curColBody->colliding->toucher.flags & 0x8000) { flag = 0x08; - } - else if (curColBody->colliding->toucher.flags & 0x10000) - { + } else if (curColBody->colliding->toucher.flags & 0x10000) { flag = 0x10; - } - else if (curColBody->colliding->toucher.flags & 0x2000) - { + } else if (curColBody->colliding->toucher.flags & 0x2000) { flag = 0x20; - } - else if (curColBody->colliding->toucher.flags & 0x80000) - { - if (freezeFlag) + } else if (curColBody->colliding->toucher.flags & 0x80000) { + if (freezeFlag) { actor->freeze = curColBody->colliding->toucher.damage; + } flag = 0x40; - } - else - { + } else { flag = 0x00; } actor->unk_116 |= flag; } } -void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3) -{ +void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3) { f32 dx = arg1->x - arg0->x; f32 dz = arg1->z - arg0->z; f32 dy = arg3 ? (arg1->y - arg0->y) : (arg0->y - arg1->y); @@ -4637,17 +4166,14 @@ void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3) /** * Spawns En_Part (Dissipating Flames) actor attached to the given actor. */ -ActorEnPart* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, Vec3f* arg3, s32 arg4, - s32 unused, GlobalContext* globalCtx, s16 params, s32 arg8) -{ +ActorEnPart* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, Vec3f* arg3, s32 arg4, s32 unused, + GlobalContext* globalCtx, s16 params, s32 arg8) { ActorEnPart* spawnedEnPart; spawnedEnPart = (ActorEnPart*)Actor_SpawnAttached(&globalCtx->actorCtx, actor, globalCtx, ACTOR_EN_PART, - spawnPos->x, spawnPos->y, spawnPos->z, - spawnRot->x, spawnRot->y, actor->objBankIndex, - params); - if (spawnedEnPart != NULL) - { + spawnPos->x, spawnPos->y, spawnPos->z, spawnRot->x, spawnRot->y, + actor->objBankIndex, params); + if (spawnedEnPart != NULL) { spawnedEnPart->actor.scale = actor->scale; spawnedEnPart->actor.speedXZ = arg3->x; spawnedEnPart->unk_150 = arg8; @@ -4661,8 +4187,7 @@ ActorEnPart* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, Vec3f return NULL; } -void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) -{ +void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) { f32 sp44; f32 sp40; f32 sp3C; @@ -4675,8 +4200,7 @@ void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) CollisionPoly* floorPoly; s32 pad; - if (actor->floorPoly != NULL) - { + if (actor->floorPoly != NULL) { floorPoly = actor->floorPoly; sp44 = floorPoly->norm.x * (1.f / 32767); sp40 = floorPoly->norm.y * (1.f / 32767); @@ -4694,8 +4218,7 @@ void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) } } -void func_80035B18(GlobalContext* globalCtx, Actor* actor, u16 textId) -{ +void func_80035B18(GlobalContext* globalCtx, Actor* actor, u16 textId) { func_8010B720(globalCtx, textId); actor->textId = textId; } @@ -4703,496 +4226,458 @@ void func_80035B18(GlobalContext* globalCtx, Actor* actor, u16 textId) /** * Tests if event_chk_inf flag is set. */ -s32 Flags_GetEventChkInf(s32 flag) -{ +s32 Flags_GetEventChkInf(s32 flag) { return gSaveContext.event_chk_inf[flag >> 4] & (1 << (flag & 0xF)); } /** * Sets event_chk_inf flag. */ -void Flags_SetEventChkInf(s32 flag) -{ +void Flags_SetEventChkInf(s32 flag) { gSaveContext.event_chk_inf[flag >> 4] |= (1 << (flag & 0xF)); } /** * Tests if inf_table flag is set. */ -s32 Flags_GetInfTable(s32 flag) -{ +s32 Flags_GetInfTable(s32 flag) { return gSaveContext.inf_table[flag >> 4] & (1 << (flag & 0xF)); } /** * Sets inf_table flag. */ -void Flags_SetInfTable(s32 flag) -{ +void Flags_SetInfTable(s32 flag) { gSaveContext.inf_table[flag >> 4] |= (1 << (flag & 0xF)); } -u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) -{ +u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { u16 retTextId = 0; - switch(arg1) - { + switch (arg1) { case 0: - if (Flags_GetEventChkInf(0x9)) - { - if (Flags_GetInfTable(0x5)) + if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetInfTable(0x5)) { retTextId = 0x1048; - else + } else { retTextId = 0x1047; - } - else - { - if (Flags_GetEventChkInf(0x2)) - { - if (Flags_GetInfTable(0x3)) - retTextId = 0x1032; - else - retTextId = 0x1031; } - else - { - if (Flags_GetInfTable(0x0)) - { - if (Flags_GetInfTable(0x1)) - retTextId = 0x1003; - else - retTextId = 0x1002; + } else { + if (Flags_GetEventChkInf(0x2)) { + if (Flags_GetInfTable(0x3)) { + retTextId = 0x1032; + } else { + retTextId = 0x1031; } - else + } else { + if (Flags_GetInfTable(0x0)) { + if (Flags_GetInfTable(0x1)) { + retTextId = 0x1003; + } else { + retTextId = 0x1002; + } + } else { retTextId = 0x1001; + } } } break; case 1: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) - { - if (Flags_GetInfTable(0x10)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetInfTable(0x10)) { retTextId = 0x1046; - else + } else { retTextId = 0x1045; - } - else - { - if (Flags_GetEventChkInf(0x3)) - { - if (Flags_GetInfTable(0xE)) + } + } else { + if (Flags_GetEventChkInf(0x3)) { + if (Flags_GetInfTable(0xE)) { retTextId = 0x1034; - else + } else { retTextId = 0x1033; - } - else - { - if (Flags_GetInfTable(0xC)) + } + } else { + if (Flags_GetInfTable(0xC)) { retTextId = 0x1030; - else + } else { retTextId = 0x102F; + } } } - } - else - { - if (Flags_GetEventChkInf(0x5C)) - { - if (Flags_GetInfTable(0x19)) + } else { + if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetInfTable(0x19)) { retTextId = 0x1071; - else + } else { retTextId = 0x1070; - } - else - { - if (Flags_GetEventChkInf(0xB)) - { - if (Flags_GetInfTable(0x17)) - retTextId = 0x1068; - else - retTextId = 0x1067; } - else - { - if (Flags_GetInfTable(0x15)) + } else { + if (Flags_GetEventChkInf(0xB)) { + if (Flags_GetInfTable(0x17)) { + retTextId = 0x1068; + } else { + retTextId = 0x1067; + } + } else { + if (Flags_GetInfTable(0x15)) { retTextId = 0x1061; - else + } else { retTextId = 0x1060; + } } } } break; case 2: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1042; - else + } else { retTextId = 0x1004; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1072; - else if (Flags_GetInfTable(0x41)) + } else if (Flags_GetInfTable(0x41)) { retTextId = 0x1055; - else + } else { retTextId = 0x1056; + } } break; case 3: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1043; - else - { - if (Flags_GetInfTable(0x1E)) + } else { + if (Flags_GetInfTable(0x1E)) { retTextId = 0x1006; - else + } else { retTextId = 0x1005; + } } - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1073; - else + } else { retTextId = 0x105A; + } } break; case 4: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1042; - else + } else { retTextId = 0x1007; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1072; - else if (Flags_GetInfTable(0x47)) + } else if (Flags_GetInfTable(0x47)) { retTextId = 0x105E; - else + } else { retTextId = 0x105D; + } } break; case 5: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1044; - else if (Flags_GetInfTable(0x22)) + } else if (Flags_GetInfTable(0x22)) { retTextId = 0x1009; - else + } else { retTextId = 0x1008; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1075; - else + } else { retTextId = 0x105B; + } } break; case 6: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1042; - else if (Flags_GetInfTable(0x24)) + } else if (Flags_GetInfTable(0x24)) { retTextId = 0x100B; - else + } else { retTextId = 0x100A; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1056; - else + } else { retTextId = 0x105F; + } } break; case 7: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1043; - else if (Flags_GetInfTable(0x26)) + } else if (Flags_GetInfTable(0x26)) { retTextId = 0x100D; - else + } else { retTextId = 0x100C; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1057; - else + } else { retTextId = 0x1057; + } } break; case 8: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1043; - else if (Flags_GetInfTable(0x28)) + } else if (Flags_GetInfTable(0x28)) { retTextId = 0x1019; - else + } else { retTextId = 0x100E; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1077; - else if (Flags_GetInfTable(0x51)) + } else if (Flags_GetInfTable(0x51)) { retTextId = 0x1058; - else + } else { retTextId = 0x1059; + } } break; case 9: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1049; - else + } else { retTextId = 0x1035; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1079; - else + } else { retTextId = 0x104e; + } } break; case 10: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104A; - else + } else { retTextId = 0x1038; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1079; - else if (Flags_GetInfTable(0x59)) + } else if (Flags_GetInfTable(0x59)) { retTextId = 0x1050; - else + } else { retTextId = 0x104F; + } } break; case 11: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104B; - else + } else { retTextId = 0x103C; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x107b; - else + } else { retTextId = 0x1051; + } } break; case 12: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104C; - else + } else { retTextId = 0x103D; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x107C; - else + } else { retTextId = 0x1052; + } } break; case 13: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x9)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104D; - else + } else { retTextId = 0x103E; - } - else - { - if (Flags_GetEventChkInf(0x5C)) + } + } else { + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x106E; - else if (Flags_GetInfTable(0x61)) + } else if (Flags_GetInfTable(0x61)) { retTextId = 0x1053; - else + } else { retTextId = 0x1054; + } } break; case 15: - if (Flags_GetEventChkInf(0x5C)) + if (Flags_GetEventChkInf(0x5C)) { retTextId = 0x1078; - else if (Flags_GetInfTable(0x66)) + } else if (Flags_GetInfTable(0x66)) { retTextId = 0x1066; - else + } else { retTextId = 0x1062; + } break; case 16: - if (globalCtx->sceneNum == SCENE_SPOT15) + if (globalCtx->sceneNum == SCENE_SPOT15) { retTextId = 0x7002; - else if (Flags_GetInfTable(0x6A)) + } else if (Flags_GetInfTable(0x6A)) { retTextId = 0x7004; - else if ((gSaveContext.day_time >= 0x4000) && (gSaveContext.day_time < 0xC556)) + } else if ((gSaveContext.day_time >= 0x4000) && (gSaveContext.day_time < 0xC556)) { retTextId = 0x7002; - else + } else { retTextId = 0x7003; + } break; case 17: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) - { - if (Flags_GetInfTable(0x6c)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetInfTable(0x6c)) { retTextId = 0x7008; - else + } else { retTextId = 0x7007; - } - else + } + } else { retTextId = 0; + } break; case 19: retTextId = 0x702D; break; case 18: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x7006; - else - { - if (Flags_GetEventChkInf(0x12)) - { - if (Flags_GetInfTable(0x71)) + } else { + if (Flags_GetEventChkInf(0x12)) { + if (Flags_GetInfTable(0x71)) { retTextId = 0x7072; - else + } else { retTextId = 0x7071; - } - else + } + } else { retTextId = 0x7029; + } } break; case 20: case 21: - if (Flags_GetEventChkInf(0x42)) + if (Flags_GetEventChkInf(0x42)) { retTextId = 0x2012; - else if (Flags_GetEventChkInf(0x41)) - { - if (Flags_GetInfTable(0x76)) + } else if (Flags_GetEventChkInf(0x41)) { + if (Flags_GetInfTable(0x76)) { retTextId = 0x2011; - else + } else { retTextId = 0x2010; - } - else if (Flags_GetEventChkInf(0x40)) + } + } else if (Flags_GetEventChkInf(0x40)) { retTextId = 0x200F; - else + } else { retTextId = 0x200E; + } break; case 24: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x7044; - else + } else { retTextId = 0x7015; + } break; case 25: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x7045; - else - { + } else { Flags_GetInfTable(0xC2); retTextId = 0x7016; } break; case 26: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x7046; - else - { + } else { Flags_GetInfTable(0xc2); retTextId = 0x7018; } break; case 27: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x7047; - else if (Flags_GetEventChkInf(0x14)) + } else if (Flags_GetEventChkInf(0x14)) { retTextId = 0x701A; - else if (Flags_GetEventChkInf(0x11)) - { - if (Flags_GetInfTable(0xC6)) + } else if (Flags_GetEventChkInf(0x11)) { + if (Flags_GetInfTable(0xC6)) { retTextId = 0x701C; - else + } else { retTextId = 0x701B; - } - else + } + } else { retTextId = 0x701A; + } break; case 28: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x7048; - else - { + } else { Flags_GetInfTable(0xca); retTextId = 0x701D; } break; case 29: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x7049; - else - { + } else { Flags_GetInfTable(0xcc); retTextId = 0x701F; } break; case 30: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x704A; - else - { + } else { Flags_GetInfTable(0xCE); retTextId = 0x7021; } break; case 31: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x704B; - else - { + } else { Flags_GetInfTable(0xD0); retTextId = 0x7023; } break; case 32: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x704C; - else - { + } else { Flags_GetInfTable(0xD2); retTextId = 0x7025; } break; case 33: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { retTextId = 0x704D; - else - { + } else { Flags_GetInfTable(0xD4); retTextId = 0x7027; } @@ -5202,213 +4687,212 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) retTextId = 0x403C; break; case 35: - if (Flags_GetInfTable(0xD8)) + if (Flags_GetInfTable(0xD8)) { retTextId = 0x5029; - else + } else { retTextId = 0x5028; + } break; case 37: retTextId = 0x5002; break; case 38: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x25)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; - else if (Flags_GetEventChkInf(0x23)) + } else if (Flags_GetEventChkInf(0x23)) { retTextId = 0x3021; - else if (Flags_GetInfTable(0xE0)) + } else if (Flags_GetInfTable(0xE0)) { retTextId = 0x302A; - else + } else { retTextId = 0x3008; - } - else - { - if (Flags_GetEventChkInf(0x20)) + } + } else { + if (Flags_GetEventChkInf(0x20)) { retTextId = 0x4043; - else + } else { retTextId = 0x302A; + } } break; case 39: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x25)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; - else if (Flags_GetEventChkInf(0x23)) + } else if (Flags_GetEventChkInf(0x23)) { retTextId = 0x3026; - else + } else { retTextId = 0x3009; - } - else - { - if (Flags_GetEventChkInf(0x2A)) + } + } else { + if (Flags_GetEventChkInf(0x2A)) { retTextId = 0x4043; - else + } else { retTextId = 0x302A; + } } break; case 40: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x25)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; - else if (Flags_GetEventChkInf(0x23)) + } else if (Flags_GetEventChkInf(0x23)) { retTextId = 0x3026; - else if (Flags_GetInfTable(0xEB)) + } else if (Flags_GetInfTable(0xEB)) { retTextId = 0x302B; - else + } else { retTextId = 0x300A; - } - else - { - if (Flags_GetEventChkInf(0x2B)) + } + } else { + if (Flags_GetEventChkInf(0x2B)) { retTextId = 0x4043; - else + } else { retTextId = 0x302A; + } } break; case 41: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x25)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; - else if (Flags_GetInfTable(0xF0)) + } else if (Flags_GetInfTable(0xF0)) { retTextId = 0x3015; - else + } else { retTextId = 0x3014; - } - else - { - if (Flags_GetEventChkInf(0x2C)) + } + } else { + if (Flags_GetEventChkInf(0x2C)) { retTextId = 0x4043; - else + } else { retTextId = 0x302A; + } } break; case 42: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x25)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; - else if (Flags_GetInfTable(0xF4)) + } else if (Flags_GetInfTable(0xF4)) { retTextId = 0x3017; - else + } else { retTextId = 0x3016; - } - else - { - if (Flags_GetEventChkInf(0x2C)) + } + } else { + if (Flags_GetEventChkInf(0x2C)) { retTextId = 0x4043; - else + } else { retTextId = 0x302A; + } } break; case 43: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x25)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; - else if (Flags_GetInfTable(0xF8)) + } else if (Flags_GetInfTable(0xF8)) { retTextId = 0x3019; - else + } else { retTextId = 0x3018; - } - else - { - if (Flags_GetEventChkInf(0x2D)) + } + } else { + if (Flags_GetEventChkInf(0x2D)) { retTextId = 0x4043; - else + } else { retTextId = 0x302A; + } } break; case 48: - if (Flags_GetEventChkInf(0x25)) + if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3029; - else if (Flags_GetEventChkInf(0x20) && Flags_GetEventChkInf(0x21)) + } else if (Flags_GetEventChkInf(0x20) && Flags_GetEventChkInf(0x21)) { retTextId = 0x301B; - else + } else { retTextId = 0x301A; + } break; case 49: - if (Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x37)) { retTextId = 0x402D; - else if (Flags_GetEventChkInf(0x30)) + } else if (Flags_GetEventChkInf(0x30)) { retTextId = 0x4007; - else + } else { retTextId = 0x4006; + } break; case 50: - if (Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x37)) { retTextId = 0x402E; - else if (Flags_GetEventChkInf(0x30)) - { - if (Flags_GetInfTable(0x124)) + } else if (Flags_GetEventChkInf(0x30)) { + if (Flags_GetInfTable(0x124)) { retTextId = 0x4009; - else + } else { retTextId = 0x4008; - } - else + } + } else { retTextId = 0x4006; + } break; case 51: - if (Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x37)) { retTextId = 0x402D; - else if (Flags_GetEventChkInf(0x31)) - { - if (Flags_GetInfTable(0x12A)) + } else if (Flags_GetEventChkInf(0x31)) { + if (Flags_GetInfTable(0x12A)) { retTextId = 0x400B; - else + } else { retTextId = 0x402F; - } - else if (Flags_GetEventChkInf(0x30)) + } + } else if (Flags_GetEventChkInf(0x30)) { retTextId = 0x400A; - else + } else { retTextId = 0x4006; + } break; case 52: - if (Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x37)) { retTextId = 0x402E; - else if (Flags_GetEventChkInf(0x30)) + } else if (Flags_GetEventChkInf(0x30)) { retTextId = 0x400C; - else + } else { retTextId = 0x4006; + } break; case 53: - if (Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x37)) { retTextId = 0x402D; - else if (Flags_GetEventChkInf(0x33)) + } else if (Flags_GetEventChkInf(0x33)) { retTextId = 0x4010; - else if (Flags_GetEventChkInf(0x30)) + } else if (Flags_GetEventChkInf(0x30)) { retTextId = 0x400F; - else + } else { retTextId = 0x4006; + } break; case 54: - if (Flags_GetEventChkInf(0x37)) + if (Flags_GetEventChkInf(0x37)) { retTextId = 0x402E; - else if (Flags_GetEventChkInf(0x30)) + } else if (Flags_GetEventChkInf(0x30)) { retTextId = 0x4011; - else + } else { retTextId = 0x4006; + } break; case 55: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x37)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x37)) { retTextId = 0x402B; - else if (Flags_GetEventChkInf(0x31)) - { - if (Flags_GetInfTable(0x138)) + } else if (Flags_GetEventChkInf(0x31)) { + if (Flags_GetInfTable(0x138)) { retTextId = 0x401C; - else + } else { retTextId = 0x401B; - } - else + } + } else { retTextId = 0x401A; - } - else + } + } else { retTextId = 0; + } break; case 58: retTextId = 0x500F; @@ -5420,79 +4904,77 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) retTextId = 0x5012; break; case 61: - if (Flags_GetInfTable(0x166)) + if (Flags_GetInfTable(0x166)) { retTextId = 0x5001; - else + } else { retTextId = 0x5000; + } break; case 62: retTextId = 0x5012; break; case 63: - if (Flags_GetInfTable(0x16A)) + if (Flags_GetInfTable(0x16A)) { retTextId = 0x5001; - else + } else { retTextId = 0x5000; + } break; case 71: - if (Flags_GetEventChkInf(0x16)) + if (Flags_GetEventChkInf(0x16)) { retTextId = 0x2049; - else if (Flags_GetEventChkInf(0x15)) + } else if (Flags_GetEventChkInf(0x15)) { retTextId = 0x2048; - else if (Flags_GetEventChkInf(0x14)) + } else if (Flags_GetEventChkInf(0x14)) { retTextId = 0x2047; - else if (Flags_GetEventChkInf(0x12) && !Flags_GetEventChkInf(0x14)) + } else if (Flags_GetEventChkInf(0x12) && !Flags_GetEventChkInf(0x14)) { retTextId = 0x2044; - else if (Flags_GetEventChkInf(0x10)) - { - if (Flags_GetEventChkInf(0x11)) + } else if (Flags_GetEventChkInf(0x10)) { + if (Flags_GetEventChkInf(0x11)) { retTextId = 0x2043; - else + } else { retTextId = 0x2042; - } - else + } + } else { retTextId = 0x2041; + } break; case 72: - if (LINK_IS_CHILD) - { - if (Flags_GetEventChkInf(0x14)) + if (LINK_IS_CHILD) { + if (Flags_GetEventChkInf(0x14)) { retTextId = 0x2040; - else if (Flags_GetInfTable(0x94)) + } else if (Flags_GetInfTable(0x94)) { retTextId = 0x2040; - else + } else { retTextId = 0x203F; - } - else - { - if (!Flags_GetEventChkInf(0x18)) - { - if (gSaveContext.night_flag) - retTextId = 0x204E; - else if (Flags_GetInfTable(0x9A)) - retTextId = 0x2031; - else - retTextId = 0x2030; } - else + } else { + if (!Flags_GetEventChkInf(0x18)) { + if (gSaveContext.night_flag) { + retTextId = 0x204E; + } else if (Flags_GetInfTable(0x9A)) { + retTextId = 0x2031; + } else { + retTextId = 0x2030; + } + } else { retTextId = 0; + } } break; } - if (retTextId == 0) + if (retTextId == 0) { retTextId = 1; + } return retTextId; } -void func_80036E50(u16 textId, s16 arg1) -{ - switch (arg1) - { +void func_80036E50(u16 textId, s16 arg1) { + switch (arg1) { case 0: - switch (textId) - { + switch (textId) { case 0x1001: Flags_SetInfTable(0x0); return; @@ -5509,14 +4991,14 @@ void func_80036E50(u16 textId, s16 arg1) } return; case 1: - switch (textId) - { + switch (textId) { case 0x102F: Flags_SetEventChkInf(0x2); Flags_SetInfTable(0xC); return; case 0x1033: - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, + &D_801333E8); Flags_SetEventChkInf(0x4); Flags_SetInfTable(0xE); return; @@ -5536,132 +5018,160 @@ void func_80036E50(u16 textId, s16 arg1) } return; case 2: - if (textId == 0x1056) + if (textId == 0x1056) { Flags_SetInfTable(0x41); + } return; case 3: - if (textId == 0x1005) + if (textId == 0x1005) { Flags_SetInfTable(0x1E); + } return; case 4: - if (textId == 0x105D) + if (textId == 0x105D) { Flags_SetInfTable(0x47); + } return; case 5: - if (textId == 0x1008) + if (textId == 0x1008) { Flags_SetInfTable(0x22); + } return; case 6: - if (textId == 0x100A) + if (textId == 0x100A) { Flags_SetInfTable(0x24); + } return; case 7: - if (textId == 0x100C) + if (textId == 0x100C) { Flags_SetInfTable(0x26); + } return; case 8: - if (textId == 0x100E) + if (textId == 0x100E) { Flags_SetInfTable(0x28); - if (textId == 0x1059) + } + if (textId == 0x1059) { Flags_SetInfTable(0x51); + } return; case 10: - if (textId == 0x104F) + if (textId == 0x104F) { Flags_SetInfTable(0x59); + } return; case 13: - if (textId == 0x1054) + if (textId == 0x1054) { Flags_SetInfTable(0x61); + } return; case 15: - if (textId == 0x1062) + if (textId == 0x1062) { Flags_SetInfTable(0x66); + } return; case 16: - if (textId == 0x7002) + if (textId == 0x7002) { Flags_SetInfTable(0x6A); - if (textId == 0x7003) + } + if (textId == 0x7003) { Flags_SetInfTable(0x6A); + } return; case 17: - if (textId == 0x7007) + if (textId == 0x7007) { Flags_SetInfTable(0x6C); + } return; case 18: - if (textId == 0x7071) + if (textId == 0x7071) { Flags_SetInfTable(0x71); + } return; case 20: case 21: - if (textId == 0x2010) + if (textId == 0x2010) { Flags_SetInfTable(0x76); + } return; case 25: - if (textId == 0x7016) + if (textId == 0x7016) { Flags_SetInfTable(0xC2); + } return; case 26: - if (textId == 0x7018) + if (textId == 0x7018) { Flags_SetInfTable(0xC4); + } return; case 28: - if (textId == 0x701D) + if (textId == 0x701D) { Flags_SetInfTable(0xCA); + } return; case 29: - if (textId == 0x701F) + if (textId == 0x701F) { Flags_SetInfTable(0xCC); + } return; case 30: - if (textId == 0x7021) + if (textId == 0x7021) { Flags_SetInfTable(0xCE); + } return; case 31: - if (textId == 0x7023) + if (textId == 0x7023) { Flags_SetInfTable(0xD0); + } return; case 32: - if (textId == 0x7025) + if (textId == 0x7025) { Flags_SetInfTable(0xD2); + } return; case 33: - if (textId == 0x7027) + if (textId == 0x7027) { Flags_SetInfTable(0xD4); + } return; case 34: - if (textId == 0x403c) + if (textId == 0x403c) { Flags_SetInfTable(0xD6); + } return; case 35: - if (textId == 0x5028) + if (textId == 0x5028) { Flags_SetInfTable(0xD8); + } return; case 38: - if (textId == 0x3008) + if (textId == 0x3008) { Flags_SetInfTable(0xE0); + } return; case 40: - if (textId == 0x300B) + if (textId == 0x300B) { Flags_SetInfTable(0xEB); + } return; case 41: - if (textId == 0x3014) + if (textId == 0x3014) { Flags_SetInfTable(0xF0); + } return; case 42: - if (textId == 0x3016) + if (textId == 0x3016) { Flags_SetInfTable(0xF4); + } return; case 43: - if (textId == 0x3018) - { + if (textId == 0x3018) { Flags_SetEventChkInf(0x20); Flags_SetInfTable(0xF8); } return; case 48: - if (textId == 0x3020) - { + if (textId == 0x3020) { Flags_SetEventChkInf(0x22); Flags_SetInfTable(0x113); } @@ -5670,136 +5180,140 @@ void func_80036E50(u16 textId, s16 arg1) case 52: case 53: case 54: - if (textId == 0x4006) + if (textId == 0x4006) { Flags_SetEventChkInf(0x30); + } return; case 50: - if (textId == 0x4006) + if (textId == 0x4006) { Flags_SetEventChkInf(0x30); - if (textId == 0x4008) + } + if (textId == 0x4008) { Flags_SetInfTable(0x124); + } return; case 51: - if (textId == 0x4006) + if (textId == 0x4006) { Flags_SetEventChkInf(0x30); - if (textId == 0x400A) + } + if (textId == 0x400A) { Flags_SetEventChkInf(0x32); - if (textId == 0x402F) + } + if (textId == 0x402F) { Flags_SetInfTable(0x12A); + } return; case 55: - if (textId == 0x401B) - { + if (textId == 0x401B) { Flags_SetEventChkInf(0x33); Flags_SetInfTable(0x138); } return; case 61: - if (textId == 0x5000) + if (textId == 0x5000) { Flags_SetInfTable(0x166); + } return; case 63: - if (textId == 0x5013) + if (textId == 0x5013) { Flags_SetInfTable(0x16A); + } return; case 71: - if (textId == 0x2041) + if (textId == 0x2041) { Flags_SetEventChkInf(0x10); - if (textId == 0x2044) + } + if (textId == 0x2044) { Flags_SetEventChkInf(0x12); - if (textId == 0x2047) + } + if (textId == 0x2047) { Flags_SetEventChkInf(0x15); - if (textId == 0x2048) + } + if (textId == 0x2048) { Flags_SetEventChkInf(0x16); + } return; case 72: return; } } -s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId) -{ +s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId) { MessageContext* msgCtx = &globalCtx->msgCtx; s32 ret = 1; - switch (textId) - { + switch (textId) { case 0x1035: - if (msgCtx->choiceIndex == 0) - { - if (Flags_GetInfTable(0x2A)) + if (msgCtx->choiceIndex == 0) { + if (Flags_GetInfTable(0x2A)) { func_80035B18(globalCtx, actor, 0x1036); - else + } else { func_80035B18(globalCtx, actor, 0x1041); + } } - if (msgCtx->choiceIndex == 1) - { - if (Flags_GetInfTable(0x2B)) + if (msgCtx->choiceIndex == 1) { + if (Flags_GetInfTable(0x2B)) { func_80035B18(globalCtx, actor, 0x1037); - else + } else { func_80035B18(globalCtx, actor, 0x1041); + } } ret = 0; break; case 0x1038: - if (msgCtx->choiceIndex == 0) - { - if (Flags_GetInfTable(0x2E)) + if (msgCtx->choiceIndex == 0) { + if (Flags_GetInfTable(0x2E)) { func_80035B18(globalCtx, actor, 0x1039); - else + } else { func_80035B18(globalCtx, actor, 0x1041); + } } - if (msgCtx->choiceIndex == 1) - { - if (Flags_GetInfTable(0x2F)) + if (msgCtx->choiceIndex == 1) { + if (Flags_GetInfTable(0x2F)) { func_80035B18(globalCtx, actor, 0x103A); - else + } else { func_80035B18(globalCtx, actor, 0x1041); + } } - if (msgCtx->choiceIndex == 2) - { - if (Flags_GetInfTable(0x30)) + if (msgCtx->choiceIndex == 2) { + if (Flags_GetInfTable(0x30)) { func_80035B18(globalCtx, actor, 0x103B); - else + } else { func_80035B18(globalCtx, actor, 0x1041); + } } ret = 0; break; case 0x103E: - if (msgCtx->choiceIndex == 0) + if (msgCtx->choiceIndex == 0) { func_80035B18(globalCtx, actor, 0x103F); - if (msgCtx->choiceIndex == 1) + } + if (msgCtx->choiceIndex == 1) { func_80035B18(globalCtx, actor, 0x1040); + } ret = 0; break; case 0x1041: - if (msgCtx->unk_E2FA == 0x1035) - { - if (msgCtx->choiceIndex == 0) - { + if (msgCtx->unk_E2FA == 0x1035) { + if (msgCtx->choiceIndex == 0) { func_80035B18(globalCtx, actor, 0x1036); Flags_SetInfTable(0x2A); } - if (msgCtx->choiceIndex == 1) - { + if (msgCtx->choiceIndex == 1) { func_80035B18(globalCtx, actor, 0x1037); Flags_SetInfTable(0x2B); } } - if (msgCtx->unk_E2FA == 0x1038) - { - if (msgCtx->choiceIndex == 0) - { + if (msgCtx->unk_E2FA == 0x1038) { + if (msgCtx->choiceIndex == 0) { func_80035B18(globalCtx, actor, 0x1039); Flags_SetInfTable(0x2E); } - if (msgCtx->choiceIndex == 1) - { + if (msgCtx->choiceIndex == 1) { func_80035B18(globalCtx, actor, 0x103A); Flags_SetInfTable(0x2F); } - if (msgCtx->choiceIndex == 2) - { + if (msgCtx->choiceIndex == 2) { func_80035B18(globalCtx, actor, 0x103B); Flags_SetInfTable(0x30); } @@ -5807,81 +5321,88 @@ s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId) ret = 0; break; case 0x1062: - if (msgCtx->choiceIndex == 0) + if (msgCtx->choiceIndex == 0) { func_80035B18(globalCtx, actor, 0x1063); - if (msgCtx->choiceIndex == 1) + } + if (msgCtx->choiceIndex == 1) { func_80035B18(globalCtx, actor, 0x1064); + } ret = 0; break; case 0x2030: case 0x2031: - if (msgCtx->choiceIndex == 0) - { - if (gSaveContext.rupees >= 10) - { + if (msgCtx->choiceIndex == 0) { + if (gSaveContext.rupees >= 10) { func_80035B18(globalCtx, actor, 0x2034); Rupees_ChangeBy(-10); - } - else + } else { func_80035B18(globalCtx, actor, 0x2032); + } } - if (msgCtx->choiceIndex == 1) + if (msgCtx->choiceIndex == 1) { func_80035B18(globalCtx, actor, 0x2032); + } Flags_SetInfTable(0x9A); ret = 0; break; case 0x2036: case 0x2037: - if (msgCtx->choiceIndex == 0) + if (msgCtx->choiceIndex == 0) { func_80035B18(globalCtx, actor, 0x201F); - if (msgCtx->choiceIndex == 1) + } + if (msgCtx->choiceIndex == 1) { func_80035B18(globalCtx, actor, 0x205A); + } ret = 0; break; case 0x2038: - if (msgCtx->choiceIndex == 0) + if (msgCtx->choiceIndex == 0) { break; - if (msgCtx->choiceIndex == 1) + } + if (msgCtx->choiceIndex == 1) { func_80035B18(globalCtx, actor, 0x205A); + } ret = 0; break; case 0x2034: - if (msgCtx->choiceIndex != 0) + if (msgCtx->choiceIndex != 0) { break; + } func_80035B18(globalCtx, actor, 0x2035); ret = 0; break; case 0x2043: - if (Flags_GetEventChkInf(0x12)) + if (Flags_GetEventChkInf(0x12)) { break; + } func_80035B18(globalCtx, actor, 0x2044); ret = 0; break; case 0x205A: break; case 0x300A: - if (msgCtx->choiceIndex == 0) - { - if (Flags_GetEventChkInf(0x22)) + if (msgCtx->choiceIndex == 0) { + if (Flags_GetEventChkInf(0x22)) { func_80035B18(globalCtx, actor, 0x300B); - else + } else { func_80035B18(globalCtx, actor, 0x300C); + } } - if (msgCtx->choiceIndex == 1) + if (msgCtx->choiceIndex == 1) { func_80035B18(globalCtx, actor, 0x300D); + } ret = 0; break; case 0x301B: - if (msgCtx->choiceIndex == 0) - { + if (msgCtx->choiceIndex == 0) { func_80035B18(globalCtx, actor, 0x301D); } - if (msgCtx->choiceIndex == 1) - { - if (Flags_GetInfTable(0x113)) + if (msgCtx->choiceIndex == 1) { + if (Flags_GetInfTable(0x113)) { func_80035B18(globalCtx, actor, 0x301F); - else + } else { func_80035B18(globalCtx, actor, 0x301E); + } } ret = 0; break; @@ -5890,10 +5411,12 @@ s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId) ret = 0; break; case 0x400C: - if (msgCtx->choiceIndex == 0) + if (msgCtx->choiceIndex == 0) { func_80035B18(globalCtx, actor, 0x400D); - if (msgCtx->choiceIndex == 1) + } + if (msgCtx->choiceIndex == 1) { func_80035B18(globalCtx, actor, 0x400E); + } ret = 0; break; case 0x7007: @@ -5913,37 +5436,31 @@ s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId) return ret; } -u16 func_80037C30(GlobalContext* globalCtx, s16 arg1) -{ +u16 func_80037C30(GlobalContext* globalCtx, s16 arg1) { return func_80035BFC(globalCtx, arg1); } -s32 func_80037C5C(GlobalContext* globalCtx, s16 arg1, u16 textId) -{ +s32 func_80037C5C(GlobalContext* globalCtx, s16 arg1, u16 textId) { func_80036E50(textId, arg1); return 0; } -s32 func_80037C94(GlobalContext* globalCtx, Actor* actor, s32 arg2) -{ +s32 func_80037C94(GlobalContext* globalCtx, Actor* actor, s32 arg2) { return func_800374E0(globalCtx, actor, actor->textId); } -s32 func_80037CB8(GlobalContext* globalCtx, Actor* actor, s16 arg2) -{ +s32 func_80037CB8(GlobalContext* globalCtx, Actor* actor, s16 arg2) { MessageContext* msgCtx = &globalCtx->msgCtx; s32 ret = 0; - switch (func_8010BDBC(msgCtx)) - { + switch (func_8010BDBC(msgCtx)) { case 2: func_80037C5C(globalCtx, arg2, actor->textId); ret = 1; break; case 4: case 5: - if (func_80106BC8(globalCtx) && func_80037C94(globalCtx, actor, arg2)) - { + if (func_80106BC8(globalCtx) && func_80037C94(globalCtx, actor, arg2)) { Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); msgCtx->msgMode = 0x36; ret = 1; @@ -5954,58 +5471,57 @@ s32 func_80037CB8(GlobalContext* globalCtx, Actor* actor, s16 arg2) return ret; } -s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3) -{ +s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3) { s16 var; s16 sp2C; s16 sp2A; s16 abs_var; - if (func_8002F194(actor, globalCtx)) - { + if (func_8002F194(actor, globalCtx)) { *arg3 = 1; return 1; } - if (*arg3 == 1) - { - if (func_80037CB8(globalCtx, actor, arg2)) + if (*arg3 == 1) { + if (func_80037CB8(globalCtx, actor, arg2)) { *arg3 = 0; + } return 0; } func_8002F374(globalCtx, actor, &sp2C, &sp2A); - if (0) ; // Necessary to match + if (0) {} // Necessary to match - if ((sp2C < 0) || (sp2C > 320) || (sp2A < 0) || (sp2A > 240)) + if ((sp2C < 0) || (sp2C > 320) || (sp2A < 0) || (sp2A > 240)) { return 0; + } var = actor->rotTowardsLinkY - actor->shape.rot.y; abs_var = ABS(var); - if (abs_var >= 0x4300) + if (abs_var >= 0x4300) { return 0; - - if ((actor->waterSurfaceDist > 25600.0f) && (actor->unk_10C == 0)) - return 0; - - if (actor->waterSurfaceDist <= 6400.0f) - { - if (func_8002F2CC(actor, globalCtx, 80.0f)) - actor->textId = func_80037C30(globalCtx, arg2); } - else - { - if (func_8002F2F4(actor, globalCtx)) + + if ((actor->waterSurfaceDist > 25600.0f) && (actor->unk_10C == 0)) { + return 0; + } + + if (actor->waterSurfaceDist <= 6400.0f) { + if (func_8002F2CC(actor, globalCtx, 80.0f)) { actor->textId = func_80037C30(globalCtx, arg2); + } + } else { + if (func_8002F2F4(actor, globalCtx)) { + actor->textId = func_80037C30(globalCtx, arg2); + } } return 0; } -s32 func_80037F30(Vec3s* arg0, Vec3s* arg1) -{ +s32 func_80037F30(Vec3s* arg0, Vec3s* arg1) { Math_SmoothScaleMaxMinS(&arg0->y, 0, 6, 6200, 100); Math_SmoothScaleMaxMinS(&arg0->x, 0, 6, 6200, 100); Math_SmoothScaleMaxMinS(&arg1->y, 0, 6, 6200, 100); @@ -6013,8 +5529,7 @@ s32 func_80037F30(Vec3s* arg0, Vec3s* arg1) return 1; } -s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3) -{ +s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3) { s16 sp36; s16 sp34; s16 var; @@ -6028,8 +5543,9 @@ s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3) var = Math_SmoothScaleMaxMinS(&arg2->y, sp34, 6, 2000, 1); arg2->y = (arg2->y < -8000) ? -8000 : ((arg2->y > 8000) ? 8000 : arg2->y); - if (var && (ABS(arg2->y) < 8000)) + if (var && (ABS(arg2->y) < 8000)) { return 0; + } Math_SmoothScaleMaxMinS(&arg3->y, sp34 - arg2->y, 4, 2000, 1); arg3->y = (arg3->y < -12000) ? -12000 : ((arg3->y > 12000) ? 12000 : arg3->y); @@ -6037,8 +5553,7 @@ s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3) return 1; } -s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, f32 arg4) -{ +s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, f32 arg4) { Player* player = PLAYER; s32 pad; Vec3f sp2C; @@ -6048,29 +5563,27 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar actor->posRot2.pos = actor->posRot.pos; actor->posRot2.pos.y += arg4; - if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) - { + if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) { var = actor->rotTowardsLinkY - actor->shape.rot.y; abs_var = ABS(var); - if (abs_var >= 0x4300) - { + if (abs_var >= 0x4300) { func_80037F30(arg2, arg3); return 0; } } - if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) + if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) { sp2C = globalCtx->view.eye; - else + } else { sp2C = player->actor.posRot2.pos; + } func_80037FC8(actor, &sp2C, arg2, arg3); return 1; } -s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4) -{ +s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4) { Player* player = PLAYER; s32 pad; Vec3f sp24; @@ -6079,21 +5592,20 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar actor->posRot2.pos = arg4; - if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) - { + if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) { var = actor->rotTowardsLinkY - actor->shape.rot.y; abs_var = ABS(var); - if (abs_var >= 0x4300) - { + if (abs_var >= 0x4300) { func_80037F30(arg2, arg3); return 0; } } - if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) + if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) { sp24 = globalCtx->view.eye; - else + } else { sp24 = player->actor.posRot2.pos; + } func_80037FC8(actor, &sp24, arg2, arg3); diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index 2a15f876dd..29a18cf994 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -2,24 +2,19 @@ #include #include -#define ACTOR_OVERLAY(name, allocType) \ - { \ - (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, \ - _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, \ - NULL, &name##_InitVars, #name, allocType, 0 \ +#define ACTOR_OVERLAY(name, allocType) \ + { \ + (u32) _ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \ + _ovl_##name##SegmentEnd, NULL, &name##_InitVars, #name, allocType, 0 \ } -#define ACTOR_OVERLAY_INTERNAL(name, allocType) \ - { \ - 0, 0, \ - NULL, NULL, \ - NULL, &name##_InitVars, #name, allocType, 0 \ - } +#define ACTOR_OVERLAY_INTERNAL(name, allocType) \ + { 0, 0, NULL, NULL, NULL, &name##_InitVars, #name, allocType, 0 } -#define ACTOR_OVERLAY_UNSET { 0 } +#define ACTOR_OVERLAY_UNSET \ + { 0 } -ActorOverlay gActorOverlayTable[] = -{ +ActorOverlay gActorOverlayTable[] = { ACTOR_OVERLAY_INTERNAL(Player, ALLOCTYPE_NORMAL), ACTOR_OVERLAY_UNSET, ACTOR_OVERLAY(En_Test, ALLOCTYPE_NORMAL), @@ -497,26 +492,21 @@ s32 gMaxProfile = 0; static FaultClient sFaultClient; -void ActorOverlayTable_LogPrint(void) -{ +void ActorOverlayTable_LogPrint(void) { ActorOverlay* overlayEntry; u32 i; osSyncPrintf("actor_dlftbls %u\n", gMaxProfile); osSyncPrintf("RomStart RomEnd SegStart SegEnd allocp profile segname\n"); - for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) - { - osSyncPrintf("%08x %08x %08x %08x %08x %08x %s\n", - overlayEntry->vromStart, overlayEntry->vromEnd, - overlayEntry->vramStart, overlayEntry->vramEnd, - overlayEntry->loadedRamAddr, &overlayEntry->initInfo->id, - overlayEntry->name != NULL ? overlayEntry->name : "?"); + for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) { + osSyncPrintf("%08x %08x %08x %08x %08x %08x %s\n", overlayEntry->vromStart, overlayEntry->vromEnd, + overlayEntry->vramStart, overlayEntry->vramEnd, overlayEntry->loadedRamAddr, + &overlayEntry->initInfo->id, overlayEntry->name != NULL ? overlayEntry->name : "?"); } } -void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) -{ +void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) { ActorOverlay* overlayEntry; u32 overlaySize; s32 i; @@ -526,26 +516,22 @@ void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) FaultDrawer_Printf("actor_dlftbls %u\n", gMaxProfile); FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n"); - for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) - { + for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) { overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart; - if (overlayEntry->loadedRamAddr != NULL) - { - FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", - i, overlayEntry->loadedRamAddr, (u32)overlayEntry->loadedRamAddr + overlaySize, - overlayEntry->nbLoaded, overlayEntry->name != NULL ? overlayEntry->name : ""); + if (overlayEntry->loadedRamAddr != NULL) { + FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr, + (u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->nbLoaded, + overlayEntry->name != NULL ? overlayEntry->name : ""); } } } -void ActorOverlayTable_Init(void) -{ +void ActorOverlayTable_Init(void) { gMaxProfile = ACTOR_DLF_MAX; Fault_AddClient(&sFaultClient, ActorOverlayTable_FaultPrint, NULL, NULL); } -void ActorOverlayTable_Cleanup(void) -{ +void ActorOverlayTable_Cleanup(void) { Fault_RemoveClient(&sFaultClient); gMaxProfile = 0; } diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index d36b154c8a..12c66c975c 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -3,47 +3,41 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038600.s") -void func_80038708(s16* puParm1, s16* puParm2, u16 uParm3) -{ - *puParm1 = *puParm2; - puParm1[1] = uParm3; +void func_80038708(s16* puParm1, s16* puParm2, u16 uParm3) { + *puParm1 = *puParm2; + puParm1[1] = uParm3; } -void func_8003871C(u16* puParm1) -{ - *puParm1 = 0xFFFF; +void func_8003871C(u16* puParm1) { + *puParm1 = 0xFFFF; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038728.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038780.s") -void func_800387FC(u32 uParm1, u32* puParm2) -{ - *puParm2 = 0; - puParm2[1] = 0; +void func_800387FC(u32 uParm1, u32* puParm2) { + *puParm2 = 0; + puParm2[1] = 0; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003880C.s") -void func_80038870(int iParm1) -{ - *(u32*)(iParm1 + 4) = 0; +void func_80038870(int iParm1) { + *(u32*)(iParm1 + 4) = 0; } -u32 func_80038878(s32 iParm1) -{ - u32 uVar1; - - uVar1 = *(u32*)(iParm1 + 4) & 0xffff; - *(int *)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1; - - if (*(int *)(iParm1 + 8) <= (int)uVar1) - { - return 0xffff; - } +u32 func_80038878(s32 iParm1) { + u32 uVar1; - return uVar1; + uVar1 = *(u32*)(iParm1 + 4) & 0xffff; + *(int*)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1; + + if (*(int*)(iParm1 + 8) <= (int)uVar1) { + return 0xffff; + } + + return uVar1; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800388A8.s") @@ -56,7 +50,6 @@ u32 func_80038878(s32 iParm1) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038A28.s") - #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038B7C.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038BE0.s") @@ -175,12 +168,11 @@ u32 func_80038878(s32 iParm1) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E214.s") -void func_8003E398(u16* puParm1) -{ - *puParm1 = 0; - puParm1[1] = 0; - *(u32*)(puParm1 + 2) = 0; - *(u32*)(puParm1 + 4) = 0; +void func_8003E398(u16* puParm1) { + *puParm1 = 0; + puParm1[1] = 0; + *(u32*)(puParm1 + 2) = 0; + *(u32*)(puParm1 + 4) = 0; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E3AC.s") @@ -195,15 +187,12 @@ void func_8003E398(u16* puParm1) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E688.s") -void func_8003E6C4(u16* puParm1) -{ - *puParm1 = 0; - func_8003E688(); +void func_8003E6C4(u16* puParm1) { + *puParm1 = 0; + func_8003E688(); } - -void func_8003E6E4(u16* a0) -{ +void func_8003E6E4(u16* a0) { *a0 = 0; } @@ -211,21 +200,17 @@ void func_8003E6E4(u16* a0) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E750.s") -void func_8003E804(int iParm1) -{ - func_8003E5B4(iParm1 + 0x14, iParm1 + 0x34); +void func_8003E804(int iParm1) { + func_8003E5B4(iParm1 + 0x14, iParm1 + 0x34); } - -void func_8003E82C(u32* a0) -{ +void func_8003E82C(u32* a0) { *a0 = 0; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E834.s") -void func_8003E888(u32* a0) -{ +void func_8003E888(u32* a0) { *a0 = 0; } @@ -235,8 +220,7 @@ void func_8003E888(u32* a0) /* NON-MATCHING -void func_8003E8EC(u32 uParm1, u32* iParm2) -{ +void func_8003E8EC(u32 uParm1, u32* iParm2) { iParm2[0x06] = iParm2[0x0E]; iParm2[0x05] = iParm2[0x0D]; iParm2[0x07] = iParm2[0x0F]; @@ -246,30 +230,28 @@ void func_8003E8EC(u32 uParm1, u32* iParm2) iParm2[0x0B] = iParm2[0x13]; iParm2[0x0C] = iParm2[0x14]; - + //int i; - //for (i = 0; i < 4; i++) - //{ + //for (i = 0; i < 4; i++) { //iParm2[0x06 + (i * 2)] = iParm2[0x0E + (i * 2)]; //iParm2[0x07 + (i * 2)] = iParm2[0x0D + (i * 2)]; //} } */ -u32 func_8003E934(int iParm1) -{ - if (!((-1 < iParm1) && (iParm1 < 0x32))) - return 0; +u32 func_8003E934(int iParm1) { + if (!((-1 < iParm1) && (iParm1 < 0x32))) { + return 0; + } - return 1; + return 1; } -void func_8003E954(u32 uParm1, u8* puParm2) -{ - *puParm2 = 1; - func_8003E82C(puParm2 + 0x13f0); - func_8003E888(puParm2 + 0x13f4); - func_800387FC(uParm1, puParm2 + 0x13f8); +void func_8003E954(u32 uParm1, u8* puParm2) { + *puParm2 = 1; + func_8003E82C(puParm2 + 0x13f0); + func_8003E888(puParm2 + 0x13f4); + func_800387FC(uParm1, puParm2 + 0x13f8); } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E9A0.s") @@ -323,19 +305,16 @@ void func_8003E954(u32 uParm1, u8* puParm2) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800418D0.s") #ifdef NON_MATCHING -void func_80041978(int iParm1, int iParm2) -{ - u8* puVar1; +void func_80041978(int iParm1, int iParm2) { + u8* puVar1; - puVar1 = *(u8 **)(iParm1 + 8); - if (puVar1 < puVar1 + iParm2) - { - *puVar1 = 0; - while (puVar1++ < (u8*)(*(int *)(iParm1 + 8) + iParm2)) - { - *puVar1 = 0; + puVar1 = *(u8**)(iParm1 + 8); + if (puVar1 < puVar1 + iParm2) { + *puVar1 = 0; + while (puVar1++ < (u8*)(*(int*)(iParm1 + 8) + iParm2)) { + *puVar1 = 0; + } } - } } #else #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041978.s") @@ -343,12 +322,11 @@ void func_80041978(int iParm1, int iParm2) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800419B0.s") -u32 func_80041A28(CollisionContext *a0, u32 a1, u32 a2) -{ - u32 uVar1; - - uVar1 = func_800419B0(a0, a1, a2, 0); - return uVar1 & 0xff; +u32 func_80041A28(CollisionContext* a0, u32 a1, u32 a2) { + u32 uVar1; + + uVar1 = func_800419B0(a0, a1, a2, 0); + return uVar1 & 0xff; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041A4C.s") @@ -365,12 +343,11 @@ u32 func_80041A28(CollisionContext *a0, u32 a1, u32 a2) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041D4C.s") -u32 func_80041D94(u32 a0, u32 a1, u32 a2) -{ - u32 uVar1; - - uVar1 = func_800419B0(a0, a1, a2, 0); - return uVar1 >> 0x15 & 0x1f; +u32 func_80041D94(u32 a0, u32 a1, u32 a2) { + u32 uVar1; + + uVar1 = func_800419B0(a0, a1, a2, 0); + return uVar1 >> 0x15 & 0x1f; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041DB8.s") @@ -385,12 +362,11 @@ u32 func_80041D94(u32 a0, u32 a1, u32 a2) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041EEC.s") -u32 func_80041F10(u32 a0, u32 a1, u32 a2) -{ - u32 uVar1; - - uVar1 = func_800419B0(a0, a1, a2, 1); - return uVar1 & 0xf; +u32 func_80041F10(u32 a0, u32 a1, u32 a2) { + u32 uVar1; + + uVar1 = func_800419B0(a0, a1, a2, 1); + return uVar1 & 0xf; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041F34.s") @@ -409,29 +385,28 @@ u32 func_80041F10(u32 a0, u32 a1, u32 a2) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800420E4.s") -u32 func_80042108(u32 a0, u32 a1, u32 a2) -{ - u32 result; - s32 var1; +u32 func_80042108(u32 a0, u32 a1, u32 a2) { + u32 result; + s32 var1; - var1 = func_800419B0(a0, a1, a2, 1); + var1 = func_800419B0(a0, a1, a2, 1); - if (var1 << 4 < 0) - result = 1; - else - result = 0; + if (var1 << 4 < 0) { + result = 1; + } else { + result = 0; + } - return result; + return result; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8004213C.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042244.s") -u8 func_80042538(CollisionContext *colCtx, s32 iParm2) -{ +u8 func_80042538(CollisionContext* colCtx, s32 iParm2) { u32 var1 = *(u32*)(iParm2 + 0xc); - return var1; + return var1; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042548.s") @@ -451,4 +426,3 @@ u8 func_80042538(CollisionContext *colCtx, s32 iParm2) #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042EF8.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042FC4.s") - diff --git a/src/code/z_camera.c b/src/code/z_camera.c index aba96fe446..d7b0108d54 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -2,20 +2,19 @@ #include #include -// Non-matchings functions marked with CLOSE are either a matter of regalloc or stack size and can possibly be fixed with the permutator. +// Non-matchings functions marked with CLOSE are either a matter of regalloc or stack size and can possibly be fixed +// with the permutator. -typedef struct -{ +typedef struct { Vec3f unk_00; Vec3f unk_0C; - CollisionPoly *unk_18; + CollisionPoly* unk_18; char unk_1C[0x8]; s32 unk_24; } struct_80043D18; // names for this struct's values come from a debug function, may want to rename -typedef struct -{ +typedef struct { s8 code; s8 z; u16 T; @@ -23,88 +22,77 @@ typedef struct Vec3s pos; } SplineData; // originally called SplinedatZ - // 47 lines #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800437F0.s") // had an attempt at this but didn't get very close -f32 func_8004389C(f32 a, f32 b, f32 c, f32 d) -{ - f32 temp1 = a - b; - f32 temp2; - f32 ret; - - if (fabsf(temp1) >= d) - { - temp2 = temp1 * c; - ret = b + temp2; - } - else - ret = a; +f32 func_8004389C(f32 a, f32 b, f32 c, f32 d) { + f32 temp1 = a - b; + f32 temp2; + f32 ret; - return ret; + if (fabsf(temp1) >= d) { + temp2 = temp1 * c; + ret = b + temp2; + } else { + ret = a; + } + + return ret; } -f32 func_800438DC(f32 a, f32 b, f32 c, f32 d) -{ - f32 temp1 = a - b; - f32 temp2; - f32 ret; - - if (fabsf(temp1) >= d) - { - temp2 = temp1 * c; - ret = b + temp2; - } - else - ret = b; +f32 func_800438DC(f32 a, f32 b, f32 c, f32 d) { + f32 temp1 = a - b; + f32 temp2; + f32 ret; - return ret; + if (fabsf(temp1) >= d) { + temp2 = temp1 * c; + ret = b + temp2; + } else { + ret = b; + } + + return ret; } -s16 func_8004391C(s16 a, s16 b, f32 c, s16 d) -{ - s16 temp1 = a - b; - s16 temp2; - s32 ret; - - if (ABS(temp1) >= d) - { - temp2 = temp1 * c + 0.5f; - ret = b + temp2; - } - else - ret = a; +s16 func_8004391C(s16 a, s16 b, f32 c, s16 d) { + s16 temp1 = a - b; + s16 temp2; + s32 ret; - return ret; + if (ABS(temp1) >= d) { + temp2 = temp1 * c + 0.5f; + ret = b + temp2; + } else { + ret = a; + } + + return ret; } -s16 func_800439AC(s16 a, s16 b, f32 c, s16 d) -{ - s16 temp1 = a - b; - s16 temp2; - s32 ret; - - if (ABS(temp1) >= d) - { - temp2 = temp1 * c + 0.5f; - ret = b + temp2; - } - else - ret = b; +s16 func_800439AC(s16 a, s16 b, f32 c, s16 d) { + s16 temp1 = a - b; + s16 temp2; + s32 ret; - return ret; + if (ABS(temp1) >= d) { + temp2 = temp1 * c + 0.5f; + ret = b + temp2; + } else { + ret = b; + } + + return ret; } -void func_80043A3C(Vec3f *a, Vec3f *b, f32 c, f32 d, f32 e) -{ +void func_80043A3C(Vec3f* a, Vec3f* b, f32 c, f32 d, f32 e) { b->x = func_8004389C(a->x, b->x, d, e); b->y = func_8004389C(a->y, b->y, c, e); b->z = func_8004389C(a->z, b->z, d, e); } -void func_80043ABC(Camera *camera) -{ +void func_80043ABC(Camera* camera) { camera->unk_C0.z = 100.0f; camera->unk_C0.y = OREG(7); camera->unk_C0.x = OREG(6); @@ -113,8 +101,7 @@ void func_80043ABC(Camera *camera) camera->unk_CC.z = OREG(4) * 0.01f; } -void func_80043B60(Camera *camera) -{ +void func_80043B60(Camera* camera) { camera->unk_C0.x = OREG(27); camera->unk_C0.z = OREG(27); camera->unk_C0.y = OREG(27); @@ -123,8 +110,7 @@ void func_80043B60(Camera *camera) camera->unk_CC.z = 0.001f; } -Vec3f *func_80043BC4(Vec3f *a, Vec3s *b) -{ +Vec3f* func_80043BC4(Vec3f* a, Vec3s* b) { Vec3f sp4; sp4.x = b->x; @@ -135,21 +121,19 @@ Vec3f *func_80043BC4(Vec3f *a, Vec3s *b) return a; } -Vec3f *func_80043C28(Vec3f *a, Vec3f *b, struct_80045714 *c) -{ +Vec3f* func_80043C28(Vec3f* a, Vec3f* b, struct_80045714* c) { Vec3f sp24, sp18; func_8007C25C(&sp18, c); sp24.x = b->x + sp18.x; sp24.y = b->y + sp18.y; sp24.z = b->z + sp18.z; - + *a = sp24; return a; } -Vec3f *func_80043CAC(Vec3f *a, Vec3f *b, Vec3f *c, f32 d) -{ +Vec3f* func_80043CAC(Vec3f* a, Vec3f* b, Vec3f* c, f32 d) { Vec3f sp4; sp4.x = b->x + (c->x * d); @@ -160,12 +144,11 @@ Vec3f *func_80043CAC(Vec3f *a, Vec3f *b, Vec3f *c, f32 d) return a; } -s32 func_80043D18(Camera *camera, Vec3f *b, struct_80043D18 *c) -{ - CollisionContext *colCtx; +s32 func_80043D18(Camera* camera, Vec3f* b, struct_80043D18* c) { + CollisionContext* colCtx; Vec3f sp68, sp5C, sp50; f32 temp_ret; - CollisionPoly *sp48; + CollisionPoly* sp48; s32 sp44; struct_80045714 sp3C; @@ -173,47 +156,44 @@ s32 func_80043D18(Camera *camera, Vec3f *b, struct_80043D18 *c) func_8007C490(&sp3C, b, &c->unk_00); sp3C.unk_00 += 8.0f; func_80043C28(&sp5C, b, &sp3C); - - if (func_8003DD6C(colCtx, b, &sp5C, &sp68, &c->unk_18, 1, 1, 1, -1, &c->unk_24) == 0) - { + + if (func_8003DD6C(colCtx, b, &sp5C, &sp68, &c->unk_18, 1, 1, 1, -1, &c->unk_24) == 0) { func_8007C0F8(&sp50, b, &c->unk_00); - + c->unk_0C.x = -sp50.x; c->unk_0C.y = -sp50.y; c->unk_0C.z = -sp50.z; - + sp68 = c->unk_00; sp68.y += 5.0f; temp_ret = func_8003CCA4(colCtx, &sp48, &sp44, &sp68); - - if ((c->unk_00.y - temp_ret) > 5.0f) - { + + if ((c->unk_00.y - temp_ret) > 5.0f) { c->unk_00.x += c->unk_0C.x; c->unk_00.y += c->unk_0C.y; c->unk_00.z += c->unk_0C.z; return 0; } - + c->unk_18 = sp48; sp68.y = temp_ret + 1.0f; c->unk_24 = sp44; } - + c->unk_0C.x = c->unk_18->norm.x * (1.f / 32767); c->unk_0C.y = c->unk_18->norm.y * (1.f / 32767); c->unk_0C.z = c->unk_18->norm.z * (1.f / 32767); c->unk_00.x = c->unk_0C.x + sp68.x; c->unk_00.y = c->unk_0C.y + sp68.y; c->unk_00.z = c->unk_0C.z + sp68.z; - + return sp44 + 1; } -void func_80043F34(Camera *camera, Vec3f *b, Vec3f *c) -{ +void func_80043F34(Camera* camera, Vec3f* b, Vec3f* c) { struct_80043D18 sp20; Vec3s unused; - + sp20.unk_00 = *c; func_80043D18(camera, b, &sp20); *c = sp20.unk_00; @@ -222,11 +202,10 @@ void func_80043F34(Camera *camera, Vec3f *b, Vec3f *c) // 242 lines #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80043F94.s") -void func_80044340(Camera *camera, Vec3f *b, Vec3f *c) -{ +void func_80044340(Camera* camera, Vec3f* b, Vec3f* c) { struct_80043D18 sp20; Vec3s unused; - + sp20.unk_00 = *c; func_80043F94(camera, b, &sp20); *c = sp20.unk_00; @@ -236,17 +215,15 @@ f32 func_80038B7C(); #ifdef NON_MATCHING // ordering -s32 func_800443A0(Camera *camera, Vec3f *b, Vec3f *c) -{ +s32 func_800443A0(Camera* camera, Vec3f* b, Vec3f* c) { s32 sp4C; Vec3f sp40; s32 sp3C; s32 sp38; - CollisionPoly *sp34; - + CollisionPoly* sp34; + sp34 = NULL; // this is moved to the top when it should be done in the middle of the function args being loaded - if (func_8003DD6C(&camera->globalCtx->colCtx, b, c, &sp40, &sp34, 1, 1, 1, 0, &sp38) != 0) - { + if (func_8003DD6C(&camera->globalCtx->colCtx, b, c, &sp40, &sp34, 1, 1, 1, 0, &sp38) != 0) { if (func_80038B7C(sp34, b) < 0.0f) return 1; } @@ -256,21 +233,17 @@ s32 func_800443A0(Camera *camera, Vec3f *b, Vec3f *c) #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800443A0.s") #endif -f32 func_8003C940(CollisionContext *, CollisionPoly **, s32 *, Vec3f *); -f32 func_80044434(Camera *camera, Vec3f *b, Vec3f *c, s32 *d) -{ +f32 func_8003C940(CollisionContext*, CollisionPoly**, s32*, Vec3f*); +f32 func_80044434(Camera* camera, Vec3f* b, Vec3f* c, s32* d) { s32 sp2C; // unused - CollisionPoly *sp28; + CollisionPoly* sp28; f32 temp_ret = func_8003C940(&camera->globalCtx->colCtx, &sp28, d, c); - - if (temp_ret == -32000.0f) - { + + if (temp_ret == -32000.0f) { b->x = 0.0f; b->z = 0.0f; b->y = 1.0f; - } - else - { + } else { b->x = sp28->norm.x * (1.f / 32767); b->y = sp28->norm.y * (1.f / 32767); b->z = sp28->norm.z * (1.f / 32767); @@ -279,32 +252,28 @@ f32 func_80044434(Camera *camera, Vec3f *b, Vec3f *c, s32 *d) return temp_ret; } -void func_80044510(Camera *camera, Vec3f *b) -{ +void func_80044510(Camera* camera, Vec3f* b) { Vec3f sp2C, sp20; s32 sp1C; sp2C = *b; sp2C.y += 80.0f; - + func_80044434(camera, &sp20, &sp2C, &sp1C); } // 125 lines (loop) #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80044568.s") -s16 func_80044740(Camera *camera, s32 b) -{ +s16 func_80044740(Camera* camera, s32 b) { return func_80041A4C(&camera->globalCtx->colCtx, b, 50); } -void func_8004476C(Camera *camera) -{ +void func_8004476C(Camera* camera) { func_80041C10(&camera->globalCtx->colCtx, camera->unk_148, 50); } -s32 func_8004479C(Camera *camera, s32 *b, Vec3f *c) -{ +s32 func_8004479C(Camera* camera, s32* b, Vec3f* c) { s32 temp_ret; PosRot sp20; s32 ret; @@ -312,77 +281,74 @@ s32 func_8004479C(Camera *camera, s32 *b, Vec3f *c) func_8002EF44(&sp20, &camera->player->actor); temp_ret = func_80041A28(&camera->globalCtx->colCtx, c, *b); - if (func_80041A4C(&camera->globalCtx->colCtx, temp_ret, *b) == 0) + if (func_80041A4C(&camera->globalCtx->colCtx, temp_ret, *b) == 0) { ret = -1; - else + } else { ret = temp_ret; + } return ret; } -s32 func_8004481C(Camera *camera, s16 *arg1) -{ - CollisionPoly *sp44; +s32 func_8004481C(Camera* camera, s16* arg1) { + CollisionPoly* sp44; s32 sp40; // unused s32 sp3C; PosRot sp28; func_8002EF44(&sp28, &camera->player->actor); sp28.pos.y += func_8002DC84(camera->player); - if (func_8003C940(&camera->globalCtx->colCtx, &sp44, &sp3C, &sp28.pos) == -32000.0f) - { + if (func_8003C940(&camera->globalCtx->colCtx, &sp44, &sp3C, &sp28.pos) == -32000.0f) { return 0; } *arg1 = func_80041B80(&camera->globalCtx->colCtx, sp44, sp3C); return func_80041C98(&camera->globalCtx->colCtx, sp44, sp3C); } -s32 func_800448CC(Camera *camera, f32 *b) -{ +s32 func_800448CC(Camera* camera, f32* b) { PosRot sp34; s32 sp30; s32 temp_ret; func_8002EF44(&sp34, &camera->player->actor); *b = sp34.pos.y; - - if (func_8004213C(camera->globalCtx, &camera->globalCtx->colCtx, sp34.pos.x, sp34.pos.z, b, &sp30) == 0) - { + + if (func_8004213C(camera->globalCtx, &camera->globalCtx->colCtx, sp34.pos.x, sp34.pos.z, b, &sp30) == 0) { *b = -32000.0f; return -1; } - if (!(camera->player->stateFlags1 & 0x8000000)) - { + if (!(camera->player->stateFlags1 & 0x8000000)) { *b = -32000.0f; return -1; } - + temp_ret = func_80042538(&camera->globalCtx->colCtx, sp30); - if ((temp_ret <= 0) || (func_80042548(&camera->globalCtx->colCtx, sp30) <= 0)) + if ((temp_ret <= 0) || (func_80042548(&camera->globalCtx->colCtx, sp30) <= 0)) { return -2; - + } + return temp_ret; } -f32 func_800449AC(Camera *camera, Vec3f *b, s32 *arg2) -{ +f32 func_800449AC(Camera* camera, Vec3f* b, s32* arg2) { PosRot sp2C; f32 sp28; s32 sp24; func_8002EF44(&sp2C, &camera->player->actor); sp28 = sp2C.pos.y; - - if (func_8004213C(camera->globalCtx, &camera->globalCtx->colCtx, b->x, b->z, &sp28, &sp24) == 0) + + if (func_8004213C(camera->globalCtx, &camera->globalCtx->colCtx, b->x, b->z, &sp28, &sp24) == 0) { return -32000.f; - if (sp28 < b->y) + } + if (sp28 < b->y) { return -32000.f; + } *arg2 = func_8004259C(&camera->globalCtx->colCtx, sp24); return sp28; } -s16 func_80044A74(Vec3f *a, Vec3f *b) -{ +s16 func_80044A74(Vec3f* a, Vec3f* b) { return Math_atan2f(b->x - a->x, b->z - a->z) * (180 / M_PI) * (32767.5f / 180) + 0.5f; } @@ -392,17 +358,17 @@ s16 func_80044A74(Vec3f *a, Vec3f *b) // 143 lines (extremely confusing) #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80044E68.s") -f32 func_800450A4(Camera *camera, f32 b) -{ +f32 func_800450A4(Camera* camera, f32 b) { f32 ret; - - if (camera->unk_100 < (OREG(41) * 0.01f)) + + if (camera->unk_100 < (OREG(41) * 0.01f)) { ret = OREG(41) * 0.01f; - else if (b <= camera->unk_100) + } else if (b <= camera->unk_100) { ret = b; - else + } else { ret = OREG(42) * 0.01f * camera->unk_100; - + } + return ret; } @@ -415,17 +381,15 @@ f32 func_800450A4(Camera *camera, f32 b) // 76 lines (unknown types) #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80045350.s") -void *func_8004545C(Vec3f *a, s32 b, s32 c, struct_80043D18 *d, struct_80043D18 *e) -{ +void* func_8004545C(Vec3f* a, s32 b, s32 c, struct_80043D18* d, struct_80043D18* e) { Vec3f sp24; - if (func_800427B4(d->unk_18, e->unk_18, b, c, &sp24) == 0) - { + if (func_800427B4(d->unk_18, e->unk_18, b, c, &sp24) == 0) { osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: corner check no cross point %x %x\n" VT_RST, d, e); *a = d->unk_00; return a; } - + *a = sp24; return a; } @@ -435,8 +399,7 @@ void *func_8004545C(Vec3f *a, s32 b, s32 c, struct_80043D18 *d, struct_80043D18 #ifdef NON_MATCHING // CLOSE: stack is 4 bytes too big -f32 func_80045714(Vec3f *a, s16 b, s16 c, f32 arg3) -{ +f32 func_80045714(Vec3f* a, s16 b, s16 c, f32 arg3) { struct_80045714 sp1C; f32 sp18; @@ -446,128 +409,124 @@ f32 func_80045714(Vec3f *a, s16 b, s16 c, f32 arg3) return Math_Coss(b - c) * (sp18 * arg3); } #else -f32 func_80045714(Vec3f *a, s16 b, s16 c, f32 arg3); +f32 func_80045714(Vec3f* a, s16 b, s16 c, f32 arg3); #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80045714.s") #endif f32 func_8007C0A8(f32, f32); -s32 func_800457A8(Camera *camera, struct_80045714 *b, f32 c, s16 d) -{ +s32 func_800457A8(Camera* camera, struct_80045714* b, f32 c, s16 d) { f32 unused; Vec3f sp50; Vec3f sp44; s32 unused2; - PosRot *sp2C; + PosRot* sp2C; f32 temp_ret; - + temp_ret = func_8002DC84(camera->player); sp50.x = 0.f; sp50.z = 0.f; sp50.y = temp_ret + c; - + sp2C = &camera->unk_94; - if (d != 0) - { + if (d != 0) { sp50.y -= func_8007C0A8(func_80045714(&camera->unk_108, sp2C->rot.y, b->unk_06, OREG(9)), temp_ret); } func_80043A3C(&sp50, &camera->unk_E4, camera->unk_CC.y, camera->unk_CC.x, 0.1f); - + sp44.x = sp2C->pos.x + camera->unk_E4.x; sp44.y = sp2C->pos.y + camera->unk_E4.y; sp44.z = sp2C->pos.z + camera->unk_E4.z; func_80043A3C(&sp44, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f); - + return 1; } -f32 func_8007C028(Vec3f *, Vec3f *); +f32 func_8007C028(Vec3f*, Vec3f*); #ifdef NON_MATCHING // CLOSE: regalloc -s32 func_800458D4(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 e) -{ +s32 func_800458D4(Camera* camera, struct_80045714* b, f32 c, f32* d, s16 e) { f32 phi_f2; Vec3f sp60; Vec3f sp54; f32 temp_ret; - PosRot *temp_s1; + PosRot* temp_s1; f32 sp48; s32 pad[2]; sp60.y = func_8002DC84(camera->player) + c; sp60.x = 0.0f; sp60.z = 0.0f; - + temp_s1 = &camera->unk_94; if (e != 0) sp60.y -= func_80045714(&camera->unk_108, temp_s1->rot.y, b->unk_06, OREG(9)); - + sp48 = temp_s1->pos.y - *d; temp_ret = Math_atan2f(sp48, func_8007C028(&camera->unk_50, &camera->unk_5C)); // f2 and f14 are swapped - + if (OREG(32) * (M_PI / 180) < temp_ret) phi_f2 = 1.0f - sinf(temp_ret - OREG(32) * (M_PI / 180)); else if (OREG(33) * (M_PI / 180) > temp_ret) phi_f2 = 1.0f - sinf(OREG(33) * (M_PI / 180) - temp_ret); else phi_f2 = 1.0f; - + sp60.y -= sp48 * phi_f2; func_80043A3C(&sp60, &camera->unk_E4, OREG(29) * 0.01f, OREG(30) * 0.01f, 0.1f); - + sp54.x = temp_s1->pos.x + camera->unk_E4.x; sp54.y = temp_s1->pos.y + camera->unk_E4.y; sp54.z = temp_s1->pos.z + camera->unk_E4.z; func_80043A3C(&sp54, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f); - + return 1; } #else #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800458D4.s") #endif -s32 func_80045B08(Camera *camera, struct_80045714 *b, f32 c, s16 d) -{ +s32 func_80045B08(Camera* camera, struct_80045714* b, f32 c, s16 d) { f32 phi_f2; Vec3f sp48; Vec3f sp3C; f32 sp38; // unused f32 temp_ret; - PosRot *temp_s1; + PosRot* temp_s1; sp48.y = func_8002DC84(camera->player) + c; sp48.x = 0.0f; sp48.z = 0.0f; - - temp_ret = Math_Sins((s32) d); + + temp_ret = Math_Sins((s32)d); temp_s1 = &camera->unk_94; - - if (temp_ret < 0.0f) + + if (temp_ret < 0.0f) { phi_f2 = Math_Coss(temp_s1->rot.y - b->unk_06); - else + } else { phi_f2 = -Math_Coss(temp_s1->rot.y - b->unk_06); - + } + sp48.y -= temp_ret * phi_f2 * OREG(9); func_80043A3C(&sp48, &camera->unk_E4, camera->unk_CC.y, camera->unk_CC.x, 0.1f); - + sp3C.x = temp_s1->pos.x + camera->unk_E4.x; sp3C.y = temp_s1->pos.y + camera->unk_E4.y; sp3C.z = temp_s1->pos.z + camera->unk_E4.z; func_80043A3C(&sp3C, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f); - + return 1; } #ifdef NON_MATCHING // someone who's not me can have fun with this function -s32 func_80045C74(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 arg4) -{ +s32 func_80045C74(Camera* camera, struct_80045714* b, f32 c, f32* d, s16 arg4) { Vec3f sp70; Vec3f sp64; f32 sp54; - PosRot *sp3C; + PosRot* sp3C; f32 temp; f32 temp_f2; f32 temp_ret_3; @@ -577,72 +536,61 @@ s32 func_80045C74(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 arg4) sp70.y = func_8002DC84(camera->player) + c; sp70.x = 0.0f; sp70.z = 0.0f; - - if (PREG(76) != 0) - { - if (arg4 != 0) - { + + if (PREG(76) != 0) { + if (arg4 != 0) { sp70.y -= func_80045714(&camera->unk_108, sp3C->rot.y, b->unk_06, OREG(9)); } } - + sp3C = &camera->unk_94; - - if ((sp3C->pos.y == camera->unk_104) || (camera->player->actor.gravity > -0.1f) || (camera->player->stateFlags1 & 0x200000)) - { + + if ((sp3C->pos.y == camera->unk_104) || (camera->player->actor.gravity > -0.1f) || + (camera->player->stateFlags1 & 0x200000)) { *d = func_8004389C(sp3C->pos.y, *d, OREG(43) * 0.01f, 0.1f); sp70.y -= sp3C->pos.y - *d; func_80043A3C(&sp70, &camera->unk_E4, camera->unk_CC.y, camera->unk_CC.x, 0.1f); - } - else - { + } else { temp = sp3C->pos.y - *d; - if (PREG(75) == 0) - { + if (PREG(75) == 0) { sp54 = func_8007C028(&camera->unk_50, &camera->unk_5C); Math_atan2f(temp, sp54); temp_f2 = Math_tanf(camera->unk_FC * 0.4f * (M_PI / 180)) * sp54; - - if (temp > temp_f2) - { + + if (temp > temp_f2) { *d += temp - temp_f2; phi_f20 = temp_f2; - } - else - { + } else { phi_f20 = temp; - if (temp < -temp_f2) - { + if (temp < -temp_f2) { *d += temp + temp_f2; phi_f20 = -temp_f2; } } sp70.y -= phi_f20; - } - else - { + } else { temp_ret_3 = Math_atan2f(temp, func_8007C028(&camera->unk_50, &camera->unk_5C)); - + if (OREG(32) * (M_PI / 180) < temp_ret_3) phi_f16 = 1.0f - sinf(temp_ret_3 - OREG(32) * (M_PI / 180)); else if (temp_ret_3 < OREG(33) * (M_PI / 180)) phi_f16 = 1.0f - sinf(OREG(33) * (M_PI / 180) - temp_ret_3); else phi_f16 = 1.0f; - + sp70.y -= temp * phi_f16; } - + func_80043A3C(&sp70, &camera->unk_E4, OREG(29) * 0.01f, OREG(30) * 0.01f, 0.1f); camera->unk_CC.y = OREG(29) * 0.01f; camera->unk_CC.x = OREG(30) * 0.01f; } - + sp64.x = sp3C->pos.x + camera->unk_E4.x; sp64.y = sp3C->pos.y + camera->unk_E4.y; sp64.z = sp3C->pos.z + camera->unk_E4.z; func_80043A3C(&sp64, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f); - + return 1; } #else @@ -652,141 +600,123 @@ s32 func_80045C74(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 arg4) // 421 lines #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800460A8.s") -s32 func_800466F8(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 e) -{ +s32 func_800466F8(Camera* camera, struct_80045714* b, f32 c, f32* d, s16 e) { s32 phi_v0; Vec3f sp60; Vec3f sp54; f32 sp50; // unused f32 sp4C; // unused f32 sp48; // I doubt this is a Vec3f - Player *sp44; + Player* sp44; PosRot sp30; sp48 = func_8002DC84(camera->player); sp44 = camera->player; func_8002EF44(&sp30, sp44->rideActor); - - if ((*(s32 *)((s32)(sp44->rideActor) + 0x1F0) & 4) != 0) // actors aren't this big, is rideActor a different type? + + if ((*(s32*)((s32)(sp44->rideActor) + 0x1F0) & 4) != 0) { // actors aren't this big, is rideActor a different type? phi_v0 = 1; - else + } else { phi_v0 = 0; - - if (phi_v0 != 0) - { + } + + if (phi_v0 != 0) { sp30.pos.y -= 49.f; *d = func_8004389C(sp30.pos.y, *d, 0.1f, 0.2f); camera->unk_100 = func_8004389C(0.4f, camera->unk_100, 0.2f, 0.02f); - } - else - { + } else { *d = func_8004389C(sp30.pos.y, *d, 0.5f, 0.2f); } - + sp60.x = 0.0f; sp60.z = 0.0f; sp60.y = sp48 + c; - - if (e != 0) + + if (e != 0) { sp60.y -= func_80045714(&camera->unk_108, camera->unk_94.rot.y, b->unk_06, OREG(9)); - + } + func_80043A3C(&sp60, &camera->unk_E4, camera->unk_CC.y, camera->unk_CC.x, 0.1f); - + sp54.x = camera->unk_E4.x + sp30.pos.x; sp54.y = camera->unk_E4.y + sp30.pos.y; sp54.z = camera->unk_E4.z + sp30.pos.z; func_80043A3C(&sp54, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f); - + return 1; } -void func_800468CC(Camera *camera, f32 b, f32 c, f32 d) -{ +void func_800468CC(Camera* camera, f32 b, f32 c, f32 d) { f32 sp1C; f32 phi_f12; - if (b < c) - { + if (b < c) { sp1C = c; phi_f12 = OREG(6); - } - else if (d < b) - { + } else if (d < b) { sp1C = d; phi_f12 = OREG(6); - } - else - { + } else { sp1C = b; phi_f12 = 1.0f; } - + camera->unk_C0.x = func_8004389C(phi_f12, camera->unk_C0.x, OREG(25) * 0.01f, 0.1f); func_8004389C(sp1C, camera->unk_DC, 1.f / camera->unk_C0.x, 0.2f); } -void func_800469C0(Camera *camera, f32 b, f32 c, f32 d, s16 e) -{ +void func_800469C0(Camera* camera, f32 b, f32 c, f32 d, s16 e) { f32 sp1C; f32 phi_f12; - if (b < c) - { + if (b < c) { sp1C = c; - - if (e != 0) + + if (e != 0) { phi_f12 = OREG(6) * 0.5f; - else + } else { phi_f12 = OREG(6); - } - else if (d < b) - { + } + } else if (d < b) { sp1C = d; - - if (e != 0) + + if (e != 0) { phi_f12 = OREG(6) * 0.5f; - else + } else { phi_f12 = OREG(6); - } - else - { + } + } else { sp1C = b; - - if (e != 0) + + if (e != 0) { phi_f12 = OREG(6); - else + } else { phi_f12 = 1.0f; + } } - + camera->unk_C0.x = func_8004389C(phi_f12, camera->unk_C0.x, OREG(25) * 0.01f, 0.1f); func_8004389C(sp1C, camera->unk_DC, 1.f / camera->unk_C0.x, 0.2f); } #ifdef NON_MATCHING // lots of regalloc and stack issues, but that's it -void func_80046B44(Camera *camera, s16 b, s16 c, s16 d) -{ +void func_80046B44(Camera* camera, s16 b, s16 c, s16 d) { s16 sp1C; s16 phi_v1; s16 phi_v0; f32 phi_a2; phi_v1 = ABS(b); - if (d > 0) - { + if (d > 0) { phi_v0 = Math_Coss(d) * d; - } - else - { + } else { phi_v0 = d; } sp1C = c - phi_v0; - if (ABS(sp1C) < phi_v1) - { + if (ABS(sp1C) < phi_v1) { phi_a2 = (1.0f / camera->unk_C0.y) * 3.0f; - } - else - { + } else { phi_a2 = (1.0f / camera->unk_C0.y) * func_800437F0(0.8f, 1.0f - phi_v0 * (1.0f / OREG(5))); } func_8004391C(sp1C, b, phi_a2, 0xa); @@ -797,33 +727,28 @@ void func_80046B44(Camera *camera, s16 b, s16 c, s16 d) #ifdef NON_MATCHING // stack, regalloc, tiny bit of ordering -s16 func_80046CB4(Camera *camera, s16 b, s16 c, f32 d, f32 e) -{ +s16 func_80046CB4(Camera* camera, s16 b, s16 c, f32 d, f32 e) { f32 sp34; s16 sp1C; f32 temp_ret; f32 phi_f14; - s16 temp; + s16 temp; - if (camera->unk_D8 > 0.001f) - { - temp = b - 0x7fff; // this is probably some kind of cast that I'm too stupid to know + if (camera->unk_D8 > 0.001f) { + temp = b - 0x7fff; // this is probably some kind of cast that I'm too stupid to know sp1C = c - temp; phi_f14 = (s16)(sp1C - 0x7fff) * 0.00003051851f; - } - else - { - temp = b - 0x7fff; + } else { + temp = b - 0x7fff; sp1C = c - temp; phi_f14 = OREG(48) * 0.01f; } temp_ret = func_800437F0(d, phi_f14); sp34 = ((1.0f - temp_ret) * e) + temp_ret; - if (sp34 < 0.0f) - { + if (sp34 < 0.0f) { sp34 = 0.0f; } - // ordering stuff here + // ordering stuff here return (s16)((sp1C * sp34) * (1.0f / camera->unk_C0.z) * func_800437F0(0.5f, camera->unk_E0)) + b; } #else @@ -833,8 +758,7 @@ s16 func_80046CB4(Camera *camera, s16 b, s16 c, f32 d, f32 e) // 364 lines #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80046E20.s") -s32 func_80047394(Camera *camera) -{ +s32 func_80047394(Camera* camera) { return 1; } @@ -847,13 +771,11 @@ s32 func_80047394(Camera *camera) // Very long function (1,444 lines), 1 jtbl #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80052E0C.s") -void Camera_DebugPrintSplineArray(char* name, s16 length, SplineData splines[]) -{ +void Camera_DebugPrintSplineArray(char* name, s16 length, SplineData splines[]) { s32 i; - + osSyncPrintf("static SplinedatZ %s[] = {\n", name); - for (i = 0; i < length; i++) - { + for (i = 0; i < length; i++) { osSyncPrintf(" /* key frame %2d */ {\n", i); osSyncPrintf(" /* code */ %d,\n", splines[i].code); osSyncPrintf(" /* z */ %d,\n", splines[i].z); @@ -865,8 +787,7 @@ void Camera_DebugPrintSplineArray(char* name, s16 length, SplineData splines[]) osSyncPrintf("};\n\n"); } -void Camera_Vec3fCopy(Vec3f *src, Vec3f *dst) -{ +void Camera_Vec3fCopy(Vec3f* src, Vec3f* dst) { dst->x = src->x; dst->y = src->y; dst->z = src->z; @@ -878,19 +799,14 @@ void Camera_Vec3fCopy(Vec3f *src, Vec3f *dst) // 225 lines #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80057C6C.s") -s32 func_8005AD40(Camera *camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f); +s32 func_8005AD40(Camera* camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f); -void func_80057FC4(Camera *camera) -{ - if (camera != &camera->globalCtx->cameraCtx.activeCameras[0]) - { +void func_80057FC4(Camera* camera) { + if (camera != &camera->globalCtx->cameraCtx.activeCameras[0]) { camera->unk_154 = camera->unk_142 = 33; camera->unk_14C &= ~0x4; - } - else if (camera->globalCtx->roomCtx.curRoom.mesh->polygon.type != 1) - { - switch (camera->globalCtx->roomCtx.curRoom.unk_03) - { + } else if (camera->globalCtx->roomCtx.curRoom.mesh->polygon.type != 1) { + switch (camera->globalCtx->roomCtx.curRoom.unk_03) { case 1: func_8005AD40(camera, 0, -99, 0, 0, 18, 10); camera->unk_154 = camera->unk_142 = 3; @@ -907,17 +823,14 @@ void func_80057FC4(Camera *camera) camera->unk_14C |= 4; break; } - } - else - { + } else { osSyncPrintf("camera: room type: prerender\n"); camera->unk_154 = camera->unk_142 = 33; camera->unk_14C &= ~0x4; } } -void Camera_Stub80058140(Camera *camera) -{ +void Camera_Stub80058140(Camera* camera) { } // 135 lines (has lwl/lwr) @@ -932,13 +845,13 @@ void Camera_Stub80058140(Camera *camera) // 296 lines #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800588B4.s") -s32 func_80058CF8(Camera *camera) -{ +s32 func_80058CF8(Camera* camera) { camera->unk_152 &= ~1; - - if (camera->globalCtx->roomCtx.curRoom.unk_02 == 3) + + if (camera->globalCtx->roomCtx.curRoom.unk_02 == 3) { camera->unk_152 |= 1; - + } + return 1; } @@ -951,49 +864,47 @@ s32 func_80058CF8(Camera *camera) // Long function, 866 lines (lots of debug symbols) #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800591EC.s") -void func_80059EC8(Camera *camera) -{ - Camera *sp24 = camera->globalCtx->cameraCtx.activeCameraPtrs[0]; - Player *player = (Player *)camera->globalCtx->actorCtx.actorList[2].first; - - if (camera->unk_160 == 0) - { +void func_80059EC8(Camera* camera) { + Camera* sp24 = camera->globalCtx->cameraCtx.activeCameraPtrs[0]; + Player* player = (Player*)camera->globalCtx->actorCtx.actorList[2].first; + + if (camera->unk_160 == 0) { func_800C0314(camera->globalCtx, camera->unk_162, 7); - - if ((camera->unk_162 == 0) && (camera->unk_168 != 0)) - { + + if ((camera->unk_162 == 0) && (camera->unk_168 != 0)) { player->actor.freeze = 0; player->stateFlags1 &= ~0x20000000; - - if (player->action != 0) - { + + if (player->action != 0) { func_8002DF54(camera->globalCtx, &player->actor, 7); osSyncPrintf("camera: player demo end!!\n"); } - + sp24->unk_14C |= 8; } - if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 == camera->unk_164) + if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 == camera->unk_164) { camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 = camera->unk_162; - - if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E == camera->unk_164) - camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E = camera->unk_14E; + } - if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_164 == 0) + if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E == camera->unk_164) { + camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E = camera->unk_14E; + } + + if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_164 == 0) { camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_15E = 0; - + } + camera->unk_162 = 0; camera->unk_14E = camera->unk_162; camera->unk_160 = -1; camera->globalCtx->unk_10B05 = 0; - + func_800C0384(camera->globalCtx, camera->unk_164); } } -s32 func_8005A02C(Camera *camera) -{ +s32 func_8005A02C(Camera* camera) { camera->unk_14C |= 0xC; camera->unk_14C &= ~(0x1000 | 0x8); return 1; @@ -1002,8 +913,7 @@ s32 func_8005A02C(Camera *camera) // 275 lines (has 2 jtbls) #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_8005A04C.s") -void func_8005A444(Camera *camera, s16 b) -{ +void func_8005A444(Camera* camera, s16 b) { func_8005A04C(camera, b, 0); } @@ -1013,8 +923,7 @@ void func_8005A444(Camera *camera, s16 b) // 154 lines (unknown arrays) #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_8005A548.s") -s32 func_8005A77C(Camera *camera, s16 b) -{ +s32 func_8005A77C(Camera* camera, s16 b) { return func_8005A548(camera, b, 0); } @@ -1036,95 +945,83 @@ s32 func_8005A77C(Camera *camera, s16 b) // 118 lines (has 1 jtbl) #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_8005AA90.s") -s32 func_8005AC48(Camera *camera, s16 b) -{ +s32 func_8005AC48(Camera* camera, s16 b) { camera->unk_14C = b; return 1; } -s32 func_8005AC60(Camera *camera) -{ +s32 func_8005AC60(Camera* camera) { camera->unk_15E = 0; return 1; } -s32 func_8005AC6C(Camera *camera, s32 b, s32 c, Player *d, s16 e) -{ +s32 func_8005AC6C(Camera* camera, s32 b, s32 c, Player* d, s16 e) { PosRot sp24; camera->unk_124 = b; camera->unk_128 = c; camera->unk_12C = e; - - if (camera->unk_12C != 0) - { + + if (camera->unk_12C != 0) { camera->player = d; func_8002EF44(&sp24, &d->actor); camera->unk_94 = sp24; - + camera->unk_156 = -1; camera->unk_D8 = 0.0f; camera->unk_E0 = 0.0f; } - + return 1; } -s16 func_8005ACFC(Camera *camera, s16 b) -{ +s16 func_8005ACFC(Camera* camera, s16 b) { camera->unk_14C |= b; return camera->unk_14C; } -s16 func_8005AD1C(Camera *camera, s16 b) -{ +s16 func_8005AD1C(Camera* camera, s16 b) { camera->unk_14C &= ~b; return camera->unk_14C; } -s32 func_8005AD40(Camera *camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f) -{ - if ((camera->unk_142 == 43) || (camera->unk_142 == 29)) +s32 func_8005AD40(Camera* camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f) { + if ((camera->unk_142 == 43) || (camera->unk_142 == 29)) { return 0; - + } + camera->unk_00 = a; camera->unk_06 = d; camera->unk_08 = e; camera->unk_0A = f; camera->unk_04 = b; - - if (b == -99) - { + + if (b == -99) { func_80045128(camera, camera->unk_144); return -99; } - - if (b == -1) - { + + if (b == -1) { func_8005A77C(camera, 29); osSyncPrintf(".... change default door camera (set %d)\n", 29); - } - else - { + } else { s32 ret = func_80044740(camera, b); camera->unk_14A |= 0x40; - - if (func_8005A77C(camera, ret) >= 0) - { + + if (func_8005A77C(camera, ret) >= 0) { camera->unk_148 = b; camera->unk_14A |= 4; } - + // this is likely important for labelling unk_148 and unk_142 osSyncPrintf("....change door camera ID %d (set %d)\n", camera->unk_148, camera->unk_142); } - + func_80045128(camera, camera->unk_144); return -1; } -s32 func_8005AE64(Camera *camera, Camera *otherCamera) -{ +s32 func_8005AE64(Camera* camera, Camera* otherCamera) { s32 unused; Vec3f sp30; @@ -1133,7 +1030,7 @@ s32 func_8005AE64(Camera *camera, Camera *otherCamera) camera->unk_E4.z = 0.0f; camera->unk_100 = 0.1f; camera->unk_50 = otherCamera->unk_50; - + sp30 = otherCamera->unk_5C; camera->unk_74 = sp30; camera->unk_5C = sp30; @@ -1142,9 +1039,8 @@ s32 func_8005AE64(Camera *camera, Camera *otherCamera) camera->unk_FC = otherCamera->unk_FC; camera->unk_15A = otherCamera->unk_15A; func_80043B60(camera); - - if (camera->player != NULL) - { + + if (camera->player != NULL) { func_8002EF14(&camera->unk_94, &camera->player->actor); camera->unk_E4.x = camera->unk_50.x - camera->unk_94.pos.x; camera->unk_E4.y = camera->unk_50.y - camera->unk_94.pos.y; @@ -1156,39 +1052,40 @@ s32 func_8005AE64(Camera *camera, Camera *otherCamera) return 1; } -s32 func_8005AFA8() -{ +s32 func_8005AFA8() { return D_8011D394; } -Vec3f *func_8005AFB4(Vec3f *dst, Camera *camera) -{ +Vec3f* func_8005AFB4(Vec3f* dst, Camera* camera) { *dst = camera->unk_80; return dst; } -void Camera_SetCameraData(Camera *camera, s16 b, s32 c, s32 d, s16 e, s16 f) // Unused -{ - if (b & 0x1) +// Unused +void Camera_SetCameraData(Camera* camera, s16 b, s32 c, s32 d, s16 e, s16 f) { + if (b & 0x1) { camera->unk_124 = c; - - if (b & 0x2) + } + + if (b & 0x2) { camera->unk_128 = d; - - if (b & 0x4) + } + + if (b & 0x4) { camera->unk_12C = e; - - if (b & 0x8) + } + + if (b & 0x8) { camera->unk_12E = f; - - if (b & 0x10) + } + + if (b & 0x10) { osSyncPrintf(VT_COL(RED, WHITE) "camera: setCameraData: last argument not alive!\n" VT_RST, b); + } } -s32 func_8005B044() -{ - if (QREG(0) == 0) - { +s32 func_8005B044() { + if (QREG(0) == 0) { QREG(2) = 1; QREG(10) = -1; QREG(11) = 100; @@ -1217,25 +1114,22 @@ s32 func_8005B044() QREG(57) = 30; QREG(58) = 0; } - + QREG(65) = 50; return 1; } -s32 func_8005B198() -{ +s32 func_8005B198() { return D_8011D3AC; } -s16 func_8005B1A4(Camera *camera) -{ +s16 func_8005B1A4(Camera* camera) { camera->unk_14C |= 0x8; - - if ((camera->unk_164 == 0) && (camera->globalCtx->cameraCtx.unk_5C0 != 0)) - { + + if ((camera->unk_164 == 0) && (camera->globalCtx->cameraCtx.unk_5C0 != 0)) { camera->globalCtx->cameraCtx.activeCameraPtrs[camera->globalCtx->cameraCtx.unk_5C0]->unk_14C |= 0x8; return camera->globalCtx->cameraCtx.unk_5C0; } - + return camera->unk_164; } diff --git a/src/code/z_cheap_proc.c b/src/code/z_cheap_proc.c index 48fd9b32a6..4b9abb220f 100644 --- a/src/code/z_cheap_proc.c +++ b/src/code/z_cheap_proc.c @@ -1,29 +1,29 @@ #include #include -void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist) -{ +void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 214); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 216), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 216), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, dlist); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 219); } -void Draw_DListXlu(GlobalContext* globalCtx, u32 dlist) -{ +void Draw_DListXlu(GlobalContext* globalCtx, u32 dlist) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 228); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 230), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 230), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, dlist); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 233); diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 116059b18c..b8a70550db 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -7,15 +7,13 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B65C.s") -s32 func_8005B6A0(GlobalContext* globalCtx, Collider* collision) -{ +s32 func_8005B6A0(GlobalContext* globalCtx, Collider* collision) { return 1; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B6B0.s") -s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) -{ +s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) { collision->actor = actor; collision->unk_14 = src->unk_00; collision->colliderFlags = src->colliderFlags; @@ -26,8 +24,7 @@ s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, C return 1; } -s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) -{ +s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) { collision->actor = actor; collision->unk_14 = src->unk_00; collision->colliderFlags = src->colliderFlags; @@ -38,20 +35,17 @@ s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, C return 1; } -void func_8005B76C(GlobalContext* globalCtx, Collider* collision) -{ +void func_8005B76C(GlobalContext* globalCtx, Collider* collision) { collision->at = NULL; collision->colliderFlags &= ~0x6; } -void func_8005B784(GlobalContext* globalCtx, Collider* collision) -{ +void func_8005B784(GlobalContext* globalCtx, Collider* collision) { collision->ac = NULL; collision->collideFlags &= ~0x82; } -void func_8005B79C(GlobalContext* globalCtx, Collider* collision) -{ +void func_8005B79C(GlobalContext* globalCtx, Collider* collision) { collision->ot = NULL; collision->maskA &= ~0x2; collision->maskB &= ~0x1; @@ -59,22 +53,18 @@ void func_8005B79C(GlobalContext* globalCtx, Collider* collision) #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B7C0.s") -s32 func_8005B7E4(GlobalContext* globalCtx, ColliderTouch* touch) -{ +s32 func_8005B7E4(GlobalContext* globalCtx, ColliderTouch* touch) { return 1; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B7F4.s") -void func_8005B818(GlobalContext* globalCtx, ColliderBody* body) -{ - +void func_8005B818(GlobalContext* globalCtx, ColliderBody* body) { } #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B824.s") -s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump) -{ +s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump) { return 1; } @@ -82,15 +72,13 @@ s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump) #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B884.s") -s32 func_8005B904(GlobalContext* globalCtx, ColliderBody* body) -{ +s32 func_8005B904(GlobalContext* globalCtx, ColliderBody* body) { func_8005B7E4(globalCtx, &body->toucher); func_8005B850(globalCtx, &body->bumper); return 1; } -s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfoInner* bodyInfoInner) -{ +s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfoInner* bodyInfoInner) { body->flags = bodyInfoInner->bodyFlags; func_8005B7F4(globalCtx, &body->toucher, &bodyInfoInner->toucherMask); func_8005B860(globalCtx, &body->bumper, &bodyInfoInner->bumperMask); @@ -100,8 +88,7 @@ s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfo return 1; } -void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body) -{ +void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body) { body->unk_18 = 0; body->unk_20 = 0; body->toucherFlags &= ~0x2; @@ -109,8 +96,7 @@ void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body) func_8005B818(globalCtx, body); } -void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body) -{ +void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body) { body->bumper.unk_0A = 0; body->bumperFlags &= ~0x2; body->bumperFlags &= ~0x80; @@ -120,15 +106,13 @@ void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body) body->bumper.unk_06 = body->bumper.unk_0A; } -void func_8005BA1C(GlobalContext* globalCtx, ColliderBody* body) -{ +void func_8005BA1C(GlobalContext* globalCtx, ColliderBody* body) { body->flags2 &= ~0x2; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005BA30.s") -s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1) -{ +s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1) { return 1; } @@ -158,73 +142,64 @@ s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1) #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C2BC.s") -s32 func_8005C318(GlobalContext* globalCtx, ColliderDimensions* dim) -{ +s32 func_8005C318(GlobalContext* globalCtx, ColliderDimensions* dim) { return 1; } -s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDimensions* src) -{ +s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDimensions* src) { *dest = *src; return 1; } -s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B65C(globalCtx, &collision->base); func_8005B884(globalCtx, &collision->body); func_8005C2BC(globalCtx, &collision->dim); return 1; } -s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B6A0(globalCtx, &collision->base); func_8005B904(globalCtx, &collision->body); func_8005C318(globalCtx, &collision->dim); return 1; } -s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* src) -{ +s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* src) { func_8005B6B0(globalCtx, &collision->base, &src->body); func_8005B93C(globalCtx, &collision->body, &src->inner); func_8005C328(globalCtx, &collision->dim, &src->dim); return 1; } -s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) -{ +s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) { func_8005B6EC(globalCtx, &collision->base, actor, &src->body); func_8005B93C(globalCtx, &collision->body, &src->inner); func_8005C328(globalCtx, &collision->dim, &src->dim); return 1; } -s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) -{ +s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, + ColliderCylinderInit* src) { func_8005B72C(globalCtx, &collision->base, actor, &src->body); func_8005B93C(globalCtx, &collision->body, &src->inner); func_8005C328(globalCtx, &collision->dim, &src->dim); return 1; } -s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B76C(globalCtx, &collision->base); func_8005B9B0(globalCtx, &collision->body); return 1; } -s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B784(globalCtx, &collision->base); func_8005B9E8(globalCtx, &collision->body); return 1; } -s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B79C(globalCtx, &collision->base); func_8005BA1C(globalCtx, &collision->body); return 1; @@ -232,8 +207,7 @@ s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision) #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C5B0.s") -s32 func_8005C5F8(UNK_TYPE arg0, UNK_TYPE arg1) -{ +s32 func_8005C5F8(UNK_TYPE arg0, UNK_TYPE arg1) { return 1; } @@ -269,55 +243,48 @@ s32 func_8005CEB4(GlobalContext* globalCtx, ColliderDimensions* dim) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005CF90.s") -s32 func_8005D018(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 func_8005D018(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B65C(globalCtx, &collision->base); func_8005B884(globalCtx, &collision->body); func_8005CE6C(globalCtx, &collision->dim); return 1; } -s32 func_8005D060(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 func_8005D060(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B6A0(globalCtx, &collision->base); func_8005B904(globalCtx, &collision->body); func_8005CEB4(globalCtx, &collision->dim); return 1; } -s32 func_8005D0A8(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) -{ +s32 func_8005D0A8(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) { func_8005B6EC(globalCtx, &collision->base, actor, &src->body); func_8005B93C(globalCtx, &collision->body, &src->inner); func_8005CF90(globalCtx, &collision->dim, &src->dim); return 1; } -s32 func_8005D104(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) -{ +s32 func_8005D104(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) { func_8005B72C(globalCtx, &collision->base, actor, &src->body); func_8005B93C(globalCtx, &collision->body, &src->inner); func_8005CF90(globalCtx, &collision->dim, &src->dim); return 1; } -s32 func_8005D160(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 func_8005D160(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B76C(globalCtx, &collision->base); func_8005B9B0(globalCtx, &collision->body); func_8005CEC4(globalCtx, &collision->dim); return 1; } -s32 func_8005D1A8(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 func_8005D1A8(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B784(globalCtx, &collision->base); func_8005B9E8(globalCtx, &collision->body); return 1; } -s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision) -{ +s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision) { func_8005B79C(globalCtx, &collision->base); func_8005BA1C(globalCtx, &collision->body); return 1; @@ -331,9 +298,7 @@ s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision) #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D3BC.s") -void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1) -{ - +void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1) { } #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D40C.s") diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index 0625a2b542..cb57394771 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -1,8 +1,7 @@ #include #include -void SaveContext_Init(void) -{ +void SaveContext_Init(void) { bzero(&gSaveContext, sizeof(gSaveContext)); D_8015FA88 = 0; D_8015FA8C = 0; @@ -18,4 +17,3 @@ void SaveContext_Init(void) gSaveContext.transition_type = 0xFF; gSaveContext.unk_13EE = 50; } - diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 5555ed40f2..59c6e11a4f 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -1,15 +1,13 @@ -#include +#include #include -void func_80110990(GlobalContext* globalCtx) -{ +void func_80110990(GlobalContext* globalCtx) { func_80080F44(globalCtx); } #ifdef NON_MATCHING // regalloc, stack usage and minor ordering differences -void func_801109B0(GlobalContext* globalCtx) -{ +void func_801109B0(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; s32 parameterStart; s32 parameterSize; @@ -32,9 +30,9 @@ void func_801109B0(GlobalContext* globalCtx) interfaceCtx->unk_228 = XREG(95); interfaceCtx->minimapAlpha = 0; interfaceCtx->unk_260 = 0; - interfaceCtx->unk_244 = interfaceCtx->aAlpha = interfaceCtx->bAlpha = - interfaceCtx->cLeftAlpha = interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha = - interfaceCtx->healthAlpha = interfaceCtx->startAlpha = interfaceCtx->magicAlpha = 0; + interfaceCtx->unk_244 = interfaceCtx->aAlpha = interfaceCtx->bAlpha = interfaceCtx->cLeftAlpha = + interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha = interfaceCtx->healthAlpha = interfaceCtx->startAlpha = + interfaceCtx->magicAlpha = 0; parameterStart = _parameter_staticSegmentRomStart; parameterSize = _parameter_staticSegmentRomEnd - parameterStart; @@ -48,7 +46,7 @@ void func_801109B0(GlobalContext* globalCtx) if (interfaceCtx->parameterSegment == NULL) __assert("parameter->parameterSegment != NULL", "../z_construct.c", 161); - + DmaMgr_SendRequest1(interfaceCtx->parameterSegment, parameterStart, parameterSize, "../z_construct.c", 162); interfaceCtx->do_actionSegment = Game_Alloc(&globalCtx->state, 0x480, "../z_construct.c", 166); @@ -69,7 +67,8 @@ void func_801109B0(GlobalContext* globalCtx) else do_actionOffset = 0x5700; - DmaMgr_SendRequest1(interfaceCtx->do_actionSegment, do_actionStart + do_actionOffset, 0x300, "../z_construct.c", 174); + DmaMgr_SendRequest1(interfaceCtx->do_actionSegment, do_actionStart + do_actionOffset, 0x300, "../z_construct.c", + 174); if (gSaveContext.language == 0) do_actionOffset = 0x480; @@ -78,7 +77,8 @@ void func_801109B0(GlobalContext* globalCtx) else do_actionOffset = 0x5B80; - DmaMgr_SendRequest1((void*)((u32)interfaceCtx->do_actionSegment + 0x300), do_actionStart + do_actionOffset, 0x180, "../z_construct.c", 178); + DmaMgr_SendRequest1((void*)((u32)interfaceCtx->do_actionSegment + 0x300), do_actionStart + do_actionOffset, 0x180, + "../z_construct.c", 178); interfaceCtx->icon_itemSegment = Game_Alloc(&globalCtx->state, 0x4000, "../z_construct.c", 190); @@ -89,45 +89,42 @@ void func_801109B0(GlobalContext* globalCtx) if (interfaceCtx->icon_itemSegment == NULL) __assert("parameter->icon_itemSegment != NULL", "../z_construct.c", 193); - osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", - gSaveContext.equips.button_items[0], gSaveContext.equips.button_items[1], - gSaveContext.equips.button_items[2], gSaveContext.equips.button_items[3]); + osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.button_items[0], + gSaveContext.equips.button_items[1], gSaveContext.equips.button_items[2], + gSaveContext.equips.button_items[3]); if (gSaveContext.equips.button_items[0] < 0xF0) DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment, - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, - 0x1000, "../z_construct.c", 198); + _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000, + "../z_construct.c", 198); else if (gSaveContext.equips.button_items[0] != 0xFF) DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment, - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, - 0x1000, "../z_construct.c", 203); + _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000, + "../z_construct.c", 203); if (gSaveContext.equips.button_items[1] < 0xF0) DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x1000), - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80, - 0x1000, "../z_construct.c", 209); + _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80, 0x1000, + "../z_construct.c", 209); if (gSaveContext.equips.button_items[2] < 0xF0) DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x2000), - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80, - 0x1000, "../z_construct.c", 214); + _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80, 0x1000, + "../z_construct.c", 214); if (gSaveContext.equips.button_items[3] < 0xF0) DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x3000), - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80, - 0x1000, "../z_construct.c", 219); + _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80, 0x1000, + "../z_construct.c", 219); osSyncPrintf("EVENT=%d\n", gSaveContext.timer_1_state); - if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) || - (gSaveContext.timer_2_state == 4) || (gSaveContext.timer_2_state == 10)) - { + if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) || (gSaveContext.timer_2_state == 4) || + (gSaveContext.timer_2_state == 10)) { osSyncPrintf("restart_flag=%d\n", gSaveContext.respawn_flag); - if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1)) - { - if (gSaveContext.timer_1_state == 4) - { + if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1)) { + if (gSaveContext.timer_1_state == 4) { gSaveContext.timer_1_state = 1; gSaveContext.timer_x[0] = 140; gSaveContext.timer_y[0] = 80; @@ -147,8 +144,7 @@ void func_801109B0(GlobalContext* globalCtx) gSaveContext.timer_y[temp] = 46; } - if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16)) - { + if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16)) { gSaveContext.timer_1_state = 0; // Translates to: "Timer Stop!!!!!!!!!!!!!!!!!!!!!!" osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer_1_state); @@ -179,8 +175,7 @@ void func_801109B0(GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_construct/func_801109B0.s") #endif -void func_80110F68(GlobalContext* globalCtx) -{ +void func_80110F68(GlobalContext* globalCtx) { MessageContext* msgCtx = &globalCtx->msgCtx; s32 pad; @@ -202,16 +197,16 @@ void func_80110F68(GlobalContext* globalCtx) // Translates to: "Textbox game_alloc=%x" osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200); - if (msgCtx->textboxSegment == NULL) + if (msgCtx->textboxSegment == NULL) { __assert("message->fukidashiSegment != NULL", "../z_construct.c", 352); + } func_8006EF10(&globalCtx->msgCtx.unk_128); YREG(31) = 0; } -void func_80111070(void) -{ +void func_80111070(void) { YREG(8) = 0xA; YREG(14) = 0; YREG(15) = 0; @@ -526,8 +521,7 @@ void func_80111070(void) WREG(94) = 3; WREG(95) = 6; - if (gSaveContext.game_mode == 0) - { + if (gSaveContext.game_mode == 0) { VREG(0) = 0x34; VREG(1) = 0x24; VREG(2) = 0xD6; @@ -618,7 +612,6 @@ void func_80111070(void) VREG(92) = -0x3F; } -void func_80112098(GlobalContext* globalCtx) -{ +void func_80112098(GlobalContext* globalCtx) { func_80111070(); } diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 451443a6bc..e0c1c4f9f8 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -5,73 +5,43 @@ #include #include -typedef struct -{ +typedef struct { u8 x; u8 y; u8 colorId; char text[0x15]; } PrintTextBuffer; -typedef struct -{ +typedef struct { u16 push; u16 held; } InputCombo; -GameInfo* gGameInfo; -int D_8015FA94; //no known symbols +GameInfo* gGameInfo; +int D_8015FA94; // no known symbols PrintTextBuffer D_8015FA98[0x16]; -s16 D_8011E0B0 = 0; //PrintTextBuffer index +s16 D_8011E0B0 = 0; // PrintTextBuffer index Color_RGBA8 printTextColors[] = { - { 0xFF, 0xFF, 0x20, 0xC0 }, - { 0xFF, 0x96, 0x80, 0xC0 }, - { 0x80, 0x60, 0x00, 0x40 }, - { 0xC0, 0x80, 0x10, 0x80 }, - { 0xFF, 0xC0, 0x20, 0x80 }, - { 0xE6, 0xE6, 0xDC, 0x40 }, - { 0x80, 0x96, 0xFF, 0x80 }, - { 0x80, 0xFF, 0x20, 0x80 }, + { 0xFF, 0xFF, 0x20, 0xC0 }, { 0xFF, 0x96, 0x80, 0xC0 }, { 0x80, 0x60, 0x00, 0x40 }, { 0xC0, 0x80, 0x10, 0x80 }, + { 0xFF, 0xC0, 0x20, 0x80 }, { 0xE6, 0xE6, 0xDC, 0x40 }, { 0x80, 0x96, 0xFF, 0x80 }, { 0x80, 0xFF, 0x20, 0x80 }, }; InputCombo inputCombos[REG_GROUPS] = { - { L_TRIG, U_CBUTTONS }, - { L_TRIG, L_CBUTTONS }, - { L_TRIG, D_CBUTTONS }, - { L_TRIG, A_BUTTON }, - { R_TRIG, D_CBUTTONS }, - { L_TRIG, R_CBUTTONS }, - { L_TRIG, R_TRIG }, - { L_TRIG, L_JPAD }, - { L_TRIG, R_JPAD }, - { L_TRIG, U_JPAD }, - { L_TRIG, B_BUTTON }, - { L_TRIG, Z_TRIG }, - { L_TRIG, D_JPAD }, - { R_TRIG, A_BUTTON }, - { R_TRIG, B_BUTTON }, - { R_TRIG, Z_TRIG }, - { R_TRIG, L_TRIG }, - { R_TRIG, U_CBUTTONS }, - { R_TRIG, R_CBUTTONS }, - { R_TRIG, L_JPAD }, - { R_TRIG, L_CBUTTONS }, - { R_TRIG, START_BUTTON }, - { L_TRIG, START_BUTTON }, - { R_TRIG, R_JPAD }, - { R_TRIG, U_JPAD }, - { START_BUTTON, R_TRIG }, - { START_BUTTON, A_BUTTON }, - { START_BUTTON, B_BUTTON }, + { L_TRIG, U_CBUTTONS }, { L_TRIG, L_CBUTTONS }, { L_TRIG, D_CBUTTONS }, { L_TRIG, A_BUTTON }, + { R_TRIG, D_CBUTTONS }, { L_TRIG, R_CBUTTONS }, { L_TRIG, R_TRIG }, { L_TRIG, L_JPAD }, + { L_TRIG, R_JPAD }, { L_TRIG, U_JPAD }, { L_TRIG, B_BUTTON }, { L_TRIG, Z_TRIG }, + { L_TRIG, D_JPAD }, { R_TRIG, A_BUTTON }, { R_TRIG, B_BUTTON }, { R_TRIG, Z_TRIG }, + { R_TRIG, L_TRIG }, { R_TRIG, U_CBUTTONS }, { R_TRIG, R_CBUTTONS }, { R_TRIG, L_JPAD }, + { R_TRIG, L_CBUTTONS }, { R_TRIG, START_BUTTON }, { L_TRIG, START_BUTTON }, { R_TRIG, R_JPAD }, + { R_TRIG, U_JPAD }, { START_BUTTON, R_TRIG }, { START_BUTTON, A_BUTTON }, { START_BUTTON, B_BUTTON }, { START_BUTTON, R_CBUTTONS }, }; char regChar[] = " SOPQMYDUIZCNKXcsiWAVHGmnBdkb"; -//initialize GameInfo -void func_800636C0() -{ +// initialize GameInfo +void func_800636C0() { s32 i; gGameInfo = (GameInfo*)SystemArena_MallocDebug(sizeof(GameInfo), "../z_debug.c", 260); @@ -80,26 +50,22 @@ void func_800636C0() gGameInfo->regCur = 0; gGameInfo->dpadLast = 0; gGameInfo->repeat = 0; - for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++) - { + for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++) { gGameInfo->data[i] = 0; } } -//Called when free movement is active. -//8011D394 to enable camera debugger -void func_8006375C(s32 arg0, s32 arg1, float* d_80855320) -{ - +// Called when free movement is active. +// 8011D394 to enable camera debugger +void func_8006375C(s32 arg0, s32 arg1, float* d_80855320) { } -#ifdef NON_MATCHING //regalloc -//Copy Camera Debugger Text -void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) -{ +#ifdef NON_MATCHING // regalloc +// Copy Camera Debugger Text +void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) { PrintTextBuffer* buf; char* bufText; - s16 i; //v1 + s16 i; // v1 buf = &D_8015FA98[D_8011E0B0]; if (D_8011E0B0 < 0x16) { @@ -112,9 +78,11 @@ void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) bufText = buf->text + 1; if (*buf->text = *text++) { - do if (i++ > 0x14) { - break; - } while (*bufText++ = *text++); + do + if (i++ > 0x14) { + break; + } + while (*bufText++ = *text++); } *bufText = '\0'; @@ -124,34 +92,31 @@ void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) #else #pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_8006376C.s") -#endif +#endif -//Draw Text -void func_80063828(GfxPrint* gfxPrint) -{ +// Draw Text +void func_80063828(GfxPrint* gfxPrint) { s32 i; Color_RGBA8* color; PrintTextBuffer* buffer; char* text; i = 0; - if (D_8011E0B0 > 0) - { - do - { + if (D_8011E0B0 > 0) { + do { buffer = &D_8015FA98[i]; text = buffer->text; color = &printTextColors[buffer->colorId]; GfxPrint_SetColor(gfxPrint, color->r, color->g, color->b, color->a); GfxPrint_SetPos(gfxPrint, buffer->x, buffer->y); - GfxPrint_Printf(gfxPrint, "%s", text); + GfxPrint_Printf(gfxPrint, "%s", text); i += 1; } while (i < D_8011E0B0); } } -//Edit REG +// Edit REG void func_8006390C(Input* input) { s32 dpad; @@ -162,18 +127,14 @@ void func_8006390C(Input* input) { regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE; dpad = input->raw.pad & 0xF00; - if (!~(input->raw.pad | ~L_TRIG) || - !~(input->raw.pad | ~R_TRIG) || - !~(input->raw.pad | ~START_BUTTON)) { + if (!~(input->raw.pad | ~L_TRIG) || !~(input->raw.pad | ~R_TRIG) || !~(input->raw.pad | ~START_BUTTON)) { input_combo = inputCombos; - for (i = 0; i < REG_GROUPS; i++) - { - if (~(~input_combo->push | input->raw.pad) || - ~(~input_combo->held | input->padPressed)) { + for (i = 0; i < REG_GROUPS; i++) { + if (~(~input_combo->push | input->raw.pad) || ~(~input_combo->held | input->padPressed)) { input_combo++; - } - else + } else { break; + } } if (i < REG_GROUPS) { @@ -184,10 +145,8 @@ void func_8006390C(Input* input) { gGameInfo->regGroup = i; gGameInfo->regPage = 0; } - } - else { - switch (gGameInfo->regPage - 1) - { + } else { + switch (gGameInfo->regPage - 1) { case 0: case 1: case 2: @@ -195,80 +154,73 @@ void func_8006390C(Input* input) { case 4: case 5: - if (dpad == gGameInfo->dpadLast) { - gGameInfo->repeat--; - if (gGameInfo->repeat < 0) { - gGameInfo->repeat = 1; + if (dpad == gGameInfo->dpadLast) { + gGameInfo->repeat--; + if (gGameInfo->repeat < 0) { + gGameInfo->repeat = 1; + } else { + dpad ^= gGameInfo->dpadLast; + } + } else { + gGameInfo->repeat = 0x10; + gGameInfo->dpadLast = dpad; } - else { - dpad ^= gGameInfo->dpadLast; - } - } - else { - gGameInfo->repeat = 0x10; - gGameInfo->dpadLast = dpad; - } - increment = - (dpad & R_JPAD) ? ( - !~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) ? 1000 : - !~(input->raw.pad | ~A_BUTTON) ? 100 : - !~(input->raw.pad | ~B_BUTTON) ? 10 : 1) : - (dpad & L_JPAD) ? ( - !~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) ? -1000 : - !~(input->raw.pad | ~A_BUTTON) ? -100 : - !~(input->raw.pad | ~B_BUTTON) ? -10 : -1) : - 0; + increment = (dpad & R_JPAD) + ? (!~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) + ? 1000 + : !~(input->raw.pad | ~A_BUTTON) ? 100 : !~(input->raw.pad | ~B_BUTTON) ? 10 : 1) + : (dpad & L_JPAD) ? (!~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) + ? -1000 + : !~(input->raw.pad | ~A_BUTTON) + ? -100 + : !~(input->raw.pad | ~B_BUTTON) ? -10 : -1) + : 0; - gGameInfo->data[gGameInfo->regCur + regGroup] += increment; - if (dpad & U_JPAD) { - gGameInfo->regCur--; - if (gGameInfo->regCur < 0) { - gGameInfo->regCur = REG_PER_PAGE - 1; + gGameInfo->data[gGameInfo->regCur + regGroup] += increment; + if (dpad & U_JPAD) { + gGameInfo->regCur--; + if (gGameInfo->regCur < 0) { + gGameInfo->regCur = REG_PER_PAGE - 1; + } + } else if (dpad & D_JPAD) { + gGameInfo->regCur++; + if (gGameInfo->regCur >= REG_PER_PAGE) { + gGameInfo->regCur = 0; + } } - } - else if (dpad & D_JPAD) { - gGameInfo->regCur++; - if (gGameInfo->regCur >= REG_PER_PAGE) { - gGameInfo->regCur = 0; + if (iREG(0)) { + iREG(0) = 0; + func_800AA000(0, iREG(1), iREG(2), iREG(3)); } - } - if (iREG(0)) { - iREG(0) = 0; - func_800AA000(0, iREG(1), iREG(2), iREG(3)); - } } } } -//Draw Memory Viewer -void func_80063C04(GfxPrint* gfxPrint) -{ +// Draw Memory Viewer +void func_80063C04(GfxPrint* gfxPrint) { s32 i; s32 page; s32 regGroup; - s32 test; //removing affects stack + s32 test; // removing affects stack char name[3]; page = (gGameInfo->regPage * REG_PER_PAGE) - REG_PER_PAGE; regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE; - //set up register name string + // set up register name string name[0] = 'R'; - name[1] = regChar[gGameInfo->regGroup]; //r_group type char + name[1] = regChar[gGameInfo->regGroup]; // r_group type char name[2] = '\0'; GfxPrint_SetColor(gfxPrint, 0, 0x80, 0x80, 0x80); - for (i = 0; i != REG_PER_PAGE; i++) - { - if (i == gGameInfo->regCur) - { + for (i = 0; i != REG_PER_PAGE; i++) { + if (i == gGameInfo->regCur) { GfxPrint_SetColor(gfxPrint, 0, 0xff, 0xff, 0xff); } GfxPrint_SetPos(gfxPrint, 3, i + 5); GfxPrint_Printf(gfxPrint, "%s%02d%6d", &name, page + i, gGameInfo->data[i + regGroup]); - if (i == gGameInfo->regCur) - { + if (i == gGameInfo->regCur) { GfxPrint_SetColor(gfxPrint, 0, 0x80, 0x80, 0x80); } } @@ -281,7 +233,7 @@ void func_80063D7C(GraphicsContext* gfxCtx) { void* unk2[6]; GfxPrint gfxPrint; void* unk[2]; - Gfx* dlFrame[4]; //stores state of GfxCtx next ptrs + Gfx* dlFrame[4]; // stores state of GfxCtx next ptrs func_800C6AC4(&dlFrame, gfxCtx, "../z_debug.c", 628); GfxPrint_Ctor(&gfxPrint); @@ -303,7 +255,7 @@ void func_80063D7C(GraphicsContext* gfxCtx) { gSPEndDisplayList(sp7C++); func_800C6C28(sp78, sp7C); gfxCtx->polyOpa.p = sp7C; - if (0); + if (0) {} func_800C6B54(&dlFrame, gfxCtx, "../z_debug.c", 664); GfxPrint_Dtor(&gfxPrint); } diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c index e961e9c742..e27afafeb7 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -1,25 +1,22 @@ #include #include -typedef struct -{ +typedef struct { /* 0x00 */ s16 drawType; // indicates which draw function to use when displaying the object - /* 0x04 */ u32 drawArg; // segment address (display list or texture) passed to the draw funciton when called -} DebugDispObjectInfo; // size = 0x8 + /* 0x04 */ u32 drawArg; // segment address (display list or texture) passed to the draw funciton when called +} DebugDispObjectInfo; // size = 0x8 typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, u32, GlobalContext*); static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx); static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx); -static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = -{ +static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = { DebugDisplay_DrawSpriteI8, DebugDisplay_DrawPolygon, }; -static DebugDispObjectInfo sDebugObjectInfoTable[] = -{ +static DebugDispObjectInfo sDebugObjectInfoTable[] = { { 0, 0x040035F0 }, // Circle { 0, 0x040038F0 }, // Cross { 0, 0x040036F0 }, // Ball @@ -32,15 +29,13 @@ static Lights1 sDebugObjectLights = gdSPDefLights1(0x80, 0x80, 0x80, 0xFF, 0xFF, static DebugDispObject* sDebugObjectListHead; -void DebugDisplay_Init(void) -{ +void DebugDisplay_Init(void) { sDebugObjectListHead = NULL; } -DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, - f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, - s16 type, GraphicsContext* gfxCtx) -{ +DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX, + f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type, + GraphicsContext* gfxCtx) { DebugDispObject* prevHead = sDebugObjectListHead; sDebugObjectListHead = Graph_Alloc(gfxCtx, sizeof(DebugDispObject)); @@ -64,21 +59,18 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, return sDebugObjectListHead; } -void DebugDisplay_DrawObjects(GlobalContext* globalCtx) -{ +void DebugDisplay_DrawObjects(GlobalContext* globalCtx) { DebugDispObject* dispObj = sDebugObjectListHead; DebugDispObjectInfo* objInfo; - while (dispObj != NULL) - { + while (dispObj != NULL) { objInfo = &sDebugObjectInfoTable[dispObj->type]; sDebugObjectDrawFuncTable[objInfo->drawType](dispObj, objInfo->drawArg, globalCtx); dispObj = dispObj->next; } } -static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx) -{ +static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; @@ -93,24 +85,17 @@ static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, Glo Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY); Matrix_RotateXYZ(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY); - gDPLoadTextureBlock(gfxCtx->polyXlu.p++, - texture, - G_IM_FMT_I, - G_IM_SIZ_8b, - 16, 16, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gfxCtx->polyXlu.p++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 189), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 189), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, &D_04004298); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 192); } -static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx) -{ +static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; @@ -124,7 +109,8 @@ static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, Global func_800D1694(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot); Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 228), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 228), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, dlist); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 231); diff --git a/src/code/z_demo.c b/src/code/z_demo.c index c24ab06ade..bbc125e269 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -13,70 +13,34 @@ void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx); void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx); void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx); -CutsceneStateHandler sCsStateHandlers1[] = -{ - func_80064720, - func_80064760, - func_80064720, - func_80068D84, - func_80064720, +CutsceneStateHandler sCsStateHandlers1[] = { + func_80064720, func_80064760, func_80064720, func_80068D84, func_80064720, }; -CutsceneStateHandler sCsStateHandlers2[] = -{ - func_80064720, - func_800647C0, - func_80068C3C, - func_80068DC0, - func_80068C3C, +CutsceneStateHandler sCsStateHandlers2[] = { + func_80064720, func_800647C0, func_80068C3C, func_80068DC0, func_80068C3C, }; u8 sTitleCsState = 0; // TODO: use symbols for these cutscene locations once scenes and rooms are in C -EntranceCutscene sEntranceCutsceneTable[] = -{ - { 0x0185, 2, 0xA0, 0x02013AA0 }, - { 0x013D, 2, 0xA1, 0x02007EA0 }, - { 0x00DB, 2, 0xA3, 0x0200A540 }, - { 0x0108, 2, 0xA4, 0x02003D70 }, - { 0x0138, 1, 0xA5, 0x02003F40 }, - { 0x014D, 2, 0xA6, 0x02008400 }, - { 0x0053, 2, 0xA7, 0x0200CE00 }, - { 0x0000, 2, 0xA8, 0x0200B650 }, - { 0x028A, 0, 0x18, 0x0200F9E0 }, - { 0x0292, 0, 0x18, 0x0200FF00 }, - { 0x028E, 0, 0x18, 0x02010550 }, - { 0x0476, 0, 0x18, 0x02010B30 }, - { 0x050F, 1, 0xA9, 0x0200BB80 }, - { 0x0102, 2, 0xB1, 0x02007A30 }, - { 0x0117, 2, 0xB2, 0x020031E0 }, - { 0x0129, 2, 0xB3, 0x02006490 }, - { 0x0157, 2, 0xB4, 0x02005BD0 }, - { 0x0028, 2, 0xB5, 0x02015600 }, - { 0x00E4, 2, 0xB6, 0x020070C0 }, - { 0x0225, 2, 0xB7, 0x02004A80 }, - { 0x0123, 2, 0xB8, 0x02007990 }, - { 0x0147, 2, 0xB9, 0x020076D0 }, - { 0x0138, 0, 0xBA, 0x02004280 }, - { 0x0574, 2, 0x5A, 0x020028E0 }, - { 0x0538, 2, 0xBB, 0x0201E790 }, - { 0x053C, 2, 0xBC, 0x0201EF70 }, - { 0x0540, 2, 0xBD, 0x02021380 }, - { 0x0544, 2, 0xBE, 0x0201E3E0 }, - { 0x0548, 2, 0xBF, 0x0201DF90 }, - { 0x054C, 2, 0xAD, 0x0201EB40 }, - { 0x008D, 0, 0xC0, 0x02002BB0 }, - { 0x03B4, 0, 0xC7, 0x020055C0 }, - { 0x0246, 2, 0xB9, 0x020076D0 }, +EntranceCutscene sEntranceCutsceneTable[] = { + { 0x0185, 2, 0xA0, 0x02013AA0 }, { 0x013D, 2, 0xA1, 0x02007EA0 }, { 0x00DB, 2, 0xA3, 0x0200A540 }, + { 0x0108, 2, 0xA4, 0x02003D70 }, { 0x0138, 1, 0xA5, 0x02003F40 }, { 0x014D, 2, 0xA6, 0x02008400 }, + { 0x0053, 2, 0xA7, 0x0200CE00 }, { 0x0000, 2, 0xA8, 0x0200B650 }, { 0x028A, 0, 0x18, 0x0200F9E0 }, + { 0x0292, 0, 0x18, 0x0200FF00 }, { 0x028E, 0, 0x18, 0x02010550 }, { 0x0476, 0, 0x18, 0x02010B30 }, + { 0x050F, 1, 0xA9, 0x0200BB80 }, { 0x0102, 2, 0xB1, 0x02007A30 }, { 0x0117, 2, 0xB2, 0x020031E0 }, + { 0x0129, 2, 0xB3, 0x02006490 }, { 0x0157, 2, 0xB4, 0x02005BD0 }, { 0x0028, 2, 0xB5, 0x02015600 }, + { 0x00E4, 2, 0xB6, 0x020070C0 }, { 0x0225, 2, 0xB7, 0x02004A80 }, { 0x0123, 2, 0xB8, 0x02007990 }, + { 0x0147, 2, 0xB9, 0x020076D0 }, { 0x0138, 0, 0xBA, 0x02004280 }, { 0x0574, 2, 0x5A, 0x020028E0 }, + { 0x0538, 2, 0xBB, 0x0201E790 }, { 0x053C, 2, 0xBC, 0x0201EF70 }, { 0x0540, 2, 0xBD, 0x02021380 }, + { 0x0544, 2, 0xBE, 0x0201E3E0 }, { 0x0548, 2, 0xBF, 0x0201DF90 }, { 0x054C, 2, 0xAD, 0x0201EB40 }, + { 0x008D, 0, 0xC0, 0x02002BB0 }, { 0x03B4, 0, 0xC7, 0x020055C0 }, { 0x0246, 2, 0xB9, 0x020076D0 }, { 0x05E8, 2, 0xC6, 0x0200C9D0 }, }; // Unused, seems to be an early list of dungeon entrance cutscene locations -u32 D_8011E304[] = -{ - 0x0200B650, 0x02015600, 0x02014F80, 0x02003F80, 0x02000330, 0x0201DA50 -}; +u32 D_8011E304[] = { 0x0200B650, 0x02015600, 0x02014F80, 0x02003F80, 0x02000330, 0x0201DA50 }; u16 D_8015FCC0; u16 D_8015FCC2; @@ -84,14 +48,13 @@ u16 D_8015FCC4; s16 D_8015FCC6; u8 D_8015FCC8; s16 D_8015FCCA; -u16 D_8015FCCC; // only written to, never read +u16 D_8015FCCC; // only written to, never read s8 D_8015FCD0[20]; // unreferenced -u8 D_8015FCE4; // only written to, never read +u8 D_8015FCE4; // only written to, never read void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx); -void Cutscene_DrawDebugInfo(GlobalContext* globalCtx, Gfx** dlist, CutsceneContext* csCtx) -{ +void Cutscene_DrawDebugInfo(GlobalContext* globalCtx, Gfx** dlist, CutsceneContext* csCtx) { u8 pad[0x1C]; GfxPrint printer; u8 pad2[8]; @@ -110,47 +73,42 @@ void Cutscene_DrawDebugInfo(GlobalContext* globalCtx, Gfx** dlist, CutsceneConte GfxPrint_Dtor(&printer); } -void func_8006450C(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ +void func_8006450C(GlobalContext* globalCtx, CutsceneContext* csCtx) { csCtx->state = CS_STATE_IDLE; csCtx->unk_0C = 0.0f; } -void func_80064520(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ +void func_80064520(GlobalContext* globalCtx, CutsceneContext* csCtx) { csCtx->state = CS_STATE_SKIPPABLE_INIT; csCtx->linkAction = NULL; } -void func_80064534(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ - if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC) +void func_80064534(GlobalContext* globalCtx, CutsceneContext* csCtx) { + if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC) { csCtx->state = CS_STATE_UNSKIPPABLE_INIT; + } } -void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ - if (gSaveContext.cutscene_index < 0xFFF0) +void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx) { + if (gSaveContext.cutscene_index < 0xFFF0) { sCsStateHandlers1[csCtx->state](globalCtx, csCtx); + } } #ifdef NON_MATCHING // minor ordering and regalloc differences -void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ +void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) { CutsceneStateHandler handler; if (!~(globalCtx->state.input[0].padPressed | -0x201) && (csCtx->state == CS_STATE_IDLE) && - (gSaveContext.scene_setup_index >= 4)) - { + (gSaveContext.scene_setup_index >= 4)) { D_8015FCC8 = 0; gSaveContext.cutscene_index = 0xFFFD; gSaveContext.cutscene_trigger = 1; } if (!~(globalCtx->state.input[0].padPressed | -0x801) && (csCtx->state == CS_STATE_IDLE) && - (gSaveContext.scene_setup_index >= 4) && (D_8011D394 == 0)) - { + (gSaveContext.scene_setup_index >= 4) && (D_8011D394 == 0)) { D_8015FCC8 = 1; gSaveContext.cutscene_index = 0xFFFD; gSaveContext.cutscene_trigger = 1; @@ -159,16 +117,14 @@ void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) if ((gSaveContext.cutscene_trigger != 0) && (globalCtx->sceneLoadFlag == 0x14)) gSaveContext.cutscene_trigger = 0; - if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE)) - { + if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE)) { // Translates to: "CUTSCENE START REQUEST ANNOUNCEMENT!" osSyncPrintf("\nデモ開始要求 発令!"); gSaveContext.cutscene_index = 0xFFFD; gSaveContext.cutscene_trigger = 1; } - if (gSaveContext.cutscene_index >= 0xFFF0) - { + if (gSaveContext.cutscene_index >= 0xFFF0) { func_80068ECC(globalCtx, csCtx); handler = sCsStateHandlers2[csCtx->state]; handler(globalCtx, csCtx); @@ -178,36 +134,29 @@ void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800645A0.s") #endif -void func_80064720(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ - +void func_80064720(GlobalContext* globalCtx, CutsceneContext* csCtx) { } -u32 func_8006472C(GlobalContext* globalCtx, CutsceneContext* csCtx, f32 target) -{ +u32 func_8006472C(GlobalContext* globalCtx, CutsceneContext* csCtx, f32 target) { return Math_ApproxF(&csCtx->unk_0C, target, 0.1f); } -void func_80064760(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ +void func_80064760(GlobalContext* globalCtx, CutsceneContext* csCtx) { Interface_ChangeAlpha(1); func_800B3840(0x20); - if (func_8006472C(globalCtx, csCtx, 1.0f)) - { + if (func_8006472C(globalCtx, csCtx, 1.0f)) { func_800F68BC(1); csCtx->state++; } } -void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ +void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx) { func_80068C3C(globalCtx, csCtx); Interface_ChangeAlpha(1); func_800B3840(0x20); - if (func_8006472C(globalCtx, csCtx, 1.0f)) - { + if (func_8006472C(globalCtx, csCtx, 1.0f)) { func_800F68BC(1); csCtx->state++; } @@ -216,16 +165,14 @@ void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx) // Command 3: Misc. Actions #ifdef NON_MATCHING // regalloc and minor ordering differences -void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) -{ +void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) { Player* player = PLAYER; f32 temp; u8 sp3F; sp3F = 0; - if ((csCtx->frames < cmd->startFrame) || - (csCtx->frames >= cmd->endFrame) && (cmd->endFrame != cmd->startFrame)) + if ((csCtx->frames < cmd->startFrame) || (csCtx->frames >= cmd->endFrame) && (cmd->endFrame != cmd->startFrame)) return; temp = func_8006F93C(cmd->endFrame - 1, cmd->startFrame, csCtx->frames); @@ -233,27 +180,23 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* if (csCtx->frames == cmd->startFrame) sp3F = 1; - switch (cmd->base) - { + switch (cmd->base) { case 1: - if (sp3F != 0) - { + if (sp3F != 0) { func_800F6D58(0xE, 4, 0x3F); func_800F6D58(0xE, 1, 1); globalCtx->unk_10B12[0] = 0x14; } break; case 2: - if (sp3F != 0) - { + if (sp3F != 0) { func_800F6D58(0xF, 0, 0); func_800753C4(globalCtx, 3); D_8015FD70 = 1; } break; case 3: - if (sp3F != 0) - { + if (sp3F != 0) { func_8006C3D0(globalCtx, 0); if (gSaveContext.entrance_index == 0x0053) func_8006C3D0(globalCtx, 2); @@ -264,8 +207,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* globalCtx->unk_10AC4 += 0x23; break; case 7: - if (sp3F != 0) - { + if (sp3F != 0) { globalCtx->unk_10A3D = 1; globalCtx->gloomySky = 1; globalCtx->unk_10A3C = 0; @@ -295,8 +237,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* globalCtx->unk_11D30[0] = 0; break; case 12: - if (sp3F != 0) - { + if (sp3F != 0) { if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC) csCtx->state = CS_STATE_UNSKIPPABLE_INIT; } @@ -313,12 +254,11 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* break; case 15: if (sp3F != 0) - TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->unk_1B0, - 0xA0, 0x78, 0x90, 0x18, 0x14); + TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->unk_1B0, 0xA0, 0x78, 0x90, + 0x18, 0x14); break; case 16: - if (sp3F != 0) - { + if (sp3F != 0) { D_8015FCCA = func_80092F88(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 6); func_80092DAC(D_8015FCCA, 0x7FFF); func_80092E70(D_8015FCCA, 4, 0, 1000, 0); @@ -334,8 +274,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* globalCtx->gloomySkyEvent = 2; if (gSaveContext.day_time < 0x4AAB) gSaveContext.day_time += 30; - if (globalCtx->unk_10B12[1] == 0) - { + if (globalCtx->unk_10B12[1] == 0) { D_8011FB30 = 0; func_800F6D58(14, 1, 0); } @@ -370,8 +309,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* gSaveContext.day_time = 0xCAAA; break; case 26: - if ((gSaveContext.day_time < 0x3000) || (gSaveContext.day_time >= 0x4555)) - { + if ((gSaveContext.day_time < 0x3000) || (gSaveContext.day_time >= 0x4555)) { if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time < 0xAAAB)) globalCtx->unk_10AE3 = 1; else if ((gSaveContext.day_time >= 0xAAAB) && (gSaveContext.day_time < 0xC556)) @@ -381,19 +319,14 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* } break; case 27: - if (globalCtx->state.frames & 8) - { - if (globalCtx->unk_10AB0[0] < 40) - { + if (globalCtx->state.frames & 8) { + if (globalCtx->unk_10AB0[0] < 40) { globalCtx->unk_10AB0[0] += 2; globalCtx->unk_10AB0[4] -= 3; globalCtx->unk_10AB0[5] -= 3; } - } - else - { - if (globalCtx->unk_10AB0[0] > 2) - { + } else { + if (globalCtx->unk_10AB0[0] > 2) { globalCtx->unk_10AB0[0] -= 2; globalCtx->unk_10AB0[4] += 3; globalCtx->unk_10AB0[5] += 3; @@ -437,62 +370,57 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* #endif // Command 4: Set Environment Lighting -void Cutscene_Command_SetLighting(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) -{ - if (csCtx->frames == cmd->startFrame) - { +void Cutscene_Command_SetLighting(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) { + if (csCtx->frames == cmd->startFrame) { globalCtx->unk_10AE3 = cmd->setting - 1; globalCtx->unk_10AFC = 1.0f; } } // Command 0x56: Play Background Music -void Cutscene_Command_PlayBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd) -{ - if (csCtx->frames == cmd->startFrame) +void Cutscene_Command_PlayBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd) { + if (csCtx->frames == cmd->startFrame) { func_800F595C(cmd->sequence - 1); + } } // Command 0x57: Stop Background Music -void Cutscene_Command_StopBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd) -{ - if (csCtx->frames == cmd->startFrame) +void Cutscene_Command_StopBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd) { + if (csCtx->frames == cmd->startFrame) { func_800F59E8(cmd->sequence - 1); + } } // Command 0x7C: Fade Background Music over duration -void Cutscene_Command_FadeBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicFade* cmd) -{ +void Cutscene_Command_FadeBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicFade* cmd) { u8 var1; - if ((csCtx->frames == cmd->startFrame) && (csCtx->frames < cmd->endFrame)) - { + if ((csCtx->frames == cmd->startFrame) && (csCtx->frames < cmd->endFrame)) { var1 = cmd->endFrame - cmd->startFrame; - if (cmd->type == 3) + if (cmd->type == 3) { Audio_SetBGM(var1 << 0x10 | 0x110000FF); - else + } else { Audio_SetBGM(var1 << 0x10 | 0x100000FF); + } } } // Command 9: ? -void Cutscene_Command_09(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdUnknown9* cmd) -{ - if (csCtx->frames == cmd->startFrame) +void Cutscene_Command_09(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdUnknown9* cmd) { + if (csCtx->frames == cmd->startFrame) { func_800AA000(0.0f, cmd->unk_06, cmd->unk_07, cmd->unk_08); + } } // Command 0x8C: Set Time of Day & Environment Time #ifdef NON_MATCHING // regalloc differences -void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTime* cmd) -{ +void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTime* cmd) { s16 temp1; s16 temp2; - if (csCtx->frames == cmd->startFrame) - { + if (csCtx->frames == cmd->startFrame) { temp1 = (cmd->hour * 60.0f) / 0.021972656f; temp2 = (cmd->minute + 1) / 0.021972656f; gSaveContext.environment_time = gSaveContext.day_time = temp1 + temp2; @@ -503,25 +431,22 @@ void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTim #endif // Command 0x3E8: Code Execution (& Terminates Cutscene?) -void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) -{ +void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) { Player* player = PLAYER; s32 temp = 0; - if ((gSaveContext.game_mode != 0) && (gSaveContext.game_mode != 3) && - (globalCtx->sceneNum != SCENE_SPOT00) && (csCtx->frames > 20) && - (!~(globalCtx->state.input[0].padPressed | 0xFFFF7FFF) || - !~(globalCtx->state.input[0].padPressed | -0x4001) || + if ((gSaveContext.game_mode != 0) && (gSaveContext.game_mode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) && + (csCtx->frames > 20) && + (!~(globalCtx->state.input[0].padPressed | 0xFFFF7FFF) || !~(globalCtx->state.input[0].padPressed | -0x4001) || !~(globalCtx->state.input[0].padPressed | -0x1001)) && - (gSaveContext.file_num != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) - { + (gSaveContext.file_num != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) { Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); temp = 1; } if ((csCtx->frames == cmd->startFrame) || (temp != 0) || - ((csCtx->frames > 20) && (!~(globalCtx->state.input[0].padPressed | -0x1001)) && (gSaveContext.file_num != 0xFEDC))) - { + ((csCtx->frames > 20) && (!~(globalCtx->state.input[0].padPressed | -0x1001)) && + (gSaveContext.file_num != 0xFEDC))) { csCtx->state = CS_STATE_UNSKIPPABLE_EXEC; func_800F68BC(0); gSaveContext.unk_1410 = 1; @@ -529,13 +454,13 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt // Translates to: "FUTURE FORK DESIGNATION=No. [%d]" osSyncPrintf("\n分岐先指定!!=[%d]番", cmd->base); - if ((gSaveContext.game_mode != 0) && (csCtx->frames != cmd->startFrame)) + if ((gSaveContext.game_mode != 0) && (csCtx->frames != cmd->startFrame)) { gSaveContext.unk_13E7 = 1; + } gSaveContext.cutscene_index = 0; - switch (cmd->base) - { + switch (cmd->base) { case 1: globalCtx->nextEntranceIndex = 0x00A0; gSaveContext.cutscene_index = 0xFFF1; @@ -581,22 +506,19 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt case 8: gSaveContext.fw.set = 0; gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0; - if (!(gSaveContext.event_chk_inf[4] & 0x20)) - { + if (!(gSaveContext.event_chk_inf[4] & 0x20)) { gSaveContext.event_chk_inf[4] |= 0x20; globalCtx->nextEntranceIndex = 0x00A0; globalCtx->sceneLoadFlag = 0x14; gSaveContext.cutscene_index = 0xFFF3; globalCtx->fadeOutTransition = 0xB; - } - else - { - if (gSaveContext.scene_setup_index < 4) - { - if (LINK_IS_CHILD) + } else { + if (gSaveContext.scene_setup_index < 4) { + if (LINK_IS_CHILD) { globalCtx->linkAgeOnLoad = 0; - else + } else { globalCtx->linkAgeOnLoad = 1; + } } globalCtx->nextEntranceIndex = 0x02CA; globalCtx->sceneLoadFlag = 0x14; @@ -1037,19 +959,14 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt globalCtx->fadeOutTransition = 3; break; case 95: - if ((gSaveContext.event_chk_inf[4] & 0x100) && - (gSaveContext.event_chk_inf[4] & 0x200) && - (gSaveContext.event_chk_inf[4] & 0x400)) - { + if ((gSaveContext.event_chk_inf[4] & 0x100) && (gSaveContext.event_chk_inf[4] & 0x200) && + (gSaveContext.event_chk_inf[4] & 0x400)) { globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; gSaveContext.cutscene_index = 0xFFF3; globalCtx->fadeOutTransition = 2; - } - else - { - switch (gSaveContext.scene_setup_index) - { + } else { + switch (gSaveContext.scene_setup_index) { case 8: globalCtx->nextEntranceIndex = 0x00FC; globalCtx->sceneLoadFlag = 0x14; @@ -1070,15 +987,12 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt } break; case 96: - if (gBitFlags[4] & gSaveContext.quest_items) - { + if (gBitFlags[4] & gSaveContext.quest_items) { globalCtx->nextEntranceIndex = 0x006B; globalCtx->sceneLoadFlag = 0x14; gSaveContext.cutscene_index = 0xFFF1; globalCtx->fadeOutTransition = 5; - } - else - { + } else { gSaveContext.event_chk_inf[12] |= 0x100; globalCtx->nextEntranceIndex = 0x0610; globalCtx->sceneLoadFlag = 0x14; @@ -1087,15 +1001,12 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt } break; case 97: - if (gBitFlags[3] & gSaveContext.quest_items) - { + if (gBitFlags[3] & gSaveContext.quest_items) { globalCtx->nextEntranceIndex = 0x006B; globalCtx->sceneLoadFlag = 0x14; gSaveContext.cutscene_index = 0xFFF1; globalCtx->fadeOutTransition = 5; - } - else - { + } else { globalCtx->nextEntranceIndex = 0x0580; globalCtx->sceneLoadFlag = 0x14; globalCtx->fadeOutTransition = 3; @@ -1138,8 +1049,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt globalCtx->fadeOutTransition = 2; break; case 104: - switch (sTitleCsState) - { + switch (sTitleCsState) { case 0: globalCtx->nextEntranceIndex = 0x008D; globalCtx->sceneLoadFlag = 0x14; @@ -1206,16 +1116,13 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt break; case 113: if (Flags_GetEventChkInf(0xBB) && Flags_GetEventChkInf(0xBC) && Flags_GetEventChkInf(0xBD) && - Flags_GetEventChkInf(0xBE) && Flags_GetEventChkInf(0xBF) && Flags_GetEventChkInf(0xAD)) - { + Flags_GetEventChkInf(0xBE) && Flags_GetEventChkInf(0xBF) && Flags_GetEventChkInf(0xAD)) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&D_0201DA50); globalCtx->csCtx.frames = 0; gSaveContext.cutscene_trigger = 1; gSaveContext.cutscene_index = 0xFFFF; csCtx->state = CS_STATE_UNSKIPPABLE_INIT; - } - else - { + } else { gSaveContext.cutscene_index = 0xFFFF; csCtx->state = CS_STATE_UNSKIPPABLE_INIT; } @@ -1232,14 +1139,11 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt gSaveContext.transition_type = 2; break; case 116: - if (gSaveContext.event_chk_inf[12] & 0x100) - { + if (gSaveContext.event_chk_inf[12] & 0x100) { globalCtx->nextEntranceIndex = 0x0580; globalCtx->sceneLoadFlag = 0x14; globalCtx->fadeOutTransition = 3; - } - else - { + } else { globalCtx->nextEntranceIndex = 0x0610; globalCtx->sceneLoadFlag = 0x14; globalCtx->fadeOutTransition = 3; @@ -1273,67 +1177,68 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt } // Command 0x2D: Transition Effects -void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) -{ +void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) { f32 temp; - if ((csCtx->frames >= cmd->startFrame) && (csCtx->frames <= cmd->endFrame)) - { + if ((csCtx->frames >= cmd->startFrame) && (csCtx->frames <= cmd->endFrame)) { globalCtx->unk_10B05 = 1; temp = func_8006F93C(cmd->endFrame, cmd->startFrame, csCtx->frames); - switch (cmd->base) - { + switch (cmd->base) { case 1: case 5: globalCtx->unk_10B06[0] = 0xA0; globalCtx->unk_10B06[1] = 0xA0; globalCtx->unk_10B06[2] = 0xA0; - if (cmd->base == 1) - { + if (cmd->base == 1) { globalCtx->unk_10B06[3] = 255.0f * temp; - if ((temp == 0.0f) && (gSaveContext.entrance_index == 0x006B)) - Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - else if ((temp == 0.0f) && - ((gSaveContext.entrance_index == 0x0053) || - (gSaveContext.entrance_index == 0x0138) || - (gSaveContext.entrance_index == 0x0371))) - Audio_PlaySoundGeneral(NA_SE_EV_WHITE_OUT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - else if ((temp == 0.0f) && (globalCtx->sceneNum == SCENE_GANONTIKA)) + if ((temp == 0.0f) && (gSaveContext.entrance_index == 0x006B)) { + Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + } else if ((temp == 0.0f) && + ((gSaveContext.entrance_index == 0x0053) || (gSaveContext.entrance_index == 0x0138) || + (gSaveContext.entrance_index == 0x0371))) { + Audio_PlaySoundGeneral(NA_SE_EV_WHITE_OUT, &D_801333D4, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + } else if ((temp == 0.0f) && (globalCtx->sceneNum == SCENE_GANONTIKA)) { func_800788CC(NA_SE_EV_WHITE_OUT); - } - else + } + } else { globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; + } break; case 2: case 6: globalCtx->unk_10B06[0] = 0; globalCtx->unk_10B06[1] = 0; globalCtx->unk_10B06[2] = 0xFF; - if (cmd->base == 2) + if (cmd->base == 2) { globalCtx->unk_10B06[3] = 255.0f * temp; - else + } else { globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; + } break; case 3: case 7: globalCtx->unk_10B06[0] = 0xFF; globalCtx->unk_10B06[1] = 0; globalCtx->unk_10B06[2] = 0; - if (cmd->base == 3) + if (cmd->base == 3) { globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; - else + } else { globalCtx->unk_10B06[3] = 255.0f * temp; + } break; case 4: case 8: globalCtx->unk_10B06[0] = 0; globalCtx->unk_10B06[1] = 0xFF; globalCtx->unk_10B06[2] = 0; - if (cmd->base == 4) + if (cmd->base == 4) { globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; - else + } else { globalCtx->unk_10B06[3] = 255.0f * temp; + } break; case 9: gSaveContext.unk_1410 = 1; @@ -1343,10 +1248,11 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs globalCtx->unk_10B06[0] = 0; globalCtx->unk_10B06[1] = 0; globalCtx->unk_10B06[2] = 0; - if (cmd->base == 10) + if (cmd->base == 10) { globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; - else + } else { globalCtx->unk_10B06[3] = 255.0f * temp; + } break; case 12: gSaveContext.unk_1410 = 255.0f - (155.0f * temp); @@ -1362,8 +1268,7 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs } // Command 0x1 & 0x5: Camera Positions -s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) -{ +s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) { s32 shouldContinue = 1; CsCmdBase* cmdBase = (CsCmdBase*)cmd; s32 size; @@ -1372,15 +1277,12 @@ s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext* size = 8; if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) && - ((csCtx->unk_18 < cmdBase->startFrame) || (csCtx->unk_18 >= 0xF000))) - { + ((csCtx->unk_18 < cmdBase->startFrame) || (csCtx->unk_18 >= 0xF000))) { csCtx->unk_1B = 1; csCtx->cameraPosition = (CutsceneCameraPoint*)cmd; - if (csCtx->unk_1A != 0) - { + if (csCtx->unk_1A != 0) { csCtx->unk_18 = cmdBase->startFrame; - if (D_8015FCC8 != 0) - { + if (D_8015FCC8 != 0) { func_800C0874(globalCtx, csCtx->unk_16, 0x25); func_800C0314(globalCtx, D_8015FCC6, 1); func_800C0314(globalCtx, csCtx->unk_16, 7); @@ -1391,10 +1293,10 @@ s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext* } } - while (shouldContinue) - { - if (((CutsceneCameraPoint*)cmd)->continueFlag == -1) - shouldContinue = 0; + while (shouldContinue) { + if (((CutsceneCameraPoint*)cmd)->continueFlag == -1) { + shouldContinue = 0; + } cmd += 0x10; size += 0x10; } @@ -1403,8 +1305,7 @@ s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext* } // Command 0x2 & 0x6: Camera Focus Points -s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) -{ +s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) { s32 shouldContinue = 1; CsCmdBase* cmdBase = (CsCmdBase*)cmd; s32 size; @@ -1413,15 +1314,12 @@ s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCt size = 8; if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) && - ((D_8015FCC0 < cmdBase->startFrame) || (D_8015FCC0 >= 0xF000))) - { + ((D_8015FCC0 < cmdBase->startFrame) || (D_8015FCC0 >= 0xF000))) { csCtx->unk_1A = 1; csCtx->cameraFocus = (CutsceneCameraPoint*)cmd; - if (csCtx->unk_1B != 0) - { + if (csCtx->unk_1B != 0) { D_8015FCC0 = cmdBase->startFrame; - if (D_8015FCC8 != 0) - { + if (D_8015FCC8 != 0) { func_800C0874(globalCtx, csCtx->unk_16, 0x25); func_800C0314(globalCtx, D_8015FCC6, 1); func_800C0314(globalCtx, csCtx->unk_16, 7); @@ -1432,10 +1330,10 @@ s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCt } } - while (shouldContinue) - { - if (((CutsceneCameraPoint*)cmd)->continueFlag == -1) - shouldContinue = 0; + while (shouldContinue) { + if (((CutsceneCameraPoint*)cmd)->continueFlag == -1) { + shouldContinue = 0; + } cmd += 0x10; size += 0x10; } @@ -1444,8 +1342,7 @@ s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCt } // Command 0x7: ? (Related to camera positons) -s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused) -{ +s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused) { CsCmdBase* cmdBase = (CsCmdBase*)cmd; s32 size; Vec3f sp3C; @@ -1457,15 +1354,12 @@ s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm size = 8; if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) && - ((D_8015FCC2 < cmdBase->startFrame) || (D_8015FCC2 >= 0xF000))) - { + ((D_8015FCC2 < cmdBase->startFrame) || (D_8015FCC2 >= 0xF000))) { csCtx->unk_1B = 1; csCtx->cameraPosition = (CutsceneCameraPoint*)cmd; - if (csCtx->unk_1A != 0) - { + if (csCtx->unk_1A != 0) { D_8015FCC2 = cmdBase->startFrame; - if (D_8015FCC8 != 0) - { + if (D_8015FCC8 != 0) { sp2C = func_800C04A4(globalCtx, csCtx->unk_16); sp2C->player = NULL; func_800C0314(globalCtx, 0, 1); @@ -1491,8 +1385,7 @@ s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm } // Command 0x8: ? (Related to camera focus points) -s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused) -{ +s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused) { CsCmdBase* cmdBase = (CsCmdBase*)cmd; s32 size; Vec3f sp3C; @@ -1504,15 +1397,12 @@ s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm size = 8; if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) && - ((D_8015FCC4 < cmdBase->startFrame) || (D_8015FCC4 >= 0xF000))) - { + ((D_8015FCC4 < cmdBase->startFrame) || (D_8015FCC4 >= 0xF000))) { csCtx->unk_1A = 1; csCtx->cameraFocus = (CutsceneCameraPoint*)cmd; - if (csCtx->unk_1B != 0) - { + if (csCtx->unk_1B != 0) { D_8015FCC4 = cmdBase->startFrame; - if (D_8015FCC8 != 0) - { + if (D_8015FCC8 != 0) { sp2C = func_800C04A4(globalCtx, csCtx->unk_16); sp2C->player = NULL; func_800C0314(globalCtx, 0, 1); @@ -1536,81 +1426,70 @@ s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm } // Command 0x13: Textbox -void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdTextbox* cmd) -{ +void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdTextbox* cmd) { u8 dialogState; s16 originalCsFrames; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) - { - if (cmd->type != 2) - { - if (D_8011E1C0 != cmd->base) - { + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { + if (cmd->type != 2) { + if (D_8011E1C0 != cmd->base) { D_8011E1C0 = cmd->base; - if ((cmd->type == 3) && (gBitFlags[20] & gSaveContext.quest_items)) + if ((cmd->type == 3) && (gBitFlags[20] & gSaveContext.quest_items)) { func_8010B680(globalCtx, cmd->textId1, 0); - else if ((cmd->type == 4) && (gBitFlags[19] & gSaveContext.quest_items)) + } else if ((cmd->type == 4) && (gBitFlags[19] & gSaveContext.quest_items)) { func_8010B680(globalCtx, cmd->textId1, 0); - else + } else { func_8010B680(globalCtx, cmd->base, 0); + } return; } - } - else - { - if (D_8011E1C4 != cmd->base) - { + } else { + if (D_8011E1C4 != cmd->base) { D_8011E1C4 = cmd->base; func_8010BD58(globalCtx, cmd->base); return; } } - if (csCtx->frames >= cmd->endFrame) - { + if (csCtx->frames >= cmd->endFrame) { originalCsFrames = csCtx->frames; dialogState = func_8010BDBC(&globalCtx->msgCtx); - if ((dialogState != 2) && (dialogState != 0) && (dialogState != 7) && (dialogState != 8)) - { + if ((dialogState != 2) && (dialogState != 0) && (dialogState != 7) && (dialogState != 8)) { csCtx->frames--; - if ((dialogState == 4) && (func_80106BC8(globalCtx) != 0)) - { - if (globalCtx->msgCtx.choiceIndex == 0) - { - if (cmd->textId1 != 0xFFFF) + if ((dialogState == 4) && (func_80106BC8(globalCtx) != 0)) { + if (globalCtx->msgCtx.choiceIndex == 0) { + if (cmd->textId1 != 0xFFFF) { func_8010B720(globalCtx, cmd->textId1); - else + } else { csCtx->frames++; - } - else - { - if (cmd->textId2 != 0xFFFF) + } + } else { + if (cmd->textId2 != 0xFFFF) { func_8010B720(globalCtx, cmd->textId2); - else + } else { csCtx->frames++; + } } } - if (dialogState == 9) - { - if (cmd->textId1 != 0xFFFF) + if (dialogState == 9) { + if (cmd->textId1 != 0xFFFF) { func_8010B720(globalCtx, cmd->textId1); - else + } else { csCtx->frames++; + } } - if (dialogState == 5) - { - if (func_80106BC8(globalCtx) != 0) + if (dialogState == 5) { + if (func_80106BC8(globalCtx) != 0) { func_8010BD58(globalCtx, cmd->base); + } } } - if (csCtx->frames == originalCsFrames) - { + if (csCtx->frames == originalCsFrames) { Interface_ChangeAlpha(1); D_8011E1C0 = 0; D_8011E1C4 = 0; @@ -1619,8 +1498,7 @@ void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx, } } -void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cutscenePtr) -{ +void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cutscenePtr) { s16 i; s32 totalEntries; s32 cmdType; @@ -1634,33 +1512,29 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, MemCopy(&cutsceneEndFrame, cutscenePtr, 4); cutscenePtr += 4; - if ((cutsceneEndFrame < csCtx->frames) && (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC)) - { + if ((cutsceneEndFrame < csCtx->frames) && (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC)) { csCtx->state = CS_STATE_UNSKIPPABLE_INIT; return; } - if (!~(globalCtx->state.input[0].padPressed | -0x101)) - { + if (!~(globalCtx->state.input[0].padPressed | -0x101)) { csCtx->state = CS_STATE_UNSKIPPABLE_INIT; return; } - for (i = 0; i < totalEntries; i++) - { + for (i = 0; i < totalEntries; i++) { MemCopy(&cmdType, cutscenePtr, 4); cutscenePtr += 4; - if (cmdType == -1) + if (cmdType == -1) { return; + } - switch (cmdType) - { + switch (cmdType) { case CS_CMD_MISC: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { func_80064824(globalCtx, csCtx, (void*)cutscenePtr); cutscenePtr += 0x30; } @@ -1668,8 +1542,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case CS_CMD_SET_LIGHTING: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { Cutscene_Command_SetLighting(globalCtx, csCtx, (void*)cutscenePtr); cutscenePtr += 0x30; } @@ -1677,8 +1550,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case CS_CMD_PLAYBGM: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { Cutscene_Command_PlayBGM(globalCtx, csCtx, (void*)cutscenePtr); cutscenePtr += 0x30; } @@ -1686,8 +1558,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case CS_CMD_STOPBGM: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { Cutscene_Command_StopBGM(globalCtx, csCtx, (void*)cutscenePtr); cutscenePtr += 0x30; } @@ -1695,8 +1566,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case CS_CMD_FADEBGM: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { Cutscene_Command_FadeBGM(globalCtx, csCtx, (void*)cutscenePtr); cutscenePtr += 0x30; } @@ -1704,8 +1574,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case CS_CMD_09: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { Cutscene_Command_09(globalCtx, csCtx, (void*)cutscenePtr); cutscenePtr += 0xC; } @@ -1713,8 +1582,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case CS_CMD_SETTIME: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { func_80065134(globalCtx, csCtx, (void*)cutscenePtr); cutscenePtr += 0xC; } @@ -1722,11 +1590,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case CS_CMD_SET_ACTOR_ACTION_0: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->linkAction = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; @@ -1750,11 +1618,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case 144: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[0] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; @@ -1778,11 +1646,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case 141: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[1] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; @@ -1802,11 +1670,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case 132: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[2] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; @@ -1825,11 +1693,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case 133: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[3] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; @@ -1844,11 +1712,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case 135: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[4] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; @@ -1861,11 +1729,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case 136: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[5] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; @@ -1879,11 +1747,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case 137: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[6] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; @@ -1896,33 +1764,33 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case 142: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[7] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; case 62: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[8] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; case CS_CMD_SET_ACTOR_ACTION_10: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) + if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) { csCtx->actorActions[9] = (void*)cutscenePtr; + } cutscenePtr += 0x30; } break; @@ -1952,11 +1820,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, case CS_CMD_TEXTBOX: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) - { + for (j = 0; j < cmdEntries; j++) { cmd = (CsCmdBase*)cutscenePtr; - if (cmd->base != 0xFFFF) + if (cmd->base != 0xFFFF) { Cutscene_Command_Textbox(globalCtx, csCtx, (void*)cutscenePtr); + } cutscenePtr += 0xC; } break; @@ -1968,28 +1836,26 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, default: MemCopy(&cmdEntries, cutscenePtr, 4); cutscenePtr += 4; - for (j = 0; j < cmdEntries; j++) + for (j = 0; j < cmdEntries; j++) { cutscenePtr += 0x30; + } break; } } } -void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ +void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx) { Gfx* displayList; Gfx* prevDisplayList; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - if (0) ; // Necessary to match + if (0) {} // Necessary to match - if (gSaveContext.cutscene_index >= 0xFFF0) - { - if (0) ; // Also necessary to match + if (gSaveContext.cutscene_index >= 0xFFF0) { + if (0) {} // Also necessary to match - if (BREG(0) != 0) - { + if (BREG(0) != 0) { gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_demo.c", 4101); @@ -2005,42 +1871,38 @@ void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx) } csCtx->frames++; - if (dREG(95) != 0) + if (dREG(95) != 0) { Cutscene_ProcessCommands(globalCtx, csCtx, D_8012D1F0); - else + } else { Cutscene_ProcessCommands(globalCtx, csCtx, globalCtx->csCtx.segment); + } } } -void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ - if (func_8006472C(globalCtx, csCtx, 0.0f)) - { +void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx) { + if (func_8006472C(globalCtx, csCtx, 0.0f)) { func_800F68BC(0); csCtx->state = CS_STATE_IDLE; } } -void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ +void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) { s16 i; - if (func_8006472C(globalCtx, csCtx, 0.0f)) - { + if (func_8006472C(globalCtx, csCtx, 0.0f)) { csCtx->linkAction = NULL; - for (i = 0; i < 10; i++) + for (i = 0; i < 10; i++) { csCtx->actorActions[i] = NULL; + } // Translates to: "RIGHT HERE, HUH" osSyncPrintf("\n\n\n\n\nやっぱりここかいな"); gSaveContext.cutscene_index = 0; gSaveContext.game_mode = 0; - if (D_8015FCC8 != 0) - { - switch (gSaveContext.entrance_index) - { + if (D_8015FCC8 != 0) { + switch (gSaveContext.entrance_index) { case 0x028A: case 0x028E: case 0x0292: @@ -2058,15 +1920,14 @@ void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) } } -void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) -{ +void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) { u8 i; - if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE) && !func_8008E988(globalCtx)) + if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE) && !func_8008E988(globalCtx)) { gSaveContext.cutscene_index = 0xFFFD; + } - if ((gSaveContext.cutscene_index >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) - { + if ((gSaveContext.cutscene_index >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) { func_8006C438(globalCtx, 0); D_8011E1C0 = 0; @@ -2074,13 +1935,13 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) csCtx->unk_12 = 0; csCtx->linkAction = NULL; - for (i = 0; i < 10; i++) + for (i = 0; i < 10; i++) { csCtx->actorActions[i] = NULL; + } csCtx->state++; - if (csCtx->state == CS_STATE_SKIPPABLE_INIT) - { + if (csCtx->state == CS_STATE_SKIPPABLE_INIT) { func_800F68BC(1); csCtx->frames = 0xFFFF; @@ -2092,11 +1953,11 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) csCtx->unk_1B = 0; D_8015FCC6 = globalCtx->cameraCtx.unk_5C0; - if (D_8015FCC8 != 0) + if (D_8015FCC8 != 0) { csCtx->unk_14_all = func_800C0230(globalCtx); + } - if (gSaveContext.cutscene_trigger == 0) - { + if (gSaveContext.cutscene_trigger == 0) { Interface_ChangeAlpha(1); func_800B3840(0x20); func_800B38A4(0x20); @@ -2110,41 +1971,39 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) } } -void func_80069048(GlobalContext* globalCtx) -{ +void func_80069048(GlobalContext* globalCtx) { s16 i; D_8015FCCC = 0; - for (i = 0; i < 20; i++) ; // Empty Loop + for (i = 0; i < 20; i++) { + ; // Empty Loop + } D_8015FCE4 = 0; } -void func_8006907C(GlobalContext* globalCtx) -{ - if (D_8015FCCC != 0) +void func_8006907C(GlobalContext* globalCtx) { + if (D_8015FCCC != 0) { D_8015FCCC = 0; + } } -void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx) -{ +void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx) { EntranceCutscene* entranceCutscene; u8 requiredAge; s16 i; - for (i = 0; i < ARRAY_COUNT(sEntranceCutsceneTable); i++) - { + for (i = 0; i < ARRAY_COUNT(sEntranceCutsceneTable); i++) { entranceCutscene = &sEntranceCutsceneTable[i]; requiredAge = entranceCutscene->ageRestriction; - if (requiredAge == 2) + if (requiredAge == 2) { requiredAge = gSaveContext.link_age; + } if ((gSaveContext.entrance_index == entranceCutscene->entrance) && (!Flags_GetEventChkInf(entranceCutscene->flag) || (entranceCutscene->flag == 0x18)) && - (gSaveContext.cutscene_index < 0xFFF0) && - ((u8)gSaveContext.link_age == requiredAge) && - (gSaveContext.respawn_flag <= 0)) - { + (gSaveContext.cutscene_index < 0xFFF0) && ((u8)gSaveContext.link_age == requiredAge) && + (gSaveContext.respawn_flag <= 0)) { Flags_SetEventChkInf(entranceCutscene->flag); Cutscene_SetSegment(globalCtx, entranceCutscene->segAddr); gSaveContext.cutscene_trigger = 2; @@ -2156,42 +2015,31 @@ void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx) #ifdef NON_MATCHING // regalloc differences -void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) -{ +void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) { osSyncPrintf("\ngame_info.mode=[%d] restart_flag", gSaveContext.respawn_flag); - if ((gSaveContext.game_mode == 0) && (gSaveContext.respawn_flag <= 0) && (gSaveContext.cutscene_index < 0xFFF0)) - { - if ((gSaveContext.entrance_index == 0x01E1) && !Flags_GetEventChkInf(0xAC)) - { + if ((gSaveContext.game_mode == 0) && (gSaveContext.respawn_flag <= 0) && (gSaveContext.cutscene_index < 0xFFF0)) { + if ((gSaveContext.entrance_index == 0x01E1) && !Flags_GetEventChkInf(0xAC)) { Flags_SetEventChkInf(0xAC); gSaveContext.entrance_index = 0x0123; gSaveContext.cutscene_index = 0xFFF0; - } - else if ((gSaveContext.entrance_index == 0x00DB) && LINK_IS_ADULT && - (gSaveContext.event_chk_inf[4] & 0x0100) && (gSaveContext.event_chk_inf[4] & 0x0200) && - (gSaveContext.event_chk_inf[4] & 0x0400) && !Flags_GetEventChkInf(0xAA)) - { + } else if ((gSaveContext.entrance_index == 0x00DB) && LINK_IS_ADULT && + (gSaveContext.event_chk_inf[4] & 0x0100) && (gSaveContext.event_chk_inf[4] & 0x0200) && + (gSaveContext.event_chk_inf[4] & 0x0400) && !Flags_GetEventChkInf(0xAA)) { Flags_SetEventChkInf(0xAA); gSaveContext.cutscene_index = 0xFFF0; - } - else if ((gSaveContext.entrance_index == 0x05E0) && !Flags_GetEventChkInf(0xC1)) - { + } else if ((gSaveContext.entrance_index == 0x05E0) && !Flags_GetEventChkInf(0xC1)) { Flags_SetEventChkInf(0xC1); Item_Give(globalCtx, ITEM_OCARINA_FAIRY); gSaveContext.entrance_index = 0x011E; gSaveContext.cutscene_index = 0xFFF0; - } - else if ((gBitFlags[3] & gSaveContext.quest_items) && (gBitFlags[4] & gSaveContext.quest_items) && - LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) && - (gEntranceTable[gSaveContext.entrance_index].scene == 67)) - { + } else if ((gBitFlags[3] & gSaveContext.quest_items) && (gBitFlags[4] & gSaveContext.quest_items) && + LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) && + (gEntranceTable[gSaveContext.entrance_index].scene == 67)) { Flags_SetEventChkInf(0xC4); gSaveContext.entrance_index = 0x0053; gSaveContext.cutscene_index = 0xFFF8; - } - else if (!Flags_GetEventChkInf(0xC7) && (gEntranceTable[gSaveContext.entrance_index].scene == 79)) - { + } else if (!Flags_GetEventChkInf(0xC7) && (gEntranceTable[gSaveContext.entrance_index].scene == 79)) { Flags_SetEventChkInf(0xC7); gSaveContext.entrance_index = 0x0517; gSaveContext.cutscene_index = 0xFFF0; @@ -2202,10 +2050,10 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/Cutscene_HandleConditionalTriggers.s") #endif -void Cutscene_SetSegment(GlobalContext* globalCtx, u32 segment) -{ - if (SEGMENT_NUMBER(segment) != 0) +void Cutscene_SetSegment(GlobalContext* globalCtx, u32 segment) { + if (SEGMENT_NUMBER(segment) != 0) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(segment); - else + } else { globalCtx->csCtx.segment = (void*)segment; + } } diff --git a/src/code/z_draw.c b/src/code/z_draw.c index 9bc4bbd7a8..383ed1b4d8 100644 --- a/src/code/z_draw.c +++ b/src/code/z_draw.c @@ -29,15 +29,13 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId); static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId); static void func_8006B870(GlobalContext* globalCtx, s16 drawId); -typedef struct -{ - /* 0x00 */ void (*drawFunc)(GlobalContext*, s16); - /* 0x04 */ u32 dlists[8]; +typedef struct { + /* 0x00 */ void (*drawFunc)(GlobalContext*, s16); + /* 0x04 */ u32 dlists[8]; } DrawItemTableEntry; // size = 0x24 // TODO: use symbols for these dlists once objects are in C -static DrawItemTableEntry sDrawItemTable[] = -{ +static DrawItemTableEntry sDrawItemTable[] = { { func_8006AAA8, { 0x06000670, 0x06000750 } }, { func_8006A9CC, { 0x06000800 } }, { func_8006ABEC, { 0x06000A80, 0x06000AE0 } }, @@ -71,8 +69,10 @@ static DrawItemTableEntry sDrawItemTable[] = { func_8006A9CC, { 0x06000EE0 } }, { func_8006A9CC, { 0x060009A0 } }, { func_8006A9CC, { 0x06000B70 } }, - { func_8006B870, { 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } }, - { func_8006B870, { 0x06001850, 0x06001770, 0x060017F0, 0x060019A0, 0x06001810, 0x06001A28, 0x06001830, 0x06001AD8 } }, + { func_8006B870, + { 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } }, + { func_8006B870, + { 0x06001850, 0x06001770, 0x060017F0, 0x060019A0, 0x06001810, 0x06001A28, 0x06001830, 0x06001AD8 } }, { func_8006A9CC, { 0x06000F60 } }, { func_8006A9CC, { 0x06000340 } }, { func_8006A9CC, { 0x06000B90 } }, @@ -161,88 +161,90 @@ static DrawItemTableEntry sDrawItemTable[] = * Draw "Get Item" Model * Calls the corresponding draw function for the given draw ID */ -void func_800694A0(GlobalContext* globalCtx, s16 drawId) -{ +void func_800694A0(GlobalContext* globalCtx, s16 drawId) { sDrawItemTable[drawId].drawFunc(globalCtx, drawId); } // All remaining functions in this file are draw functions referenced in the table and called by the function above -static void func_800694E4(GlobalContext* globalCtx, s16 drawId) -{ +static void func_800694E4(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 556); func_80093BA8(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 560), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 565); } -static void func_800695C0(GlobalContext* globalCtx, s16 drawId) -{ +static void func_800695C0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 572); gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 5); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 576), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 581); } -static void func_8006969C(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006969C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 588); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 592), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 16, 32, - 1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 8), 16, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0), + 0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1), + 1 * -(globalCtx->state.frames * 8), 16, 32)); Matrix_Push(); Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY); func_800D1FD4(&globalCtx->mf_11DA0); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 615), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); Matrix_Pull(); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 621); } -static void func_80069880(GlobalContext* globalCtx, s16 drawId) -{ +static void func_80069880(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 628); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 632), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 641), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 16, 32, - 1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 6), 16, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0), + 0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1), + 1 * -(globalCtx->state.frames * 6), 16, 32)); Matrix_Push(); func_800D1FD4(&globalCtx->mf_11DA0); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 656), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]); Matrix_Pull(); @@ -250,35 +252,36 @@ static void func_80069880(GlobalContext* globalCtx, s16 drawId) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 663); } -static void func_80069AC8(GlobalContext* globalCtx, s16 drawId) -{ +static void func_80069AC8(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 670); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 674), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 683), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 32, 32, - 1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 6), 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0), + 0 * (globalCtx->state.frames * 0), 32, 32, 1, 1 * (globalCtx->state.frames * 1), + 1 * -(globalCtx->state.frames * 6), 32, 32)); Matrix_Push(); func_800D1FD4(&globalCtx->mf_11DA0); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 698), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]); Matrix_Pull(); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 704); } -static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) -{ +static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -286,77 +289,80 @@ static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) func_80093D18(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0 * (globalCtx->state.frames * 0) % 256, 1 * (globalCtx->state.frames * 2) % 256, 64, 64, - 1, 0 * (globalCtx->state.frames * 0) % 128, 1 * (globalCtx->state.frames * 1) % 128, 32, 32)); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0) % 256, + 1 * (globalCtx->state.frames * 2) % 256, 64, 64, 1, + 0 * (globalCtx->state.frames * 0) % 128, 1 * (globalCtx->state.frames * 1) % 128, 32, + 32)); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 723), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 730), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); - func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 735); } -static void func_80069EB0(GlobalContext* globalCtx, s16 drawId) -{ +static void func_80069EB0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 742); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 746), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0 * (globalCtx->state.frames * 0), 1 * -(globalCtx->state.frames * 5), 32, 32, - 1, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 32, 64)); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0), + 1 * -(globalCtx->state.frames * 5), 32, 32, 1, 0 * (globalCtx->state.frames * 0), + 0 * (globalCtx->state.frames * 0), 32, 64)); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 760), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 765); } -static void func_8006A060(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006A060(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 772); func_80093BA8(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 776), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 783); } -static void func_8006A158(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006A158(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 811); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 815), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 5); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 822), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 827); } -static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -364,25 +370,26 @@ static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) func_80093D18(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, -1 * (globalCtx->state.frames * 1), 1 * (globalCtx->state.frames * 1), 32, 32, - 1, -1 * (globalCtx->state.frames * 1), 1 * (globalCtx->state.frames * 1), 32, 32)); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, -1 * (globalCtx->state.frames * 1), + 1 * (globalCtx->state.frames * 1), 32, 32, 1, -1 * (globalCtx->state.frames * 1), + 1 * (globalCtx->state.frames * 1), 32, 32)); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 845), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[3]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 855), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[4]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[5]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 861); } -static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -390,17 +397,17 @@ static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) func_80093D18(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 1 * (globalCtx->state.frames * 1), 0 * (globalCtx->state.frames * 1), 32, 32, - 1, 0 * (globalCtx->state.frames * 1), 0 * (globalCtx->state.frames * 1), 32, 32)); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 1), + 0 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 1), + 0 * (globalCtx->state.frames * 1), 32, 32)); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 878), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 883); } -static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -408,17 +415,17 @@ static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) func_80093D18(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 1 * (globalCtx->state.frames * 6), 1 * (globalCtx->state.frames * 6), 32, 32, - 1, 1 * (globalCtx->state.frames * 6), 1 * (globalCtx->state.frames * 6), 32, 32)); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 6), + 1 * (globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 6), + 1 * (globalCtx->state.frames * 6), 32, 32)); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 901), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 906); } -static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -426,17 +433,17 @@ static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) func_80093D84(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 3), 32, 32, - 1, 0 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 2), 32, 32)); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 1), + 1 * -(globalCtx->state.frames * 3), 32, 32, 1, 0 * (globalCtx->state.frames * 1), + 1 * -(globalCtx->state.frames * 2), 32, 32)); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 924), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 929); } -static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -444,100 +451,103 @@ static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) func_80093D84(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0 * (globalCtx->state.frames * 0), 1 * (globalCtx->state.frames * 1), 32, 32, - 1, 0 * (globalCtx->state.frames * 0), 1 * (globalCtx->state.frames * 1), 32, 32)); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0), + 1 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 0), + 1 * (globalCtx->state.frames * 1), 32, 32)); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 947), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 952); } -static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 959); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 963), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 968); } -static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 975); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 979), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 986), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 991); } -static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 998); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1002), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1008); } -static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1015); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1019), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1027), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1032); } -static void func_8006AE40(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006AE40(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1039); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1043), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1050), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1056); } -static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -545,10 +555,11 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) func_80093D84(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 1 * (globalCtx->state.frames * 2), 1 * -(globalCtx->state.frames * 6), 32, 32, - 1, 1 * (globalCtx->state.frames * 1), -1 * (globalCtx->state.frames * 2), 32, 32)); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2), + 1 * -(globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 1), + -1 * (globalCtx->state.frames * 2), 32, 32)); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1074), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]); @@ -556,15 +567,15 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1081); } -static void func_8006B124(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006B124(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1088); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1092), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]); @@ -573,28 +584,28 @@ static void func_8006B124(GlobalContext* globalCtx, s16 drawId) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1100); } -static void func_8006B24C(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006B24C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1108); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1112), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1120), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1126); } -static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -603,20 +614,21 @@ static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) Matrix_Scale(0.7f, 0.7f, 0.7f, MTXMODE_APPLY); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1140), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1148), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1154); } -static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -624,10 +636,11 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) func_80093D84(globalCtx->state.gfxCtx); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 1 * (globalCtx->state.frames * 2), -1 * (globalCtx->state.frames * 2), 64, 64, - 1, 1 * (globalCtx->state.frames * 4), 1 * -(globalCtx->state.frames * 4), 32, 32)); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2), + -1 * (globalCtx->state.frames * 2), 64, 64, 1, 1 * (globalCtx->state.frames * 4), + 1 * -(globalCtx->state.frames * 4), 32, 32)); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1173), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]); @@ -636,20 +649,21 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1181); } -static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1188); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1192), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1200), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[4]); @@ -657,8 +671,7 @@ static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1207); } -static void func_8006B870(GlobalContext* globalCtx, s16 drawId) -{ +static void func_8006B870(GlobalContext* globalCtx, s16 drawId) { u32 pad; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; @@ -666,7 +679,8 @@ static void func_8006B870(GlobalContext* globalCtx, s16 drawId) func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1214); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1218), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]); diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index eb7b016dc6..56fbb6b3e5 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -9,8 +9,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80020A50.s") -void func_80020F60(u32 unused, GraphicsContext* gfxCtx) -{ +void func_80020F60(u32 unused, GraphicsContext* gfxCtx) { Gfx* gfxArr[5]; func_800C6AC4(gfxArr, gfxCtx, D_80135180, 809); @@ -29,4 +28,3 @@ void func_80020F60(u32 unused, GraphicsContext* gfxCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_800224F4.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80022A10.s") - diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c index fd85f4abb7..d3f2591f82 100644 --- a/src/code/z_eff_shield_particle.c +++ b/src/code/z_eff_shield_particle.c @@ -8,4 +8,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_shield_particle/func_8002389C.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_shield_particle/func_800245BC.s") - diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index f24a7f3ab6..5f7c2a65f5 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -3,12 +3,9 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80024B00.s") -void func_80024F0C(UNK_TYPE arg0) -{ - +void func_80024F0C(UNK_TYPE arg0) { } #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80024F14.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80025000.s") - diff --git a/src/code/z_eff_ss_dead.c b/src/code/z_eff_ss_dead.c index c3228d70b1..f203e81e4e 100644 --- a/src/code/z_eff_ss_dead.c +++ b/src/code/z_eff_ss_dead.c @@ -12,4 +12,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_ss_dead/func_80026860.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_ss_dead/func_80026A6C.s") - diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 833994f810..34b264bf42 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -7,8 +7,7 @@ void Effect_SS_Delete(LoadedParticleEntry* particle); #pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_800272B0.s") -void Effect_SS_Clear(GlobalContext* globalCtx) -{ +void Effect_SS_Clear(GlobalContext* globalCtx) { u32 i; LoadedParticleEntry* iter; ParticleOverlay* iter2; @@ -18,35 +17,36 @@ void Effect_SS_Clear(GlobalContext* globalCtx) EffectSS2Info.searchIndex = 0; EffectSS2Info.size = 0; - for (iter = EffectSS2Info.data_table; iter < EffectSS2Info.data_table + EffectSS2Info.size; iter++) + for (iter = EffectSS2Info.data_table; iter < EffectSS2Info.data_table + EffectSS2Info.size; iter++) { Effect_SS_Delete(iter); + } // Free memory from loaded particle overlays iter2 = &sParticleOverlayTable[0]; - for (i = 0; i < ARRAY_COUNT(sParticleOverlayTable); i++) - { + for (i = 0; i < ARRAY_COUNT(sParticleOverlayTable); i++) { addr = iter2->loadedRamAddr; - if (addr != NULL) + if (addr != NULL) { ZeldaArena_FreeDebug(addr, D_801357DC, 337); + } (iter2++)->loadedRamAddr = NULL; } } -void Effect_SS_Delete(LoadedParticleEntry* particle) -{ - if (particle->flags & 2) +void Effect_SS_Delete(LoadedParticleEntry* particle) { + if (particle->flags & 2) { func_800F89E8(particle); + } - if (particle->flags & 4) + if (particle->flags & 4) { func_800F89E8(&particle->unk_2C); + } Effect_SS_ResetEntry(particle); } -void Effect_SS_ResetEntry(LoadedParticleEntry* particle) -{ +void Effect_SS_ResetEntry(LoadedParticleEntry* particle) { u32 i; particle->type = 0x25; @@ -70,8 +70,9 @@ void Effect_SS_ResetEntry(LoadedParticleEntry* particle) particle->unk_38 = 0; particle->unk_3C = 0; - for (i = 0; i != 13; i++) + for (i = 0; i != 13; i++) { particle->unk_40[i] = 0; + } } #pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_800275D0.s") @@ -80,12 +81,10 @@ void Effect_SS_ResetEntry(LoadedParticleEntry* particle) #pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_80027798.s") -void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index) -{ +void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index) { LoadedParticleEntry* particle = &EffectSS2Info.data_table[index]; - if (particle->update != NULL) - { + if (particle->update != NULL) { particle->velocity.x += particle->acceleration.x; particle->velocity.y += particle->acceleration.y; particle->velocity.z += particle->acceleration.z; @@ -98,47 +97,43 @@ void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index) } } -void Effect_SS_UpdateAllParticles(GlobalContext* globalCtx) -{ +void Effect_SS_UpdateAllParticles(GlobalContext* globalCtx) { s32 i; - for (i = 0; i < EffectSS2Info.size; i++) - { - if (EffectSS2Info.data_table[i].life > -1) - { + for (i = 0; i < EffectSS2Info.size; i++) { + if (EffectSS2Info.data_table[i].life > -1) { EffectSS2Info.data_table[i].life--; - if (EffectSS2Info.data_table[i].life < 0) + if (EffectSS2Info.data_table[i].life < 0) { Effect_SS_Delete(&EffectSS2Info.data_table[i]); + } } - if (EffectSS2Info.data_table[i].life > -1) + if (EffectSS2Info.data_table[i].life > -1) { Effect_SS_UpdateParticle(globalCtx, i); + } } } -void Effect_SS_DrawParticle(GlobalContext* globalCtx, s32 index) -{ +void Effect_SS_DrawParticle(GlobalContext* globalCtx, s32 index) { LoadedParticleEntry* particle = &EffectSS2Info.data_table[index]; - if (particle->draw != NULL) + if (particle->draw != NULL) { particle->draw(globalCtx, index, particle); + } } #pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_80027BDC.s") -s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2) -{ - s16 ret = !arg2 ? arg1 : (arg0 + (s32) ((f32) (arg1 - arg0) / arg2)); +s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2) { + s16 ret = !arg2 ? arg1 : (arg0 + (s32)((f32)(arg1 - arg0) / arg2)); return ret; } -s16 func_80027E34(s16 a0, s16 a1, f32 a2) -{ +s16 func_80027E34(s16 a0, s16 a1, f32 a2) { return (a1 - a0) * a2 + a0; } -u8 func_80027E84(u8 a0, u8 a1, f32 a2) -{ +u8 func_80027E84(u8 a0, u8 a1, f32 a2) { return a2 * ((f32)a1 - (f32)a0) + a0; } diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index a385667eed..847e25e2fa 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -164,4 +164,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002A9F4.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002AA44.s") - diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 02bc0a16e8..ea67ceb05a 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -1,8 +1,7 @@ #include #include -typedef enum -{ +typedef enum { /* 0x00 */ A_OBJ_BLOCK_SMALL, /* 0x01 */ A_OBJ_BLOCK_LARGE, /* 0x02 */ A_OBJ_BLOCK_HUGE, @@ -17,23 +16,22 @@ typedef enum /* 0x0B */ A_OBJ_KNOB } AObjType; -typedef struct -{ +typedef struct { /* 0x000 */ Actor actor; - /* 0x14C */ u32 dynaPolyId; - /* 0x150 */ f32 unk_150; - /* 0x154 */ f32 unk_154; - /* 0x158 */ s16 unk_158; - /* 0x15C */ u32 unk_15C; - /* 0x160 */ u8 unk_160; + /* 0x14C */ u32 dynaPolyId; + /* 0x150 */ f32 unk_150; + /* 0x154 */ f32 unk_154; + /* 0x158 */ s16 unk_158; + /* 0x15C */ u32 unk_15C; + /* 0x160 */ u8 unk_160; /* 0x164 */ ActorFunc updateFunc; - /* 0x168 */ s32 unk_168; - /* 0x16C */ s16 textId; - /* 0x16E */ s16 unk_16E; - /* 0x170 */ s16 unk_170; - /* 0x172 */ s16 unk_172; - /* 0x174 */ s16 unk_174; - /* 0x178 */ f32 unk_178; + /* 0x168 */ s32 unk_168; + /* 0x16C */ s16 textId; + /* 0x16E */ s16 unk_16E; + /* 0x170 */ s16 unk_170; + /* 0x172 */ s16 unk_172; + /* 0x174 */ s16 unk_174; + /* 0x178 */ f32 unk_178; /* 0x17C */ ColliderCylinderMain cylinderCollider; } ActorEnAObj; // size = 0x1C8 @@ -54,15 +52,13 @@ extern ColliderCylinderInit D_80115440; extern u32 D_8011546C[]; extern u32 D_80115484[]; -void En_A_Obj_SetNewUpdate(ActorEnAObj* this, ActorFunc newUpdateFunc) -{ +void En_A_Obj_SetNewUpdate(ActorEnAObj* this, ActorFunc newUpdateFunc) { this->updateFunc = newUpdateFunc; } #ifdef NON_MATCHING // minor ordering and regalloc differences -void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx) -{ +void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx) { u32 sp34; s16 type; s16 initialParams; @@ -77,8 +73,7 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx) this->textId = (initialParams >> 8) & 0xFF; this->actor.params = type; - switch (type & 0xFFFF) - { + switch (type & 0xFFFF) { case A_OBJ_BLOCK_SMALL: Actor_SetScale(&this->actor, 0.025f); break; @@ -112,8 +107,7 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx) params = this->actor.params; this->actor.posRot2.pos = this->actor.posRot.pos; - switch (params) - { + switch (params) { case A_OBJ_BLOCK_LARGE: case A_OBJ_BLOCK_HUGE: this->dynaPolyId = 1; @@ -159,12 +153,11 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx) func_8001D234(this, params); break; } - + if (this->actor.params < 5) this->actor.sub_98.mass = 0xFF; - if (this->dynaPolyId != -1) - { + if (this->dynaPolyId != -1) { DynaPolyInfo_Alloc(D_8011546C[this->dynaPolyId], &sp34); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp34); } @@ -173,51 +166,44 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_en_a_keep/En_A_Obj_Init.s") #endif -void En_A_Obj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx) -{ +void En_A_Obj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx) { ColliderCylinderMain* cylinderCollider = &this->cylinderCollider; DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); - switch (this->actor.params) - { + switch (this->actor.params) { case A_OBJ_SIGNPOST_OBLONG: case A_OBJ_SIGNPOST_ARROW: ActorCollider_FreeCylinder(globalCtx, cylinderCollider); } } -void func_8001D204(ActorEnAObj* this, GlobalContext* globalCtx) -{ - if (func_8002F334(&this->actor, globalCtx)) +void func_8001D204(ActorEnAObj* this, GlobalContext* globalCtx) { + if (func_8002F334(&this->actor, globalCtx)) { func_8001D234(this, this->actor.params); + } } -void func_8001D234(ActorEnAObj* this, s16 params) -{ +void func_8001D234(ActorEnAObj* this, s16 params) { En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D25C); } -void func_8001D25C(ActorEnAObj* this, GlobalContext* globalCtx) -{ +void func_8001D25C(ActorEnAObj* this, GlobalContext* globalCtx) { s16 var; - if (this->actor.textId != 0) - { + if (this->actor.textId != 0) { var = this->actor.rotTowardsLinkY - this->actor.shape.rot.y; - if ((ABS(var) < 0x2800) || - ((this->actor.params == 0xA) && (ABS(var) > 0x5800))) - { - if (func_8002F194(&this->actor, globalCtx)) + if ((ABS(var) < 0x2800) || ((this->actor.params == 0xA) && (ABS(var) > 0x5800))) { + if (func_8002F194(&this->actor, globalCtx)) { En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D204); - else + } else { func_8002F2F4(&this->actor, globalCtx); + } } } } -void func_8001D310(ActorEnAObj* this, s16 params) -{ +void func_8001D310(ActorEnAObj* this, s16 params) { this->unk_16E = 0; this->unk_168 = 10; this->actor.posRot.rot.y = 0; @@ -225,41 +211,34 @@ void func_8001D310(ActorEnAObj* this, s16 params) En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D360); } -void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx) -{ - if (this->unk_16E == 0) - { - if (this->unk_160 != 0) - { +void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx) { + if (this->unk_16E == 0) { + if (this->unk_160 != 0) { this->unk_16E++; this->unk_170 = 20; - if ((s16)(this->actor.rotTowardsLinkY + 0x4000) < 0) + if ((s16)(this->actor.rotTowardsLinkY + 0x4000) < 0) { this->unk_174 = -1000; - else + } else { this->unk_174 = 1000; + } - if (this->actor.rotTowardsLinkY < 0) + if (this->actor.rotTowardsLinkY < 0) { this->unk_172 = -this->unk_174; - else + } else { this->unk_172 = this->unk_174; + } } - } - else - { - if (this->unk_168 != 0) - { + } else { + if (this->unk_168 != 0) { this->unk_168--; - } - else - { + } else { this->actor.shape.rot.y += this->unk_172; this->actor.shape.rot.x += this->unk_174; this->unk_170--; this->actor.gravity = -1.0f; - if (this->unk_170 == 0) - { + if (this->unk_170 == 0) { this->actor.posRot.pos = this->actor.initPosRot.pos; this->unk_16E = 0; this->unk_168 = 10; @@ -271,82 +250,74 @@ void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx) } } -void func_8001D480(ActorEnAObj* this, s16 params) -{ +void func_8001D480(ActorEnAObj* this, s16 params) { En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D4A8); } -void func_8001D4A8(ActorEnAObj* this, GlobalContext* globalCtx) -{ +void func_8001D4A8(ActorEnAObj* this, GlobalContext* globalCtx) { Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f); this->actor.shape.rot.x = this->actor.shape.rot.x + (this->actor.posRot.rot.x >> 1); this->actor.shape.rot.z = this->actor.shape.rot.z + (this->actor.posRot.rot.z >> 1); - if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 0x8)) - { - if (1) // Necessary to match + if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 0x8)) { + if (1) { // Necessary to match this->actor.posRot.rot.y = ((this->actor.unk_7E - this->actor.posRot.rot.y) + this->actor.unk_7E) - 0x8000; + } this->actor.bgCheckFlags &= ~0x8; } - if (this->actor.bgCheckFlags & 0x2) - { - if (this->actor.velocity.y < -8.0f) - { + if (this->actor.bgCheckFlags & 0x2) { + if (this->actor.velocity.y < -8.0f) { this->actor.velocity.y *= -0.6f; this->actor.speedXZ *= 0.6f; this->actor.bgCheckFlags &= ~0x3; - } - else + } else { Actor_Kill(&this->actor); + } } } -void func_8001D5C8(ActorEnAObj* this, s16 params) -{ +void func_8001D5C8(ActorEnAObj* this, s16 params) { this->actor.unk_FC = 1200.0f; this->actor.unk_F8 = 720.0f; En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D608); } -void func_8001D608(ActorEnAObj* this, GlobalContext* globalCtx) -{ +void func_8001D608(ActorEnAObj* this, GlobalContext* globalCtx) { this->actor.speedXZ += this->unk_150; this->actor.posRot.rot.y = this->unk_158; - this->actor.speedXZ = (this->actor.speedXZ < -2.5f) ? -2.5f : - ((this->actor.speedXZ > 2.5f) ? 2.5f : - this->actor.speedXZ); + this->actor.speedXZ = + (this->actor.speedXZ < -2.5f) ? -2.5f : ((this->actor.speedXZ > 2.5f) ? 2.5f : this->actor.speedXZ); Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); - if (this->actor.speedXZ != 0.0f) + if (this->actor.speedXZ != 0.0f) { Audio_PlayActorSound2(&this->actor, 0x200A); + } this->unk_154 = 0.0f; this->unk_150 = 0.0f; } -void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx) -{ +void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx) { ColliderCylinderMain* cylinderCollider; this->updateFunc(this, globalCtx); Actor_MoveForward(&this->actor); - if (this->actor.gravity != 0.0f) - { - if (this->actor.params != A_OBJ_KNOB) + if (this->actor.gravity != 0.0f) { + if (this->actor.params != A_OBJ_KNOB) { func_8002E4B4(globalCtx, &this->actor, 5.0f, 40.0f, 0.0f, 0x1D); - else + } else { func_8002E4B4(globalCtx, &this->actor, 5.0f, 20.0f, 0.0f, 0x1D); + } } this->actor.posRot2.pos = this->actor.posRot.pos; this->actor.posRot2.pos.y += this->unk_178; - switch (this->actor.params) - { + switch (this->actor.params) { case A_OBJ_SIGNPOST_OBLONG: case A_OBJ_SIGNPOST_ARROW: cylinderCollider = &this->cylinderCollider; @@ -355,8 +326,7 @@ void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx) } } -void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) -{ +void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) { s32 type = this->actor.params; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; @@ -365,13 +335,16 @@ void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) func_80093D18(globalCtx->state.gfxCtx); - if (type > A_OBJ_KNOB) + if (type > A_OBJ_KNOB) { type = A_OBJ_KNOB; + } - if (this->actor.params == A_OBJ_KNOB) + if (this->actor.params == A_OBJ_KNOB) { gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 1, 0x3C, 0x3C, 0x3C, 0x32); + } - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, D_80115484[type]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715); diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 3ce4c4b753..1945c75ff3 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -1,8 +1,7 @@ #include #include -typedef enum -{ +typedef enum { /* 0x00 */ DROP_RUPEE_GREEN, /* 0x01 */ DROP_RUPEE_BLUE, /* 0x02 */ DROP_RUPEE_RED, @@ -31,8 +30,7 @@ typedef enum /* 0x19 */ DROP_BOMBS_SPECIAL } DropType; -typedef struct -{ +typedef struct { /* 0x000 */ Actor actor; /* 0x14C */ ActorFunc updateFunc; /* 0x150 */ s16 collectibleFlag; @@ -65,15 +63,13 @@ extern u8 D_80115664[]; // Internal Actor Functions -void En_Item00_SetNewUpdate(ActorEnItem00* this, ActorFunc newUpdateFunc) -{ +void En_Item00_SetNewUpdate(ActorEnItem00* this, ActorFunc newUpdateFunc) { this->updateFunc = newUpdateFunc; } #ifdef NON_MATCHING // Very close to matching, just a single ordering issue -void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) { s32 pad1; s32 pad2; f32 sp34; @@ -91,8 +87,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) this->actor.params = this->actor.params & 0x00FF; - if (Flags_GetCollectible(globalCtx, this->collectibleFlag)) - { + if (Flags_GetCollectible(globalCtx, this->collectibleFlag)) { Actor_Kill(&this->actor); return; } @@ -103,8 +98,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) this->unk_158 = 1; - switch (this->actor.params) - { + switch (this->actor.params) { case DROP_RUPEE_GREEN: case DROP_RUPEE_BLUE: case DROP_RUPEE_RED: @@ -216,8 +210,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) this->unk_152 = 0; // MISMATCH: minor ordering issues here - if (!spawnParam8000) - { + if (!spawnParam8000) { En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8); this->unk_15A = -1; return; @@ -230,8 +223,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; - switch (this->actor.params) - { + switch (this->actor.params) { case DROP_RUPEE_GREEN: Item_Give(globalCtx, ITEM_RUPEE_GREEN); break; @@ -307,147 +299,131 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_en_item00/En_Item00_Init.s") #endif -void En_Item00_Destroy(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void En_Item00_Destroy(ActorEnItem00* this, GlobalContext* globalCtx) { ColliderCylinderMain* cylinderCollider = &this->cylinderCollider; ActorCollider_FreeCylinder(globalCtx, cylinderCollider); } -void func_8001DFC8(ActorEnItem00* this, GlobalContext* globalCtx) -{ - if ((this->actor.params <= DROP_RUPEE_RED) || - ((this->actor.params == DROP_HEART) && (this->unk_15A < 0)) || - (this->actor.params == DROP_HEART_PIECE)) - { +void func_8001DFC8(ActorEnItem00* this, GlobalContext* globalCtx) { + if ((this->actor.params <= DROP_RUPEE_RED) || ((this->actor.params == DROP_HEART) && (this->unk_15A < 0)) || + (this->actor.params == DROP_HEART_PIECE)) { this->actor.shape.rot.y += 960; - } - else - { - if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) - { - if (this->unk_15A == -1) - { - if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) + } else { + if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) { + if (this->unk_15A == -1) { + if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000, + 1500)) { this->unk_15A = -2; - } - else - { - if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) + } + } else { + if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000, + 1500)) { this->unk_15A = -1; + } } Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.x, 0, 2, 2500, 500); } } - if (this->actor.params == DROP_HEART_PIECE) + if (this->actor.params == DROP_HEART_PIECE) { this->actor.shape.unk_08 = Math_Sins(this->actor.shape.rot.y) * 150.0f + 850.0f; + } Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); - if (this->unk_154 == 0) - if ((this->actor.params != DROP_SMALL_KEY) && - (this->actor.params != DROP_HEART_PIECE) && - (this->actor.params != DROP_HEART_CONTAINER)) - { + if (this->unk_154 == 0) { + if ((this->actor.params != DROP_SMALL_KEY) && (this->actor.params != DROP_HEART_PIECE) && + (this->actor.params != DROP_HEART_CONTAINER)) { this->unk_154 = -1; } + } - if (this->unk_15A == 0) - if ((this->actor.params != DROP_SMALL_KEY) && - (this->actor.params != DROP_HEART_PIECE) && - (this->actor.params != DROP_HEART_CONTAINER)) - { + if (this->unk_15A == 0) { + if ((this->actor.params != DROP_SMALL_KEY) && (this->actor.params != DROP_HEART_PIECE) && + (this->actor.params != DROP_HEART_CONTAINER)) { Actor_Kill(&this->actor); } + } - if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 0x0001)) + if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 0x0001)) { En_Item00_SetNewUpdate(this, (ActorFunc)func_8001E1C8); + } } -void func_8001E1C8(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void func_8001E1C8(ActorEnItem00* this, GlobalContext* globalCtx) { f32 originalVelocity; Vec3f pos; - if (this->actor.params <= DROP_RUPEE_RED) + if (this->actor.params <= DROP_RUPEE_RED) { this->actor.shape.rot.y += 960; + } - if (globalCtx->gameplayFrames & 1) - { + if (globalCtx->gameplayFrames & 1) { pos.x = this->actor.posRot.pos.x + Math_Rand_CenteredFloat(10.0f); pos.y = this->actor.posRot.pos.y + Math_Rand_CenteredFloat(10.0f); pos.z = this->actor.posRot.pos.z + Math_Rand_CenteredFloat(10.0f); func_80028B74(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514); } - if (this->actor.bgCheckFlags & 0x0003) - { + if (this->actor.bgCheckFlags & 0x0003) { originalVelocity = this->actor.velocity.y; - if (originalVelocity > -2.0f) - { + if (originalVelocity > -2.0f) { En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8); this->actor.velocity.y = 0.0f; - } - else - { + } else { this->actor.velocity.y = originalVelocity * -0.8f; this->actor.bgCheckFlags = this->actor.bgCheckFlags & 0xFFFE; } } } -void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx) { s32 pad; Vec3f pos; s32 var1; this->unk_15A++; - if (this->actor.params == DROP_HEART) - { - if (this->actor.velocity.y < 0.0f) - { + if (this->actor.params == DROP_HEART) { + if (this->actor.velocity.y < 0.0f) { this->actor.speedXZ = 0.0f; this->actor.gravity = -0.4f; - if (this->actor.velocity.y < -1.5f) + if (this->actor.velocity.y < -1.5f) { this->actor.velocity.y = -1.5f; - this->actor.initPosRot.rot.z += (s16) ((this->actor.velocity.y + 3.0f) * 1000.0f); - this->actor.posRot.pos.x += Math_Coss(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z)); - this->actor.posRot.pos.z += Math_Sins(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z)); + } + this->actor.initPosRot.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f); + this->actor.posRot.pos.x += + Math_Coss(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z)); + this->actor.posRot.pos.z += + Math_Sins(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z)); } } - if (this->actor.params <= DROP_RUPEE_RED) - { + if (this->actor.params <= DROP_RUPEE_RED) { this->actor.shape.rot.y += 960; - } - else if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) - { + } else if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) { this->actor.posRot.rot.x -= 700; this->actor.shape.rot.y += 400; this->actor.shape.rot.x = this->actor.posRot.rot.x - 0x4000; } - if (this->actor.velocity.y <= 2.0f) - { + if (this->actor.velocity.y <= 2.0f) { var1 = (u16)this->actor.shape.rot.z + 10000; - if (var1 < 65535) + if (var1 < 65535) { this->actor.shape.rot.z += 10000; - else + } else { this->actor.shape.rot.z = -1; + } } - if (!(globalCtx->gameplayFrames & 1)) - { + if (!(globalCtx->gameplayFrames & 1)) { pos.x = this->actor.posRot.pos.x + (Math_Rand_ZeroOne() - 0.5f) * 10.0f; pos.y = this->actor.posRot.pos.y + (Math_Rand_ZeroOne() - 0.5f) * 10.0f; pos.z = this->actor.posRot.pos.z + (Math_Rand_ZeroOne() - 0.5f) * 10.0f; func_80028B74(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514); } - if (this->actor.bgCheckFlags & 0x0003) - { + if (this->actor.bgCheckFlags & 0x0003) { En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8); this->actor.shape.rot.z = 0; this->actor.velocity.y = 0.0f; @@ -455,40 +431,36 @@ void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx) } } -void func_8001E5C8(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void func_8001E5C8(ActorEnItem00* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (this->unk_152 != 0) - { - if (!func_8002F410(&this->actor, globalCtx)) - { + if (this->unk_152 != 0) { + if (!func_8002F410(&this->actor, globalCtx)) { func_8002F434(&this->actor, globalCtx, this->unk_152, 50.0f, 80.0f); this->unk_15A++; - } - else - { + } else { this->unk_152 = 0; } } - if (this->unk_15A == 0) - { + if (this->unk_15A == 0) { Actor_Kill(&this->actor); return; } this->actor.posRot.pos = player->actor.posRot.pos; - if (this->actor.params <= DROP_RUPEE_RED) + if (this->actor.params <= DROP_RUPEE_RED) { this->actor.shape.rot.y += 960; - else if (this->actor.params == DROP_HEART) + } else if (this->actor.params == DROP_HEART) { this->actor.shape.rot.y = 0; + } this->actor.posRot.pos.y += 40.0f + Math_Sins(this->unk_15A * 15000) * (this->unk_15A * 0.3f); - if LINK_IS_ADULT - this->actor.posRot.pos.y += 20.0f; + if + LINK_IS_ADULT + this->actor.posRot.pos.y += 20.0f; } extern s32 D_80157D90; @@ -497,8 +469,7 @@ extern s16 D_80157D94; #ifdef NON_MATCHING // Almost matching, just a few minor ordering issues -void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) { s32 pad1; s32 pad2; s32 sp3C; @@ -521,44 +492,34 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) this->actor.scale.z = this->actor.scale.x; this->actor.scale.y = this->actor.scale.x; - if (this->actor.gravity) - { - if (this->actor.bgCheckFlags & 0x0003) - { + if (this->actor.gravity) { + if (this->actor.bgCheckFlags & 0x0003) { // Separate symbols seem to be used here for 0x80157D90 since the loads and stores are completely separate - if (D_80157D90 != globalCtx->gameplayFrames) - { + if (D_80157D90 != globalCtx->gameplayFrames) { D_80157D90_ = globalCtx->gameplayFrames; D_80157D94 = 0; - for (i = 0; i < 50; i++) - { - if (globalCtx->colCtx.dyna.flags[i] & 1) - { + for (i = 0; i < 50; i++) { + if (globalCtx->colCtx.dyna.flags[i] & 1) { dynaActor = globalCtx->colCtx.dyna.actorMeshArr[i].actor; if ((dynaActor != NULL) && (dynaActor->update != NULL) && ((dynaActor->posRot.pos.x != dynaActor->pos4.x) || (dynaActor->posRot.pos.y != dynaActor->pos4.y) || - (dynaActor->posRot.pos.z != dynaActor->pos4.z))) - { + (dynaActor->posRot.pos.z != dynaActor->pos4.z))) { D_80157D94++; break; } } } } - } - else - { + } else { sp3A = 1; Actor_MoveForward(&this->actor); } - if (sp3A || D_80157D94) - { + if (sp3A || D_80157D94) { func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D); - if (this->actor.unk_80 <= -10000.0f) - { + if (this->actor.unk_80 <= -10000.0f) { Actor_Kill(&this->actor); return; } @@ -569,8 +530,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this->cylinderCollider); if ((this->actor.params == DROP_SHIELD_DEKU) || (this->actor.params == DROP_SHIELD_HYLIAN) || - (this->actor.params == DROP_TUNIC_ZORA) || (this->actor.params == DROP_TUNIC_GORON)) - { + (this->actor.params == DROP_TUNIC_ZORA) || (this->actor.params == DROP_TUNIC_GORON)) { f32 newUnkBC = Math_Coss(this->actor.shape.rot.x) * 37.0f; this->actor.shape.unk_08 = newUnkBC; if (newUnkBC >= 0.0f) @@ -583,8 +543,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) return; // MISMATCH: The first function argument is loaded too early here - if (!((this->actor.xzDistanceFromLink <= 30.0f) && - (this->actor.yDistanceFromLink >= -50.0f) && + if (!((this->actor.xzDistanceFromLink <= 30.0f) && (this->actor.yDistanceFromLink >= -50.0f) && (this->actor.yDistanceFromLink <= 50.0f))) if (!func_8002F410(&this->actor, globalCtx)) return; @@ -592,8 +551,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) if (globalCtx->unk_10A20 != 0) return; - switch (this->actor.params) - { + switch (this->actor.params) { case DROP_RUPEE_GREEN: Item_Give(globalCtx, ITEM_RUPEE_GREEN); break; @@ -675,8 +633,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) if ((sp3C != 0) && !func_8002F410(&this->actor, globalCtx)) func_8002F554(&this->actor, globalCtx, sp3C); - switch (this->actor.params) - { + switch (this->actor.params) { case DROP_HEART_PIECE: case DROP_HEART_CONTAINER: case DROP_SMALL_KEY: @@ -684,29 +641,22 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) case DROP_SHIELD_HYLIAN: case DROP_TUNIC_ZORA: case DROP_TUNIC_GORON: - if (func_8002F410(&this->actor, globalCtx)) - { + if (func_8002F410(&this->actor, globalCtx)) { Flags_SetCollectible(globalCtx, this->collectibleFlag); Actor_Kill(&this->actor); } return; } - if ((this->actor.params <= DROP_RUPEE_RED) || (this->actor.params == DROP_RUPEE_ORANGE)) - { + if ((this->actor.params <= DROP_RUPEE_RED) || (this->actor.params == DROP_RUPEE_ORANGE)) { Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - else if (sp3C != 0) - { - if (func_8002F410(&this->actor, globalCtx)) - { + } else if (sp3C != 0) { + if (func_8002F410(&this->actor, globalCtx)) { Flags_SetCollectible(globalCtx, this->collectibleFlag); Actor_Kill(&this->actor); } return; - } - else - { + } else { Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -734,15 +684,12 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx); void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx); void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx); -void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx) { s32 pad; f32 unkFloat; - if (!(this->unk_156 & this->unk_158)) - { - switch (this->actor.params) - { + if (!(this->unk_156 & this->unk_158)) { + switch (this->actor.params) { case DROP_RUPEE_GREEN: case DROP_RUPEE_BLUE: case DROP_RUPEE_RED: @@ -757,20 +704,15 @@ void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx) func_8001F1F4(this, globalCtx); break; case DROP_HEART: - if (this->unk_15A < 0) - { - if (this->unk_15A == -1) - { + if (this->unk_15A < 0) { + if (this->unk_15A == -1) { s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART); - if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) - { + if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) { this->actor.objBankIndex = bankIndex; Actor_SetObjectDependency(globalCtx, &this->actor); this->unk_15A = -2; } - } - else - { + } else { unkFloat = 16.0f; Matrix_Scale(unkFloat, unkFloat, unkFloat, MTXMODE_APPLY); func_800694A0(globalCtx, 0x08); @@ -813,8 +755,7 @@ void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx) /** * Draw Function used for Rupee types of En_Item00. */ -void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; s32 iconNb; Gfx* gfxArr[5]; @@ -824,15 +765,16 @@ void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx) func_80093D18(globalCtx->state.gfxCtx); func_8002EBCC(&this->actor, globalCtx, 0); - if (1) // Necessary to match - { - if (this->actor.params <= DROP_RUPEE_RED) + if (1) { // Necessary to match + if (this->actor.params <= DROP_RUPEE_RED) { iconNb = this->actor.params; - else + } else { iconNb = this->actor.params - 0x10; + } } - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1562), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1562), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80115530[iconNb])); @@ -844,8 +786,7 @@ void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx) /** * Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...). */ -void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx) { s32 iconNb; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; @@ -856,16 +797,18 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx) gfxCtx->polyOpa.p = func_800BC8A0(globalCtx, gfxCtx->polyOpa.p); - if (this->actor.params == DROP_BOMBS_SPECIAL) + if (this->actor.params == DROP_BOMBS_SPECIAL) { iconNb = 1; - else if (this->actor.params >= DROP_ARROWS_SMALL) + } else if (this->actor.params >= DROP_ARROWS_SMALL) { iconNb -= 3; + } gfxCtx->polyOpa.p = func_800946E4(gfxCtx->polyOpa.p); gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80115544[iconNb])); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1607), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1607), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, &D_0403F070); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1611); @@ -874,8 +817,7 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx) /** * Draw Function used for the Heart Container type of En_Item00. */ -void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -883,12 +825,14 @@ void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx) func_80093D18(globalCtx->state.gfxCtx); func_8002EBCC(&this->actor, globalCtx, 0); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1634), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1634), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, &D_0403BBA0); func_80093D84(globalCtx->state.gfxCtx); func_8002ED80(&this->actor, globalCtx, 0); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1644), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1644), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, &D_0403BCD8); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1647); @@ -897,8 +841,7 @@ void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx) /** * Draw Function used for the Piece of Heart type of En_Item00. */ -void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx) -{ +void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -906,7 +849,8 @@ void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx) func_80093D84(globalCtx->state.gfxCtx); func_8002ED80(&this->actor, globalCtx, 0); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1670), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1670), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyXlu.p++, &D_0403B030); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1673); @@ -916,38 +860,39 @@ void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx) * Converts a given drop type ID based on link's current age, health and owned items. * Returns a new drop type ID or -1 to cancel the drop. */ -s16 func_8001F404(s16 dropId) -{ - if (LINK_IS_ADULT) - { - if (dropId == DROP_SEEDS) +s16 func_8001F404(s16 dropId) { + if (LINK_IS_ADULT) { + if (dropId == DROP_SEEDS) { dropId = DROP_ARROWS_SMALL; - else if (dropId == DROP_STICK) + } else if (dropId == DROP_STICK) { dropId = DROP_RUPEE_GREEN; - } - else - { - if (dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) + } + } else { + if (dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) { dropId = DROP_SEEDS; + } } // This is convoluted but it seems like it must be a single condition to match + // clang-format off if (((dropId == DROP_BOMBS_A || dropId == DROP_BOMBS_SPECIAL || dropId == DROP_BOMBS_B) && INV_CONTENT(ITEM_BOMB) == ITEM_NONE) || ((dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) && INV_CONTENT(ITEM_BOW) == ITEM_NONE) || ((dropId == DROP_MAGIC_LARGE || dropId == DROP_MAGIC_SMALL) && gSaveContext.magic_level == 0) || - ((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE)) + ((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE)) { return -1; + } + // clang-format on - if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health) + if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health) { return DROP_RUPEE_GREEN; + } return dropId; } // External functions used by other actors to drop collectibles, which usually results in spawning an En_Item00 actor. -Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) -{ +Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) { s32 pad[2]; ActorEnItem00* spawnedActor = NULL; s16 param4000 = params & 0x4000; @@ -956,26 +901,21 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param params = params & 0x3FFF; - if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) - { + if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) { // TODO: Prevent the cast to ActorEnItem00 here since this is a different actor (En_Elf) - spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, - spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, - 0, 0, 0, 0x0002); + spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, + spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, 0x0002); func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28); - } - else - { - if (!param8000) + } else { + if (!param8000) { params = func_8001F404(params & 0x00FF); + } - if (params != -1) - { - spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, - spawnPos->x, spawnPos->y, spawnPos->z, - 0, 0, 0, params | param8000 | param3F00); - if ((spawnedActor != NULL) && !param8000) - { + if (params != -1) { + spawnedActor = + (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y, + spawnPos->z, 0, 0, 0, params | param8000 | param3F00); + if ((spawnedActor != NULL) && !param8000) { spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f; spawnedActor->actor.speedXZ = 2.0f; spawnedActor->actor.gravity = -0.9f; @@ -985,8 +925,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param spawnedActor->unk_15A = 220; if ((spawnedActor->actor.params != DROP_SMALL_KEY) && (spawnedActor->actor.params != DROP_HEART_PIECE) && - (spawnedActor->actor.params != DROP_HEART_CONTAINER)) - { + (spawnedActor->actor.params != DROP_HEART_CONTAINER)) { spawnedActor->actor.room = -1; } spawnedActor->actor.flags |= 0x0010; @@ -994,11 +933,10 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param } } - return (Actor*) spawnedActor; + return (Actor*)spawnedActor; } -Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) -{ +Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) { ActorEnItem00* spawnedActor = NULL; s32 pad; s16 param4000 = params & 0x4000; @@ -1007,24 +945,18 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 para params = params & 0x3FFF; - if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) - { + if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) { // TODO: Prevent the cast to ActorEnItem00 here since this is a different actor (En_Elf) - spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, - spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, - 0, 0, 0, 0x0002); + spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, + spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, 0x0002); func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28); - } - else - { + } else { params = func_8001F404(params & 0x00FF); - if (params != -1) - { - spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, - spawnPos->x, spawnPos->y, spawnPos->z, - 0, 0, 0, params | param8000 | param3F00); - if ((spawnedActor != NULL) && !param8000) - { + if (params != -1) { + spawnedActor = + (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y, + spawnPos->z, 0, 0, 0, params | param8000 | param3F00); + if ((spawnedActor != NULL) && !param8000) { spawnedActor->actor.velocity.y = 0.0f; spawnedActor->actor.speedXZ = 0.0f; spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f; @@ -1034,11 +966,10 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 para } } - return (Actor*) spawnedActor; + return (Actor*)spawnedActor; } -void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params) -{ +void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params) { s32 pad; ActorEnItem00* spawnedActor; s16 dropQuantity; @@ -1050,133 +981,93 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3 param8000 = params & 0x8000; params = params & 0x7FFF; - if (fromActor != NULL) - { - if (fromActor->unk_116) - { - if (fromActor->unk_116 & 0x01) - { + if (fromActor != NULL) { + if (fromActor->unk_116) { + if (fromActor->unk_116 & 0x01) { params = 1 * 0x10; dropTableIndex = 0xB; - } - else if (fromActor->unk_116 & 0x02) - { + } else if (fromActor->unk_116 & 0x02) { params = 1 * 0x10; dropTableIndex = 0x6; - } - else if (fromActor->unk_116 & 0x04) - { + } else if (fromActor->unk_116 & 0x04) { params = 6 * 0x10; dropTableIndex = 0x9; - } - else if (fromActor->unk_116 & 0x08) - { + } else if (fromActor->unk_116 & 0x08) { params = 3 * 0x10; dropTableIndex = 0xB; - } - else if (fromActor->unk_116 & 0x10) - { + } else if (fromActor->unk_116 & 0x10) { params = 6 * 0x10; dropTableIndex = 0xC; - } - else if (fromActor->unk_116 & 0x20) - { + } else if (fromActor->unk_116 & 0x20) { params = 0 * 0x10; dropTableIndex = 0x0; - } - else if (fromActor->unk_116 & 0x40) - { + } else if (fromActor->unk_116 & 0x40) { params = 0 * 0x10; dropTableIndex = 0x1; } } - if (fromActor->unk_116 & 0x20) + if (fromActor->unk_116 & 0x20) { dropId = DROP_RUPEE_PURPLE; - else + } else { dropId = D_80115574[params + dropTableIndex]; - } - else + } + } else { dropId = D_80115574[params + dropTableIndex]; + } - if (dropId == DROP_FLEXIBLE) - { - if (gSaveContext.health <= 0x10) // 1 heart or less - { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, - spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, - 0, 0, 0, 0x0002); + if (dropId == DROP_FLEXIBLE) { + if (gSaveContext.health <= 0x10) { // 1 heart or less + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0, + 0, 0, 0x0002); func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28); return; - } - else if (gSaveContext.health <= 0x30) // 3 hearts or less - { + } else if (gSaveContext.health <= 0x30) { // 3 hearts or less params = 0xB * 0x10; dropTableIndex = 0x0; dropId = DROP_HEART; - } - else if (gSaveContext.health <= 0x50) // 5 hearts or less - { + } else if (gSaveContext.health <= 0x50) { // 5 hearts or less params = 0xA * 0x10; dropTableIndex = 0x0; dropId = DROP_HEART; - } - else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) // Empty magic meter - { + } else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) { // Empty magic meter params = 0xA * 0x10; dropTableIndex = 0x0; dropId = DROP_MAGIC_LARGE; - } - else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic <= (gSaveContext.magic_level >> 1))) // Half magic or less - { + } else if ((gSaveContext.magic_level != 0) && + (gSaveContext.magic <= (gSaveContext.magic_level >> 1))) { // Half magic or less params = 0xA * 0x10; dropTableIndex = 0x0; dropId = DROP_MAGIC_SMALL; - } - else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) // Child and less then 6 deku seeds - { + } else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) { // Child and less then 6 deku seeds params = 0xA * 0x10; dropTableIndex = 0x0; dropId = DROP_SEEDS; - } - else if (LINK_IS_ADULT && (AMMO(ITEM_BOW) < 6)) // Adult and less than 6 arrows - { + } else if (LINK_IS_ADULT && (AMMO(ITEM_BOW) < 6)) { // Adult and less than 6 arrows params = 0xA * 0x10; dropTableIndex = 0x0; dropId = DROP_ARROWS_MEDIUM; - } - else if (AMMO(ITEM_BOMB) < 6) // Less than 6 bombs - { + } else if (AMMO(ITEM_BOMB) < 6) { // Less than 6 bombs params = 0xD * 0x10; dropTableIndex = 0x0; dropId = DROP_BOMBS_A; - } - else if (gSaveContext.rupees < 11) // Less than 11 Rupees - { + } else if (gSaveContext.rupees < 11) { // Less than 11 Rupees params = 0xA * 0x10; dropTableIndex = 0x0; dropId = DROP_RUPEE_RED; - } - else - { + } else { return; } } - if (dropId != 0xFF) - { + if (dropId != 0xFF) { dropQuantity = D_80115664[params + dropTableIndex]; - while (dropQuantity > 0) - { - if (!param8000) - { + while (dropQuantity > 0) { + if (!param8000) { dropId = func_8001F404(dropId); - if (dropId != 0xFF) - { - spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, - spawnPos->x, spawnPos->y, spawnPos->z, - 0, 0, 0, dropId); - if ((spawnedActor != NULL) && (dropId != 0xFF)) - { + if (dropId != 0xFF) { + spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, + spawnPos->x, spawnPos->y, spawnPos->z, 0, 0, 0, dropId); + if ((spawnedActor != NULL) && (dropId != 0xFF)) { spawnedActor->actor.velocity.y = 8.0f; spawnedActor->actor.speedXZ = 2.0f; spawnedActor->actor.gravity = -0.9f; @@ -1186,16 +1077,13 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3 spawnedActor->actor.flags |= 0x0010; if ((spawnedActor->actor.params != DROP_SMALL_KEY) && (spawnedActor->actor.params != DROP_HEART_PIECE) && - (spawnedActor->actor.params != DROP_HEART_CONTAINER)) - { + (spawnedActor->actor.params != DROP_HEART_CONTAINER)) { spawnedActor->actor.room = -1; } spawnedActor->unk_15A = 220; } } - } - else - { + } else { Item_DropCollectible(globalCtx, spawnPos, params | 0x8000); } dropQuantity--; diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c index 8035620363..e2b6f3cefc 100644 --- a/src/code/z_fbdemo.c +++ b/src/code/z_fbdemo.c @@ -18,4 +18,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_800B23E8.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_800B23F0.s") - diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c index bb9c5e8cde..8feea0af9f 100644 --- a/src/code/z_fcurve_data_skelanime.c +++ b/src/code/z_fcurve_data_skelanime.c @@ -14,4 +14,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_8006CBAC.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_8006CF6C.s") - diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 69a0e6f3a8..13f6382f52 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -2,22 +2,20 @@ #include #include -s32 func_8006CFC0(s32 scene) -{ +s32 func_8006CFC0(s32 scene) { s32 validScenes[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 }; s32 i; - for (i = 0; i < ARRAY_COUNT(validScenes); i++) - { - if (scene == validScenes[i]) + for (i = 0; i < ARRAY_COUNT(validScenes); i++) { + if (scene == validScenes[i]) { return 1; + } } return 0; } -void func_8006D074(GlobalContext* globalCtx) -{ +void func_8006D074(GlobalContext* globalCtx) { gSaveContext.horse_data.scene = SCENE_SPOT00; gSaveContext.horse_data.pos.x = -1840; gSaveContext.horse_data.pos.y = 72; @@ -25,10 +23,8 @@ void func_8006D074(GlobalContext* globalCtx) gSaveContext.horse_data.angle = -27353; } -void func_8006D0AC(GlobalContext* globalCtx) -{ - if (gSaveContext.horse_data.scene == SCENE_SPOT06) - { +void func_8006D0AC(GlobalContext* globalCtx) { + if (gSaveContext.horse_data.scene == SCENE_SPOT06) { gSaveContext.horse_data.scene = SCENE_SPOT06; gSaveContext.horse_data.pos.x = -2065; gSaveContext.horse_data.pos.y = -863; @@ -37,147 +33,126 @@ void func_8006D0AC(GlobalContext* globalCtx) } } -typedef struct -{ - /* 0x00 */ s16 scene; +typedef struct { + /* 0x00 */ s16 scene; /* 0x02 */ Vec3s pos; - /* 0x08 */ s16 angle; - /* 0x0A */ s16 type; + /* 0x08 */ s16 angle; + /* 0x0A */ s16 type; } HorseSpawn; -void func_8006D0EC(GlobalContext* globalCtx, Player* player) -{ +void func_8006D0EC(GlobalContext* globalCtx, Player* player) { s32 i; - HorseSpawn horseSpawns[] = - { - { 81, 0xFE34, 0x0064, 0x19F0, 0, 2 }, - { 87, 0xF877, 0xFBFF, 0x0300, 0, 2 }, - { 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 }, - { 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 }, + HorseSpawn horseSpawns[] = { + { 81, 0xFE34, 0x0064, 0x19F0, 0, 2 }, { 87, 0xF877, 0xFBFF, 0x0300, 0, 2 }, + { 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 }, { 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 }, { 99, 0x03A0, 0x0000, 0xF718, 0, 2 }, }; - if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) - { - player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - player->actor.posRot.pos.x, player->actor.posRot.pos.y, player->actor.posRot.pos.z, - player->actor.shape.rot.x, player->actor.shape.rot.y, player->actor.shape.rot.z, 9); - if (player->rideActor == NULL) + if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) { + player->rideActor = + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.posRot.pos.x, + player->actor.posRot.pos.y, player->actor.posRot.pos.z, player->actor.shape.rot.x, + player->actor.shape.rot.y, player->actor.shape.rot.z, 9); + if (player->rideActor == NULL) { __assert("player->ride.actor != NULL", "../z_horse.c", 343); + } func_8002DECC(globalCtx, player, player->rideActor); func_8002DE74(globalCtx, player); gSaveContext.horse_data.scene = globalCtx->sceneNum; - if (globalCtx->sceneNum == SCENE_SPOT12) + if (globalCtx->sceneNum == SCENE_SPOT12) { player->rideActor->room = -1; - } - else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3)) - { + } + } else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3)) { Actor* horseActor; gSaveContext.minigame_state = 0; - horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - 3586.0f, 1413.0f, -402.0f, - 0, 0x4000, 0, 1); + horseActor = + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1); horseActor->room = -1; - } - else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100)) - { + } else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100)) { Actor* horseActor; - horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - -25.0f, 0.0f, -1600.0f, - 0, -0x4000, 0, 1); - if (horseActor == NULL) + horseActor = + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1); + if (horseActor == NULL) { __assert("horse_actor != NULL", "../z_horse.c", 389); - } - else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) && (Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) - { - // Translates to: "SET BY EXISTENCE OF HORSE %d %d %d" - osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18), DREG(1)); - - if (func_8006CFC0(gSaveContext.horse_data.scene)) - { - Actor* horseActor; - horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - gSaveContext.horse_data.pos.x, gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z, - 0, gSaveContext.horse_data.angle, 0, 1); - if (horseActor == NULL) - __assert("horse_actor != NULL", "../z_horse.c", 414); - - if (globalCtx->sceneNum == SCENE_SPOT12) - horseActor->room = -1; } - else - { + } else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) && + (Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) { + // Translates to: "SET BY EXISTENCE OF HORSE %d %d %d" + osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18), + DREG(1)); + + if (func_8006CFC0(gSaveContext.horse_data.scene)) { + Actor* horseActor; + horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, gSaveContext.horse_data.pos.x, + gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z, 0, + gSaveContext.horse_data.angle, 0, 1); + if (horseActor == NULL) { + __assert("horse_actor != NULL", "../z_horse.c", 414); + } + + if (globalCtx->sceneNum == SCENE_SPOT12) { + horseActor->room = -1; + } + } else { osSyncPrintf(VT_COL(RED, WHITE)); // Translates to: "Horse_SetNormal():%d SET SPOT IS NO GOOD." osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene); osSyncPrintf(VT_RST); func_8006D074(globalCtx); } - } - else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) - { + } else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) { Actor* horseActor; - horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - 0.0f, 0.0f, -500.0f, - 0, 0, 0, 1); - if (horseActor == 0) + horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1); + if (horseActor == 0) { __assert("horse_actor != NULL", "../z_horse.c", 443); - } - else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) - { - for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) - { + } + } else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) { + for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) { HorseSpawn* horseSpawn = &horseSpawns[i]; - if (horseSpawn->scene == globalCtx->sceneNum) - { + if (horseSpawn->scene == globalCtx->sceneNum) { Actor* horseActor; - horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - horseSpawn->pos.x, horseSpawn->pos.y, horseSpawn->pos.z, - 0, horseSpawn->angle, 0, horseSpawn->type); - if (horseActor == NULL) + horseActor = + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y, + horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type); + if (horseActor == NULL) { __assert("horse_actor != NULL", "../z_horse.c", 466); + } - if (globalCtx->sceneNum == SCENE_SPOT12) + if (globalCtx->sceneNum == SCENE_SPOT12) { horseActor->room = -1; + } break; } } - } - else if (!Flags_GetEventChkInf(0x18)) - { - if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) &&(gSaveContext.night_flag != 0)) - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - 0.0f, 0.0f, -60.0f, - 0, 0x7360, 0, 1); + } else if (!Flags_GetEventChkInf(0x18)) { + if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.night_flag != 0)) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1); + } } } -typedef struct -{ - /* 0x00 */ s16 scene; - /* 0x04 */ s32 cutsceneIndex; +typedef struct { + /* 0x00 */ s16 scene; + /* 0x04 */ s32 cutsceneIndex; /* 0x08 */ Vec3s pos; - /* 0x0E */ s16 angle; - /* 0x10 */ s16 type; + /* 0x0E */ s16 angle; + /* 0x10 */ s16 type; } struct_8011F9B8; #ifdef NON_MATCHING // regalloc differences -void func_8006D684(GlobalContext* globalCtx, Player* player) -{ +void func_8006D684(GlobalContext* globalCtx, Player* player) { s32 pad; s32 i; Vec3s spawnPos; if ((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E || gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) && - (gSaveContext.respawn_flag == 0)) - { - Vec3s spawnPositions[] = - { + (gSaveContext.respawn_flag == 0)) { + Vec3s spawnPositions[] = { { 0xF46F, 0x0139, 0x1E14 }, { 0xF894, 0x0139, 0x1B67 }, { 0xF035, 0x0139, 0x1B15 }, @@ -193,22 +168,18 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) else spawnPos = spawnPositions[3]; - player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - spawnPos.x, spawnPos.y, spawnPos.z, - 0, player->actor.posRot.rot.y, 0, 7); + player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y, + spawnPos.z, 0, player->actor.posRot.rot.y, 0, 7); if (player->rideActor == NULL) __assert("player->ride.actor != NULL", "../z_horse.c", 561); func_8002DECC(globalCtx, player, player->rideActor); func_8002DE74(globalCtx, player); gSaveContext.horse_data.scene = globalCtx->sceneNum; - } - else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) && - (Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) - { - player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - 894.0f, 0.0f, -2084.0f, - 0, -0x7FFF, 0, 5); + } else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) && + (Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) { + player->rideActor = + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5); if (player->rideActor == NULL) __assert("player->ride.actor != NULL", "../z_horse.c", 582); @@ -218,45 +189,33 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) if (globalCtx->sceneNum == SCENE_SPOT12) player->rideActor->room = -1; - } - else - { - static struct_8011F9B8 D_8011F9B8[] = - { - { 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, - { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 }, - { 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, - { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 }, - { 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, - { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 }, - { 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, - { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, + } else { + static struct_8011F9B8 D_8011F9B8[] = { + { 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 }, + { 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 }, + { 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 }, + { 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, }; - for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) - { - if ((globalCtx->sceneNum == D_8011F9B8[i].scene) && (gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex)) - { - if (D_8011F9B8[i].type == 7) - { - if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1)) - { + for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) { + if ((globalCtx->sceneNum == D_8011F9B8[i].scene) && + (gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex)) { + if (D_8011F9B8[i].type == 7) { + if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1)) { D_8011F9B8[i].pos.x = player->actor.posRot.pos.x; D_8011F9B8[i].pos.y = player->actor.posRot.pos.y; D_8011F9B8[i].pos.z = player->actor.posRot.pos.z; } player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, - 0, player->actor.posRot.rot.y, 0, D_8011F9B8[i].type); + D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, + player->actor.posRot.rot.y, 0, D_8011F9B8[i].type); if (player->rideActor == NULL) __assert("player->ride.actor != NULL", "../z_horse.c", 628); func_8002DECC(globalCtx, player, player->rideActor); func_8002DE74(globalCtx, player); - } - else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8)) - { + } else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8)) { Vec3f sp54; s32 temp; s32 pad2; @@ -266,8 +225,8 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) temp = 0x8000; player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, - 0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp); + D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, + D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp); if (player->rideActor == NULL) __assert("player->ride.actor != NULL", "../z_horse.c", 667); @@ -285,12 +244,10 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) sp54.z = player->actor.posRot.pos.z; func_800C04D8(globalCtx, globalCtx->cameraCtx.unk_5C0, &player->actor.posRot, &sp54); - } - else - { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, - D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, - 0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type); + } else { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, + D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0, + D_8011F9B8[i].type); } break; } @@ -298,33 +255,24 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) } } #else -Vec3s D_8011F9A0[] = -{ +Vec3s D_8011F9A0[] = { { 0xF46F, 0x0139, 0x1E14 }, { 0xF894, 0x0139, 0x1B67 }, { 0xF035, 0x0139, 0x1B15 }, { 0xF6F7, 0x0139, 0x1766 }, }; -struct_8011F9B8 D_8011F9B8[] = -{ - { 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, - { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 }, - { 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, - { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 }, - { 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, - { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 }, - { 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, - { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, +struct_8011F9B8 D_8011F9B8[] = { + { 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 }, + { 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 }, + { 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 }, + { 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, }; #pragma GLOBAL_ASM("asm/non_matchings/code/z_horse/func_8006D684.s") #endif -void func_8006DC68(GlobalContext* globalCtx, Player* player) -{ - if (LINK_IS_ADULT) - { - if (!func_8006CFC0(gSaveContext.horse_data.scene)) - { +void func_8006DC68(GlobalContext* globalCtx, Player* player) { + if (LINK_IS_ADULT) { + if (!func_8006CFC0(gSaveContext.horse_data.scene)) { osSyncPrintf(VT_COL(RED, WHITE)); // Translates to: "Horse_Set_Check():%d SET SPOT IS NO GOOD." osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene); @@ -332,35 +280,31 @@ void func_8006DC68(GlobalContext* globalCtx, Player* player) func_8006D074(globalCtx); } - if (func_8006CFC0(globalCtx->sceneNum)) - { + if (func_8006CFC0(globalCtx->sceneNum)) { if ((gSaveContext.scene_setup_index > 3) || ((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E || gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) && (gSaveContext.respawn_flag == 0)) || ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) && - !Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) - { + !Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) { func_8006D684(globalCtx, player); - } - else - { + } else { func_8006D0EC(globalCtx, player); } } } } -void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) -{ +void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) { s16 x = Math_Vec3f_Yaw(&actor->posRot.pos, arg1) - actor->posRot.rot.y; - if (x > arg2) + if (x > arg2) { actor->posRot.rot.y += arg2; - else if (x < -arg2) + } else if (x < -arg2) { actor->posRot.rot.y -= arg2; - else + } else { actor->posRot.rot.y += x; + } actor->shape.rot.y = actor->posRot.rot.y; } diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 93fe90b27f..5031ad8232 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -10,4 +10,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_8006E0EC.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_8006E418.s") - diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index ad5761ec71..519639a151 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -1,15 +1,13 @@ #include #include -#define KALEIDO_OVERLAY(name) \ - { \ - NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, \ - _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, \ - 0, #name, \ +#define KALEIDO_OVERLAY(name) \ + { \ + NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \ + _ovl_##name##SegmentEnd, 0, #name, \ } -KaleidoManagerOvl gKaleidoMgrOverlayTable[] = -{ +KaleidoManagerOvl gKaleidoMgrOverlayTable[] = { KALEIDO_OVERLAY(kaleido_scope), KALEIDO_OVERLAY(player_actor), }; @@ -18,22 +16,21 @@ void* sKaleidoAreaPtr = NULL; KaleidoManagerOvl* gKaleidoMgrCurOvl = NULL; u32 D_8012D1E0 = 0; -void KaleidoManager_LoadOvl(KaleidoManagerOvl* ovl) -{ +void KaleidoManager_LoadOvl(KaleidoManagerOvl* ovl) { LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 99); ovl->loadedRamAddr = sKaleidoAreaPtr; Overlay_Load(ovl->vromStart, ovl->vromEnd, ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr); osSyncPrintf(VT_FGCOL(GREEN)); - osSyncPrintf("OVL(k):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr, ((u32)ovl->loadedRamAddr + ovl->vramEnd) - (u32)ovl->vramStart, (u32)ovl->vramStart - (u32)ovl->loadedRamAddr, ovl->name); + osSyncPrintf("OVL(k):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr, + ((u32)ovl->loadedRamAddr + ovl->vramEnd) - (u32)ovl->vramStart, + (u32)ovl->vramStart - (u32)ovl->loadedRamAddr, ovl->name); osSyncPrintf(VT_RST); ovl->off = (u32)ovl->loadedRamAddr - (u32)ovl->vramStart; gKaleidoMgrCurOvl = ovl; } -void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl) -{ - if (ovl->loadedRamAddr) - { +void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl) { + if (ovl->loadedRamAddr) { ovl->off = 0; bzero(ovl->loadedRamAddr, ovl->vramEnd - (u32)ovl->vramStart); ovl->loadedRamAddr = NULL; @@ -41,18 +38,17 @@ void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl) } } -void KaleidoManager_Init(GlobalContext* globalCtx) -{ +void KaleidoManager_Init(GlobalContext* globalCtx) { s32 largestOvl; s32 vramSize; u32 idx; largestOvl = 0; - for (idx = 0; idx < ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) - { + for (idx = 0; idx < ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) { vramSize = gKaleidoMgrOverlayTable[idx].vramEnd - (u32)gKaleidoMgrOverlayTable[idx].vramStart; - if (largestOvl < vramSize) + if (largestOvl < vramSize) { largestOvl = vramSize; + } } osSyncPrintf(VT_FGCOL(GREEN)); osSyncPrintf("KaleidoArea の最大サイズは %d バイトを確保します\n", largestOvl); @@ -64,46 +60,41 @@ void KaleidoManager_Init(GlobalContext* globalCtx) osSyncPrintf(VT_RST); gKaleidoMgrCurOvl = 0; } -void KaleidoManager_Destroy() -{ - if (gKaleidoMgrCurOvl) - { +void KaleidoManager_Destroy() { + if (gKaleidoMgrCurOvl) { KaleidoManager_ClearOvl(gKaleidoMgrCurOvl); gKaleidoMgrCurOvl = NULL; } sKaleidoAreaPtr = NULL; } -//NOTE: this function looks messed up and probably doesn't work like how the devs wanted it to work -void* KaleidoManager_GetRamAddr(void* vram) -{ +// NOTE: this function looks messed up and probably doesn't work like how the devs wanted it to work +void* KaleidoManager_GetRamAddr(void* vram) { KaleidoManagerOvl* iter; KaleidoManagerOvl* ovl; u32 idx; iter = gKaleidoMgrCurOvl; ovl = iter; - if (!ovl) - { + if (!ovl) { iter = &gKaleidoMgrOverlayTable[0]; - for (idx = 0; idx != ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) - { - if ((u32)vram >= (u32)iter->vramStart && (u32)iter->vramEnd >= (u32)vram) - { + for (idx = 0; idx != ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) { + if ((u32)vram >= (u32)iter->vramStart && (u32)iter->vramEnd >= (u32)vram) { KaleidoManager_LoadOvl(iter); ovl = iter; goto KaleidoManager_GetRamAddr_end; } - //BUG: devs probably forgot iter++ here + // BUG: devs probably forgot iter++ here } - - osSyncPrintf("異常\n"); //Abnormal + + osSyncPrintf("異常\n"); // Abnormal return NULL; } KaleidoManager_GetRamAddr_end: - if (!ovl || (u32)vram < (u32)ovl->vramStart || (u32)vram >= (u32)ovl->vramEnd) + if (!ovl || (u32)vram < (u32)ovl->vramStart || (u32)vram >= (u32)ovl->vramEnd) { return NULL; + } return (void*)((u32)vram + ovl->off); } diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index 7932415dfb..a722beff94 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -7,34 +7,30 @@ float D_80161398; u32 D_8016139C; void* D_801613A0; -extern void func_80826CB4(GlobalContext*); //KaleidoScope_Update -extern void func_808262B8(GlobalContext*); //KaleidoScope_Draw +extern void func_80826CB4(GlobalContext*); // KaleidoScope_Update +extern void func_808262B8(GlobalContext*); // KaleidoScope_Draw -void KaleidoScopeCall_LoadPlayer() -{ - if ((u32)gKaleidoMgrCurOvl != (u32)&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]) - { - if (gKaleidoMgrCurOvl) - { +void KaleidoScopeCall_LoadPlayer() { + if ((u32)gKaleidoMgrCurOvl != (u32)&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]) { + if (gKaleidoMgrCurOvl) { osSyncPrintf(VT_FGCOL(GREEN)); - osSyncPrintf("カレイド領域 強制排除\n"); //Kaleido area forced exclusion + osSyncPrintf("カレイド領域 強制排除\n"); // Kaleido area forced exclusion osSyncPrintf(VT_RST); KaleidoManager_ClearOvl(gKaleidoMgrCurOvl); } osSyncPrintf(VT_FGCOL(GREEN)); - osSyncPrintf("プレイヤーアクター搬入\n"); //Player actor import + osSyncPrintf("プレイヤーアクター搬入\n"); // Player actor import osSyncPrintf(VT_RST); KaleidoManager_LoadOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]); } } -void KaleidoScopeCall_Init(GlobalContext* globalCtx) -{ - //Kaleidoscope replacement construct +void KaleidoScopeCall_Init(GlobalContext* globalCtx) { + // Kaleidoscope replacement construct osSyncPrintf("カレイド・スコープ入れ替え コンストラクト \n"); sKaleidoScopeUpdateFunc = KaleidoManager_GetRamAddr(func_80826CB4); sKaleidoScopeDrawFunc = KaleidoManager_GetRamAddr(func_808262B8); - //Note : the line numbers suggests there was a macro (see logutils.c) + // Note : the line numbers suggests there was a macro (see logutils.c) LogUtils_LogThreadId("../z_kaleido_scope_call.c", 98); osSyncPrintf("kaleido_scope_move = %08x\n", func_80826CB4); LogUtils_LogThreadId("../z_kaleido_scope_call.c", 99); @@ -46,28 +42,23 @@ void KaleidoScopeCall_Init(GlobalContext* globalCtx) func_8006ECF4(globalCtx); } -void KaleidoScopeCall_Destroy(GlobalContext* globalCtx) -{ - //Kaleidoscope replacement +void KaleidoScopeCall_Destroy(GlobalContext* globalCtx) { + // Kaleidoscope replacement osSyncPrintf("カレイド・スコープ入れ替え デストラクト \n"); func_8006EE48(globalCtx); } -//regalloc +// regalloc #ifdef NON_MATCHING -void KaleidoScopeCall_Update(GlobalContext* globalCtx) -{ +void KaleidoScopeCall_Update(GlobalContext* globalCtx) { u32 pad; PauseContext* pauseCtx; - + pauseCtx = &globalCtx->pauseCtx; - if (pauseCtx->state != 0 || pauseCtx->flag != 0) - { - if (pauseCtx->state == 1) - { - if (func_800B38FC() == 0) - { + if (pauseCtx->state != 0 || pauseCtx->flag != 0) { + if (pauseCtx->state == 1) { + if (func_800B38FC() == 0) { HREG(80) = 7; HREG(82) = 3; R_PAUSE_MENU_MODE = 1; @@ -75,45 +66,35 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) pauseCtx->unk_1EC = 0; pauseCtx->state++; } - } - else if (pauseCtx->state == 8) - { + } else if (pauseCtx->state == 8) { HREG(80) = 7; HREG(82) = 3; R_PAUSE_MENU_MODE = 1; pauseCtx->unk_1E4 = 0; pauseCtx->unk_1EC = 0; pauseCtx->state++; - } - else if (pauseCtx->state == 2 || pauseCtx->state == 9) - { + } else if (pauseCtx->state == 2 || pauseCtx->state == 9) { osSyncPrintf("R_PAUSE_MENU_MODE=%d\n", R_PAUSE_MENU_MODE); if (R_PAUSE_MENU_MODE >= 3) pauseCtx->state++; - } - else if (pauseCtx->state != 0) - { - if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] != gKaleidoMgrCurOvl) - { - if (gKaleidoMgrCurOvl) - { + } else if (pauseCtx->state != 0) { + if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] != gKaleidoMgrCurOvl) { + if (gKaleidoMgrCurOvl) { osSyncPrintf(VT_FGCOL(GREEN)); - osSyncPrintf("カレイド領域 プレイヤー 強制排除\n"); //Kaleid Zone Player Forced Elimination + osSyncPrintf("カレイド領域 プレイヤー 強制排除\n"); // Kaleid Zone Player Forced Elimination osSyncPrintf(VT_RST); KaleidoManager_ClearOvl(gKaleidoMgrCurOvl); } osSyncPrintf(VT_FGCOL(GREEN)); - osSyncPrintf("カレイド領域 カレイドスコープ搬入\n"); //Kaleid area Kaleidoscope loading + osSyncPrintf("カレイド領域 カレイドスコープ搬入\n"); // Kaleid area Kaleidoscope loading osSyncPrintf(VT_RST); KaleidoManager_LoadOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]); } - if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] == gKaleidoMgrCurOvl) - { + if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] == gKaleidoMgrCurOvl) { sKaleidoScopeUpdateFunc(globalCtx); - if (globalCtx->pauseCtx.state == 0 && globalCtx->pauseCtx.flag == 0) - { + if (globalCtx->pauseCtx.state == 0 && globalCtx->pauseCtx.flag == 0) { osSyncPrintf(VT_FGCOL(GREEN)); - osSyncPrintf("カレイド領域 カレイドスコープ排出\n"); //Kaleid area Kaleidoscope emission + osSyncPrintf("カレイド領域 カレイドスコープ排出\n"); // Kaleid area Kaleidoscope emission osSyncPrintf(VT_RST); KaleidoManager_ClearOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]); KaleidoScopeCall_LoadPlayer(); @@ -126,18 +107,16 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_kaleido_scope_call/KaleidoScopeCall_Update.s") #endif -void KaleidoScopeCall_Draw(GlobalContext* globalCtx) -{ - KaleidoManagerOvl *kaleidoScopeOvl; +void KaleidoScopeCall_Draw(GlobalContext* globalCtx) { + KaleidoManagerOvl* kaleidoScopeOvl; - if (R_PAUSE_MENU_MODE >= 3) - { - if ((globalCtx->pauseCtx.state >= 4 && globalCtx->pauseCtx.state < 8) || (globalCtx->pauseCtx.state >= 11 && globalCtx->pauseCtx.state < 19)) - { + if (R_PAUSE_MENU_MODE >= 3) { + if ((globalCtx->pauseCtx.state >= 4 && globalCtx->pauseCtx.state < 8) || + (globalCtx->pauseCtx.state >= 11 && globalCtx->pauseCtx.state < 19)) { kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]; - if (gKaleidoMgrCurOvl == kaleidoScopeOvl) + if (gKaleidoMgrCurOvl == kaleidoScopeOvl) { sKaleidoScopeDrawFunc(globalCtx); + } } } - } diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index fb58245bd1..fc2c0b1e8f 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -6,4 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_kanfont/func_8006EEBC.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_kanfont/func_8006EF10.s") - diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 94f8bf6dc7..7caa221e5d 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -31,8 +31,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_80073A5C.s") -f32 func_800746DC() -{ +f32 func_800746DC() { return Math_Rand_ZeroOne() - 0.5f; } @@ -70,23 +69,19 @@ f32 func_800746DC() #pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800773A8.s") -s32 func_800775CC() -{ +s32 func_800775CC() { return gSaveContext.unk_18; } -void func_800775D8() -{ +void func_800775D8() { gSaveContext.unk_18 = 0; } -s32 func_800775E4() -{ +s32 func_800775E4() { return gSaveContext.unk_14; } -void func_800775F0(u16 arg0) -{ +void func_800775F0(u16 arg0) { gSaveContext.unk_140E = arg0; } @@ -97,4 +92,3 @@ void func_800775F0(u16 arg0) #pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_80077684.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800776E4.s") - diff --git a/src/code/z_lib.c b/src/code/z_lib.c index a7411c53de..c76e400c8f 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -1,109 +1,94 @@ #include #include -void Lib_MemSet(u8* dest, size_t size, u8 val) -{ +void Lib_MemSet(u8* dest, size_t size, u8 val) { u32 i = 0; // TODO: Convert this to while/for if possible - if (i == size) return; + if (i == size) { + return; + } do { *dest++ = val; i++; } while (i != size); } -f32 Math_Coss(s16 angle) -{ +f32 Math_Coss(s16 angle) { return coss(angle) * (1.0f / 32767); } -f32 Math_Sins(s16 angle) -{ +f32 Math_Sins(s16 angle) { return sins(angle) * (1.0f / 32767); } -s32 Math_ApproxUpdateScaledS(s16* pValue, s16 target, s16 step) -{ +s32 Math_ApproxUpdateScaledS(s16* pValue, s16 target, s16 step) { f32 updateScale; - if (step != 0) - { + if (step != 0) { updateScale = R_UPDATE_RATE * 0.5f; - if ((s16)(*pValue - target) > 0) + if ((s16)(*pValue - target) > 0) { step = -step; + } *pValue += (s16)(step * updateScale); - if (((s16)(*pValue - target) * step) >= 0) - { + if (((s16)(*pValue - target) * step) >= 0) { *pValue = target; return 1; } - } - else if (target == *pValue) - { + } else if (target == *pValue) { return 1; } return 0; } -s32 Math_ApproxS(s16* pValue, s16 target, s16 step) -{ - if (step != 0) - { - if (target < *pValue) +s32 Math_ApproxS(s16* pValue, s16 target, s16 step) { + if (step != 0) { + if (target < *pValue) { step = -step; + } *pValue += step; - if (((*pValue - target) * step) >= 0) - { + if (((*pValue - target) * step) >= 0) { *pValue = target; return 1; } - } - else if (target == *pValue) - { + } else if (target == *pValue) { return 1; } return 0; } -s32 Math_ApproxF(f32* pValue, f32 target, f32 step) -{ - if (step != 0.0f) - { - if (target < *pValue) +s32 Math_ApproxF(f32* pValue, f32 target, f32 step) { + if (step != 0.0f) { + if (target < *pValue) { step = -step; + } *pValue += step; - if (((*pValue - target) * step) >= 0) - { + if (((*pValue - target) * step) >= 0) { *pValue = target; return 1; } - } - else if (target == *pValue) - { + } else if (target == *pValue) { return 1; } return 0; } -s32 func_80077A90(s16* pValue, s16 target, s16 step) -{ +s32 func_80077A90(s16* pValue, s16 target, s16 step) { s16 orig = *pValue; *pValue += step; - if (((s16)(*pValue - target) * (s16)(orig - target)) <= 0) - { + if (((s16)(*pValue - target) * (s16)(orig - target)) <= 0) { *pValue = target; return 1; } @@ -111,14 +96,12 @@ s32 func_80077A90(s16* pValue, s16 target, s16 step) return 0; } -s32 func_80077AF8(s16* pValue, s16 target, s16 step) -{ +s32 func_80077AF8(s16* pValue, s16 target, s16 step) { s16 orig = *pValue; *pValue += step; - if (((*pValue - target) * ((s16)orig - target)) <= 0) - { + if (((*pValue - target) * ((s16)orig - target)) <= 0) { *pValue = target; return 1; } @@ -126,50 +109,41 @@ s32 func_80077AF8(s16* pValue, s16 target, s16 step) return 0; } -s32 func_80077B58(s16* pValue, s16 target, s16 step) -{ +s32 func_80077B58(s16* pValue, s16 target, s16 step) { s32 phi_v0 = target - *pValue; - if (phi_v0 < 0) + if (phi_v0 < 0) { step = -step; + } - if (phi_v0 >= 0x8000) - { + if (phi_v0 >= 0x8000) { step = -step; phi_v0 = 0xFFFF0001 - -phi_v0; - } - else if (phi_v0 <= -0x8000) - { + } else if (phi_v0 <= -0x8000) { phi_v0 += 0xFFFF; step = -step; } - if (step != 0) - { + if (step != 0) { *pValue += step; - if ((phi_v0 * step) <= 0) - { + if ((phi_v0 * step) <= 0) { *pValue = target; return 1; } - } - else if (target == *pValue) - { + } else if (target == *pValue) { return 1; } return 0; } -s32 func_80077C1C(f32* pValue, f32 target, f32 step) -{ +s32 func_80077C1C(f32* pValue, f32 target, f32 step) { f32 orig = *pValue; *pValue += step; - if (((*pValue - target) * (orig - target)) <= 0) - { + if (((*pValue - target) * (orig - target)) <= 0) { *pValue = target; return 1; } @@ -177,40 +151,34 @@ s32 func_80077C1C(f32* pValue, f32 target, f32 step) return 0; } -s32 func_80077C6C(f32* pValue, f32 target, f32 incrStep, f32 decrStep) -{ +s32 func_80077C6C(f32* pValue, f32 target, f32 incrStep, f32 decrStep) { f32 step = (target >= *pValue) ? incrStep : decrStep; - if (step != 0.0f) - { - if (target < *pValue) + if (step != 0.0f) { + if (target < *pValue) { step = -step; + } *pValue += step; - if (((*pValue - target) * step) >= 0) - { + if (((*pValue - target) * step) >= 0) { *pValue = target; return 1; } - } - else if (target == *pValue) - { + } else if (target == *pValue) { return 1; } return 0; } -typedef struct -{ +typedef struct { /* 0x00 */ char unk_00[0x14]; - /* 0x14 */ s8 unk_14; - /* 0x14 */ s8 unk_15; + /* 0x14 */ s8 unk_14; + /* 0x14 */ s8 unk_15; } struct_80077D10; -void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2) -{ +void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2) { f32 var1 = arg2->unk_14; f32 var2 = arg2->unk_15; @@ -220,60 +188,51 @@ void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2) *arg1 = atan2s(var2, -var1); } -s16 Math_Rand_S16Offset(s16 base, s16 range) -{ +s16 Math_Rand_S16Offset(s16 base, s16 range) { return (s16)(Math_Rand_ZeroOne() * range) + base; } -s16 Math_Rand_S16OffsetStride(s16 base, s16 stride, s16 range) -{ +s16 Math_Rand_S16OffsetStride(s16 base, s16 stride, s16 range) { return (s16)(Math_Rand_ZeroOne() * range) * stride + base; } -void Math_Vec3f_Copy(Vec3f* dest, Vec3f* src) -{ +void Math_Vec3f_Copy(Vec3f* dest, Vec3f* src) { dest->x = src->x; dest->y = src->y; dest->z = src->z; } -void Math_Vec3s_ToVec3f(Vec3f* dest, Vec3s* src) -{ +void Math_Vec3s_ToVec3f(Vec3f* dest, Vec3s* src) { dest->x = src->x; dest->y = src->y; dest->z = src->z; } -void Math_Vec3f_Sum(Vec3f* a, Vec3f* b, Vec3f* dest) -{ +void Math_Vec3f_Sum(Vec3f* a, Vec3f* b, Vec3f* dest) { dest->x = a->x + b->x; dest->y = a->y + b->y; dest->z = a->z + b->z; } -void Math_Vec3f_Diff(Vec3f* a, Vec3f* b, Vec3f* dest) -{ +void Math_Vec3f_Diff(Vec3f* a, Vec3f* b, Vec3f* dest) { dest->x = a->x - b->x; dest->y = a->y - b->y; dest->z = a->z - b->z; } -void Math_Vec3s_DiffToVec3f(Vec3f* dest, Vec3s* a, Vec3s* b) -{ +void Math_Vec3s_DiffToVec3f(Vec3f* dest, Vec3s* a, Vec3s* b) { dest->x = a->x - b->x; dest->y = a->y - b->y; dest->z = a->z - b->z; } -void Math_Vec3f_Scale(Vec3f* vec, f32 scaleF) -{ +void Math_Vec3f_Scale(Vec3f* vec, f32 scaleF) { vec->x *= scaleF; vec->y *= scaleF; vec->z *= scaleF; } -f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b) -{ +f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b) { f32 dx = b->x - a->x; f32 dy = b->y - a->y; f32 dz = b->z - a->z; @@ -281,8 +240,7 @@ f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b) return sqrtf(SQ(dx) + SQ(dy) + SQ(dz)); } -f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest) -{ +f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest) { dest->x = b->x - a->x; dest->y = b->y - a->y; dest->z = b->z - a->z; @@ -290,29 +248,25 @@ f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest) return sqrtf(SQ(dest->x) + SQ(dest->y) + SQ(dest->z)); } -f32 Math_Vec3f_DistXZ(Vec3f* a, Vec3f* b) -{ +f32 Math_Vec3f_DistXZ(Vec3f* a, Vec3f* b) { f32 dx = b->x - a->x; f32 dz = b->z - a->z; return sqrtf(SQ(dx) + SQ(dz)); } -f32 Math_Vec3f_DiffY(Vec3f* a, Vec3f* b) -{ +f32 Math_Vec3f_DiffY(Vec3f* a, Vec3f* b) { return b->y - a->y; } -s16 Math_Vec3f_Yaw(Vec3f* a, Vec3f* b) -{ +s16 Math_Vec3f_Yaw(Vec3f* a, Vec3f* b) { f32 dx = b->x - a->x; f32 dz = b->z - a->z; return atan2s(dz, dx); } -s16 Math_Vec3f_Pitch(Vec3f* a, Vec3f* b) -{ +s16 Math_Vec3f_Pitch(Vec3f* a, Vec3f* b) { return atan2s(Math_Vec3f_DistXZ(a, b), a->y - b->y); } @@ -328,69 +282,51 @@ void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain); void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain); void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain); -void (*sInitChainHandlers[])(u8* ptr, InitChainEntry* ichain) = -{ - IChain_Apply_u8, - IChain_Apply_s8, - IChain_Apply_u16, - IChain_Apply_s16, - IChain_Apply_u32, - IChain_Apply_s32, - IChain_Apply_f32, - IChain_Apply_f32div1000, - IChain_Apply_Vec3f, - IChain_Apply_Vec3fdiv1000, - IChain_Apply_Vec3s, +void (*sInitChainHandlers[])(u8* ptr, InitChainEntry* ichain) = { + IChain_Apply_u8, IChain_Apply_s8, IChain_Apply_u16, IChain_Apply_s16, + IChain_Apply_u32, IChain_Apply_s32, IChain_Apply_f32, IChain_Apply_f32div1000, + IChain_Apply_Vec3f, IChain_Apply_Vec3fdiv1000, IChain_Apply_Vec3s, }; -void Actor_ProcessInitChain(Actor* actor, InitChainEntry* ichain) -{ - do sInitChainHandlers[ichain->type]((u8*)actor, ichain); - while ((ichain++)->cont); +void Actor_ProcessInitChain(Actor* actor, InitChainEntry* ichain) { + do { + sInitChainHandlers[ichain->type]((u8*)actor, ichain); + } while ((ichain++)->cont); } -void IChain_Apply_u8(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_u8(u8* ptr, InitChainEntry* ichain) { *(u8*)(ptr + ichain->offset) = ichain->value; } -void IChain_Apply_s8(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_s8(u8* ptr, InitChainEntry* ichain) { *(s8*)(ptr + ichain->offset) = ichain->value; } -void IChain_Apply_u16(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_u16(u8* ptr, InitChainEntry* ichain) { *(u16*)(ptr + ichain->offset) = ichain->value; } -void IChain_Apply_s16(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_s16(u8* ptr, InitChainEntry* ichain) { *(s16*)(ptr + ichain->offset) = ichain->value; } -void IChain_Apply_u32(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_u32(u8* ptr, InitChainEntry* ichain) { *(u32*)(ptr + ichain->offset) = ichain->value; } -void IChain_Apply_s32(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_s32(u8* ptr, InitChainEntry* ichain) { *(s32*)(ptr + ichain->offset) = ichain->value; } -void IChain_Apply_f32(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_f32(u8* ptr, InitChainEntry* ichain) { *(f32*)(ptr + ichain->offset) = ichain->value; } -void IChain_Apply_f32div1000(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_f32div1000(u8* ptr, InitChainEntry* ichain) { *(f32*)(ptr + ichain->offset) = ichain->value / 1000.0f; } -void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain) { Vec3f* vec; f32 val; @@ -402,8 +338,7 @@ void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain) vec->x = val; } -void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain) { Vec3f* vec; f32 val; @@ -416,8 +351,7 @@ void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain) vec->x = val; } -void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain) -{ +void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain) { Vec3s* vec; s16 val; @@ -429,40 +363,37 @@ void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain) vec->x = val; } -f32 Math_SmoothScaleMaxMinF(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep) -{ +f32 Math_SmoothScaleMaxMinF(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep) { f32 var; - if (*pValue != target) - { + if (*pValue != target) { var = (target - *pValue) * scale; - if ((var >= minStep) || (var <= -minStep)) - { - if (var > maxStep) + if ((var >= minStep) || (var <= -minStep)) { + if (var > maxStep) { var = maxStep; + } - if (var < -maxStep) + if (var < -maxStep) { var = -maxStep; + } *pValue += var; - } - else - { - if (var < minStep) - { + } else { + if (var < minStep) { *pValue += minStep; var = minStep; - if (target < *pValue) + if (target < *pValue) { *pValue = target; + } } - if (var > -minStep) - { + if (var > -minStep) { *pValue += -minStep; - if (*pValue < target) + if (*pValue < target) { *pValue = target; + } } } } @@ -470,128 +401,123 @@ f32 Math_SmoothScaleMaxMinF(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 return fabsf(target - *pValue); } -void Math_SmoothScaleMaxF(f32* pValue, f32 target, f32 scale, f32 maxStep) -{ +void Math_SmoothScaleMaxF(f32* pValue, f32 target, f32 scale, f32 maxStep) { f32 step; - if (*pValue != target) - { + if (*pValue != target) { step = (target - *pValue) * scale; - if (step > maxStep) + if (step > maxStep) { step = maxStep; - else if (step < -maxStep) + } else if (step < -maxStep) { step = -maxStep; + } *pValue += step; } } -void Math_SmoothDownscaleMaxF(f32* pValue, f32 scale, f32 maxStep) -{ +void Math_SmoothDownscaleMaxF(f32* pValue, f32 scale, f32 maxStep) { f32 step; step = *pValue * scale; - if (step > maxStep) + if (step > maxStep) { step = maxStep; - else if (step < -maxStep) + } else if (step < -maxStep) { step = -maxStep; + } *pValue -= step; } -f32 func_800784D8(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep) -{ +f32 func_800784D8(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep) { f32 step; f32 baseStep; step = 0.0f; baseStep = target - *pValue; - if (*pValue != target) - { - if (baseStep > 180.0f) + if (*pValue != target) { + if (baseStep > 180.0f) { baseStep = -(360.0f - baseStep); - else if (baseStep < -180.0f) + } else if (baseStep < -180.0f) { baseStep = 360.0f + baseStep; + } step = baseStep * scale; - if ((step >= minStep) || (step <= -minStep)) - { - if (step > maxStep) + if ((step >= minStep) || (step <= -minStep)) { + if (step > maxStep) { step = maxStep; + } - if (step < -maxStep) + if (step < -maxStep) { step = -maxStep; + } *pValue += step; - } - else - { - if (step < minStep) - { + } else { + if (step < minStep) { step = minStep; *pValue += step; - if (*pValue > target) + if (*pValue > target) { *pValue = target; + } } - if (step > -minStep) - { + if (step > -minStep) { step = -minStep; *pValue += step; - if (*pValue < target) + if (*pValue < target) { *pValue = target; + } } } } - if (*pValue >= 360.0f) + if (*pValue >= 360.0f) { *pValue -= 360.0f; + } - if (*pValue < 0.0f) + if (*pValue < 0.0f) { *pValue += 360.0f; + } return step; } -s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep, s16 minStep) -{ +s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep, s16 minStep) { s16 step = 0; s16 diff = (target - *pValue); s32 baseStep = diff / invScale; - if (*pValue != target) - { + if (*pValue != target) { step = baseStep; - if ((step > minStep) || (step < -minStep)) - { - if (step > maxStep) + if ((step > minStep) || (step < -minStep)) { + if (step > maxStep) { step = maxStep; + } - if (step < -maxStep) + if (step < -maxStep) { step = -maxStep; + } *pValue += step; - } - else - { - if (diff >= 0) - { + } else { + if (diff >= 0) { *pValue += minStep; - if ((s16)(target - *pValue) <= 0) + if ((s16)(target - *pValue) <= 0) { *pValue = target; - } - else - { + } + } else { *pValue -= minStep; - if ((s16)(target - *pValue) >= 0) + if ((s16)(target - *pValue) >= 0) { *pValue = target; + } } } } @@ -599,39 +525,35 @@ s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep, return diff; } -void Math_SmoothScaleMaxS(s16* pValue, s16 target, s16 invScale, s16 maxStep) -{ +void Math_SmoothScaleMaxS(s16* pValue, s16 target, s16 invScale, s16 maxStep) { s16 step = target - *pValue; step /= invScale; - if (step > maxStep) + if (step > maxStep) { *pValue += maxStep; - else if (step < -maxStep) + } else if (step < -maxStep) { *pValue -= maxStep; - else + } else { *pValue += step; + } } -void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) -{ +void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) { dst->r = src->r; dst->g = src->g; dst->b = src->b; dst->a = src->a; } -void func_80078884(u16 sfxId) -{ +void func_80078884(u16 sfxId) { Audio_PlaySoundGeneral(sfxId, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -void func_800788CC(u16 sfxId) -{ +void func_800788CC(u16 sfxId) { Audio_PlaySoundGeneral(sfxId, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -void func_80078914(Vec3f* arg0, u16 sfxId) -{ +void func_80078914(Vec3f* arg0, u16 sfxId) { Audio_PlaySoundGeneral(sfxId, arg0, 4, &D_801333E0, &D_801333E0, &D_801333E8); } diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index f67235c4a4..b69ac8b344 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -17,8 +17,7 @@ s16 D_8015FDC8[3]; s16 D_8015FDD0[6]; s16 D_8015FDE0[6]; -void Health_InitData(GlobalContext* globalCtx) -{ +void Health_InitData(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; interfaceCtx->unk_228 = 0x140; @@ -50,28 +49,22 @@ void Health_InitData(GlobalContext* globalCtx) #ifdef NON_MATCHING // this function still needs some work -void Health_UpdateData(GlobalContext* globalCtx) -{ +void Health_UpdateData(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; f32 temp_f0 = interfaceCtx->unk_1FE * 0.1f; s16 temp1, temp2, temp3; - if (0) ; + if (0) {} - if (interfaceCtx->unk_200 != 0) - { + if (interfaceCtx->unk_200 != 0) { interfaceCtx->unk_1FE--; - if (interfaceCtx->unk_1FE <= 0) - { + if (interfaceCtx->unk_1FE <= 0) { interfaceCtx->unk_1FE = 0; interfaceCtx->unk_200 = 0; } - } - else - { + } else { interfaceCtx->unk_1FE++; - if (interfaceCtx->unk_1FE >= 10) - { + if (interfaceCtx->unk_1FE >= 10) { interfaceCtx->unk_1FE = 10; interfaceCtx->unk_200 = 1; } @@ -153,21 +146,18 @@ void Health_UpdateData(GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_lifemeter/Health_UpdateData.s") #endif -s32 func_80078E18(GlobalContext* globalCtx) -{ +s32 func_80078E18(GlobalContext* globalCtx) { gSaveContext.health = globalCtx->interfaceCtx.unk_226; return 1; } -s32 func_80078E34(GlobalContext* globalCtx) -{ +s32 func_80078E34(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; interfaceCtx->unk_228 = 0x140; interfaceCtx->unk_226 += 0x10; - if (interfaceCtx->unk_226 >= gSaveContext.health) - { + if (interfaceCtx->unk_226 >= gSaveContext.health) { interfaceCtx->unk_226 = gSaveContext.health; return 1; } @@ -175,21 +165,16 @@ s32 func_80078E34(GlobalContext* globalCtx) return 0; } -s32 func_80078E84(GlobalContext* globalCtx) -{ +s32 func_80078E84(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; - if (interfaceCtx->unk_228 != 0) - { + if (interfaceCtx->unk_228 != 0) { interfaceCtx->unk_228--; - } - else - { + } else { interfaceCtx->unk_228 = 0x140; interfaceCtx->unk_226 -= 0x10; - if (interfaceCtx->unk_226 <= 0) - { + if (interfaceCtx->unk_226 <= 0) { interfaceCtx->unk_226 = 0; globalCtx->unk_11D58(globalCtx, -(gSaveContext.health + 1)); return 1; @@ -199,8 +184,7 @@ s32 func_80078E84(GlobalContext* globalCtx) return 0; } -void Interface_DrawHealth(GlobalContext* globalCtx) -{ +void Interface_DrawHealth(GlobalContext* globalCtx) { s32 pad[5]; u8* heartBgImg; u32 curColorSet; @@ -226,184 +210,127 @@ void Interface_DrawHealth(GlobalContext* globalCtx) func_800C6AC4(gfxArr, gfxCtx, "../z_lifemeter.c", 353); - if (!(gSaveContext.health % 0x10)) + if (!(gSaveContext.health % 0x10)) { fullHeartCount--; + } curColorSet = -1; offsetY = 0.0f; offsetX = 0.0f; - for (i = 0; i < totalHeartCount; i++) - { - if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) - { - if (i < fullHeartCount) - { - if (curColorSet != 0) - { + for (i = 0; i < totalHeartCount; i++) { + if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) { + if (i < fullHeartCount) { + if (curColorSet != 0) { curColorSet = 0; gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2], + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2], interfaceCtx->unk_20E[4], interfaceCtx->healthAlpha); - gDPSetEnvColor(gfxCtx->overlay.p++, - interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2], + gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2], interfaceCtx->unk_21A[4], 0xFF); } - } - else if (i == fullHeartCount) - { - if (curColorSet != 1) - { + } else if (i == fullHeartCount) { + if (curColorSet != 1) { curColorSet = 1; gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - interfaceCtx->unk_202[0], interfaceCtx->unk_202[1], + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_202[0], interfaceCtx->unk_202[1], interfaceCtx->unk_202[2], interfaceCtx->healthAlpha); - gDPSetEnvColor(gfxCtx->overlay.p++, - interfaceCtx->unk_208[0], interfaceCtx->unk_208[1], + gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_208[0], interfaceCtx->unk_208[1], interfaceCtx->unk_208[2], 0xFF); } - } - else if (i > fullHeartCount) - { - if (curColorSet != 2) - { + } else if (i > fullHeartCount) { + if (curColorSet != 2) { curColorSet = 2; gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2], + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2], interfaceCtx->unk_20E[4], interfaceCtx->healthAlpha); - gDPSetEnvColor(gfxCtx->overlay.p++, - interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2], + gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2], interfaceCtx->unk_21A[4], 0xFF); } - } - else - { - if (curColorSet != 3) - { + } else { + if (curColorSet != 3) { curColorSet = 3; gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - interfaceCtx->unk_20E[1], interfaceCtx->unk_20E[3], + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_20E[1], interfaceCtx->unk_20E[3], interfaceCtx->unk_20E[5], interfaceCtx->healthAlpha); - gDPSetEnvColor(gfxCtx->overlay.p++, - interfaceCtx->unk_21A[1], interfaceCtx->unk_21A[3], + gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_21A[1], interfaceCtx->unk_21A[3], interfaceCtx->unk_21A[5], 0xFF); } } - if (i < fullHeartCount) + if (i < fullHeartCount) { heartBgImg = D_02000400; - else if (i == fullHeartCount) + } else if (i == fullHeartCount) { heartBgImg = D_8011FFB0[curHeartFraction]; - else + } else { heartBgImg = D_02000000; - } - else - { - if (i < fullHeartCount) - { - if (curColorSet != 4) - { + } + } else { + if (i < fullHeartCount) { + if (curColorSet != 4) { curColorSet = 4; gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - D_8015FDD0[0], D_8015FDD0[1], - D_8015FDD0[2], interfaceCtx->healthAlpha); - gDPSetEnvColor(gfxCtx->overlay.p++, - D_8015FDE0[0], D_8015FDE0[1], - D_8015FDE0[2], 0xFF); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDD0[0], D_8015FDD0[1], D_8015FDD0[2], + interfaceCtx->healthAlpha); + gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDE0[0], D_8015FDE0[1], D_8015FDE0[2], 0xFF); } - } - else if (i == fullHeartCount) - { - if (curColorSet != 5) - { + } else if (i == fullHeartCount) { + if (curColorSet != 5) { curColorSet = 5; gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - D_8015FDC0[0], D_8015FDC0[1], - D_8015FDC0[2], interfaceCtx->healthAlpha); - gDPSetEnvColor(gfxCtx->overlay.p++, - D_8015FDC8[0], D_8015FDC8[1], - D_8015FDC8[2], 0xFF); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDC0[0], D_8015FDC0[1], D_8015FDC0[2], + interfaceCtx->healthAlpha); + gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDC8[0], D_8015FDC8[1], D_8015FDC8[2], 0xFF); } - } - else if (i > fullHeartCount) - { - if (curColorSet != 6) - { + } else if (i > fullHeartCount) { + if (curColorSet != 6) { curColorSet = 6; gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - D_8015FDD0[0], D_8015FDD0[1], - D_8015FDD0[2], interfaceCtx->healthAlpha); - gDPSetEnvColor(gfxCtx->overlay.p++, - D_8015FDE0[0], D_8015FDE0[1], - D_8015FDE0[2], 0xFF); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDD0[0], D_8015FDD0[1], D_8015FDD0[2], + interfaceCtx->healthAlpha); + gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDE0[0], D_8015FDE0[1], D_8015FDE0[2], 0xFF); } - } - else - { - if (curColorSet != 7) - { + } else { + if (curColorSet != 7) { curColorSet = 7; gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - D_8015FDD0[3], D_8015FDD0[4], - D_8015FDD0[5], interfaceCtx->healthAlpha); - gDPSetEnvColor(gfxCtx->overlay.p++, - D_8015FDE0[3], D_8015FDE0[4], - D_8015FDE0[5], 0xFF); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDD0[3], D_8015FDD0[4], D_8015FDD0[5], + interfaceCtx->healthAlpha); + gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDE0[3], D_8015FDE0[4], D_8015FDE0[5], 0xFF); } } - if (i < fullHeartCount) + if (i < fullHeartCount) { heartBgImg = D_02000900; - else if (i == fullHeartCount) + } else if (i == fullHeartCount) { heartBgImg = D_8011FFF0[curHeartFraction]; - else + } else { heartBgImg = D_02000500; + } } - if (curBgImgLoaded != heartBgImg) - { + if (curBgImgLoaded != heartBgImg) { curBgImgLoaded = heartBgImg; - gDPLoadTextureBlock(gfxCtx->overlay.p++, - heartBgImg, - G_IM_FMT_IA, - G_IM_SIZ_8b, - 16, 16, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, + gDPLoadTextureBlock(gfxCtx->overlay.p++, heartBgImg, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); } - if (i != fullHeartCount) - { - if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) - { - if (curCombineModeSet != 1) - { + if (i != fullHeartCount) { + if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) { + if (curCombineModeSet != 1) { curCombineModeSet = 1; func_80094520(gfxCtx); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, + PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, + 0); } - } - else - { - if (curCombineModeSet != 3) - { + } else { + if (curCombineModeSet != 3) { curCombineModeSet = 3; func_80094520(gfxCtx); - gDPSetCombineLERP(gfxCtx->overlay.p++, - ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, - ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, + PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); } } @@ -414,40 +341,28 @@ void Interface_DrawHealth(GlobalContext* globalCtx) temp4 *= 1024.0f; temp1 = 8.0f; temp1 *= 0.68f; - gSPTextureRectangle(gfxCtx->overlay.p++, - (s32)((temp2 - temp1) * 4), (s32)((temp3 - temp1) * 4), - (s32)((temp2 + temp1) * 4), (s32)((temp3 + temp1) * 4), - G_TX_RENDERTILE, - 0, 0, + gSPTextureRectangle(gfxCtx->overlay.p++, (s32)((temp2 - temp1) * 4), (s32)((temp3 - temp1) * 4), + (s32)((temp2 + temp1) * 4), (s32)((temp3 + temp1) * 4), G_TX_RENDERTILE, 0, 0, (s32)temp4, (s32)temp4); - } - else - { - if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) - { - if (curCombineModeSet != 2) - { + } else { + if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) { + if (curCombineModeSet != 2) { curCombineModeSet = 2; func_80094A14(gfxCtx); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, + PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, + 0); } - } - else - { - if (curCombineModeSet != 4) - { + } else { + if (curCombineModeSet != 4) { curCombineModeSet = 4; func_80094A14(gfxCtx); - gDPSetCombineLERP(gfxCtx->overlay.p++, - ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, - ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, + PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); } } - if (1) - { + if (1) { Mtx* matrix = Graph_Alloc(gfxCtx, sizeof(Mtx)); func_800D2CEC(matrix, 1.0f - (0.32f * sp144), 1.0f - (0.32f * sp144), 1.0f - (0.32f * sp144), -130.0f + offsetX, 94.5f - offsetY, 0.0f); @@ -458,8 +373,7 @@ void Interface_DrawHealth(GlobalContext* globalCtx) } offsetX += 10.0f; - if (i == 9) - { + if (i == 9) { offsetY += 10.0f; offsetX = 0.0f; } @@ -470,50 +384,44 @@ void Interface_DrawHealth(GlobalContext* globalCtx) u32 Health_IsCritical(void); -void Health_HandleCriticalAlarm(GlobalContext* globalCtx) -{ +void Health_HandleCriticalAlarm(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; - if (interfaceCtx->unk_22C != 0) - { + if (interfaceCtx->unk_22C != 0) { interfaceCtx->unk_22A--; - if (interfaceCtx->unk_22A <= 0) - { + if (interfaceCtx->unk_22A <= 0) { interfaceCtx->unk_22A = 0; interfaceCtx->unk_22C = 0; - if (!func_8008E988(globalCtx) && (globalCtx->pauseCtx.state == 0) && - (globalCtx->pauseCtx.flag == 0) && Health_IsCritical() && !func_800BFC84(globalCtx)) - { + if (!func_8008E988(globalCtx) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && + Health_IsCritical() && !func_800BFC84(globalCtx)) { func_80078884(NA_SE_SY_HITPOINT_ALARM); } } - } - else - { + } else { interfaceCtx->unk_22A++; - if (interfaceCtx->unk_22A >= 10) - { + if (interfaceCtx->unk_22A >= 10) { interfaceCtx->unk_22A = 10; interfaceCtx->unk_22C = 1; } } } -u32 Health_IsCritical(void) -{ +u32 Health_IsCritical(void) { s32 var; - if (gSaveContext.health_capacity <= 0x50) + if (gSaveContext.health_capacity <= 0x50) { var = 0x10; - else if (gSaveContext.health_capacity <= 0xA0) + } else if (gSaveContext.health_capacity <= 0xA0) { var = 0x18; - else if (gSaveContext.health_capacity <= 0xF0) + } else if (gSaveContext.health_capacity <= 0xF0) { var = 0x20; - else + } else { var = 0x2C; + } - if ((var >= gSaveContext.health) && (gSaveContext.health > 0)) + if ((var >= gSaveContext.health) && (gSaveContext.health > 0)) { return 1; - else + } else { return 0; + } } diff --git a/src/code/z_lights.c b/src/code/z_lights.c index af6dbad510..46e61fa250 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -3,8 +3,8 @@ extern LightsList sLightsList; -void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius, u32 type) -{ +void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, + s16 radius, u32 type) { info->type = type; info->params.posX = posX; info->params.posY = posY; @@ -12,26 +12,24 @@ void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s Lights_SetPositionalLightColorAndRadius(info, red, green, blue, radius); } -void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius) -{ +void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, + s16 radius) { Lights_InitPositionalLight(info, posX, posY, posZ, red, green, blue, radius, 0); } -void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius) -{ +void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, + s16 radius) { Lights_InitPositionalLight(info, posX, posY, posZ, red, green, blue, radius, 2); } -void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius) -{ +void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius) { info->params.red = red; info->params.green = green; info->params.blue = blue; info->params.radius = radius; } -void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue) -{ +void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue) { info->type = 1; info->params.dirX = dirX; info->params.dirY = dirY; @@ -41,8 +39,7 @@ void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dir info->params.blue = blue; } -void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue) -{ +void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue) { mapper->ambient.l.col[0] = red; mapper->ambient.l.colc[0] = red; mapper->ambient.l.col[1] = green; @@ -54,22 +51,20 @@ void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue) #pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_80079EFC.s") -Light* Lights_MapperGetNextFreeSlot(LightMapper* mapper) -{ - if (6 < mapper->numLights) +Light* Lights_MapperGetNextFreeSlot(LightMapper* mapper) { + if (6 < mapper->numLights) { return NULL; + } return &mapper->lights[mapper->numLights++]; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007A084.s") -void func_8007A40C(LightMapper* mapper, LightInfoDirectionalParams* params, GlobalContext* globalCtx) -{ +void func_8007A40C(LightMapper* mapper, LightInfoDirectionalParams* params, GlobalContext* globalCtx) { Light* light = Lights_MapperGetNextFreeSlot(mapper); - if (light != NULL) - { + if (light != NULL) { light->l.col[0] = light->l.colc[0] = params->red; light->l.col[1] = light->l.colc[1] = params->green; light->l.col[2] = light->l.colc[2] = params->blue; @@ -81,25 +76,21 @@ void func_8007A40C(LightMapper* mapper, LightInfoDirectionalParams* params, Glob #pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007A474.s") -z_Light* Lights_FindFreeSlot() -{ +z_Light* Lights_FindFreeSlot() { z_Light* ret; - if (0x1F < sLightsList.numOccupied) + if (0x1F < sLightsList.numOccupied) { return NULL; + } ret = &sLightsList.lights[sLightsList.nextFree]; - while (ret->info != NULL) - { + while (ret->info != NULL) { sLightsList.nextFree++; - if (sLightsList.nextFree < 0x20) - { + if (sLightsList.nextFree < 0x20) { ret++; - } - else - { + } else { sLightsList.nextFree = 0; ret = &sLightsList.lights[0]; } @@ -112,36 +103,32 @@ z_Light* Lights_FindFreeSlot() #ifdef NON_MATCHING // single ordering difference -void Lights_Free(z_Light* light) -{ - if (light != NULL) - { +void Lights_Free(z_Light* light) { + if (light != NULL) { sLightsList.numOccupied--; light->info = NULL; - sLightsList.nextFree = (light - sLightsList.lights) / sizeof(z_Light); //! @bug Due to pointer arithmetic, the division is unnecessary + sLightsList.nextFree = (light - sLightsList.lights) / + sizeof(z_Light); //! @bug Due to pointer arithmetic, the division is unnecessary } } #else #pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/Lights_Free.s") #endif -void func_8007A614(GlobalContext* globalCtx, LightingContext* lightCtx) -{ +void func_8007A614(GlobalContext* globalCtx, LightingContext* lightCtx) { Lights_ClearHead(globalCtx, lightCtx); Lights_SetAmbientColor(lightCtx, 0x50, 0x50, 0x50); func_8007A698(lightCtx, 0, 0, 0, 0x3e4, 0x3200); bzero(&sLightsList, sizeof(sLightsList)); } -void Lights_SetAmbientColor(LightingContext* lightCtx, u8 red, u8 green, u8 blue) -{ +void Lights_SetAmbientColor(LightingContext* lightCtx, u8 red, u8 green, u8 blue) { lightCtx->ambientRed = red; lightCtx->ambientGreen = green; lightCtx->ambientBlue = blue; } -void func_8007A698(LightingContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 arg4, s16 arg5) -{ +void func_8007A698(LightingContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 arg4, s16 arg5) { lightCtx->unk_07 = arg1; lightCtx->unk_08 = arg2; lightCtx->unk_09 = arg3; @@ -149,38 +136,33 @@ void func_8007A698(LightingContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 arg lightCtx->unk_0C = arg5; } -LightMapper* Lights_CreateMapper(LightingContext* lightCtx, GraphicsContext* gfxCtx) -{ +LightMapper* Lights_CreateMapper(LightingContext* lightCtx, GraphicsContext* gfxCtx) { return func_8007A960(gfxCtx, lightCtx->ambientRed, lightCtx->ambientGreen, lightCtx->ambientBlue); } -void Lights_ClearHead(GlobalContext* globalCtx, LightingContext* lightCtx) -{ +void Lights_ClearHead(GlobalContext* globalCtx, LightingContext* lightCtx) { lightCtx->lightsHead = NULL; } -void Lights_RemoveAll(GlobalContext* globalCtx, LightingContext* lightCtx) -{ - while (lightCtx->lightsHead != NULL) - { +void Lights_RemoveAll(GlobalContext* globalCtx, LightingContext* lightCtx) { + while (lightCtx->lightsHead != NULL) { Lights_Remove(globalCtx, lightCtx, lightCtx->lightsHead); lightCtx->lightsHead = lightCtx->lightsHead->next; } } -z_Light* Lights_Insert(GlobalContext* globalCtx, LightingContext* lightCtx, LightInfo* info) -{ +z_Light* Lights_Insert(GlobalContext* globalCtx, LightingContext* lightCtx, LightInfo* info) { z_Light* light; light = Lights_FindFreeSlot(); - if (light != NULL) - { + if (light != NULL) { light->info = info; light->prev = NULL; light->next = lightCtx->lightsHead; - if (lightCtx->lightsHead != NULL) + if (lightCtx->lightsHead != NULL) { lightCtx->lightsHead->prev = light; + } lightCtx->lightsHead = light; } @@ -188,17 +170,17 @@ z_Light* Lights_Insert(GlobalContext* globalCtx, LightingContext* lightCtx, Ligh return light; } -void Lights_Remove(GlobalContext* globalCtx, LightingContext* lightCtx, z_Light* light) -{ - if (light != NULL) - { - if (light->prev != NULL) +void Lights_Remove(GlobalContext* globalCtx, LightingContext* lightCtx, z_Light* light) { + if (light != NULL) { + if (light->prev != NULL) { light->prev->next = light->next; - else + } else { lightCtx->lightsHead = light->next; + } - if (light->next != NULL) + if (light->next != NULL) { light->next->prev = light->prev; + } Lights_Free(light); } @@ -211,4 +193,3 @@ void Lights_Remove(GlobalContext* globalCtx, LightingContext* lightCtx, z_Light* #pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007A9B4.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007ABBC.s") - diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c index 10a328c492..fd82cca8fa 100644 --- a/src/code/z_malloc.c +++ b/src/code/z_malloc.c @@ -1,131 +1,112 @@ #include -#define LOG_SEVERITY_NOLOG 0 -#define LOG_SEVERITY_ERROR 2 -#define LOG_SEVERITY_VERBOSE 3 +#define LOG_SEVERITY_NOLOG 0 +#define LOG_SEVERITY_ERROR 2 +#define LOG_SEVERITY_VERBOSE 3 s32 gZeldaArenaLogSeverity = LOG_SEVERITY_ERROR; Arena sZeldaArena; -void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) -{ - if (!ptr) - { - if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) - { +void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { + if (!ptr) { + if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) { //"%s: %u bytes %s failed\n" osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action); - __osDisplayArena(&sZeldaArena); + __osDisplayArena(&sZeldaArena); return; } - } - else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) - { + } else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { //"%s: %u bytes %s succeeded\n" osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action); } } -void* ZeldaArena_Malloc(u32 size) -{ +void* ZeldaArena_Malloc(u32 size) { void* ptr; ptr = __osMalloc(&sZeldaArena, size); - ZeldaArena_CheckPointer(ptr, size, "zelda_malloc", "確保"); //Secure + ZeldaArena_CheckPointer(ptr, size, "zelda_malloc", "確保"); // Secure return ptr; } -void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line) -{ +void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line) { void* ptr; ptr = __osMallocDebug(&sZeldaArena, size, file, line); - ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_DEBUG", "確保"); //Secure + ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_DEBUG", "確保"); // Secure return ptr; } -void* ZeldaArena_MallocR(u32 size) -{ +void* ZeldaArena_MallocR(u32 size) { void* ptr; ptr = __osMallocR(&sZeldaArena, size); - ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r", "確保"); //Secure + ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r", "確保"); // Secure return ptr; } -void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line) -{ +void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line) { void* ptr; ptr = __osMallocRDebug(&sZeldaArena, size, file, line); - ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r_DEBUG", "確保"); //Secure + ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r_DEBUG", "確保"); // Secure return ptr; } -void* ZeldaArena_Realloc(void* ptr, u32 newSize) -{ +void* ZeldaArena_Realloc(void* ptr, u32 newSize) { ptr = __osRealloc(&sZeldaArena, ptr, newSize); ZeldaArena_CheckPointer(ptr, newSize, "zelda_realloc", "再確保"); // Re-securing return ptr; } -void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) -{ +void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) { ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line); ZeldaArena_CheckPointer(ptr, newSize, "zelda_realloc_DEBUG", "再確保"); // Re-securing return ptr; } -void ZeldaArena_Free(void* ptr) -{ +void ZeldaArena_Free(void* ptr) { __osFree(&sZeldaArena, ptr); } -void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line) -{ +void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line) { __osFreeDebug(&sZeldaArena, ptr, file, line); } -void* ZeldaArena_Calloc(u32 num, u32 size) -{ +void* ZeldaArena_Calloc(u32 num, u32 size) { void* ret; u32 n; - - n = num*size; + + n = num * size; ret = __osMalloc(&sZeldaArena, n); - if (ret) + if (ret) { bzero(ret, n); + } ZeldaArena_CheckPointer(ret, n, "zelda_calloc", "確保"); return ret; } -void ZeldaArena_Display() -{ - //Zelda heap display +void ZeldaArena_Display() { + // Zelda heap display osSyncPrintf("ゼルダヒープ表示\n"); __osDisplayArena(&sZeldaArena); } -void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) -{ +void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) { ArenaImpl_GetSizes(&sZeldaArena, outMaxFree, outFree, outAlloc); } -void ZeldaArena_Check() -{ +void ZeldaArena_Check() { __osCheckArena(&sZeldaArena); } -void ZeldaArena_Init(void* start, u32 size) -{ +void ZeldaArena_Init(void* start, u32 size) { gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG; __osMallocInit(&sZeldaArena, start, size); } -void ZeldaArena_Cleanup() -{ +void ZeldaArena_Cleanup() { gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG; __osMallocCleanup(&sZeldaArena); } -u8 ZeldaArena_IsInitalized() -{ +u8 ZeldaArena_IsInitalized() { return __osMallocIsInitalized(&sZeldaArena); } diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index 7498ffe7fe..b740bba3cb 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -22,4 +22,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_map_exp/func_80082248.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_map_exp/func_8008226C.s") - diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index bd1187cf8b..2c93435917 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -2,8 +2,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x00 */ void* texture; /* 0x04 */ u32 imageFormat; /* 0x08 */ u32 imageSize; @@ -15,76 +14,69 @@ typedef struct /* 0x20 */ u32 dtdy; } MapMarkInfo; // size = 0x24 -typedef struct -{ +typedef struct { /* 0x00 */ void* loadedRamAddr; // original name: "allocp" - /* 0x04 */ u32 vromStart; - /* 0x08 */ u32 vromEnd; - /* 0x0C */ u32 vramStart; - /* 0x10 */ u32 vramEnd; - /* 0x14 */ u32 vramTable; + /* 0x04 */ u32 vromStart; + /* 0x08 */ u32 vromEnd; + /* 0x0C */ u32 vramStart; + /* 0x10 */ u32 vramEnd; + /* 0x14 */ u32 vramTable; } MapMarkDataOverlay; // size = 0x18 -static u32 sBaseImageSizes[] = { 0, 1, 2, 3 }; +static u32 sBaseImageSizes[] = { 0, 1, 2, 3 }; static u32 sLoadBlockImageSizes[] = { 2, 2, 2, 3 }; -static u32 sIncrImageSizes[] = { 3, 1, 0, 0 }; -static u32 sShiftImageSizes[] = { 2, 1, 0, 0 }; -static u32 sBytesImageSizes[] = { 0, 1, 2, 4 }; +static u32 sIncrImageSizes[] = { 3, 1, 0, 0 }; +static u32 sShiftImageSizes[] = { 2, 1, 0, 0 }; +static u32 sBytesImageSizes[] = { 0, 1, 2, 4 }; static u32 sLineBytesImageSizes[] = { 0, 1, 2, 2 }; -#define G_IM_SIZ_MARK sBaseImageSizes[markInfo->imageSize] -#define G_IM_SIZ_MARK_LOAD_BLOCK sLoadBlockImageSizes[markInfo->imageSize] -#define G_IM_SIZ_MARK_INCR sIncrImageSizes[markInfo->imageSize] -#define G_IM_SIZ_MARK_SHIFT sShiftImageSizes[markInfo->imageSize] -#define G_IM_SIZ_MARK_BYTES sBytesImageSizes[markInfo->imageSize] -#define G_IM_SIZ_MARK_LINE_BYTES sLineBytesImageSizes[markInfo->imageSize] +#define G_IM_SIZ_MARK sBaseImageSizes[markInfo->imageSize] +#define G_IM_SIZ_MARK_LOAD_BLOCK sLoadBlockImageSizes[markInfo->imageSize] +#define G_IM_SIZ_MARK_INCR sIncrImageSizes[markInfo->imageSize] +#define G_IM_SIZ_MARK_SHIFT sShiftImageSizes[markInfo->imageSize] +#define G_IM_SIZ_MARK_BYTES sBytesImageSizes[markInfo->imageSize] +#define G_IM_SIZ_MARK_LINE_BYTES sLineBytesImageSizes[markInfo->imageSize] -static MapMarkInfo sMapMarkInfoTable[] = -{ +static MapMarkInfo sMapMarkInfoTable[] = { { D_02002580, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 32, 32, 1024, 1024 }, // Chest Icon - { D_02002900, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1024, 1024 }, // Boss Skull Icon + { D_02002900, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1024, 1024 }, // Boss Skull Icon }; -static MapMarkDataOverlay sMapMarkDataOvl = -{ +static MapMarkDataOverlay sMapMarkDataOvl = { NULL, (u32)_ovl_map_mark_dataSegmentRomStart, (u32)_ovl_map_mark_dataSegmentRomEnd, (u32)_ovl_map_mark_dataSegmentStart, (u32)_ovl_map_mark_dataSegmentEnd, - (u32)gMapMarkDataTable + (u32)gMapMarkDataTable, }; static MapMarksData** sLoadedMarkDataTable; extern u8** D_8015FFD0; -void MapMark_Init(GlobalContext* globalCtx) -{ +void MapMark_Init(GlobalContext* globalCtx) { MapMarkDataOverlay* overlay = &sMapMarkDataOvl; u32 overlaySize = overlay->vramEnd - overlay->vramStart; overlay->loadedRamAddr = Game_Alloc(&globalCtx->state, overlaySize, "../z_map_mark.c", 235); LogUtils_CheckNullPointer("dlftbl->allocp", overlay->loadedRamAddr, "../z_map_mark.c", 236); - Overlay_Load(overlay->vromStart, overlay->vromEnd, - overlay->vramStart, overlay->vramEnd, - overlay->loadedRamAddr); + Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr); sLoadedMarkDataTable = gMapMarkDataTable; - sLoadedMarkDataTable = (void*)(s32)((overlay->vramTable != 0) ? - (void*)(overlay->vramTable - (s32)(overlay->vramStart - (s32)overlay->loadedRamAddr)) : - NULL); + sLoadedMarkDataTable = + (void*)(s32)((overlay->vramTable != 0) + ? (void*)(overlay->vramTable - (s32)(overlay->vramStart - (s32)overlay->loadedRamAddr)) + : NULL); } -void MapMark_ClearPointers(GlobalContext* globalCtx) -{ +void MapMark_ClearPointers(GlobalContext* globalCtx) { sMapMarkDataOvl.loadedRamAddr = NULL; sLoadedMarkDataTable = NULL; } -void MapMark_Draw(GlobalContext* globalCtx) -{ +void MapMark_Draw(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx; MapMarkData* mapMarkData; MapMarkPoint* markPoint; @@ -99,11 +91,10 @@ void MapMark_Draw(GlobalContext* globalCtx) dungeonId = gSaveContext.dungeon_index; interfaceCtx = &globalCtx->interfaceCtx; - if ((D_8015FFD0 != NULL) && (globalCtx->interfaceCtx.roomNum >= D_8015FFD0[7][dungeonId])) - { + if ((D_8015FFD0 != NULL) && (globalCtx->interfaceCtx.roomNum >= D_8015FFD0[7][dungeonId])) { // Translates to: "ROOM NUMBER EXCEEDED, YIKES %d/%d MapMarkDraw PROCESSING INTERRUPTED" - osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n", VT_RST, - globalCtx->interfaceCtx.roomNum, D_8015FFD0[7][dungeonId]); + osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n", + VT_RST, globalCtx->interfaceCtx.roomNum, D_8015FFD0[7][dungeonId]); return; } @@ -112,10 +103,10 @@ void MapMark_Draw(GlobalContext* globalCtx) gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_map_mark.c", 303); - while (1) - { - if (mapMarkData->markType == -1) + while (1) { + if (mapMarkData->markType == -1) { break; + } gDPPipeSync(gfxCtx->overlay.p++); gDPSetTextureLUT(gfxCtx->overlay.p++, G_TT_NONE); @@ -123,31 +114,20 @@ void MapMark_Draw(GlobalContext* globalCtx) gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, interfaceCtx->minimapAlpha); markPoint = &mapMarkData->points[0]; - for (i = 0; i < mapMarkData->count; i++) - { - if ((mapMarkData->markType != 0) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) - { + for (i = 0; i < mapMarkData->count; i++) { + if ((mapMarkData->markType != 0) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) { markInfo = &sMapMarkInfoTable[mapMarkData->markType]; gDPPipeSync(gfxCtx->overlay.p++); - gDPLoadTextureBlock(gfxCtx->overlay.p++, - markInfo->texture, - markInfo->imageFormat, - G_IM_SIZ_MARK, - markInfo->textureWidth, markInfo->textureHeight, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gfxCtx->overlay.p++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK, + markInfo->textureWidth, markInfo->textureHeight, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); rectLeft = (GREG(94) + markPoint->x + 204) << 2; rectTop = (GREG(95) + markPoint->y + 140) << 2; - gSPTextureRectangle(gfxCtx->overlay.p++, - rectLeft, rectTop, - markInfo->rectWidth + rectLeft, rectTop + markInfo->rectHeight, - G_TX_RENDERTILE, - 0, 0, - markInfo->dsdx, markInfo->dtdy); + gSPTextureRectangle(gfxCtx->overlay.p++, rectLeft, rectTop, markInfo->rectWidth + rectLeft, + rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx, + markInfo->dtdy); } markPoint++; } @@ -157,10 +137,8 @@ void MapMark_Draw(GlobalContext* globalCtx) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_map_mark.c", 339); } -void MapMark_DrawConditionally(GlobalContext* globalCtx) -{ - switch (globalCtx->sceneNum) - { +void MapMark_DrawConditionally(GlobalContext* globalCtx) { + switch (globalCtx->sceneNum) { case SCENE_YDAN: case SCENE_DDAN: case SCENE_BDAN: diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index cb490341f7..970f8bc243 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -82,4 +82,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_80110460.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_801104C8.s") - diff --git a/src/code/z_moji.c b/src/code/z_moji.c index 754e8a1b64..05a7a282c8 100644 --- a/src/code/z_moji.c +++ b/src/code/z_moji.c @@ -11,107 +11,96 @@ s32 D_80120124 = 0; UNK_TYPE D_8015FFC0; UNK_TYPE D_8015FFC4; -void func_8007B910(u32 red, u32 green, u32 blue, u32 alpha) -{ +void func_8007B910(u32 red, u32 green, u32 blue, u32 alpha) { sFontColorRed = red; sFontColorGreen = green; sFontColorBlue = blue; sFontColorAlpha = alpha; } -void func_8007B934(s32 arg0, s32 arg1) -{ - if (arg0 > 39) +void func_8007B934(s32 arg0, s32 arg1) { + if (arg0 > 39) { D_80120120 = 39 * 8; - else if (arg0 < 0) + } else if (arg0 < 0) { D_80120120 = 0; - else + } else { D_80120120 = arg0 * 8; + } - if (arg1 > 29) + if (arg1 > 29) { D_80120124 = 29 * 8; - else if (arg1 < 0) + } else if (arg1 < 0) { D_80120124 = 0; - else + } else { D_80120124 = arg1 * 8; + } } -void func_8007B9A4(GraphicsContext* gfxCtx, u8 arg1) -{ +void func_8007B9A4(GraphicsContext* gfxCtx, u8 arg1) { Gfx* gfxArr[7]; func_800C6AC4(gfxArr, gfxCtx, "../z_moji.c", 86); - if ((u32)gLetterTLUT & 0xF) + if ((u32)gLetterTLUT & 0xF) { osSyncPrintf("moji_tlut --> %X\n", gLetterTLUT); + } - if (D_8015FFC0 != (arg1 & 3)) - { + if (D_8015FFC0 != (arg1 & 3)) { gDPLoadTLUT(gfxCtx->polyOpa.p++, 16, 256, &gLetterTLUT[arg1 & 3]); D_8015FFC0 = arg1 & 3; } - gSPTextureRectangle(gfxCtx->polyOpa.p++, - D_80120120 << 2, D_80120124 << 2, - (D_80120120 + 8) << 2, (D_80120124 + 8) << 2, - G_TX_RENDERTILE, - (u16)(arg1 & 4) * 64, (u16)(arg1 >> 3) * 256, - 1024, 1024); + gSPTextureRectangle(gfxCtx->polyOpa.p++, D_80120120 << 2, D_80120124 << 2, (D_80120120 + 8) << 2, + (D_80120124 + 8) << 2, G_TX_RENDERTILE, (u16)(arg1 & 4) * 64, (u16)(arg1 >> 3) * 256, 1024, + 1024); func_800C6B54(gfxArr, gfxCtx, "../z_moji.c", 123); } -void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1) -{ +void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1) { s32 i; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, gfxCtx, "../z_moji.c", 137); - if ((u32)gFontFF & 0xF) + if ((u32)gFontFF & 0xF) { osSyncPrintf("font_ff --> %X\n", gFontFF); + } gDPPipeSync(gfxCtx->polyOpa.p++); - gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, - sFontColorRed, sFontColorGreen, - sFontColorBlue, sFontColorAlpha); + gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, sFontColorRed, sFontColorGreen, sFontColorBlue, sFontColorAlpha); gDPSetTextureImage(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_16b, 1, (s32)gFontFF); - gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_16b, - 0, 0, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); gDPLoadSync(gfxCtx->polyOpa.p++); gDPLoadBlock(gfxCtx->polyOpa.p++, G_TX_LOADTILE, 0, 0, 511, 2048); gDPPipeSync(gfxCtx->polyOpa.p++); - gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_4b, - 1, 0, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); gDPSetTileSize(gfxCtx->polyOpa.p++, G_TX_RENDERTILE, 0, 0, 60, 508); D_8015FFC0 = -1; - for (i = 0; arg1[i] != 0; i++) - { - switch (arg1[i]) - { + for (i = 0; arg1[i] != 0; i++) { + switch (arg1[i]) { case 9: D_80120120 = (((D_80120120 / 8) / 8) + 1) * 8 * 8; - if (D_80120120 >= 320) - { + if (D_80120120 >= 320) { D_80120120 = 0; D_80120124 += 8; - if (D_80120124 >= 240) + if (D_80120124 >= 240) { D_80120124 = 0; + } } break; case 10: case 13: D_80120120 = 0; D_80120124 += 8; - if (D_80120124 >= 240) + if (D_80120124 >= 240) { D_80120124 = 0; + } break; default: func_8007B9A4(gfxCtx, arg1[i]); diff --git a/src/code/z_msgevent.c b/src/code/z_msgevent.c index 3282d0342f..8995189f7f 100644 --- a/src/code/z_msgevent.c +++ b/src/code/z_msgevent.c @@ -2,8 +2,7 @@ #include #include -void MsgEvent_SendNullTask() -{ +void MsgEvent_SendNullTask() { u32 pad[4]; OSScTask task; OSMesgQueue queue; diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index 639d878691..faf7ca6b7d 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -1,8 +1,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x00 */ u32 unk_00; /* 0x04 */ u32 unk_04; /* 0x08 */ s16 unk_08; @@ -13,29 +12,26 @@ typedef struct #pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_8007C704.s") -void func_8007C76C(f32* pfParm1, s16 *puParm2) -{ - puParm2[0] = pfParm1[0]; - puParm2[1] = pfParm1[1]; - puParm2[2] = pfParm1[2]; +void func_8007C76C(f32* pfParm1, s16* puParm2) { + puParm2[0] = pfParm1[0]; + puParm2[1] = pfParm1[1]; + puParm2[2] = pfParm1[2]; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_8007C7A8.s") -void func_8007C7F8(u32 uParm1, u32 uParm2) -{ - u8 auStack4[4]; - u8 auStack8[4]; - - func_8003C940(uParm1, auStack4, auStack8, uParm2); +void func_8007C7F8(u32 uParm1, u32 uParm2) { + u8 auStack4[4]; + u8 auStack8[4]; + + func_8003C940(uParm1, auStack4, auStack8, uParm2); } -void func_8007C820(struct_8007C820* puParm1, s16 uParm2, s16 uParm3, u32 uParm4, u32 param_5) -{ - puParm1->unk_00 = uParm4; - puParm1->unk_04 = param_5; - puParm1->unk_08 = uParm2; - puParm1->unk_0A = uParm3; +void func_8007C820(struct_8007C820* puParm1, s16 uParm2, s16 uParm3, u32 uParm4, u32 param_5) { + puParm1->unk_00 = uParm4; + puParm1->unk_04 = param_5; + puParm1->unk_08 = uParm2; + puParm1->unk_0A = uParm3; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_8007C850.s") @@ -52,18 +48,15 @@ void func_8007C820(struct_8007C820* puParm1, s16 uParm2, s16 uParm3, u32 uParm4, #pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_800806BC.s") -void func_8008070C() -{ +void func_8008070C() { D_80120130 = 0; } -void func_80080718() -{ +void func_80080718() { D_80120130 = 1; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_80080728.s") -void func_80080788(UNK_TYPE arg0, UNK_TYPE arg1) -{ +void func_80080788(UNK_TYPE arg0, UNK_TYPE arg1) { } diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 5b9a3abf9f..91c70d6095 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2,117 +2,115 @@ #include #include -typedef struct -{ +typedef struct { /* 0x00 */ u8 scene; /* 0x01 */ u8 flags1; /* 0x02 */ u8 flags2; /* 0x03 */ u8 flags3; } RestrictionFlags; -RestrictionFlags sRestrictionFlags[] = -{ - { SCENE_SPOT00, 0x00, 0x00, 0x10 }, - { SCENE_SPOT01, 0x00, 0x00, 0x10 }, - { SCENE_SPOT02, 0x00, 0x00, 0x10 }, - { SCENE_SPOT03, 0x00, 0x00, 0x10 }, - { SCENE_SPOT04, 0x00, 0x00, 0x10 }, - { SCENE_SPOT05, 0x00, 0x00, 0x10 }, - { SCENE_SPOT06, 0x00, 0x00, 0x10 }, - { SCENE_SPOT07, 0x00, 0x00, 0x10 }, - { SCENE_SPOT08, 0x00, 0x00, 0x10 }, - { SCENE_SPOT09, 0x00, 0x00, 0x10 }, - { SCENE_SPOT10, 0x00, 0x00, 0x10 }, - { SCENE_SPOT11, 0x00, 0x00, 0x10 }, - { SCENE_SPOT12, 0x00, 0x00, 0x10 }, - { SCENE_SPOT13, 0x00, 0x00, 0x10 }, - { SCENE_SPOT15, 0x00, 0x00, 0x10 }, - { SCENE_GANON_TOU, 0x00, 0x00, 0x10 }, - { SCENE_SPOT16, 0x00, 0x00, 0x10 }, - { SCENE_SPOT17, 0x00, 0x00, 0x10 }, - { SCENE_SPOT18, 0x00, 0x00, 0x10 }, - { SCENE_SPOT20, 0x00, 0x00, 0x10 }, - { SCENE_TOKINOMA, 0x00, 0x10, 0x15 }, - { SCENE_KENJYANOMA, 0xA2, 0xAA, 0xAA }, - { SCENE_SYATEKIJYOU, 0x11, 0x55, 0x55 }, - { SCENE_HAIRAL_NIWA, 0x11, 0x55, 0x55 }, - { SCENE_HAIRAL_NIWA_N, 0x11, 0x55, 0x55 }, - { SCENE_HAKAANA, 0x00, 0x00, 0xD0 }, - { SCENE_HAKAANA2, 0x00, 0x00, 0xD0 }, - { SCENE_HAKAANA_OUKE, 0x00, 0x00, 0xD0 }, - { SCENE_DAIYOUSEI_IZUMI, 0x00, 0x00, 0x10 }, - { SCENE_YOUSEI_IZUMI_TATE, 0x00, 0x00, 0xD0 }, - { SCENE_YOUSEI_IZUMI_YOKO, 0x00, 0x00, 0x10 }, - { SCENE_GANON_FINAL, 0x00, 0x05, 0x50 }, - { SCENE_NAKANIWA, 0x00, 0x05, 0x54 }, - { SCENE_TURIBORI, 0x11, 0x55, 0x55 }, - { SCENE_BOWLING, 0x11, 0x55, 0x55 }, - { SCENE_SOUKO, 0x00, 0x10, 0x15 }, - { SCENE_MIHARIGOYA, 0x00, 0x10, 0x14 }, - { SCENE_MAHOUYA, 0x10, 0x15, 0x55 }, - { SCENE_TAKARAYA, 0x10, 0x15, 0x55 }, - { SCENE_KINSUTA, 0x00, 0x10, 0x15 }, - { SCENE_ENTRA, 0x00, 0x10, 0x15 }, - { SCENE_ENTRA_N, 0x00, 0x10, 0x15 }, - { SCENE_ENRUI, 0x00, 0x10, 0xD5 }, - { SCENE_MARKET_DAY, 0x00, 0x10, 0x15 }, - { SCENE_MARKET_NIGHT, 0x00, 0x10, 0x15 }, - { SCENE_MARKET_RUINS, 0x00, 0x10, 0xD5 }, - { SCENE_MARKET_ALLEY, 0x00, 0x10, 0x15 }, - { SCENE_MARKET_ALLEY_N, 0x00, 0x10, 0x15 }, - { SCENE_SHRINE, 0x00, 0x10, 0x15 }, - { SCENE_SHRINE_N, 0x00, 0x10, 0x15 }, - { SCENE_SHRINE_R, 0x00, 0x10, 0xD5 }, - { SCENE_LINK_HOME, 0x10, 0x10, 0x15 }, - { SCENE_KAKARIKO, 0x10, 0x10, 0x15 }, - { SCENE_KAKARIKO3, 0x10, 0x10, 0x15 }, - { SCENE_KOKIRI_HOME, 0x10, 0x10, 0x15 }, - { SCENE_KOKIRI_HOME3, 0x10, 0x10, 0x15 }, - { SCENE_KOKIRI_HOME4, 0x10, 0x10, 0x15 }, - { SCENE_KOKIRI_HOME5, 0x10, 0x10, 0x15 }, - { SCENE_MALON_STABLE, 0x10, 0x10, 0x15 }, - { SCENE_HUT, 0x10, 0x10, 0x15 }, - { SCENE_IMPA, 0x10, 0x10, 0x15 }, - { SCENE_LABO, 0x10, 0x10, 0x15 }, - { SCENE_HYLIA_LABO, 0x00, 0x10, 0x15 }, - { SCENE_TENT, 0x10, 0x10, 0x15 }, - { SCENE_SHOP1, 0x10, 0x10, 0x15 }, - { SCENE_KOKIRI_SHOP, 0x10, 0x10, 0x15 }, - { SCENE_GOLON, 0x10, 0x10, 0x15 }, - { SCENE_ZOORA, 0x10, 0x10, 0x15 }, - { SCENE_DRAG, 0x10, 0x10, 0x15 }, - { SCENE_ALLEY_SHOP, 0x10, 0x10, 0x15 }, - { SCENE_NIGHT_SHOP, 0x10, 0x10, 0x15 }, - { SCENE_FACE_SHOP, 0x10, 0x10, 0x15 }, - { SCENE_MEN, 0x00, 0x03, 0x10 }, - { SCENE_YDAN, 0x00, 0x00, 0x00 }, - { SCENE_YDAN_BOSS, 0x00, 0x45, 0x50 }, - { SCENE_DDAN, 0x00, 0x00, 0x00 }, - { SCENE_DDAN_BOSS, 0x00, 0x45, 0x50 }, - { SCENE_BDAN, 0x00, 0x00, 0x00 }, - { SCENE_BDAN_BOSS, 0x00, 0x45, 0x50 }, - { SCENE_BMORI1, 0x00, 0x00, 0x00 }, - { SCENE_MORIBOSSROOM, 0x00, 0x45, 0x50 }, - { SCENE_HAKADANCH, 0x00, 0x00, 0x00 }, - { SCENE_HAKADAN, 0x00, 0x00, 0x00 }, - { SCENE_HAKADAN_BS, 0x00, 0x45, 0x50 }, - { SCENE_HIDAN, 0x00, 0x00, 0x00 }, - { SCENE_FIRE_BS, 0x00, 0x45, 0x50 }, - { SCENE_MIZUSIN, 0x00, 0x00, 0x00 }, - { SCENE_MIZUSIN_BS, 0x00, 0x45, 0x50 }, - { SCENE_JYASINZOU, 0x00, 0x00, 0x00 }, - { SCENE_JYASINBOSS, 0x00, 0x45, 0x50 }, - { SCENE_GANON, 0x00, 0x00, 0x00 }, - { SCENE_GANON_BOSS, 0x00, 0x45, 0x50 }, - { SCENE_ICE_DOUKUTO, 0x00, 0x00, 0xC0 }, - { SCENE_HAKASITARELAY, 0x00, 0x03, 0x14 }, - { SCENE_GANONTIKA, 0x00, 0x03, 0x10 }, - { SCENE_GANON_DEMO, 0x00, 0x45, 0x50 }, - { SCENE_GANON_SONOGO, 0x00, 0x05, 0x50 }, - { SCENE_GANONTIKA_SONOGO, 0x00, 0x05, 0x50 }, - { SCENE_GERUDOWAY, 0x00, 0x00, 0x10 }, - { SCENE_KAKUSIANA, 0x00, 0x00, 0xD0 }, - { 0xFF, 0x00, 0x00, 0x00 }, +RestrictionFlags sRestrictionFlags[] = { + { SCENE_SPOT00, 0x00, 0x00, 0x10 }, + { SCENE_SPOT01, 0x00, 0x00, 0x10 }, + { SCENE_SPOT02, 0x00, 0x00, 0x10 }, + { SCENE_SPOT03, 0x00, 0x00, 0x10 }, + { SCENE_SPOT04, 0x00, 0x00, 0x10 }, + { SCENE_SPOT05, 0x00, 0x00, 0x10 }, + { SCENE_SPOT06, 0x00, 0x00, 0x10 }, + { SCENE_SPOT07, 0x00, 0x00, 0x10 }, + { SCENE_SPOT08, 0x00, 0x00, 0x10 }, + { SCENE_SPOT09, 0x00, 0x00, 0x10 }, + { SCENE_SPOT10, 0x00, 0x00, 0x10 }, + { SCENE_SPOT11, 0x00, 0x00, 0x10 }, + { SCENE_SPOT12, 0x00, 0x00, 0x10 }, + { SCENE_SPOT13, 0x00, 0x00, 0x10 }, + { SCENE_SPOT15, 0x00, 0x00, 0x10 }, + { SCENE_GANON_TOU, 0x00, 0x00, 0x10 }, + { SCENE_SPOT16, 0x00, 0x00, 0x10 }, + { SCENE_SPOT17, 0x00, 0x00, 0x10 }, + { SCENE_SPOT18, 0x00, 0x00, 0x10 }, + { SCENE_SPOT20, 0x00, 0x00, 0x10 }, + { SCENE_TOKINOMA, 0x00, 0x10, 0x15 }, + { SCENE_KENJYANOMA, 0xA2, 0xAA, 0xAA }, + { SCENE_SYATEKIJYOU, 0x11, 0x55, 0x55 }, + { SCENE_HAIRAL_NIWA, 0x11, 0x55, 0x55 }, + { SCENE_HAIRAL_NIWA_N, 0x11, 0x55, 0x55 }, + { SCENE_HAKAANA, 0x00, 0x00, 0xD0 }, + { SCENE_HAKAANA2, 0x00, 0x00, 0xD0 }, + { SCENE_HAKAANA_OUKE, 0x00, 0x00, 0xD0 }, + { SCENE_DAIYOUSEI_IZUMI, 0x00, 0x00, 0x10 }, + { SCENE_YOUSEI_IZUMI_TATE, 0x00, 0x00, 0xD0 }, + { SCENE_YOUSEI_IZUMI_YOKO, 0x00, 0x00, 0x10 }, + { SCENE_GANON_FINAL, 0x00, 0x05, 0x50 }, + { SCENE_NAKANIWA, 0x00, 0x05, 0x54 }, + { SCENE_TURIBORI, 0x11, 0x55, 0x55 }, + { SCENE_BOWLING, 0x11, 0x55, 0x55 }, + { SCENE_SOUKO, 0x00, 0x10, 0x15 }, + { SCENE_MIHARIGOYA, 0x00, 0x10, 0x14 }, + { SCENE_MAHOUYA, 0x10, 0x15, 0x55 }, + { SCENE_TAKARAYA, 0x10, 0x15, 0x55 }, + { SCENE_KINSUTA, 0x00, 0x10, 0x15 }, + { SCENE_ENTRA, 0x00, 0x10, 0x15 }, + { SCENE_ENTRA_N, 0x00, 0x10, 0x15 }, + { SCENE_ENRUI, 0x00, 0x10, 0xD5 }, + { SCENE_MARKET_DAY, 0x00, 0x10, 0x15 }, + { SCENE_MARKET_NIGHT, 0x00, 0x10, 0x15 }, + { SCENE_MARKET_RUINS, 0x00, 0x10, 0xD5 }, + { SCENE_MARKET_ALLEY, 0x00, 0x10, 0x15 }, + { SCENE_MARKET_ALLEY_N, 0x00, 0x10, 0x15 }, + { SCENE_SHRINE, 0x00, 0x10, 0x15 }, + { SCENE_SHRINE_N, 0x00, 0x10, 0x15 }, + { SCENE_SHRINE_R, 0x00, 0x10, 0xD5 }, + { SCENE_LINK_HOME, 0x10, 0x10, 0x15 }, + { SCENE_KAKARIKO, 0x10, 0x10, 0x15 }, + { SCENE_KAKARIKO3, 0x10, 0x10, 0x15 }, + { SCENE_KOKIRI_HOME, 0x10, 0x10, 0x15 }, + { SCENE_KOKIRI_HOME3, 0x10, 0x10, 0x15 }, + { SCENE_KOKIRI_HOME4, 0x10, 0x10, 0x15 }, + { SCENE_KOKIRI_HOME5, 0x10, 0x10, 0x15 }, + { SCENE_MALON_STABLE, 0x10, 0x10, 0x15 }, + { SCENE_HUT, 0x10, 0x10, 0x15 }, + { SCENE_IMPA, 0x10, 0x10, 0x15 }, + { SCENE_LABO, 0x10, 0x10, 0x15 }, + { SCENE_HYLIA_LABO, 0x00, 0x10, 0x15 }, + { SCENE_TENT, 0x10, 0x10, 0x15 }, + { SCENE_SHOP1, 0x10, 0x10, 0x15 }, + { SCENE_KOKIRI_SHOP, 0x10, 0x10, 0x15 }, + { SCENE_GOLON, 0x10, 0x10, 0x15 }, + { SCENE_ZOORA, 0x10, 0x10, 0x15 }, + { SCENE_DRAG, 0x10, 0x10, 0x15 }, + { SCENE_ALLEY_SHOP, 0x10, 0x10, 0x15 }, + { SCENE_NIGHT_SHOP, 0x10, 0x10, 0x15 }, + { SCENE_FACE_SHOP, 0x10, 0x10, 0x15 }, + { SCENE_MEN, 0x00, 0x03, 0x10 }, + { SCENE_YDAN, 0x00, 0x00, 0x00 }, + { SCENE_YDAN_BOSS, 0x00, 0x45, 0x50 }, + { SCENE_DDAN, 0x00, 0x00, 0x00 }, + { SCENE_DDAN_BOSS, 0x00, 0x45, 0x50 }, + { SCENE_BDAN, 0x00, 0x00, 0x00 }, + { SCENE_BDAN_BOSS, 0x00, 0x45, 0x50 }, + { SCENE_BMORI1, 0x00, 0x00, 0x00 }, + { SCENE_MORIBOSSROOM, 0x00, 0x45, 0x50 }, + { SCENE_HAKADANCH, 0x00, 0x00, 0x00 }, + { SCENE_HAKADAN, 0x00, 0x00, 0x00 }, + { SCENE_HAKADAN_BS, 0x00, 0x45, 0x50 }, + { SCENE_HIDAN, 0x00, 0x00, 0x00 }, + { SCENE_FIRE_BS, 0x00, 0x45, 0x50 }, + { SCENE_MIZUSIN, 0x00, 0x00, 0x00 }, + { SCENE_MIZUSIN_BS, 0x00, 0x45, 0x50 }, + { SCENE_JYASINZOU, 0x00, 0x00, 0x00 }, + { SCENE_JYASINBOSS, 0x00, 0x45, 0x50 }, + { SCENE_GANON, 0x00, 0x00, 0x00 }, + { SCENE_GANON_BOSS, 0x00, 0x45, 0x50 }, + { SCENE_ICE_DOUKUTO, 0x00, 0x00, 0xC0 }, + { SCENE_HAKASITARELAY, 0x00, 0x03, 0x14 }, + { SCENE_GANONTIKA, 0x00, 0x03, 0x10 }, + { SCENE_GANON_DEMO, 0x00, 0x45, 0x50 }, + { SCENE_GANON_SONOGO, 0x00, 0x05, 0x50 }, + { SCENE_GANONTIKA_SONOGO, 0x00, 0x05, 0x50 }, + { SCENE_GERUDOWAY, 0x00, 0x00, 0x10 }, + { SCENE_KAKUSIANA, 0x00, 0x00, 0xD0 }, + { 0xFF, 0x00, 0x00, 0x00 }, }; s16 sHBAScoreTier = 0; @@ -128,249 +126,264 @@ s16 sMagicBorderR = 0xFF; s16 sMagicBorderG = 0xFF; s16 sMagicBorderB = 0xFF; -s16 sExtraItemBases[] = -{ - ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT, ITEM_BOMB, ITEM_BOMB, - ITEM_BOMB, ITEM_BOMB, ITEM_BOW, ITEM_BOW, ITEM_BOW, ITEM_SEEDS, - ITEM_BOMBCHU, ITEM_BOMBCHU, ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT, +s16 sExtraItemBases[] = { + ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT, ITEM_BOMB, ITEM_BOMB, ITEM_BOMB, ITEM_BOMB, ITEM_BOW, + ITEM_BOW, ITEM_BOW, ITEM_SEEDS, ITEM_BOMBCHU, ITEM_BOMBCHU, ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT, }; s16 D_80125A58 = 0; s16 D_80125A5C = 0; -Gfx sSetupDL_80125A60[] = -{ +Gfx sSetupDL_80125A60[] = { gsDPPipeSync(), - gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | - G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_SHADING_SMOOTH | G_LOD), - gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | - G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_1PRIMITIVE, + gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | + G_TEXTURE_GEN_LINEAR | G_SHADING_SMOOTH | G_LOD), + gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_1PRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2), gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE), gsSPEndDisplayList(), }; // original name: "alpha_change" -void Interface_ChangeAlpha(u16 alphaType) -{ - if (alphaType != gSaveContext.unk_13EA) - { +void Interface_ChangeAlpha(u16 alphaType) { + if (alphaType != gSaveContext.unk_13EA) { osSyncPrintf("ALPHAーTYPE=%d LAST_TIME_TYPE=%d\n", alphaType, gSaveContext.unk_13EE); gSaveContext.unk_13EA = gSaveContext.unk_13E8 = alphaType; gSaveContext.unk_13EC = 1; } } -void func_80082644(GlobalContext* globalCtx, s16 alpha) -{ +void func_80082644(GlobalContext* globalCtx, s16 alpha) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; - if (gSaveContext.button_status[0] == BTN_DISABLED) - { - if (interfaceCtx->bAlpha != 0x46) + if (gSaveContext.button_status[0] == BTN_DISABLED) { + if (interfaceCtx->bAlpha != 0x46) { interfaceCtx->bAlpha = 0x46; - } - else - { - if (interfaceCtx->bAlpha != 0xFF) + } + } else { + if (interfaceCtx->bAlpha != 0xFF) { interfaceCtx->bAlpha = alpha; + } } - if (gSaveContext.button_status[1] == BTN_DISABLED) - { - if (interfaceCtx->cLeftAlpha != 0x46) + if (gSaveContext.button_status[1] == BTN_DISABLED) { + if (interfaceCtx->cLeftAlpha != 0x46) { interfaceCtx->cLeftAlpha = 0x46; - } - else - { - if (interfaceCtx->cLeftAlpha != 0xFF) + } + } else { + if (interfaceCtx->cLeftAlpha != 0xFF) { interfaceCtx->cLeftAlpha = alpha; + } } - if (gSaveContext.button_status[2] == BTN_DISABLED) - { - if (interfaceCtx->cDownAlpha != 0x46) + if (gSaveContext.button_status[2] == BTN_DISABLED) { + if (interfaceCtx->cDownAlpha != 0x46) { interfaceCtx->cDownAlpha = 0x46; - } - else - { - if (interfaceCtx->cDownAlpha != 0xFF) + } + } else { + if (interfaceCtx->cDownAlpha != 0xFF) { interfaceCtx->cDownAlpha = alpha; + } } - if (gSaveContext.button_status[3] == BTN_DISABLED) - { - if (interfaceCtx->cRightAlpha != 0x46) + if (gSaveContext.button_status[3] == BTN_DISABLED) { + if (interfaceCtx->cRightAlpha != 0x46) { interfaceCtx->cRightAlpha = 0x46; - } - else - { - if (interfaceCtx->cRightAlpha != 0xFF) + } + } else { + if (interfaceCtx->cRightAlpha != 0xFF) { interfaceCtx->cRightAlpha = alpha; + } } - if (gSaveContext.button_status[4] == BTN_DISABLED) - { - if (interfaceCtx->aAlpha != 0x46) + if (gSaveContext.button_status[4] == BTN_DISABLED) { + if (interfaceCtx->aAlpha != 0x46) { interfaceCtx->aAlpha = 0x46; - } - else - { - if (interfaceCtx->aAlpha != 0xFF) + } + } else { + if (interfaceCtx->aAlpha != 0xFF) { interfaceCtx->aAlpha = alpha; + } } } -void func_8008277C(GlobalContext* globalCtx, s16 maxAlpha, s16 alpha) -{ +void func_8008277C(GlobalContext* globalCtx, s16 maxAlpha, s16 alpha) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; - if (gSaveContext.unk_13E7 != 0) - { + if (gSaveContext.unk_13E7 != 0) { func_80082644(globalCtx, alpha); return; } - if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) + if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) { interfaceCtx->bAlpha = maxAlpha; + } - if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) + if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) { interfaceCtx->aAlpha = maxAlpha; + } - if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) + if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) { interfaceCtx->cLeftAlpha = maxAlpha; + } - if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) + if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) { interfaceCtx->cDownAlpha = maxAlpha; + } - if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) + if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) { interfaceCtx->cRightAlpha = maxAlpha; + } } -void func_80082850(GlobalContext* globalCtx, s16 maxAlpha) -{ +void func_80082850(GlobalContext* globalCtx, s16 maxAlpha) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; s16 alpha; alpha = 0xFF - maxAlpha; - switch (gSaveContext.unk_13E8) - { + switch (gSaveContext.unk_13E8) { case 1: case 2: case 8: osSyncPrintf("a_alpha=%d, c_alpha=%d → ", interfaceCtx->aAlpha, interfaceCtx->cLeftAlpha); - if (gSaveContext.unk_13E8 == 8) - { - if (interfaceCtx->bAlpha != 0xFF) + if (gSaveContext.unk_13E8 == 8) { + if (interfaceCtx->bAlpha != 0xFF) { interfaceCtx->bAlpha = alpha; - } - else - { - if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) + } + } else { + if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) { interfaceCtx->bAlpha = maxAlpha; + } } - if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) + if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) { interfaceCtx->aAlpha = maxAlpha; + } - if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) + if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) { interfaceCtx->cLeftAlpha = maxAlpha; + } - if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) + if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) { interfaceCtx->cDownAlpha = maxAlpha; + } - if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) + if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) { interfaceCtx->cRightAlpha = maxAlpha; + } - if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) + if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) { interfaceCtx->healthAlpha = maxAlpha; + } - if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) + if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) { interfaceCtx->magicAlpha = maxAlpha; + } - if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) + if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) { interfaceCtx->minimapAlpha = maxAlpha; + } osSyncPrintf("a_alpha=%d, c_alpha=%d\n", interfaceCtx->aAlpha, interfaceCtx->cLeftAlpha); break; case 3: - if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) + if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) { interfaceCtx->aAlpha = maxAlpha; + } func_8008277C(globalCtx, maxAlpha, alpha); - if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) + if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) { interfaceCtx->magicAlpha = maxAlpha; + } - if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) + if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) { interfaceCtx->minimapAlpha = maxAlpha; + } - if (interfaceCtx->healthAlpha != 0xFF) + if (interfaceCtx->healthAlpha != 0xFF) { interfaceCtx->healthAlpha = alpha; + } break; case 4: - if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) + if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) { interfaceCtx->bAlpha = maxAlpha; + } - if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) + if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) { interfaceCtx->aAlpha = maxAlpha; + } - if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) + if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) { interfaceCtx->cLeftAlpha = maxAlpha; + } - if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) + if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) { interfaceCtx->cDownAlpha = maxAlpha; + } - if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) + if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) { interfaceCtx->cRightAlpha = maxAlpha; + } - if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) + if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) { interfaceCtx->healthAlpha = maxAlpha; + } - if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) + if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) { interfaceCtx->magicAlpha = maxAlpha; + } - if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) + if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) { interfaceCtx->minimapAlpha = maxAlpha; + } - if (interfaceCtx->aAlpha != 0xFF) + if (interfaceCtx->aAlpha != 0xFF) { interfaceCtx->aAlpha = alpha; + } break; case 5: func_8008277C(globalCtx, maxAlpha, alpha); - if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) + if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) { interfaceCtx->minimapAlpha = maxAlpha; + } - if (interfaceCtx->aAlpha != 0xFF) + if (interfaceCtx->aAlpha != 0xFF) { interfaceCtx->aAlpha = alpha; + } - if (interfaceCtx->healthAlpha != 0xFF) + if (interfaceCtx->healthAlpha != 0xFF) { interfaceCtx->healthAlpha = alpha; + } - if (interfaceCtx->magicAlpha != 0xFF) + if (interfaceCtx->magicAlpha != 0xFF) { interfaceCtx->magicAlpha = alpha; + } break; case 6: func_8008277C(globalCtx, maxAlpha, alpha); - if (interfaceCtx->aAlpha != 0xFF) + if (interfaceCtx->aAlpha != 0xFF) { interfaceCtx->aAlpha = alpha; + } - if (interfaceCtx->healthAlpha != 0xFF) + if (interfaceCtx->healthAlpha != 0xFF) { interfaceCtx->healthAlpha = alpha; + } - if (interfaceCtx->magicAlpha != 0xFF) + if (interfaceCtx->magicAlpha != 0xFF) { interfaceCtx->magicAlpha = alpha; + } - switch (globalCtx->sceneNum) - { + switch (globalCtx->sceneNum) { case SCENE_SPOT00: case SCENE_SPOT01: case SCENE_SPOT02: @@ -391,158 +404,199 @@ void func_80082850(GlobalContext* globalCtx, s16 maxAlpha) case SCENE_SPOT18: case SCENE_SPOT20: case SCENE_GANON_TOU: - if (interfaceCtx->minimapAlpha < 0xAA) + if (interfaceCtx->minimapAlpha < 0xAA) { interfaceCtx->minimapAlpha = alpha; - else + } else { interfaceCtx->minimapAlpha = 0xAA; + } break; default: - if (interfaceCtx->minimapAlpha != 0xFF) + if (interfaceCtx->minimapAlpha != 0xFF) { interfaceCtx->minimapAlpha = alpha; + } break; } break; case 7: - if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) + if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) { interfaceCtx->minimapAlpha = maxAlpha; + } func_80082644(globalCtx, alpha); - if (interfaceCtx->healthAlpha != 0xFF) + if (interfaceCtx->healthAlpha != 0xFF) { interfaceCtx->healthAlpha = alpha; + } - if (interfaceCtx->magicAlpha != 0xFF) + if (interfaceCtx->magicAlpha != 0xFF) { interfaceCtx->magicAlpha = alpha; + } break; case 9: - if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) + if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) { interfaceCtx->bAlpha = maxAlpha; + } - if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) + if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) { interfaceCtx->aAlpha = maxAlpha; + } - if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) + if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) { interfaceCtx->cLeftAlpha = maxAlpha; + } - if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) + if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) { interfaceCtx->cDownAlpha = maxAlpha; + } - if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) + if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) { interfaceCtx->cRightAlpha = maxAlpha; + } - if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) + if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) { interfaceCtx->minimapAlpha = maxAlpha; + } - if (interfaceCtx->healthAlpha != 0xFF) + if (interfaceCtx->healthAlpha != 0xFF) { interfaceCtx->healthAlpha = alpha; + } - if (interfaceCtx->magicAlpha != 0xFF) + if (interfaceCtx->magicAlpha != 0xFF) { interfaceCtx->magicAlpha = alpha; + } break; case 10: - if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) + if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) { interfaceCtx->aAlpha = maxAlpha; + } - if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) + if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) { interfaceCtx->cLeftAlpha = maxAlpha; + } - if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) + if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) { interfaceCtx->cDownAlpha = maxAlpha; + } - if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) + if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) { interfaceCtx->cRightAlpha = maxAlpha; + } - if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) + if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) { interfaceCtx->healthAlpha = maxAlpha; + } - if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) + if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) { interfaceCtx->magicAlpha = maxAlpha; + } - if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) + if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) { interfaceCtx->minimapAlpha = maxAlpha; + } - if (interfaceCtx->bAlpha != 0xFF) + if (interfaceCtx->bAlpha != 0xFF) { interfaceCtx->bAlpha = alpha; + } break; case 11: - if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) + if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) { interfaceCtx->bAlpha = maxAlpha; + } - if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) + if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) { interfaceCtx->aAlpha = maxAlpha; + } - if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) + if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) { interfaceCtx->cLeftAlpha = maxAlpha; + } - if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) + if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) { interfaceCtx->cDownAlpha = maxAlpha; + } - if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) + if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) { interfaceCtx->cRightAlpha = maxAlpha; + } - if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) + if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) { interfaceCtx->minimapAlpha = maxAlpha; + } - if ((interfaceCtx->magicAlpha!= 0) && (interfaceCtx->magicAlpha > maxAlpha)) + if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) { interfaceCtx->magicAlpha = maxAlpha; + } - if (interfaceCtx->healthAlpha != 0xFF) + if (interfaceCtx->healthAlpha != 0xFF) { interfaceCtx->healthAlpha = alpha; + } break; case 12: - if (interfaceCtx->aAlpha != 0xFF) + if (interfaceCtx->aAlpha != 0xFF) { interfaceCtx->aAlpha = alpha; + } - if (interfaceCtx->bAlpha != 0xFF) + if (interfaceCtx->bAlpha != 0xFF) { interfaceCtx->bAlpha = alpha; + } - if (interfaceCtx->minimapAlpha != 0xFF) + if (interfaceCtx->minimapAlpha != 0xFF) { interfaceCtx->minimapAlpha = alpha; + } - if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) + if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) { interfaceCtx->cLeftAlpha = maxAlpha; + } - if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) + if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) { interfaceCtx->cDownAlpha = maxAlpha; + } - if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) + if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) { interfaceCtx->cRightAlpha = maxAlpha; + } - if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) + if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) { interfaceCtx->magicAlpha = maxAlpha; + } - if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) + if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) { interfaceCtx->healthAlpha = maxAlpha; + } break; case 13: func_8008277C(globalCtx, maxAlpha, alpha); - if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) + if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) { interfaceCtx->minimapAlpha = maxAlpha; + } - if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) + if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) { interfaceCtx->aAlpha = maxAlpha; + } - if (interfaceCtx->healthAlpha != 0xFF) + if (interfaceCtx->healthAlpha != 0xFF) { interfaceCtx->healthAlpha = alpha; + } - if (interfaceCtx->magicAlpha != 0xFF) + if (interfaceCtx->magicAlpha != 0xFF) { interfaceCtx->magicAlpha = alpha; + } break; } - if ((globalCtx->roomCtx.curRoom.unk_03 == 1) && (interfaceCtx->minimapAlpha >= 0xFF)) + if ((globalCtx->roomCtx.curRoom.unk_03 == 1) && (interfaceCtx->minimapAlpha >= 0xFF)) { interfaceCtx->minimapAlpha = 0xFF; + } } -void func_80083108(GlobalContext* globalCtx) -{ +void func_80083108(GlobalContext* globalCtx) { MessageContext* msgCtx = &globalCtx->msgCtx; Player* player = PLAYER; InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; @@ -552,86 +606,72 @@ void func_80083108(GlobalContext* globalCtx) sp28 = 0; if ((gSaveContext.cutscene_index < 0xFFF0) || - ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.cutscene_index == 0xFFF0))) - { + ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.cutscene_index == 0xFFF0))) { gSaveContext.unk_13E7 = 0; if ((player->stateFlags1 & 0x00800000) || (globalCtx->unk_11E5C >= 2) || - ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) - { - if (gSaveContext.equips.button_items[0] != ITEM_NONE) - { + ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { + if (gSaveContext.equips.button_items[0] != ITEM_NONE) { gSaveContext.unk_13E7 = 1; - if (gSaveContext.button_status[0] == BTN_DISABLED) - { - gSaveContext.button_status[0] = gSaveContext.button_status[1] = - gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_ENABLED; + if (gSaveContext.button_status[0] == BTN_DISABLED) { + gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = + gSaveContext.button_status[3] = BTN_ENABLED; } if ((gSaveContext.equips.button_items[0] != ITEM_SLINGSHOT) && (gSaveContext.equips.button_items[0] != ITEM_BOW) && (gSaveContext.equips.button_items[0] != ITEM_BOMBCHU) && - (gSaveContext.equips.button_items[0] != ITEM_NONE)) - { + (gSaveContext.equips.button_items[0] != ITEM_NONE)) { gSaveContext.button_status[0] = gSaveContext.equips.button_items[0]; - if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) - { + if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) { gSaveContext.equips.button_items[0] = ITEM_BOMBCHU; Interface_LoadItemIcon1(globalCtx, 0); - } - else - { + } else { gSaveContext.equips.button_items[0] = ITEM_BOW; - if (globalCtx->unk_11E5C >= 2) - { - if (LINK_AGE_IN_YEARS == YEARS_CHILD) + if (globalCtx->unk_11E5C >= 2) { + if (LINK_AGE_IN_YEARS == YEARS_CHILD) { gSaveContext.equips.button_items[0] = ITEM_SLINGSHOT; + } Interface_LoadItemIcon1(globalCtx, 0); - } - else - { - if (gSaveContext.items[SLOT_BOW] == ITEM_NONE) + } else { + if (gSaveContext.items[SLOT_BOW] == ITEM_NONE) { gSaveContext.equips.button_items[0] = ITEM_NONE; - else + } else { Interface_LoadItemIcon1(globalCtx, 0); + } } } - gSaveContext.button_status[1] = gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_DISABLED; + gSaveContext.button_status[1] = gSaveContext.button_status[2] = gSaveContext.button_status[3] = + BTN_DISABLED; Interface_ChangeAlpha(6); } - if (globalCtx->unk_1241B != 0) + if (globalCtx->unk_1241B != 0) { Interface_ChangeAlpha(1); - else if (gSaveContext.minigame_state == 1) + } else if (gSaveContext.minigame_state == 1) { Interface_ChangeAlpha(8); - else if (globalCtx->unk_11E5C >= 2) + } else if (globalCtx->unk_11E5C >= 2) { Interface_ChangeAlpha(8); - else if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) + } else if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) { Interface_ChangeAlpha(8); - else if (player->stateFlags1 & 0x00800000) + } else if (player->stateFlags1 & 0x00800000) { Interface_ChangeAlpha(12); - } - else - { - if (player->stateFlags1 & 0x00800000) + } + } else { + if (player->stateFlags1 & 0x00800000) { Interface_ChangeAlpha(12); + } } - } - else if (globalCtx->sceneNum == SCENE_KENJYANOMA) - { + } else if (globalCtx->sceneNum == SCENE_KENJYANOMA) { Interface_ChangeAlpha(1); - } - else if (globalCtx->sceneNum == SCENE_TURIBORI) - { + } else if (globalCtx->sceneNum == SCENE_TURIBORI) { gSaveContext.unk_13E7 = 2; - if (globalCtx->interfaceCtx.unk_260 != 0) - { - if (gSaveContext.equips.button_items[0] != ITEM_FISHING_POLE) - { + if (globalCtx->interfaceCtx.unk_260 != 0) { + if (gSaveContext.equips.button_items[0] != ITEM_FISHING_POLE) { gSaveContext.button_status[0] = gSaveContext.equips.button_items[0]; gSaveContext.equips.button_items[0] = ITEM_FISHING_POLE; gSaveContext.unk_13EA = 0; @@ -639,78 +679,69 @@ void func_80083108(GlobalContext* globalCtx) Interface_ChangeAlpha(12); } - if (gSaveContext.unk_13EA != 12) + if (gSaveContext.unk_13EA != 12) { Interface_ChangeAlpha(12); - } - else if (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE) - { + } + } else if (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE) { gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; gSaveContext.unk_13EA = 0; - if (gSaveContext.equips.button_items[0] != ITEM_NONE) + if (gSaveContext.equips.button_items[0] != ITEM_NONE) { Interface_LoadItemIcon1(globalCtx, 0); + } - gSaveContext.button_status[0] = gSaveContext.button_status[1] = - gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_DISABLED; + gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = + gSaveContext.button_status[3] = BTN_DISABLED; Interface_ChangeAlpha(50); - } - else - { - if (gSaveContext.button_status[0] == BTN_ENABLED) + } else { + if (gSaveContext.button_status[0] == BTN_ENABLED) { gSaveContext.unk_13EA = 0; + } - gSaveContext.button_status[0] = gSaveContext.button_status[1] = - gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_DISABLED; + gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = + gSaveContext.button_status[3] = BTN_DISABLED; Interface_ChangeAlpha(50); } - } - else if (msgCtx->msgMode == 0) - { - if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) - { - if (gSaveContext.button_status[0] != BTN_DISABLED) + } else if (msgCtx->msgMode == 0) { + if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) { + if (gSaveContext.button_status[0] != BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[0] = BTN_DISABLED; - for (i = 1; i < 4; i++) - { - if (func_8008F2F8(globalCtx) == 2) - { + for (i = 1; i < 4; i++) { + if (func_8008F2F8(globalCtx) == 2) { if ((gSaveContext.equips.button_items[i] != ITEM_HOOKSHOT) && - (gSaveContext.equips.button_items[i] != ITEM_LONGSHOT)) - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + (gSaveContext.equips.button_items[i] != ITEM_LONGSHOT)) { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; - } - else - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + } else { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } - } - else - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + } else { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; } } - if (sp28) + if (sp28) { gSaveContext.unk_13EA = 0; + } Interface_ChangeAlpha(50); - } - else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & 0x00040000)) - { - if (gSaveContext.button_status[0] != BTN_DISABLED) - { + } else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & 0x00040000)) { + if (gSaveContext.button_status[0] != BTN_DISABLED) { gSaveContext.button_status[0] = BTN_DISABLED; gSaveContext.button_status[1] = BTN_DISABLED; gSaveContext.button_status[2] = BTN_DISABLED; @@ -718,341 +749,278 @@ void func_80083108(GlobalContext* globalCtx) gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); } - } - else if ((gSaveContext.event_inf[0] & 0xF) == 1) - { - if (player->stateFlags1 & 0x00800000) - { + } else if ((gSaveContext.event_inf[0] & 0xF) == 1) { + if (player->stateFlags1 & 0x00800000) { if ((gSaveContext.equips.button_items[0] != ITEM_NONE) && - (gSaveContext.equips.button_items[0] != ITEM_BOW)) - { - if (gSaveContext.items[SLOT_BOW] == ITEM_NONE) - { + (gSaveContext.equips.button_items[0] != ITEM_BOW)) { + if (gSaveContext.items[SLOT_BOW] == ITEM_NONE) { gSaveContext.equips.button_items[0] = ITEM_NONE; - } - else - { + } else { gSaveContext.equips.button_items[0] = ITEM_BOW; sp28 = 1; } } + } else { + do { + sp28 = 1; + + if ((gSaveContext.equips.button_items[0] == ITEM_NONE) || + (gSaveContext.equips.button_items[0] == ITEM_BOW)) { + + if ((gSaveContext.equips.button_items[0] != ITEM_SWORD_KOKIRI) && + (gSaveContext.equips.button_items[0] != ITEM_SWORD_MASTER) && + (gSaveContext.equips.button_items[0] != ITEM_SWORD_BGS) && + (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE)) { + gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; + } else { + gSaveContext.button_status[0] = gSaveContext.equips.button_items[0]; + } + } + } while (0); // Necessary to match } - else do - { - sp28 = 1; - if ((gSaveContext.equips.button_items[0] == ITEM_NONE) || - (gSaveContext.equips.button_items[0] == ITEM_BOW)) - { - - if ((gSaveContext.equips.button_items[0] != ITEM_SWORD_KOKIRI) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_MASTER) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_BGS) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE)) - { - gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; - } - else - { - gSaveContext.button_status[0] = gSaveContext.equips.button_items[0]; - } - } - } while (0); // Necessary to match - - if (sp28) - { + if (sp28) { Interface_LoadItemIcon1(globalCtx, 0); sp28 = 0; } - for (i = 1; i < 4; i++) - { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] != ITEM_OCARINA_FAIRY) && - (gSaveContext.equips.button_items[i] != ITEM_OCARINA_TIME)) - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + (gSaveContext.equips.button_items[i] != ITEM_OCARINA_TIME)) { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; - } - else - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + } else { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } } - if (sp28) + if (sp28) { gSaveContext.unk_13EA = 0; + } Interface_ChangeAlpha(50); - } - else - { - if (interfaceCtx->restrictions.bButton == 0) - { + } else { + if (interfaceCtx->restrictions.bButton == 0) { if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) || (gSaveContext.equips.button_items[0] == ITEM_BOW) || (gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.button_items[0] == ITEM_NONE)) - { - if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) - { + (gSaveContext.equips.button_items[0] == ITEM_NONE)) { + if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) { gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; sp28 = 1; - if (gSaveContext.equips.button_items[0] != ITEM_NONE) + if (gSaveContext.equips.button_items[0] != ITEM_NONE) { Interface_LoadItemIcon1(globalCtx, 0); + } } - } - else if ((gSaveContext.button_status[0] & 0xFF) == BTN_DISABLED) - { + } else if ((gSaveContext.button_status[0] & 0xFF) == BTN_DISABLED) { sp28 = 1; if (((gSaveContext.button_status[0] & 0xFF) == BTN_DISABLED) || - ((gSaveContext.button_status[0] & 0xFF) == BTN_ENABLED)) - { + ((gSaveContext.button_status[0] & 0xFF) == BTN_ENABLED)) { gSaveContext.button_status[0] = BTN_ENABLED; - } - else - { + } else { gSaveContext.equips.button_items[0] = gSaveContext.button_status[0] & 0xFF; } } - } - else if (interfaceCtx->restrictions.bButton == 1) - { + } else if (interfaceCtx->restrictions.bButton == 1) { if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) || (gSaveContext.equips.button_items[0] == ITEM_BOW) || (gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.button_items[0] == ITEM_NONE)) - { - if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) - { + (gSaveContext.equips.button_items[0] == ITEM_NONE)) { + if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) { gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; sp28 = 1; - if (gSaveContext.equips.button_items[0] != ITEM_NONE) + if (gSaveContext.equips.button_items[0] != ITEM_NONE) { Interface_LoadItemIcon1(globalCtx, 0); + } } - } - else - { - if (gSaveContext.button_status[0] == BTN_ENABLED) + } else { + if (gSaveContext.button_status[0] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[0] = BTN_DISABLED; } } - if (interfaceCtx->restrictions.bottles != 0) - { - for (i = 1; i < 4; i++) - { + if (interfaceCtx->restrictions.bottles != 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && - (gSaveContext.equips.button_items[i] <= ITEM_POE)) - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + (gSaveContext.equips.button_items[i] <= ITEM_POE)) { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; } } - } - else if (interfaceCtx->restrictions.bottles == 0) - { - for (i = 1; i < 4; i++) - { + } else if (interfaceCtx->restrictions.bottles == 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && - (gSaveContext.equips.button_items[i] <= ITEM_POE)) - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + (gSaveContext.equips.button_items[i] <= ITEM_POE)) { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } } } - if (interfaceCtx->restrictions.tradeItems != 0) - { - for (i = 1; i < 4; i++) - { + if (interfaceCtx->restrictions.tradeItems != 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)) - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)) { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; } } - } - else if (interfaceCtx->restrictions.tradeItems == 0) - { - for (i = 1; i < 4; i++) - { + } else if (interfaceCtx->restrictions.tradeItems == 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)) - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)) { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } } } - if (interfaceCtx->restrictions.hookshot != 0) - { - for (i = 1; i < 4; i++) - { + if (interfaceCtx->restrictions.hookshot != 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) || - (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT)) - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT)) { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; } } - } - else if (interfaceCtx->restrictions.hookshot == 0) - { - for (i = 1; i < 4; i++) - { + } else if (interfaceCtx->restrictions.hookshot == 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) || - (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT)) - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT)) { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } } } - if (interfaceCtx->restrictions.ocarina != 0) - { - for (i = 1; i < 4; i++) - { + if (interfaceCtx->restrictions.ocarina != 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) || - (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME)) - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME)) { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; } } - } - else if (interfaceCtx->restrictions.ocarina == 0) - { - for (i = 1; i < 4; i++) - { + } else if (interfaceCtx->restrictions.ocarina == 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) || - (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME)) - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME)) { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } } } - if (interfaceCtx->restrictions.farores != 0) - { - for (i = 1; i < 4; i++) - { - if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND) - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + if (interfaceCtx->restrictions.farores != 0) { + for (i = 1; i < 4; i++) { + if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND) { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; osSyncPrintf("***(i=%d)*** ", i); } } - } - else if (interfaceCtx->restrictions.farores == 0) - { - for (i = 1; i < 4; i++) - { - if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND) - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + } else if (interfaceCtx->restrictions.farores == 0) { + for (i = 1; i < 4; i++) { + if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND) { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } } } - if (interfaceCtx->restrictions.dinsNayrus != 0) - { - for (i = 1; i < 4; i++) - { + if (interfaceCtx->restrictions.dinsNayrus != 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] == ITEM_DINS_FIRE) || - (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE)) - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE)) { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; } } - } - else if (interfaceCtx->restrictions.dinsNayrus == 0) - { - for (i = 1; i < 4; i++) - { + } else if (interfaceCtx->restrictions.dinsNayrus == 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] == ITEM_DINS_FIRE) || - (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE)) - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE)) { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } } } - if (interfaceCtx->restrictions.all != 0) - { - for (i = 1; i < 4; i++) - { + if (interfaceCtx->restrictions.all != 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] != ITEM_OCARINA_FAIRY) && (gSaveContext.equips.button_items[i] != ITEM_OCARINA_TIME) && !((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && (gSaveContext.equips.button_items[i] <= ITEM_POE)) && !((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) - { + (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) { if ((globalCtx->sceneNum != SCENE_TAKARAYA) || - (gSaveContext.equips.button_items[i] != ITEM_LENS)) - { - if (gSaveContext.button_status[i] == BTN_ENABLED) + (gSaveContext.equips.button_items[i] != ITEM_LENS)) { + if (gSaveContext.button_status[i] == BTN_ENABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_DISABLED; - } - else - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + } else { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } } } - } - else if (interfaceCtx->restrictions.all == 0) - { - for (i = 1; i < 4; i++) - { + } else if (interfaceCtx->restrictions.all == 0) { + for (i = 1; i < 4; i++) { if ((gSaveContext.equips.button_items[i] != ITEM_DINS_FIRE) && (gSaveContext.equips.button_items[i] != ITEM_HOOKSHOT) && (gSaveContext.equips.button_items[i] != ITEM_LONGSHOT) && @@ -1063,10 +1031,10 @@ void func_80083108(GlobalContext* globalCtx) !((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && (gSaveContext.equips.button_items[i] <= ITEM_POE)) && !((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) - { - if (gSaveContext.button_status[i] == BTN_DISABLED) + (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) { + if (gSaveContext.button_status[i] == BTN_DISABLED) { sp28 = 1; + } gSaveContext.button_status[i] = BTN_ENABLED; } @@ -1076,44 +1044,39 @@ void func_80083108(GlobalContext* globalCtx) } } - if (sp28) - { + if (sp28) { gSaveContext.unk_13EA = 0; - if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_1241B == 0)) - { + if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_1241B == 0)) { Interface_ChangeAlpha(50); osSyncPrintf("???????? alpha_change( 50 ); ?????\n"); - } - else - { + } else { osSyncPrintf("game_play->fade_direction || game_play->fbdemo_wipe_modem"); } } } -void Interface_SetSceneRestrictions(GlobalContext* globalCtx) -{ +void Interface_SetSceneRestrictions(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; s16 i; u8 currentScene; + // clang-format off interfaceCtx->restrictions.hGauge = interfaceCtx->restrictions.bButton = interfaceCtx->restrictions.aButton = interfaceCtx->restrictions.bottles = - interfaceCtx->restrictions.tradeItems = interfaceCtx->restrictions.hookshot = + interfaceCtx->restrictions.tradeItems = interfaceCtx->restrictions.hookshot = interfaceCtx->restrictions.ocarina = interfaceCtx->restrictions.warpSongs = interfaceCtx->restrictions.sunsSong = interfaceCtx->restrictions.farores = interfaceCtx->restrictions.dinsNayrus = interfaceCtx->restrictions.all = 0; + // clang-format on i = 0; // Translates to: "Data settings related to button display scene_data_ID=%d\n" osSyncPrintf("ボタン表示関係データ設定 scene_data_ID=%d\n", globalCtx->sceneNum); - do - { + do { currentScene = (u8)globalCtx->sceneNum; - if (sRestrictionFlags[i].scene == currentScene) - { + if (sRestrictionFlags[i].scene == currentScene) { interfaceCtx->restrictions.hGauge = (sRestrictionFlags[i].flags1 & 0xC0) >> 6; interfaceCtx->restrictions.bButton = (sRestrictionFlags[i].flags1 & 0x30) >> 4; interfaceCtx->restrictions.aButton = (sRestrictionFlags[i].flags1 & 0x0C) >> 2; @@ -1128,104 +1091,74 @@ void Interface_SetSceneRestrictions(GlobalContext* globalCtx) interfaceCtx->restrictions.all = (sRestrictionFlags[i].flags3 & 0x03) >> 0; osSyncPrintf(VT_FGCOL(YELLOW)); - osSyncPrintf("parameter->button_status = %x,%x,%x\n", - sRestrictionFlags[i].flags1, sRestrictionFlags[i].flags2, sRestrictionFlags[i].flags3); - osSyncPrintf("h_gage=%d, b_button=%d, a_button=%d, c_bottle=%d\n", - interfaceCtx->restrictions.hGauge, interfaceCtx->restrictions.bButton, - interfaceCtx->restrictions.aButton, interfaceCtx->restrictions.bottles); - osSyncPrintf("c_warasibe=%d, c_hook=%d, c_ocarina=%d, c_warp=%d\n", - interfaceCtx->restrictions.tradeItems, interfaceCtx->restrictions.hookshot, - interfaceCtx->restrictions.ocarina, interfaceCtx->restrictions.warpSongs); - osSyncPrintf("c_sunmoon=%d, m_wind=%d, m_magic=%d, another=%d\n", - interfaceCtx->restrictions.sunsSong, interfaceCtx->restrictions.farores, - interfaceCtx->restrictions.dinsNayrus, interfaceCtx->restrictions.all); + osSyncPrintf("parameter->button_status = %x,%x,%x\n", sRestrictionFlags[i].flags1, + sRestrictionFlags[i].flags2, sRestrictionFlags[i].flags3); + osSyncPrintf("h_gage=%d, b_button=%d, a_button=%d, c_bottle=%d\n", interfaceCtx->restrictions.hGauge, + interfaceCtx->restrictions.bButton, interfaceCtx->restrictions.aButton, + interfaceCtx->restrictions.bottles); + osSyncPrintf("c_warasibe=%d, c_hook=%d, c_ocarina=%d, c_warp=%d\n", interfaceCtx->restrictions.tradeItems, + interfaceCtx->restrictions.hookshot, interfaceCtx->restrictions.ocarina, + interfaceCtx->restrictions.warpSongs); + osSyncPrintf("c_sunmoon=%d, m_wind=%d, m_magic=%d, another=%d\n", interfaceCtx->restrictions.sunsSong, + interfaceCtx->restrictions.farores, interfaceCtx->restrictions.dinsNayrus, + interfaceCtx->restrictions.all); osSyncPrintf(VT_RST); return; } i++; - } - while (sRestrictionFlags[i].scene != 0xFF); + } while (sRestrictionFlags[i].scene != 0xFF); } -Gfx* Draw_TextureIA8(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, - s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) -{ - gDPLoadTextureBlock(displayListHead++, - texture, - G_IM_FMT_IA, - G_IM_SIZ_8b, - textureWidth, textureHeight, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); +Gfx* Draw_TextureIA8(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, + s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) { + gDPLoadTextureBlock(displayListHead++, texture, G_IM_FMT_IA, G_IM_SIZ_8b, textureWidth, textureHeight, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); - gSPTextureRectangle(displayListHead++, - rectLeft * 4, rectTop * 4, - (rectLeft + rectWidth) * 4, (rectTop + rectHeight) * 4, - G_TX_RENDERTILE, - 0, 0, - dsdx, dtdy); + gSPTextureRectangle(displayListHead++, rectLeft * 4, rectTop * 4, (rectLeft + rectWidth) * 4, + (rectTop + rectHeight) * 4, G_TX_RENDERTILE, 0, 0, dsdx, dtdy); return displayListHead; } -Gfx* Draw_TextureI8(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, - s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) -{ - gDPLoadTextureBlock(displayListHead++, - texture, - G_IM_FMT_I, - G_IM_SIZ_8b, - textureWidth, textureHeight, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); +Gfx* Draw_TextureI8(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop, + s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) { + gDPLoadTextureBlock(displayListHead++, texture, G_IM_FMT_I, G_IM_SIZ_8b, textureWidth, textureHeight, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); - gSPTextureRectangle(displayListHead++, - rectLeft * 4, rectTop * 4, - (rectLeft + rectWidth) * 4, (rectTop + rectHeight) * 4, - G_TX_RENDERTILE, - 0, 0, - dsdx, dtdy); + gSPTextureRectangle(displayListHead++, rectLeft * 4, rectTop * 4, (rectLeft + rectWidth) * 4, + (rectTop + rectHeight) * 4, G_TX_RENDERTILE, 0, 0, dsdx, dtdy); return displayListHead; } #ifdef NON_MATCHING // regalloc differences -void Inventory_SwapAgeEquipment(void) -{ +void Inventory_SwapAgeEquipment(void) { s16 i; u16 temp; - if (LINK_AGE_IN_YEARS == YEARS_CHILD) - { - for (i = 0; i < 4; i++) - { + if (LINK_AGE_IN_YEARS == YEARS_CHILD) { + for (i = 0; i < 4; i++) { if (i != 0) gSaveContext.child_equips.button_items[i] = gSaveContext.equips.button_items[i]; else gSaveContext.child_equips.button_items[i] = ITEM_SWORD_KOKIRI; if (i != 0) - gSaveContext.child_equips.c_button_slots[i-1] = gSaveContext.equips.c_button_slots[i-1]; + gSaveContext.child_equips.c_button_slots[i - 1] = gSaveContext.equips.c_button_slots[i - 1]; } gSaveContext.child_equips.equipment = gSaveContext.equips.equipment; - if (gSaveContext.adult_equips.button_items[0] == ITEM_NONE) - { + if (gSaveContext.adult_equips.button_items[0] == ITEM_NONE) { gSaveContext.equips.button_items[0] = ITEM_SWORD_MASTER; - if (gSaveContext.items[SLOT_NUT] != ITEM_NONE) - { + if (gSaveContext.items[SLOT_NUT] != ITEM_NONE) { gSaveContext.equips.button_items[1] = ITEM_NUT; gSaveContext.equips.c_button_slots[0] = SLOT_NUT; - } - else - { + } else { gSaveContext.equips.c_button_slots[0] = SLOT_NONE; gSaveContext.equips.button_items[1] = ITEM_NONE; } @@ -1235,57 +1168,47 @@ void Inventory_SwapAgeEquipment(void) gSaveContext.equips.c_button_slots[2] = SLOT_OCARINA; gSaveContext.equips.equipment = 0x1122; gSaveContext.equips.button_items[3] = gSaveContext.items[SLOT_OCARINA]; - } - else - { - for (i = 0; i < 4; i++) - { + } else { + for (i = 0; i < 4; i++) { gSaveContext.equips.button_items[i] = gSaveContext.adult_equips.button_items[i]; if (i != 0) - gSaveContext.equips.c_button_slots[i-1] = gSaveContext.adult_equips.c_button_slots[i-1]; + gSaveContext.equips.c_button_slots[i - 1] = gSaveContext.adult_equips.c_button_slots[i - 1]; if (((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && (gSaveContext.equips.button_items[i] <= ITEM_POE)) || ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) - { - osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i-1]); - gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i-1]]; + (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) { + osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i - 1]); + gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i - 1]]; } } gSaveContext.equips.equipment = gSaveContext.adult_equips.equipment; } - } - else - { - for (i = 0; i < 4; i++) - { + } else { + for (i = 0; i < 4; i++) { gSaveContext.adult_equips.button_items[i] = gSaveContext.equips.button_items[i]; if (i != 0) - gSaveContext.adult_equips.c_button_slots[i-1] = gSaveContext.equips.c_button_slots[i-1]; + gSaveContext.adult_equips.c_button_slots[i - 1] = gSaveContext.equips.c_button_slots[i - 1]; } gSaveContext.adult_equips.equipment = gSaveContext.equips.equipment; - if (gSaveContext.child_equips.button_items[0] != ITEM_NONE) - { - for (i = 0; i < 4; i++) - { + if (gSaveContext.child_equips.button_items[0] != ITEM_NONE) { + for (i = 0; i < 4; i++) { gSaveContext.equips.button_items[i] = gSaveContext.child_equips.button_items[i]; if (i != 0) - gSaveContext.equips.c_button_slots[i-1] = gSaveContext.child_equips.c_button_slots[i-1]; + gSaveContext.equips.c_button_slots[i - 1] = gSaveContext.child_equips.c_button_slots[i - 1]; if (((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && (gSaveContext.equips.button_items[i] <= ITEM_POE)) || ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) - { - osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i-1]); - gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i-1]]; + (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) { + osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i - 1]); + gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i - 1]]; } } @@ -1296,8 +1219,7 @@ void Inventory_SwapAgeEquipment(void) } temp = gEquipMasks[EQUIP_SHIELD] & gSaveContext.equips.equipment; - if (temp != 0) - { + if (temp != 0) { temp >>= gEquipShifts[EQUIP_SHIELD]; if (!(gBitFlags[temp + 3] & gSaveContext.equipment)) gSaveContext.equips.equipment &= gEquipNegMasks[EQUIP_SHIELD]; @@ -1307,8 +1229,7 @@ void Inventory_SwapAgeEquipment(void) #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Inventory_SwapAgeEquipment.s") #endif -void Interface_InitHorsebackArchery(GlobalContext* globalCtx) -{ +void Interface_InitHorsebackArchery(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; gSaveContext.minigame_state = 1; @@ -1317,21 +1238,20 @@ void Interface_InitHorsebackArchery(GlobalContext* globalCtx) interfaceCtx->hbaAmmo = 20; } -void func_800849EC(GlobalContext* globalCtx) -{ +void func_800849EC(GlobalContext* globalCtx) { gSaveContext.equipment |= gBitFlags[2] << gEquipShifts[0]; gSaveContext.equipment ^= 8 << gEquipShifts[0]; - if (gBitFlags[3] & gSaveContext.equipment) + if (gBitFlags[3] & gSaveContext.equipment) { gSaveContext.equips.button_items[0] = ITEM_SWORD_KNIFE; - else + } else { gSaveContext.equips.button_items[0] = ITEM_SWORD_BGS; + } Interface_LoadItemIcon1(globalCtx, 0); } -void Interface_LoadItemIcon1(GlobalContext* globalCtx, u16 button) -{ +void Interface_LoadItemIcon1(GlobalContext* globalCtx, u16 button) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK); @@ -1341,8 +1261,7 @@ void Interface_LoadItemIcon1(GlobalContext* globalCtx, u16 button) osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); } -void Interface_LoadItemIcon2(GlobalContext* globalCtx, u16 button) -{ +void Interface_LoadItemIcon2(GlobalContext* globalCtx, u16 button) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK); @@ -1352,42 +1271,33 @@ void Interface_LoadItemIcon2(GlobalContext* globalCtx, u16 button) osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); } -void func_80084BF4(GlobalContext* globalCtx, u16 flag) -{ - if (flag) - { +void func_80084BF4(GlobalContext* globalCtx, u16 flag) { + if (flag) { if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) || (gSaveContext.equips.button_items[0] == ITEM_BOW) || (gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) || (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE) || - (gSaveContext.button_status[0] == BTN_DISABLED)) - { + (gSaveContext.button_status[0] == BTN_DISABLED)) { if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) || (gSaveContext.equips.button_items[0] == ITEM_BOW) || (gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE)) - { + (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE)) { gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; Interface_LoadItemIcon1(globalCtx, 0); } - } - else if (gSaveContext.equips.button_items[0] == ITEM_NONE) - { - if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) - { + } else if (gSaveContext.equips.button_items[0] == ITEM_NONE) { + if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) { gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; Interface_LoadItemIcon1(globalCtx, 0); } } - gSaveContext.button_status[0] = gSaveContext.button_status[1] = - gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_ENABLED; + gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = + gSaveContext.button_status[3] = BTN_ENABLED; Interface_ChangeAlpha(7); - } - else - { - gSaveContext.button_status[0] = gSaveContext.button_status[1] = - gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_ENABLED; + } else { + gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = + gSaveContext.button_status[3] = BTN_ENABLED; func_80083108(globalCtx); } } @@ -1396,8 +1306,7 @@ s16 sAmmoRefillCounts[] = { 5, 10, 20, 30, 5, 10, 30, 0, 5, 20, 1, 5, 20, 50, 20 #ifdef NON_MATCHING // regalloc, minor ordering and stack usage differences -u8 Item_Give(GlobalContext* globalCtx, u8 item) -{ +u8 Item_Give(GlobalContext* globalCtx, u8 item) { s16 i; s16 slot; s16 oldItem; @@ -1413,8 +1322,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) osSyncPrintf("item_get_setting=%d pt=%d z=%x\n", item, slot, gSaveContext.items[slot]); osSyncPrintf(VT_RST); - if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) - { + if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) { gSaveContext.quest_items |= gBitFlags[item - ITEM_MEDALLION_FOREST]; osSyncPrintf(VT_FGCOL(YELLOW)); @@ -1426,23 +1334,19 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) func_8006D0AC(globalCtx); return ITEM_NONE; - } - else if ((item >= ITEM_SONG_MINUET) && (item <= ITEM_SONG_STORMS)) - { + } else if ((item >= ITEM_SONG_MINUET) && (item <= ITEM_SONG_STORMS)) { gSaveContext.quest_items |= gBitFlags[item - ITEM_SONG_MINUET + 6]; osSyncPrintf(VT_FGCOL(YELLOW)); // Translates to: "Musical scores = %x" osSyncPrintf("楽譜 = %x\n", gSaveContext.quest_items); // Translates to: "Musical scores = %x (%x) (%x)" - osSyncPrintf("楽譜 = %x (%x) (%x)\n", gSaveContext.quest_items, - gBitFlags[item - ITEM_SONG_MINUET + 6], gBitFlags[item - ITEM_SONG_MINUET]); + osSyncPrintf("楽譜 = %x (%x) (%x)\n", gSaveContext.quest_items, gBitFlags[item - ITEM_SONG_MINUET + 6], + gBitFlags[item - ITEM_SONG_MINUET]); osSyncPrintf(VT_RST); return ITEM_NONE; - } - else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_ZORA_SAPPHIRE)) - { + } else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_ZORA_SAPPHIRE)) { gSaveContext.quest_items |= gBitFlags[item - ITEM_KOKIRI_EMERALD + 18]; osSyncPrintf(VT_FGCOL(YELLOW)); @@ -1451,9 +1355,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) osSyncPrintf(VT_RST); return ITEM_NONE; - } - else if ((item == ITEM_STONE_OF_AGONY) || (item == ITEM_GERUDO_CARD)) - { + } else if ((item == ITEM_STONE_OF_AGONY) || (item == ITEM_GERUDO_CARD)) { gSaveContext.quest_items |= gBitFlags[item - ITEM_STONE_OF_AGONY + 21]; osSyncPrintf(VT_FGCOL(YELLOW)); @@ -1462,9 +1364,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) osSyncPrintf(VT_RST); return ITEM_NONE; - } - else if (item == ITEM_SKULL_TOKEN) - { + } else if (item == ITEM_SKULL_TOKEN) { gSaveContext.quest_items |= gBitFlags[item - ITEM_SKULL_TOKEN + 23]; gSaveContext.gs_tokens++; @@ -1474,27 +1374,20 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) osSyncPrintf(VT_RST); return ITEM_NONE; - } - else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS)) - { + } else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS)) { gSaveContext.equipment |= gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD]; - if (item == ITEM_SWORD_BGS) - { + if (item == ITEM_SWORD_BGS) { gSaveContext.bgs_hits_left = 8; - if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) - { + if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) { gSaveContext.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; - if (gSaveContext.equips.button_items[0] == ITEM_SWORD_KNIFE) - { + if (gSaveContext.equips.button_items[0] == ITEM_SWORD_KNIFE) { gSaveContext.equips.button_items[0] = ITEM_SWORD_BGS; Interface_LoadItemIcon1(globalCtx, 0); } } - } - else if (item == ITEM_SWORD_MASTER) - { + } else if (item == ITEM_SWORD_MASTER) { gSaveContext.equips.button_items[0] = ITEM_SWORD_MASTER; gSaveContext.equips.equipment &= 0xFFF0; gSaveContext.equips.equipment |= 0x0002; @@ -1502,251 +1395,168 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) } return ITEM_NONE; - } - else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR)) - { + } else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR)) { gSaveContext.equipment |= (gBitFlags[item - ITEM_SHIELD_DEKU] << gEquipShifts[EQUIP_SHIELD]); return ITEM_NONE; - } - else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA)) - { + } else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA)) { gSaveContext.equipment |= (gBitFlags[item - ITEM_TUNIC_KOKIRI] << gEquipShifts[EQUIP_TUNIC]); return ITEM_NONE; - } - else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER)) - { + } else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER)) { gSaveContext.equipment |= (gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]); return ITEM_NONE; - } - else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) - { + } else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) { gSaveContext.dungeon_items[gSaveContext.dungeon_index] |= gBitFlags[item - ITEM_KEY_BOSS]; return ITEM_NONE; - } - else if (item == ITEM_KEY_SMALL) - { - if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] < 0) - { + } else if (item == ITEM_KEY_SMALL) { + if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] < 0) { gSaveContext.dungeon_keys[gSaveContext.dungeon_index] = 1; return ITEM_NONE; - } - else - { + } else { gSaveContext.dungeon_keys[gSaveContext.dungeon_index]++; return ITEM_NONE; } - } - else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) - { - if (CUR_UPG_VALUE(UPG_QUIVER) == 0) - { + } else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) { + if (CUR_UPG_VALUE(UPG_QUIVER) == 0) { Inventory_ChangeUpgrade(UPG_QUIVER, 1); INV_CONTENT(ITEM_BOW) = ITEM_BOW; AMMO(ITEM_BOW) = CAPACITY(UPG_QUIVER, 1); return ITEM_NONE; - } - else - { + } else { AMMO(ITEM_BOW)++; if (AMMO(ITEM_BOW) > CUR_CAPACITY(UPG_QUIVER)) AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER); } - } - else if (item == ITEM_QUIVER_40) - { + } else if (item == ITEM_QUIVER_40) { Inventory_ChangeUpgrade(UPG_QUIVER, 2); AMMO(ITEM_BOW) = CAPACITY(UPG_QUIVER, 2); return ITEM_NONE; - } - else if (item == ITEM_QUIVER_50) - { + } else if (item == ITEM_QUIVER_50) { Inventory_ChangeUpgrade(UPG_QUIVER, 3); AMMO(ITEM_BOW) = CAPACITY(UPG_QUIVER, 3); return ITEM_NONE; - } - else if (item == ITEM_BULLET_BAG_40) - { + } else if (item == ITEM_BULLET_BAG_40) { Inventory_ChangeUpgrade(UPG_BULLET_BAG, 2); AMMO(ITEM_SLINGSHOT) = CAPACITY(UPG_BULLET_BAG, 2); return ITEM_NONE; - } - else if (item == ITEM_BULLET_BAG_50) - { + } else if (item == ITEM_BULLET_BAG_50) { Inventory_ChangeUpgrade(UPG_BULLET_BAG, 3); AMMO(ITEM_SLINGSHOT) = CAPACITY(UPG_BULLET_BAG, 3); return ITEM_NONE; - } - else if (item == ITEM_BOMB_BAG_20) - { - if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) - { + } else if (item == ITEM_BOMB_BAG_20) { + if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) { Inventory_ChangeUpgrade(UPG_BOMB_BAG, 1); INV_CONTENT(ITEM_BOMB) = ITEM_BOMB; AMMO(ITEM_BOMB) = CAPACITY(UPG_BOMB_BAG, 1); return ITEM_NONE; - } - else - { + } else { AMMO(ITEM_BOMB)++; if (AMMO(ITEM_BOMB) > CUR_CAPACITY(UPG_BOMB_BAG)) AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG); } - } - else if (item == ITEM_BOMB_BAG_30) - { + } else if (item == ITEM_BOMB_BAG_30) { Inventory_ChangeUpgrade(UPG_BOMB_BAG, 2); AMMO(ITEM_BOMB) = CAPACITY(UPG_BOMB_BAG, 2); return ITEM_NONE; - } - else if (item == ITEM_BOMB_BAG_40) - { + } else if (item == ITEM_BOMB_BAG_40) { Inventory_ChangeUpgrade(UPG_BOMB_BAG, 3); AMMO(ITEM_BOMB) = CAPACITY(UPG_BOMB_BAG, 3); return ITEM_NONE; - } - else if (item == ITEM_BRACELET) - { + } else if (item == ITEM_BRACELET) { Inventory_ChangeUpgrade(UPG_STRENGTH, 1); return ITEM_NONE; - } - else if (item == ITEM_GAUNTLETS_SILVER) - { + } else if (item == ITEM_GAUNTLETS_SILVER) { Inventory_ChangeUpgrade(UPG_STRENGTH, 2); return ITEM_NONE; - } - else if (item == ITEM_GAUNTLETS_GOLD) - { + } else if (item == ITEM_GAUNTLETS_GOLD) { Inventory_ChangeUpgrade(UPG_STRENGTH, 3); return ITEM_NONE; - } - else if (item == ITEM_SCALE_SILVER) - { + } else if (item == ITEM_SCALE_SILVER) { Inventory_ChangeUpgrade(UPG_SCALE, 1); return ITEM_NONE; - } - else if (item == ITEM_SCALE_GOLDEN) - { + } else if (item == ITEM_SCALE_GOLDEN) { Inventory_ChangeUpgrade(UPG_SCALE, 2); return ITEM_NONE; - } - else if (item == ITEM_WALLET_ADULT) - { + } else if (item == ITEM_WALLET_ADULT) { Inventory_ChangeUpgrade(UPG_WALLET, 1); return ITEM_NONE; - } - else if (item == ITEM_WALLET_GIANT) - { + } else if (item == ITEM_WALLET_GIANT) { Inventory_ChangeUpgrade(UPG_WALLET, 2); return ITEM_NONE; - } - else if (item == ITEM_STICK_UPGRADE_20) - { + } else if (item == ITEM_STICK_UPGRADE_20) { if (gSaveContext.items[slot] == ITEM_NONE) INV_CONTENT(ITEM_STICK) = ITEM_STICK; Inventory_ChangeUpgrade(UPG_STICKS, 2); AMMO(ITEM_STICK) = CAPACITY(UPG_STICKS, 2); return ITEM_NONE; - } - else if (item == ITEM_STICK_UPGRADE_30) - { + } else if (item == ITEM_STICK_UPGRADE_30) { if (gSaveContext.items[slot] == ITEM_NONE) INV_CONTENT(ITEM_STICK) = ITEM_STICK; Inventory_ChangeUpgrade(UPG_STICKS, 3); AMMO(ITEM_STICK) = CAPACITY(UPG_STICKS, 3); return ITEM_NONE; - } - else if (item == ITEM_NUT_UPGRADE_30) - { + } else if (item == ITEM_NUT_UPGRADE_30) { if (gSaveContext.items[slot] == ITEM_NONE) INV_CONTENT(ITEM_NUT) = ITEM_NUT; Inventory_ChangeUpgrade(UPG_NUTS, 2); AMMO(ITEM_NUT) = CAPACITY(UPG_NUTS, 2); return ITEM_NONE; - } - else if (item == ITEM_NUT_UPGRADE_40) - { + } else if (item == ITEM_NUT_UPGRADE_40) { if (gSaveContext.items[slot] == ITEM_NONE) INV_CONTENT(ITEM_NUT) = ITEM_NUT; Inventory_ChangeUpgrade(UPG_NUTS, 3); AMMO(ITEM_NUT) = CAPACITY(UPG_NUTS, 3); return ITEM_NONE; - } - else if (item == ITEM_LONGSHOT) - { + } else if (item == ITEM_LONGSHOT) { INV_CONTENT(item) = item; - for (i = 1; i < 4; i++) - { - if (gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) - { + for (i = 1; i < 4; i++) { + if (gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) { gSaveContext.equips.button_items[i] = ITEM_LONGSHOT; Interface_LoadItemIcon1(globalCtx, i); } } return ITEM_NONE; - } - else if (item == ITEM_STICK) - { - if (gSaveContext.items[slot] == ITEM_NONE) - { + } else if (item == ITEM_STICK) { + if (gSaveContext.items[slot] == ITEM_NONE) { Inventory_ChangeUpgrade(UPG_STICKS, 1); AMMO(ITEM_STICK) = 1; - } - else - { + } else { AMMO(ITEM_STICK)++; if (AMMO(ITEM_STICK) > CUR_CAPACITY(UPG_STICKS)) AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS); } - } - else if ((item == ITEM_STICKS_5) || (item == ITEM_STICKS_10)) - { - if (gSaveContext.items[slot] == ITEM_NONE) - { + } else if ((item == ITEM_STICKS_5) || (item == ITEM_STICKS_10)) { + if (gSaveContext.items[slot] == ITEM_NONE) { Inventory_ChangeUpgrade(UPG_STICKS, 1); AMMO(ITEM_STICK) = sAmmoRefillCounts[item - ITEM_STICKS_5]; - } - else - { + } else { AMMO(ITEM_STICK) += sAmmoRefillCounts[item - ITEM_STICKS_5]; if (AMMO(ITEM_STICK) > CUR_CAPACITY(UPG_STICKS)) AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS); } item = ITEM_STICK; - } - else if (item == ITEM_NUT) - { - if (gSaveContext.items[slot] == ITEM_NONE) - { + } else if (item == ITEM_NUT) { + if (gSaveContext.items[slot] == ITEM_NONE) { Inventory_ChangeUpgrade(UPG_NUTS, 1); AMMO(ITEM_NUT) = ITEM_NUT; - } - else - { + } else { AMMO(ITEM_NUT)++; if (AMMO(ITEM_NUT) > CUR_CAPACITY(UPG_NUTS)) AMMO(ITEM_NUT) = CUR_CAPACITY(UPG_NUTS); } - } - else if ((item == ITEM_NUTS_5) || (item == ITEM_NUTS_10)) - { - if (gSaveContext.items[slot] == ITEM_NONE) - { + } else if ((item == ITEM_NUTS_5) || (item == ITEM_NUTS_10)) { + if (gSaveContext.items[slot] == ITEM_NONE) { Inventory_ChangeUpgrade(UPG_NUTS, 1); AMMO(ITEM_NUT) += sAmmoRefillCounts[item - ITEM_NUTS_5]; // Translates to: "Deku Nuts %d(%d)=%d BS_count=%d" - osSyncPrintf("デクの実 %d(%d)=%d BS_count=%d\n", - item, ITEM_NUTS_5, item - ITEM_NUTS_5, sAmmoRefillCounts[item - ITEM_NUTS_5]); - } - else - { + osSyncPrintf("デクの実 %d(%d)=%d BS_count=%d\n", item, ITEM_NUTS_5, item - ITEM_NUTS_5, + sAmmoRefillCounts[item - ITEM_NUTS_5]); + } else { AMMO(ITEM_NUT) += sAmmoRefillCounts[item - ITEM_NUTS_5]; if (AMMO(ITEM_NUT) > CUR_CAPACITY(UPG_NUTS)) AMMO(ITEM_NUT) = CUR_CAPACITY(UPG_NUTS); } item = ITEM_NUT; - } - else if (item == ITEM_BOMB) - { + } else if (item == ITEM_BOMB) { // Translates to: "Bomb Bomb Bomb Bomb Bomb Bomb Bomb" osSyncPrintf(" 爆弾 爆弾 爆弾 爆弾 爆弾 爆弾 爆弾 \n"); bombCount = AMMO(ITEM_BOMB) + 1; @@ -1754,49 +1564,35 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) if (bombCount > CUR_CAPACITY(UPG_BOMB_BAG)) AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG); return ITEM_NONE; - } - else if ((item >= ITEM_BOMBS_5) && (item <= ITEM_BOMBS_30)) - { + } else if ((item >= ITEM_BOMBS_5) && (item <= ITEM_BOMBS_30)) { bombCount = AMMO(ITEM_BOMB) + sAmmoRefillCounts[item - ITEM_BOMBS_5]; AMMO(ITEM_BOMB) = bombCount; if (bombCount > CUR_CAPACITY(UPG_BOMB_BAG)) AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG); return ITEM_NONE; - } - else if (item == ITEM_BOMBCHU) - { - if (gSaveContext.items[slot] == ITEM_NONE) - { + } else if (item == ITEM_BOMBCHU) { + if (gSaveContext.items[slot] == ITEM_NONE) { INV_CONTENT(ITEM_BOMBCHU) = ITEM_BOMBCHU; AMMO(ITEM_BOMBCHU) = 10; return ITEM_NONE; - } - else - { + } else { AMMO(ITEM_BOMBCHU) += 10; if (AMMO(ITEM_BOMBCHU) > 50) AMMO(ITEM_BOMBCHU) = 50; return ITEM_NONE; } - } - else if ((item == ITEM_BOMBCHUS_5) || (item == ITEM_BOMBCHUS_20)) - { - if (gSaveContext.items[slot] == ITEM_NONE) - { + } else if ((item == ITEM_BOMBCHUS_5) || (item == ITEM_BOMBCHUS_20)) { + if (gSaveContext.items[slot] == ITEM_NONE) { INV_CONTENT(ITEM_BOMBCHU) = ITEM_BOMBCHU; AMMO(ITEM_BOMBCHU) += sAmmoRefillCounts[item - ITEM_BOMBCHUS_5 + 8]; return ITEM_NONE; - } - else - { + } else { AMMO(ITEM_BOMBCHU) += sAmmoRefillCounts[item - ITEM_BOMBCHUS_5 + 8]; if (AMMO(ITEM_BOMBCHU) > 50) AMMO(ITEM_BOMBCHU) = 50; return ITEM_NONE; } - } - else if ((item >= ITEM_ARROWS_SMALL) && (item <= ITEM_ARROWS_LARGE)) - { + } else if ((item >= ITEM_ARROWS_SMALL) && (item <= ITEM_ARROWS_LARGE)) { AMMO(ITEM_BOW) += sAmmoRefillCounts[item - ITEM_ARROWS_SMALL + 4]; if ((AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER)) || (AMMO(ITEM_BOW) < 0)) @@ -1805,178 +1601,128 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) osSyncPrintf("%d本 Item_MaxGet=%d\n", AMMO(ITEM_BOW), CUR_CAPACITY(UPG_QUIVER)); return ITEM_BOW; - } - else if (item == ITEM_SLINGSHOT) - { + } else if (item == ITEM_SLINGSHOT) { Inventory_ChangeUpgrade(UPG_BULLET_BAG, 1); INV_CONTENT(ITEM_SLINGSHOT) = ITEM_SLINGSHOT; AMMO(ITEM_SLINGSHOT) = 30; return ITEM_NONE; - } - else if (item == ITEM_SEEDS) - { + } else if (item == ITEM_SEEDS) { AMMO(ITEM_SLINGSHOT) += 5; if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG)) AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG); - if (!(gSaveContext.item_get_inf[1] & 8)) - { + if (!(gSaveContext.item_get_inf[1] & 8)) { gSaveContext.item_get_inf[1] |= 8; return ITEM_NONE; } return ITEM_SEEDS; - } - else if (item == ITEM_SEEDS_30) - { + } else if (item == ITEM_SEEDS_30) { AMMO(ITEM_SLINGSHOT) += 30; if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG)) AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG); - if (!(gSaveContext.item_get_inf[1] & 8)) - { + if (!(gSaveContext.item_get_inf[1] & 8)) { gSaveContext.item_get_inf[1] |= 8; return ITEM_NONE; } return ITEM_SEEDS; - } - else if (item == ITEM_OCARINA_FAIRY) - { + } else if (item == ITEM_OCARINA_FAIRY) { INV_CONTENT(ITEM_OCARINA_FAIRY) = ITEM_OCARINA_FAIRY; return ITEM_NONE; - } - else if (item == ITEM_OCARINA_TIME) - { + } else if (item == ITEM_OCARINA_TIME) { INV_CONTENT(ITEM_OCARINA_TIME) = ITEM_OCARINA_TIME; - for (i = 1; i < 4; i++) - { - if (gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) - { + for (i = 1; i < 4; i++) { + if (gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) { gSaveContext.equips.button_items[i] = ITEM_OCARINA_TIME; Interface_LoadItemIcon1(globalCtx, i); } } return ITEM_NONE; - } - else if (item == ITEM_BEAN) - { - if (gSaveContext.items[slot] == ITEM_NONE) - { + } else if (item == ITEM_BEAN) { + if (gSaveContext.items[slot] == ITEM_NONE) { INV_CONTENT(item) = item; AMMO(ITEM_BEAN) = 1; BEANS_BOUGHT = 1; - } - else - { + } else { AMMO(ITEM_BEAN)++; BEANS_BOUGHT++; } return ITEM_NONE; - } - else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) - { + } else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) { gSaveContext.quest_items += 0x10000000; return ITEM_NONE; - } - else if (item == ITEM_HEART_CONTAINER) - { + } else if (item == ITEM_HEART_CONTAINER) { gSaveContext.health_capacity += 0x10; gSaveContext.health += 0x10; return ITEM_NONE; - } - else if (item == ITEM_HEART) - { + } else if (item == ITEM_HEART) { // Translates to: "Recovery Heart" osSyncPrintf("回復ハート回復ハート回復ハート\n"); Health_ChangeBy(globalCtx, 0x10); return item; - } - else if (item == ITEM_MAGIC_SMALL) - { + } else if (item == ITEM_MAGIC_SMALL) { if (gSaveContext.unk_13F0 != 10) func_80087680(globalCtx); func_80087708(globalCtx, 12, 5); - if (!(gSaveContext.inf_table[25] & 0x100)) - { + if (!(gSaveContext.inf_table[25] & 0x100)) { gSaveContext.inf_table[25] |= 0x100; return ITEM_NONE; } return item; - } - else if (item == ITEM_MAGIC_LARGE) - { + } else if (item == ITEM_MAGIC_LARGE) { if (gSaveContext.unk_13F0 != 10) func_80087680(globalCtx); func_80087708(globalCtx, 24, 5); - if (!(gSaveContext.inf_table[25] & 0x100)) - { + if (!(gSaveContext.inf_table[25] & 0x100)) { gSaveContext.inf_table[25] |= 0x100; return ITEM_NONE; } return item; - } - else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_INVALID_8)) - { + } else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_INVALID_8)) { Rupees_ChangeBy(sAmmoRefillCounts[item - ITEM_RUPEE_GREEN + 10]); return ITEM_NONE; - } - else if (item == ITEM_BOTTLE) - { - for (i = 0; i < 4; i++) - { - if (gSaveContext.items[SLOT(item) + i] == ITEM_NONE) - { + } else if (item == ITEM_BOTTLE) { + for (i = 0; i < 4; i++) { + if (gSaveContext.items[SLOT(item) + i] == ITEM_NONE) { gSaveContext.items[SLOT(item) + i] = item; return ITEM_NONE; } } - } - else if (((item >= ITEM_POTION_RED) && (item <= ITEM_POE)) || (item == ITEM_MILK)) - { + } else if (((item >= ITEM_POTION_RED) && (item <= ITEM_POE)) || (item == ITEM_MILK)) { bottleSlot = SLOT(item); - if ((item != ITEM_MILK_BOTTLE) && (item != ITEM_LETTER_RUTO)) - { - if (item == ITEM_MILK) - { + if ((item != ITEM_MILK_BOTTLE) && (item != ITEM_LETTER_RUTO)) { + if (item == ITEM_MILK) { item = ITEM_MILK_BOTTLE; bottleSlot = SLOT(item); } - for (i = 0; i < 4; i++) - { - if (gSaveContext.items[bottleSlot + i] == ITEM_BOTTLE) - { + for (i = 0; i < 4; i++) { + if (gSaveContext.items[bottleSlot + i] == ITEM_BOTTLE) { // Translates to: "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d" osSyncPrintf("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n", - gSaveContext.equips.c_button_slots[0], - gSaveContext.equips.c_button_slots[1], - gSaveContext.equips.c_button_slots[2], - bottleSlot + i, item); + gSaveContext.equips.c_button_slots[0], gSaveContext.equips.c_button_slots[1], + gSaveContext.equips.c_button_slots[2], bottleSlot + i, item); - if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[0]) - { + if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[0]) { gSaveContext.equips.button_items[1] = item; Interface_LoadItemIcon2(globalCtx, 1); gSaveContext.button_status[1] = BTN_ENABLED; - } - else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[1]) - { + } else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[1]) { gSaveContext.equips.button_items[2] = item; Interface_LoadItemIcon2(globalCtx, 2); gSaveContext.button_status[2] = BTN_ENABLED; - } - else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[2]) - { + } else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[2]) { gSaveContext.equips.button_items[3] = item; Interface_LoadItemIcon1(globalCtx, 3); gSaveContext.button_status[3] = BTN_ENABLED; @@ -1986,40 +1732,28 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) return ITEM_NONE; } } - } - else - { - for (i = 0; i < 4; i++) - { - if (gSaveContext.items[bottleSlot + i] == ITEM_NONE) - { + } else { + for (i = 0; i < 4; i++) { + if (gSaveContext.items[bottleSlot + i] == ITEM_NONE) { gSaveContext.items[bottleSlot + i] = item; return ITEM_NONE; } } } - } - else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) - { + } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { if (item == ITEM_SAW) gSaveContext.item_get_inf[1] |= 0x8000; prevTradeItem = INV_CONTENT(item); INV_CONTENT(item) = item; - if (prevTradeItem != ITEM_NONE) - { - for (i = 1; i < 4; i++) - { - if (prevTradeItem == gSaveContext.equips.button_items[i]) - { - if (item != ITEM_SOLD_OUT) - { + if (prevTradeItem != ITEM_NONE) { + for (i = 1; i < 4; i++) { + if (prevTradeItem == gSaveContext.equips.button_items[i]) { + if (item != ITEM_SOLD_OUT) { gSaveContext.equips.button_items[i] = item; Interface_LoadItemIcon1(globalCtx, i); - } - else - { + } else { gSaveContext.equips.button_items[i] = ITEM_NONE; } return ITEM_NONE; @@ -2040,222 +1774,166 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Item_Give.s") #endif -u8 Item_CheckObtainability(u8 item) -{ +u8 Item_CheckObtainability(u8 item) { s16 i; s16 slot; s32 bottleSlot; slot = SLOT(item); - if (item >= ITEM_STICKS_5) + if (item >= ITEM_STICKS_5) { slot = SLOT(sExtraItemBases[item - ITEM_STICKS_5]); + } osSyncPrintf(VT_FGCOL(GREEN)); osSyncPrintf("item_get_non_setting=%d pt=%d z=%x\n", item, slot, gSaveContext.items[slot]); osSyncPrintf(VT_RST); - if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) - { + if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) { return ITEM_NONE; - } - else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_SKULL_TOKEN)) - { + } else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_SKULL_TOKEN)) { return ITEM_NONE; - } - else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS)) - { - if (item == ITEM_SWORD_BGS) + } else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS)) { + if (item == ITEM_SWORD_BGS) { return ITEM_NONE; - else if ((gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD]) & gSaveContext.equipment) + } else if ((gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD]) & gSaveContext.equipment) { return item; - else + } else { return ITEM_NONE; - } - else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR)) - { - if ((gBitFlags[item - ITEM_SHIELD_DEKU] << gEquipShifts[EQUIP_SHIELD]) & gSaveContext.equipment) + } + } else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR)) { + if ((gBitFlags[item - ITEM_SHIELD_DEKU] << gEquipShifts[EQUIP_SHIELD]) & gSaveContext.equipment) { return item; - else + } else { return ITEM_NONE; - } - else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA)) - { - if ((gBitFlags[item - ITEM_TUNIC_KOKIRI] << gEquipShifts[EQUIP_TUNIC]) & gSaveContext.equipment) + } + } else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA)) { + if ((gBitFlags[item - ITEM_TUNIC_KOKIRI] << gEquipShifts[EQUIP_TUNIC]) & gSaveContext.equipment) { return item; - else + } else { return ITEM_NONE; - } - else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER)) - { - if ((gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]) & gSaveContext.equipment) + } + } else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER)) { + if ((gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]) & gSaveContext.equipment) { return item; - else + } else { return ITEM_NONE; - } - else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) - { + } + } else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) { return ITEM_NONE; - } - else if (item == ITEM_KEY_SMALL) - { + } else if (item == ITEM_KEY_SMALL) { return ITEM_NONE; - } - else if ((item >= ITEM_SLINGSHOT) && (item <= ITEM_BOMBCHU)) - { + } else if ((item >= ITEM_SLINGSHOT) && (item <= ITEM_BOMBCHU)) { return ITEM_NONE; - } - else if ((item == ITEM_BOMBCHUS_5) || (item == ITEM_BOMBCHUS_20)) - { + } else if ((item == ITEM_BOMBCHUS_5) || (item == ITEM_BOMBCHUS_20)) { return ITEM_NONE; - } - else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) - { - if (CUR_UPG_VALUE(UPG_QUIVER) == 0) + } else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) { + if (CUR_UPG_VALUE(UPG_QUIVER) == 0) { return ITEM_NONE; - else + } else { return 0; - } - else if ((item == ITEM_QUIVER_40) || (item == ITEM_QUIVER_50)) - { + } + } else if ((item == ITEM_QUIVER_40) || (item == ITEM_QUIVER_50)) { return ITEM_NONE; - } - else if ((item == ITEM_BULLET_BAG_40) || (item == ITEM_BULLET_BAG_50)) - { + } else if ((item == ITEM_BULLET_BAG_40) || (item == ITEM_BULLET_BAG_50)) { return ITEM_NONE; - } - else if ((item == ITEM_BOMB_BAG_20) || (item == ITEM_BOMB)) - { - if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) + } else if ((item == ITEM_BOMB_BAG_20) || (item == ITEM_BOMB)) { + if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) { return ITEM_NONE; - else + } else { return 0; - } - else if ((item >= ITEM_STICK_UPGRADE_20) && (item <= ITEM_NUT_UPGRADE_40)) - { + } + } else if ((item >= ITEM_STICK_UPGRADE_20) && (item <= ITEM_NUT_UPGRADE_40)) { return ITEM_NONE; - } - else if ((item >= ITEM_BOMB_BAG_30) && (item <= ITEM_WALLET_GIANT)) - { + } else if ((item >= ITEM_BOMB_BAG_30) && (item <= ITEM_WALLET_GIANT)) { return ITEM_NONE; - } - else if (item == ITEM_LONGSHOT) - { + } else if (item == ITEM_LONGSHOT) { return ITEM_NONE; - } - else if ((item == ITEM_SEEDS) || (item == ITEM_SEEDS_30)) - { - if (!(gSaveContext.item_get_inf[1] & 0x8)) + } else if ((item == ITEM_SEEDS) || (item == ITEM_SEEDS_30)) { + if (!(gSaveContext.item_get_inf[1] & 0x8)) { return ITEM_NONE; - else + } else { return ITEM_SEEDS; - } - else if (item == ITEM_BEAN) - { + } + } else if (item == ITEM_BEAN) { return ITEM_NONE; - } - else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) - { + } else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) { return ITEM_NONE; - } - else if (item == ITEM_HEART_CONTAINER) - { + } else if (item == ITEM_HEART_CONTAINER) { return ITEM_NONE; - } - else if (item == ITEM_HEART) - { + } else if (item == ITEM_HEART) { return ITEM_HEART; - } - else if ((item == ITEM_MAGIC_SMALL) || (item == ITEM_MAGIC_LARGE)) - { + } else if ((item == ITEM_MAGIC_SMALL) || (item == ITEM_MAGIC_LARGE)) { // Translates to: "Magic Pot Get_Inf_Table( 25, 0x0100)=%d" osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", gSaveContext.inf_table[25] & 0x100); - if (!(gSaveContext.inf_table[25] & 0x100)) + if (!(gSaveContext.inf_table[25] & 0x100)) { return ITEM_NONE; - else + } else { return item; - } - else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_INVALID_8)) - { + } + } else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_INVALID_8)) { return ITEM_NONE; - } - else if (item == ITEM_BOTTLE) - { + } else if (item == ITEM_BOTTLE) { return ITEM_NONE; - } - else if (((item >= ITEM_POTION_RED) && (item <= ITEM_POE)) || (item == ITEM_MILK)) - { + } else if (((item >= ITEM_POTION_RED) && (item <= ITEM_POE)) || (item == ITEM_MILK)) { bottleSlot = SLOT(item); - if ((item != ITEM_MILK_BOTTLE) && (item != ITEM_LETTER_RUTO)) - { - if (item == ITEM_MILK) - { + if ((item != ITEM_MILK_BOTTLE) && (item != ITEM_LETTER_RUTO)) { + if (item == ITEM_MILK) { item = ITEM_MILK_BOTTLE; bottleSlot = SLOT(item); } - for (i = 0; i < 4; i++) - { - if (gSaveContext.items[bottleSlot + i] == ITEM_BOTTLE) + for (i = 0; i < 4; i++) { + if (gSaveContext.items[bottleSlot + i] == ITEM_BOTTLE) { return ITEM_NONE; + } + } + } else { + for (i = 0; i < 4; i++) { + if (gSaveContext.items[bottleSlot + i] == ITEM_NONE) { + return ITEM_NONE; + } } } - else - { - for (i = 0; i < 4; i++) - { - if (gSaveContext.items[bottleSlot + i] == ITEM_NONE) - return ITEM_NONE; - } - } - } - else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) - { + } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { return ITEM_NONE; } return gSaveContext.items[slot]; } -void Inventory_DeleteItem(u16 item, u16 invSlot) -{ +void Inventory_DeleteItem(u16 item, u16 invSlot) { s16 i; - if (item == ITEM_BEAN) + if (item == ITEM_BEAN) { BEANS_BOUGHT = 0; // Beans bought + } gSaveContext.items[invSlot] = ITEM_NONE; osSyncPrintf("\nItem_Register(%d)\n", invSlot, gSaveContext.items[invSlot]); - for (i = 1; i < 4; i++) - { - if (gSaveContext.equips.button_items[i] == item) - { + for (i = 1; i < 4; i++) { + if (gSaveContext.equips.button_items[i] == item) { gSaveContext.equips.button_items[i] = ITEM_NONE; - gSaveContext.equips.c_button_slots[i-1] = SLOT_NONE; + gSaveContext.equips.c_button_slots[i - 1] = SLOT_NONE; } } } #ifdef NON_MATCHING // regalloc differences -s32 Inventory_ReplaceItem(GlobalContext* globalCtx, u16 oldItem, u16 newItem) -{ +s32 Inventory_ReplaceItem(GlobalContext* globalCtx, u16 oldItem, u16 newItem) { s16 i; s16 j; - for (i = 0; i < ARRAY_COUNT(gSaveContext.items); i++) - { - if (gSaveContext.items[i] == oldItem) - { + for (i = 0; i < ARRAY_COUNT(gSaveContext.items); i++) { + if (gSaveContext.items[i] == oldItem) { gSaveContext.items[i] = newItem; // Translates to: "Item Purge (%d)" osSyncPrintf("アイテム消去(%d)", i); - for (j = 1; j < 4; j++) - { - if (gSaveContext.equips.button_items[j] == oldItem) - { + for (j = 1; j < 4; j++) { + if (gSaveContext.equips.button_items[j] == oldItem) { gSaveContext.equips.button_items[j] = newItem; Interface_LoadItemIcon1(globalCtx, j); break; @@ -2271,54 +1949,54 @@ s32 Inventory_ReplaceItem(GlobalContext* globalCtx, u16 oldItem, u16 newItem) #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Inventory_ReplaceItem.s") #endif -s32 Inventory_HasEmptyBottle(void) -{ +s32 Inventory_HasEmptyBottle(void) { u8* items = gSaveContext.items; - if (items[SLOT_BOTTLE_1] == ITEM_BOTTLE) + if (items[SLOT_BOTTLE_1] == ITEM_BOTTLE) { return 1; - else if (items[SLOT_BOTTLE_2] == ITEM_BOTTLE) + } else if (items[SLOT_BOTTLE_2] == ITEM_BOTTLE) { return 1; - else if (items[SLOT_BOTTLE_3] == ITEM_BOTTLE) + } else if (items[SLOT_BOTTLE_3] == ITEM_BOTTLE) { return 1; - else if (items[SLOT_BOTTLE_4] == ITEM_BOTTLE) + } else if (items[SLOT_BOTTLE_4] == ITEM_BOTTLE) { return 1; - else + } else { return 0; + } } -s32 Inventory_HasSpecificBottle(u8 bottleItem) -{ +s32 Inventory_HasSpecificBottle(u8 bottleItem) { u8* items = gSaveContext.items; - if (items[SLOT_BOTTLE_1] == bottleItem) + if (items[SLOT_BOTTLE_1] == bottleItem) { return 1; - else if (items[SLOT_BOTTLE_2] == bottleItem) + } else if (items[SLOT_BOTTLE_2] == bottleItem) { return 1; - else if (items[SLOT_BOTTLE_3] == bottleItem) + } else if (items[SLOT_BOTTLE_3] == bottleItem) { return 1; - else if (items[SLOT_BOTTLE_4] == bottleItem) + } else if (items[SLOT_BOTTLE_4] == bottleItem) { return 1; - else + } else { return 0; + } } #ifdef NON_MATCHING // save context pointer isn't reused after Interface_LoadItemIcon1 when it should be -void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 cButton) -{ - osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", - item, cButton, gSaveContext.equips.c_button_slots[cButton-1], - gSaveContext.items[gSaveContext.equips.c_button_slots[cButton-1]]); +void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 cButton) { + osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, cButton, + gSaveContext.equips.c_button_slots[cButton - 1], + gSaveContext.items[gSaveContext.equips.c_button_slots[cButton - 1]]); // Special case to only empty half of a Lon Lon Milk Bottle - if ((gSaveContext.items[gSaveContext.equips.c_button_slots[cButton-1]] == ITEM_MILK_BOTTLE) && (item == ITEM_BOTTLE)) + if ((gSaveContext.items[gSaveContext.equips.c_button_slots[cButton - 1]] == ITEM_MILK_BOTTLE) && + (item == ITEM_BOTTLE)) item = ITEM_MILK_HALF; - gSaveContext.items[gSaveContext.equips.c_button_slots[cButton-1]] = item; + gSaveContext.items[gSaveContext.equips.c_button_slots[cButton - 1]] = item; gSaveContext.equips.button_items[cButton] = item; - if (1) ; // Improves codegen but may not be necessary + if (1) {} // Improves codegen but may not be necessary Interface_LoadItemIcon1(globalCtx, cButton); @@ -2331,25 +2009,20 @@ void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 cButton) #ifdef NON_MATCHING // mostly regalloc, minor ordering, and stack usage differences -s32 Inventory_ConsumeFairy(GlobalContext* globalCtx) -{ +s32 Inventory_ConsumeFairy(GlobalContext* globalCtx) { s32 bottleSlot; s16 i; s16 j; bottleSlot = SLOT(ITEM_FAIRY); - for (i = 0; i < 4; i++) - { - if (gSaveContext.items[bottleSlot + i] == ITEM_FAIRY) - { - for (j = 1; j < 4; j++) - { - if (gSaveContext.equips.button_items[j] == ITEM_FAIRY) - { + for (i = 0; i < 4; i++) { + if (gSaveContext.items[bottleSlot + i] == ITEM_FAIRY) { + for (j = 1; j < 4; j++) { + if (gSaveContext.equips.button_items[j] == ITEM_FAIRY) { gSaveContext.equips.button_items[j] = ITEM_BOTTLE; Interface_LoadItemIcon1(globalCtx, j); - bottleSlot = gSaveContext.equips.c_button_slots[j-1]; + bottleSlot = gSaveContext.equips.c_button_slots[j - 1]; break; } } @@ -2366,12 +2039,10 @@ s32 Inventory_ConsumeFairy(GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Inventory_ConsumeFairy.s") #endif -void func_80086D5C(s32* buf, u16 size) -{ +void func_80086D5C(s32* buf, u16 size) { u16 i; - for (i = 0; i < size; i++) - { + for (i = 0; i < size; i++) { buf[i] = 0; } } @@ -2380,8 +2051,7 @@ u32 sDoActionTextures[] = { 0x07000000, 0x07000180 }; #ifdef NON_MATCHING // 0x80000000 is reused in the 2 *_TO_VIRTUAL macros when it shouldn't -void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 arg2) -{ +void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 arg2) { if (action >= 0x1D) action = 0x0A; @@ -2391,16 +2061,13 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 a if (gSaveContext.language == 2) action += 0x1D; - if ((action != 0x0A) && (action != 0x27) && (action != 0x44)) - { + if ((action != 0x0A) && (action != 0x27) && (action != 0x44)) { osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK); DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, (u32)interfaceCtx->do_actionSegment + (arg2 * 0x180), - (u32)_do_action_staticSegmentRomStart + (action * 0x180), - 0x180, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145); + (u32)_do_action_staticSegmentRomStart + (action * 0x180), 0x180, 0, + &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); - } - else - { + } else { gSegments[7] = PHYSICAL_TO_VIRTUAL(interfaceCtx->do_actionSegment); func_80086D5C(SEGMENTED_TO_VIRTUAL(sDoActionTextures[arg2]), 0x180 / 4); } @@ -2410,78 +2077,73 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 a #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_LoadActionLabel.s") #endif -void Interface_SetDoAction(GlobalContext* globalCtx, u16 action) -{ +void Interface_SetDoAction(GlobalContext* globalCtx, u16 action) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; PauseContext* pauseCtx = &globalCtx->pauseCtx; - if (interfaceCtx->unk_1F0 != action) - { + if (interfaceCtx->unk_1F0 != action) { interfaceCtx->unk_1F0 = action; interfaceCtx->unk_1EC = 1; interfaceCtx->unk_1F4 = 0.0f; Interface_LoadActionLabel(interfaceCtx, action, 1); - if (pauseCtx->state != 0) + if (pauseCtx->state != 0) { interfaceCtx->unk_1EC = 3; + } } } -void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState) -{ +void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; - if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && - !interfaceCtx->naviCalling && - (globalCtx->csCtx.state == 0)) - { + if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && !interfaceCtx->naviCalling && + (globalCtx->csCtx.state == 0)) { // clang-format off // NOLINTNEXTLINE if (naviCallState == 0x1E) Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); // clang-format on - if (naviCallState == 0x1D) + if (naviCallState == 0x1D) { func_800F4524(&D_801333D4, NA_SE_VO_NA_HELLO_2, 32); + } interfaceCtx->naviCalling = 1; sCUpInvisible = 0; sCUpTimer = 10; - } - else if ((naviCallState == 0x1F) && - interfaceCtx->naviCalling) - { + } else if ((naviCallState == 0x1F) && interfaceCtx->naviCalling) { interfaceCtx->naviCalling = 0; } } -void Interface_LoadActionLabelB(GlobalContext* globalCtx, u16 action) -{ +void Interface_LoadActionLabelB(GlobalContext* globalCtx, u16 action) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; - if (gSaveContext.language != 0) + if (gSaveContext.language != 0) { action += 0x1D; + } - if (gSaveContext.language == 2) + if (gSaveContext.language == 2) { action += 0x1D; + } interfaceCtx->unk_1FC = action; osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK); DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, (u32)interfaceCtx->do_actionSegment + 0x180, - (u32)_do_action_staticSegmentRomStart + (action * 0x180), - 0x180, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228); + (u32)_do_action_staticSegmentRomStart + (action * 0x180), 0x180, 0, &interfaceCtx->loadQueue, + NULL, "../z_parameter.c", 2228); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); interfaceCtx->unk_1FA = 1; } -s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) -{ +s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) { u16 heartCount; u16 healthLevel; // Translates to: "***** Fluctuation=%d (now=%d, max=%d) ***" - osSyncPrintf("***** 増減=%d (now=%d, max=%d) ***", healthChange, gSaveContext.health, gSaveContext.health_capacity); + osSyncPrintf("***** 増減=%d (now=%d, max=%d) ***", healthChange, gSaveContext.health, + gSaveContext.health_capacity); // clang-format off // NOLINTNEXTLINE @@ -2496,107 +2158,95 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) gSaveContext.health += healthChange; - if (gSaveContext.health > gSaveContext.health_capacity) + if (gSaveContext.health > gSaveContext.health_capacity) { gSaveContext.health = gSaveContext.health_capacity; + } heartCount = gSaveContext.health % 0x10; healthLevel = heartCount; - if (heartCount != 0) - { - if (heartCount > 10) + if (heartCount != 0) { + if (heartCount > 10) { healthLevel = 3; - else if (heartCount > 5) + } else if (heartCount > 5) { healthLevel = 2; - else + } else { healthLevel = 1; + } } // Translates to: "Life=%d *** %d ******" osSyncPrintf(" ライフ=%d *** %d ******\n", gSaveContext.health, healthLevel); - if (gSaveContext.health <= 0) - { + if (gSaveContext.health <= 0) { gSaveContext.health = 0; return 0; - } - else - { + } else { return 1; } } -void Health_GiveHearts(s16 hearts) -{ +void Health_GiveHearts(s16 hearts) { gSaveContext.health_capacity += hearts * 0x10; } -void Rupees_ChangeBy(s16 rupeeChange) -{ +void Rupees_ChangeBy(s16 rupeeChange) { gSaveContext.rupee_accumulator += rupeeChange; } -void Inventory_ChangeAmmo(s16 item, s16 ammoChange) -{ +void Inventory_ChangeAmmo(s16 item, s16 ammoChange) { // Translates to: "Item = (%d) Amount = (%d + %d)" osSyncPrintf("アイテム = (%d) 数 = (%d + %d) ", item, AMMO(item), ammoChange); - if (item == ITEM_STICK) - { + if (item == ITEM_STICK) { AMMO(ITEM_STICK) += ammoChange; - if (AMMO(ITEM_STICK) >= CUR_CAPACITY(UPG_STICKS)) + if (AMMO(ITEM_STICK) >= CUR_CAPACITY(UPG_STICKS)) { AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS); - else if (AMMO(ITEM_STICK) < 0) + } else if (AMMO(ITEM_STICK) < 0) { AMMO(ITEM_STICK) = 0; - } - else if (item == ITEM_NUT) - { + } + } else if (item == ITEM_NUT) { AMMO(ITEM_NUT) += ammoChange; - if (AMMO(ITEM_NUT) >= CUR_CAPACITY(UPG_NUTS)) + if (AMMO(ITEM_NUT) >= CUR_CAPACITY(UPG_NUTS)) { AMMO(ITEM_NUT) = CUR_CAPACITY(UPG_NUTS); - else if (AMMO(ITEM_NUT) < 0) + } else if (AMMO(ITEM_NUT) < 0) { AMMO(ITEM_NUT) = 0; - } - else if (item == ITEM_BOMBCHU) - { + } + } else if (item == ITEM_BOMBCHU) { AMMO(ITEM_BOMBCHU) += ammoChange; - if (AMMO(ITEM_BOMBCHU) >= 50) + if (AMMO(ITEM_BOMBCHU) >= 50) { AMMO(ITEM_BOMBCHU) = 50; - else if (AMMO(ITEM_BOMBCHU) < 0) + } else if (AMMO(ITEM_BOMBCHU) < 0) { AMMO(ITEM_BOMBCHU) = 0; - } - else if (item == ITEM_BOW) - { + } + } else if (item == ITEM_BOW) { AMMO(ITEM_BOW) += ammoChange; - if (AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER)) + if (AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER)) { AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER); - else if (AMMO(ITEM_BOW) < 0) + } else if (AMMO(ITEM_BOW) < 0) { AMMO(ITEM_BOW) = 0; - } - else if ((item == ITEM_SLINGSHOT) || (item == ITEM_SEEDS)) - { + } + } else if ((item == ITEM_SLINGSHOT) || (item == ITEM_SEEDS)) { AMMO(ITEM_SLINGSHOT) += ammoChange; - if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG)) + if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG)) { AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG); - else if (AMMO(ITEM_SLINGSHOT) < 0) + } else if (AMMO(ITEM_SLINGSHOT) < 0) { AMMO(ITEM_SLINGSHOT) = 0; - } - else if (item == ITEM_BOMB) - { + } + } else if (item == ITEM_BOMB) { AMMO(ITEM_BOMB) += ammoChange; - if (AMMO(ITEM_BOMB) >= CUR_CAPACITY(UPG_BOMB_BAG)) + if (AMMO(ITEM_BOMB) >= CUR_CAPACITY(UPG_BOMB_BAG)) { AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG); - else if (AMMO(ITEM_BOMB) < 0) + } else if (AMMO(ITEM_BOMB) < 0) { AMMO(ITEM_BOMB) = 0; - } - else if (item == ITEM_BEAN) - { + } + } else if (item == ITEM_BEAN) { AMMO(ITEM_BEAN) += ammoChange; } @@ -2604,109 +2254,96 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) osSyncPrintf("合計 = (%d)\n", AMMO(item)); } -void func_80087680(GlobalContext* globalCtx) -{ - if (gSaveContext.magic_acquired) - { +void func_80087680(GlobalContext* globalCtx) { + if (gSaveContext.magic_acquired) { gSaveContext.unk_13F2 = gSaveContext.unk_13F0; gSaveContext.unk_13F6 = (gSaveContext.double_magic * 0x30) + 0x30; gSaveContext.unk_13F0 = 9; } } -void func_800876C8(GlobalContext* globalCtx) -{ - if ((gSaveContext.unk_13F0 != 8) && (gSaveContext.unk_13F0 != 9)) - { - if (gSaveContext.unk_13F0 == 10) +void func_800876C8(GlobalContext* globalCtx) { + if ((gSaveContext.unk_13F0 != 8) && (gSaveContext.unk_13F0 != 9)) { + if (gSaveContext.unk_13F0 == 10) { gSaveContext.unk_13F2 = gSaveContext.unk_13F0; + } gSaveContext.unk_13F0 = 5; } } -s32 func_80087708(GlobalContext* globalCtx, s16 arg1, s16 arg2) -{ - if (!gSaveContext.magic_acquired) - return 0; - - if ((arg2 != 5) && (gSaveContext.magic - arg1) < 0) - { - if (gSaveContext.unk_13F4 != 0) - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); +s32 func_80087708(GlobalContext* globalCtx, s16 arg1, s16 arg2) { + if (!gSaveContext.magic_acquired) { return 0; } - switch (arg2) - { + if ((arg2 != 5) && (gSaveContext.magic - arg1) < 0) { + if (gSaveContext.unk_13F4 != 0) { + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + } + return 0; + } + + switch (arg2) { case 0: case 2: - if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) - { - if (gSaveContext.unk_13F0 == 7) + if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) { + if (gSaveContext.unk_13F0 == 7) { globalCtx->actorCtx.unk_03 = 0; + } gSaveContext.unk_13F8 = gSaveContext.magic - arg1; gSaveContext.unk_13F0 = 1; return 1; - } - else - { + } else { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); return 0; } case 1: - if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) - { - if (gSaveContext.unk_13F0 == 7) + if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) { + if (gSaveContext.unk_13F0 == 7) { globalCtx->actorCtx.unk_03 = 0; + } gSaveContext.unk_13F8 = gSaveContext.magic - arg1; gSaveContext.unk_13F0 = 6; return 1; - } - else - { + } else { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); return 0; } case 3: - if (gSaveContext.unk_13F0 == 0) - { - if (gSaveContext.magic != 0) - { + if (gSaveContext.unk_13F0 == 0) { + if (gSaveContext.magic != 0) { globalCtx->interfaceCtx.unk_230 = 80; gSaveContext.unk_13F0 = 7; return 1; + } else { + return 0; } - else - return 0; - } - else - { - if (gSaveContext.unk_13F0 == 7) + } else { + if (gSaveContext.unk_13F0 == 7) { return 1; - else + } else { return 0; + } } case 4: - if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) - { - if (gSaveContext.unk_13F0 == 7) + if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) { + if (gSaveContext.unk_13F0 == 7) { globalCtx->actorCtx.unk_03 = 0; + } gSaveContext.unk_13F8 = gSaveContext.magic - arg1; gSaveContext.unk_13F0 = 4; return 1; - } - else - { + } else { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); return 0; } case 5: - if (gSaveContext.unk_13F4 >= gSaveContext.magic) - { + if (gSaveContext.unk_13F4 >= gSaveContext.magic) { gSaveContext.unk_13F8 = gSaveContext.magic + arg1; - if (gSaveContext.unk_13F8 >= gSaveContext.unk_13F4) + if (gSaveContext.unk_13F8 >= gSaveContext.unk_13F4) { gSaveContext.unk_13F8 = gSaveContext.unk_13F4; + } gSaveContext.unk_13F0 = 10; return 1; @@ -2719,10 +2356,8 @@ s32 func_80087708(GlobalContext* globalCtx, s16 arg1, s16 arg2) #ifdef NON_MATCHING // this function still needs some work -void Interface_UpdateMagicBar(GlobalContext* globalCtx) -{ - static s16 sMagicBorderColors[][3] = - { +void Interface_UpdateMagicBar(GlobalContext* globalCtx) { + static s16 sMagicBorderColors[][3] = { { 0xFF, 0xFF, 0xFF }, { 0x96, 0x96, 0x96 }, { 0xFF, 0xFF, 0x96 }, @@ -2734,27 +2369,20 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) s16* color; s16 maxMagic; - switch (gSaveContext.unk_13F0) - { + switch (gSaveContext.unk_13F0) { case 8: maxMagic = gSaveContext.magic_level * 0x30; - if (gSaveContext.unk_13F4 != maxMagic) - { - if (gSaveContext.unk_13F4 < maxMagic) - { + if (gSaveContext.unk_13F4 != maxMagic) { + if (gSaveContext.unk_13F4 < maxMagic) { gSaveContext.unk_13F4 += 8; if (gSaveContext.unk_13F4 > maxMagic) gSaveContext.unk_13F4 = maxMagic; - } - else - { + } else { gSaveContext.unk_13F4 -= 8; if (gSaveContext.unk_13F4 <= maxMagic) gSaveContext.unk_13F4 = maxMagic; } - } - else - { + } else { gSaveContext.unk_13F0 = 9; } break; @@ -2766,8 +2394,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) // Translates to: "Storage MAGIC_NOW=%d (%d)" osSyncPrintf("蓄電 MAGIC_NOW=%d (%d)\n", gSaveContext.magic, gSaveContext.unk_13F6); - if (gSaveContext.magic >= gSaveContext.unk_13F6) - { + if (gSaveContext.magic >= gSaveContext.unk_13F6) { gSaveContext.magic = gSaveContext.unk_13F6; gSaveContext.unk_13F0 = gSaveContext.unk_13F2; gSaveContext.unk_13F2 = 0; @@ -2779,16 +2406,13 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) break; case 2: gSaveContext.magic -= 2; - if (gSaveContext.magic <= 0) - { + if (gSaveContext.magic <= 0) { gSaveContext.magic = 0; gSaveContext.unk_13F0 = 3; sMagicBorderB = 0xFF; sMagicBorderG = 0xFF; sMagicBorderR = 0xFF; - } - else if (gSaveContext.magic == gSaveContext.unk_13F8) - { + } else if (gSaveContext.magic == gSaveContext.unk_13F8) { gSaveContext.unk_13F0 = 3; sMagicBorderB = 0xFF; sMagicBorderG = 0xFF; @@ -2815,8 +2439,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) sMagicBorderB += ABS(sMagicBorderB - color[2]) / sMagicBorderRatio; sMagicBorderRatio--; - if (sMagicBorderRatio == 0) - { + if (sMagicBorderRatio == 0) { sMagicBorderR = color[0]; sMagicBorderG = color[1]; sMagicBorderB = color[2]; @@ -2833,32 +2456,24 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) gSaveContext.unk_13F0 = 0; break; case 7: - if ((globalCtx->pauseCtx.state == 0) && - (globalCtx->pauseCtx.flag == 0) && - (globalCtx->msgCtx.msgMode == 0) && - (globalCtx->unk_10A20 == 0) && - (globalCtx->sceneLoadFlag == 0) && - (globalCtx->unk_1241B == 0) && - (func_800BFC84(globalCtx) == 0)) - { - if ((gSaveContext.magic == 0) || - ((func_8008F2F8(globalCtx) >= 2) && - (func_8008F2F8(globalCtx) < 5)) || + if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && + (globalCtx->msgCtx.msgMode == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->sceneLoadFlag == 0) && + (globalCtx->unk_1241B == 0) && (func_800BFC84(globalCtx) == 0)) { + if ((gSaveContext.magic == 0) || ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) || ((gSaveContext.equips.button_items[1] != ITEM_LENS) && (gSaveContext.equips.button_items[2] != ITEM_LENS) && (gSaveContext.equips.button_items[3] != ITEM_LENS)) || - (globalCtx->actorCtx.unk_03 == 0)) - { + (globalCtx->actorCtx.unk_03 == 0)) { globalCtx->actorCtx.unk_03 = 0; - Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0, + &D_801333E8); gSaveContext.unk_13F0 = 0; sMagicBorderR = sMagicBorderG = sMagicBorderB = 0xFF; break; } globalCtx->interfaceCtx.unk_230--; - if (globalCtx->interfaceCtx.unk_230 == 0) - { + if (globalCtx->interfaceCtx.unk_230 == 0) { gSaveContext.magic--; globalCtx->interfaceCtx.unk_230 = 80; } @@ -2882,8 +2497,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) sMagicBorderB += ABS(sMagicBorderB - color[2]) / sMagicBorderRatio; sMagicBorderRatio--; - if (sMagicBorderRatio == 0) - { + if (sMagicBorderRatio == 0) { sMagicBorderR = color[0]; sMagicBorderG = color[1]; sMagicBorderB = color[2]; @@ -2896,8 +2510,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) case 10: gSaveContext.magic += 4; Audio_PlaySoundGeneral(0x401F, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (gSaveContext.magic >= gSaveContext.unk_13F8) - { + if (gSaveContext.magic >= gSaveContext.unk_13F8) { gSaveContext.magic = gSaveContext.unk_13F8; gSaveContext.unk_13F0 = gSaveContext.unk_13F2; gSaveContext.unk_13F2 = 0; @@ -2909,8 +2522,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) } } #else -s16 sMagicBorderColors[][3] = -{ +s16 sMagicBorderColors[][3] = { { 0xFF, 0xFF, 0xFF }, { 0x96, 0x96, 0x96 }, { 0xFF, 0xFF, 0x96 }, @@ -2923,8 +2535,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx); #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_UpdateMagicBar.s") #endif -void Interface_DrawMagicBar(GlobalContext* globalCtx) -{ +void Interface_DrawMagicBar(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; s16 magicBarY; GraphicsContext* gfxCtx; @@ -2933,180 +2544,131 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 2650); - if (gSaveContext.magic_level != 0) - { - if (gSaveContext.health_capacity > 0xA0) + if (gSaveContext.magic_level != 0) { + if (gSaveContext.health_capacity > 0xA0) { magicBarY = R_MAGIC_BAR_LARGE_Y; - else + } else { magicBarY = R_MAGIC_BAR_SMALL_Y; + } func_80094520(globalCtx->state.gfxCtx); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, sMagicBorderR, sMagicBorderG, sMagicBorderB, interfaceCtx->magicAlpha); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, sMagicBorderR, sMagicBorderG, sMagicBorderB, + interfaceCtx->magicAlpha); gDPSetEnvColor(gfxCtx->overlay.p++, 0x64, 0x32, 0x32, 0xFF); - gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, - D_020038C0, - 8, 16, - R_MAGIC_BAR_X, magicBarY, - 8, 16, - 1024, 1024); + gfxCtx->overlay.p = + Draw_TextureIA8(gfxCtx->overlay.p, D_020038C0, 8, 16, R_MAGIC_BAR_X, magicBarY, 8, 16, 1024, 1024); - gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, - D_02003940, - 24, 16, - R_MAGIC_BAR_X + 8, magicBarY, - gSaveContext.unk_13F4, 16, - 1024, 1024); + gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, D_02003940, 24, 16, R_MAGIC_BAR_X + 8, magicBarY, + gSaveContext.unk_13F4, 16, 1024, 1024); gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, D_020038C0); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, - 0, 0, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_MIRROR | G_TX_WRAP, 3, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD, G_TX_MIRROR | G_TX_WRAP, 3, G_TX_NOLOD); gDPLoadSync(gfxCtx->overlay.p++); gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 63, 2048); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_8b, - 1, 0, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_MIRROR | G_TX_WRAP, 3, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_8b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD, G_TX_MIRROR | G_TX_WRAP, 3, G_TX_NOLOD); gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 28, 60); - gSPTextureRectangle(gfxCtx->overlay.p++, - ((R_MAGIC_BAR_X + gSaveContext.unk_13F4) + 8) << 2, magicBarY << 2, - ((R_MAGIC_BAR_X + gSaveContext.unk_13F4) + 16) << 2, (magicBarY + 16) << 2, - G_TX_RENDERTILE, - 256, 0, - 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, ((R_MAGIC_BAR_X + gSaveContext.unk_13F4) + 8) << 2, magicBarY << 2, + ((R_MAGIC_BAR_X + gSaveContext.unk_13F4) + 16) << 2, (magicBarY + 16) << 2, G_TX_RENDERTILE, + 256, 0, 1024, 1024); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE, + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE); gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0xFF); - if (gSaveContext.unk_13F0 == 4) - { + if (gSaveContext.unk_13F0 == 4) { // Yellow part of the bar being used when casting a spell gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFA, 0xFA, 0x00, interfaceCtx->magicAlpha); - gDPLoadMultiBlock_4b(gfxCtx->overlay.p++, - D_02003AC0, - 0, - G_TX_RENDERTILE, - G_IM_FMT_I, - 16, 16, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, + gDPLoadMultiBlock_4b(gfxCtx->overlay.p++, D_02003AC0, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, 16, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2, - (R_MAGIC_FILL_X + gSaveContext.magic) << 2, (magicBarY + 10) << 2, - G_TX_RENDERTILE, - 0, 0, - 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2, + (R_MAGIC_FILL_X + gSaveContext.magic) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, 0, + 0, 1024, 1024); // Fill the rest of the bar with the normal magic color gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), R_MAGIC_FILL_COLOR(2), interfaceCtx->magicAlpha); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2, - (R_MAGIC_FILL_X + gSaveContext.unk_13F8) << 2, (magicBarY + 10) << 2, - G_TX_RENDERTILE, - 0, 0, - 1024, 1024); - } - else - { + gSPTextureRectangle(gfxCtx->overlay.p++, R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2, + (R_MAGIC_FILL_X + gSaveContext.unk_13F8) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, + 0, 0, 1024, 1024); + } else { // Fill the whole bar with the normal magic color - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), R_MAGIC_FILL_COLOR(2), interfaceCtx->magicAlpha); - gDPLoadMultiBlock_4b(gfxCtx->overlay.p++, - D_02003AC0, - 0, - G_TX_RENDERTILE, - G_IM_FMT_I, - 16, 16, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, + gDPLoadMultiBlock_4b(gfxCtx->overlay.p++, D_02003AC0, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, 16, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2, - (R_MAGIC_FILL_X + gSaveContext.magic) << 2, (magicBarY + 10) << 2, - G_TX_RENDERTILE, - 0, 0, - 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2, + (R_MAGIC_FILL_X + gSaveContext.magic) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, 0, + 0, 1024, 1024); } } func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 2731); } -void func_80088AA0(s16 arg0) -{ +void func_80088AA0(s16 arg0) { gSaveContext.timer_x[1] = 140; gSaveContext.timer_y[1] = 80; D_80125A5C = 0; gSaveContext.timer_2_value = arg0; - if (arg0 != 0) + if (arg0 != 0) { gSaveContext.timer_2_state = 1; - else + } else { gSaveContext.timer_2_state = 7; -} - -void func_80088AF0(GlobalContext* globalCtx) -{ - if (gSaveContext.timer_2_state != 0) - { - if (gSaveContext.event_inf[1] & 1) - gSaveContext.timer_2_value = 239; - else - gSaveContext.timer_2_value = 1; } } -void func_80088B34(s16 arg0) -{ +void func_80088AF0(GlobalContext* globalCtx) { + if (gSaveContext.timer_2_state != 0) { + if (gSaveContext.event_inf[1] & 1) { + gSaveContext.timer_2_value = 239; + } else { + gSaveContext.timer_2_value = 1; + } + } +} + +void func_80088B34(s16 arg0) { gSaveContext.timer_x[0] = 140; gSaveContext.timer_y[0] = 80; D_80125A5C = 0; gSaveContext.timer_1_value = arg0; - if (arg0 != 0) + if (arg0 != 0) { gSaveContext.timer_1_state = 5; - else + } else { gSaveContext.timer_1_state = 11; + } } -void Interface_DrawActionLabel(GraphicsContext* gfxCtx, void* texture) -{ +void Interface_DrawActionLabel(GraphicsContext* gfxCtx, void* texture) { Gfx* gfxArr[5]; func_800C6AC4(gfxArr, gfxCtx, "../z_parameter.c", 2820); gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, texture); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, - 0, 0, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); gDPLoadSync(gfxCtx->overlay.p++); gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 191, 683); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, - 3, 0, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, 3, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 188, 60); gSP1Quadrangle(gfxCtx->overlay.p++, 0, 2, 3, 1, 0); @@ -3120,8 +2682,7 @@ s16 sStartButtonLeftPos[] = { 132, 130, 130 }; #ifdef NON_MATCHING // regalloc and ordering differences -void Interface_DrawItemButtons(GlobalContext* globalCtx) -{ +void Interface_DrawItemButtons(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; Player* player = PLAYER; f32 temp; @@ -3138,169 +2699,117 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) // B Button Color & Texture // Also loads the Item Button Texture reused by other buttons afterwards gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_B_BTN_COLOR(0), R_B_BTN_COLOR(1), - R_B_BTN_COLOR(2), interfaceCtx->bAlpha); + gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, + TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_B_BTN_COLOR(0), R_B_BTN_COLOR(1), R_B_BTN_COLOR(2), + interfaceCtx->bAlpha); gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0xFF); - gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, - &D_02000A00[0], - 32, 32, - R_ITEM_BTN_X(0), R_ITEM_BTN_Y(0), - R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0), - R_ITEM_BTN_DD(0) * 2, R_ITEM_BTN_DD(0) * 2); + gfxCtx->overlay.p = + Draw_TextureIA8(gfxCtx->overlay.p, &D_02000A00[0], 32, 32, R_ITEM_BTN_X(0), R_ITEM_BTN_Y(0), + R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_DD(0) * 2, R_ITEM_BTN_DD(0) * 2); // C-Left Button Color & Texture gDPPipeSync(gfxCtx->overlay.p++); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), - R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_ITEM_BTN_X(1) << 2, - R_ITEM_BTN_Y(1) << 2, - (R_ITEM_BTN_X(1) + R_ITEM_BTN_WIDTH(1)) << 2, - (R_ITEM_BTN_Y(1) + R_ITEM_BTN_WIDTH(1)) << 2, - G_TX_RENDERTILE, - 0, 0, - R_ITEM_BTN_DD(1) * 2, - R_ITEM_BTN_DD(1) * 2); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), + interfaceCtx->cLeftAlpha); + gSPTextureRectangle(gfxCtx->overlay.p++, R_ITEM_BTN_X(1) << 2, R_ITEM_BTN_Y(1) << 2, + (R_ITEM_BTN_X(1) + R_ITEM_BTN_WIDTH(1)) << 2, (R_ITEM_BTN_Y(1) + R_ITEM_BTN_WIDTH(1)) << 2, + G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(1) * 2, R_ITEM_BTN_DD(1) * 2); // C-Down Button Color & Texture - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), - R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_ITEM_BTN_X(2) << 2, - R_ITEM_BTN_Y(2) << 2, - (R_ITEM_BTN_X(2) + R_ITEM_BTN_WIDTH(2)) << 2, - (R_ITEM_BTN_Y(2) + R_ITEM_BTN_WIDTH(2)) << 2, - G_TX_RENDERTILE, - 0, 0, - R_ITEM_BTN_DD(2) * 2, - R_ITEM_BTN_DD(2) * 2); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), + interfaceCtx->cDownAlpha); + gSPTextureRectangle(gfxCtx->overlay.p++, R_ITEM_BTN_X(2) << 2, R_ITEM_BTN_Y(2) << 2, + (R_ITEM_BTN_X(2) + R_ITEM_BTN_WIDTH(2)) << 2, (R_ITEM_BTN_Y(2) + R_ITEM_BTN_WIDTH(2)) << 2, + G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(2) * 2, R_ITEM_BTN_DD(2) * 2); // C-Right Button Color & Texture - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), - R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_ITEM_BTN_X(3) << 2, - R_ITEM_BTN_Y(3) << 2, - (R_ITEM_BTN_X(3) + R_ITEM_BTN_WIDTH(3)) << 2, - (R_ITEM_BTN_Y(3) + R_ITEM_BTN_WIDTH(3)) << 2, - G_TX_RENDERTILE, - 0, 0, - R_ITEM_BTN_DD(3) * 2, - R_ITEM_BTN_DD(3) * 2); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), + interfaceCtx->cRightAlpha); + gSPTextureRectangle(gfxCtx->overlay.p++, R_ITEM_BTN_X(3) << 2, R_ITEM_BTN_Y(3) << 2, + (R_ITEM_BTN_X(3) + R_ITEM_BTN_WIDTH(3)) << 2, (R_ITEM_BTN_Y(3) + R_ITEM_BTN_WIDTH(3)) << 2, + G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) * 2, R_ITEM_BTN_DD(3) * 2); - if ((globalCtx->pauseCtx.state < 8) || (globalCtx->pauseCtx.state >= 18)) - { - if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) - { + if ((globalCtx->pauseCtx.state < 8) || (globalCtx->pauseCtx.state >= 18)) { + if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) { // Start Button Texture, Color & Label gDPPipeSync(gfxCtx->overlay.p++); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x78, 0x78, 0x78, interfaceCtx->startAlpha); - gSPTextureRectangle(gfxCtx->overlay.p++, - sStartButtonLeftPos[gSaveContext.language] << 2, 156, - (sStartButtonLeftPos[gSaveContext.language] + 22) << 2, 68, - G_TX_RENDERTILE, - 0, 0, - 1462, 1462); + gSPTextureRectangle(gfxCtx->overlay.p++, sStartButtonLeftPos[gSaveContext.language] << 2, 156, + (sStartButtonLeftPos[gSaveContext.language] + 22) << 2, 68, G_TX_RENDERTILE, 0, 0, 1462, + 1462); gDPPipeSync(gfxCtx->overlay.p++); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->startAlpha); gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0x00); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, (u32)interfaceCtx->do_actionSegment + 0x300); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, - 0, 0, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, + (u32)interfaceCtx->do_actionSegment + 0x300); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPLoadSync(gfxCtx->overlay.p++); gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 191, 683); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, - 3, 0, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, 3, 0, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 48, 16); temp = R_START_LABEL_DD(gSaveContext.language) / 100.0f; - gSPTextureRectangle(gfxCtx->overlay.p++, - R_START_LABEL_X(gSaveContext.language) << 2, + gSPTextureRectangle(gfxCtx->overlay.p++, R_START_LABEL_X(gSaveContext.language) << 2, R_START_LABEL_Y(gSaveContext.language) << 2, (R_START_LABEL_X(gSaveContext.language) + (s16)(16 / temp)) << 2, - (R_START_LABEL_Y(gSaveContext.language) + (s16)(48 / temp)) << 2, - G_TX_RENDERTILE, - 0, 0, - (s16)(1024 / temp), - (s16)(1024 / temp)); + (R_START_LABEL_Y(gSaveContext.language) + (s16)(48 / temp)) << 2, G_TX_RENDERTILE, 0, 0, + (s16)(1024 / temp), (s16)(1024 / temp)); } } - if (interfaceCtx->naviCalling && (globalCtx->pauseCtx.state == 0) && - (globalCtx->pauseCtx.flag == 0) && (globalCtx->csCtx.state == 0)) - { - if (!sCUpInvisible) - { + if (interfaceCtx->naviCalling && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && + (globalCtx->csCtx.state == 0)) { + if (!sCUpInvisible) { // C-Up Button Texture, Color & Label (Navi Text) gDPPipeSync(gfxCtx->overlay.p++); if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) cUpAlpha = 0; - else if ((player->stateFlags2 & 0x00200000) || (func_8008F2F8(globalCtx) == 4) || (player->stateFlags2 & 0x00040000)) + else if ((player->stateFlags2 & 0x00200000) || (func_8008F2F8(globalCtx) == 4) || + (player->stateFlags2 & 0x00040000)) cUpAlpha = 0x46; else cUpAlpha = interfaceCtx->healthAlpha; - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), - R_C_BTN_COLOR(2), cUpAlpha); - gDPSetCombineLERP(gfxCtx->overlay.p++, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_C_UP_BTN_X << 2, R_C_UP_BTN_Y << 2, - (R_C_UP_BTN_X + 16) << 2, (R_C_UP_BTN_Y + 16) << 2, - G_TX_RENDERTILE, - 0, 0, - 2048, 2048); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), cUpAlpha); + gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, + PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); + gSPTextureRectangle(gfxCtx->overlay.p++, R_C_UP_BTN_X << 2, R_C_UP_BTN_Y << 2, (R_C_UP_BTN_X + 16) << 2, + (R_C_UP_BTN_Y + 16) << 2, G_TX_RENDERTILE, 0, 0, 2048, 2048); gDPPipeSync(gfxCtx->overlay.p++); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, cUpAlpha); gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0x00); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, sCUpLabelTextures[gSaveContext.language]); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, - 0, 0, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, + sCUpLabelTextures[gSaveContext.language]); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPLoadSync(gfxCtx->overlay.p++); gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 63, 1024); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, - 2, 0, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, 2, 0, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 124, 28); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_C_UP_ICON_X << 2, R_C_UP_ICON_Y << 2, - (R_C_UP_ICON_X + 8) << 2, (R_C_UP_ICON_Y + 32) << 2, - G_TX_RENDERTILE, - 0, 0, - 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, R_C_UP_ICON_X << 2, R_C_UP_ICON_Y << 2, (R_C_UP_ICON_X + 8) << 2, + (R_C_UP_ICON_Y + 32) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024); } sCUpTimer--; - if (sCUpTimer == 0) - { + if (sCUpTimer == 0) { sCUpTimer = 10; sCUpInvisible ^= 1; } @@ -3309,29 +2818,21 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) gDPPipeSync(gfxCtx->overlay.p++); // Empty C Button Arrows - for (i = 1; i < 4; i++) - { - if (gSaveContext.equips.button_items[i] > 0xF0) - { + for (i = 1; i < 4; i++) { + if (gSaveContext.equips.button_items[i] > 0xF0) { if (i == 1) - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), - R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), + interfaceCtx->cLeftAlpha); else if (i == 2) - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), - R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), + interfaceCtx->cDownAlpha); else - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), - R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), + interfaceCtx->cRightAlpha); - gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, - &D_02000A00[i + 1], - 0x20, 0x20, - R_ITEM_BTN_X(i), R_ITEM_BTN_Y(i), - R_ITEM_BTN_WIDTH(i), R_ITEM_BTN_WIDTH(i), - R_ITEM_BTN_DD(i) * 2, R_ITEM_BTN_DD(i) * 2); + gfxCtx->overlay.p = + Draw_TextureIA8(gfxCtx->overlay.p, &D_02000A00[i + 1], 0x20, 0x20, R_ITEM_BTN_X(i), R_ITEM_BTN_Y(i), + R_ITEM_BTN_WIDTH(i), R_ITEM_BTN_WIDTH(i), R_ITEM_BTN_DD(i) * 2, R_ITEM_BTN_DD(i) * 2); } } @@ -3342,39 +2843,25 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx); #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_DrawItemButtons.s") #endif -void Interface_DrawItemIconTexture(GlobalContext* globalCtx, void* texture, s16 button) -{ +void Interface_DrawItemIconTexture(GlobalContext* globalCtx, void* texture, s16 button) { GraphicsContext* gfxCtx; Gfx* gfxArr[4]; gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 3079); - gDPLoadTextureBlock(gfxCtx->overlay.p++, - texture, - G_IM_FMT_RGBA, - G_IM_SIZ_32b, - 32, 32, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gfxCtx->overlay.p++, texture, G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_ITEM_ICON_X(button) << 2, - R_ITEM_ICON_Y(button) << 2, + gSPTextureRectangle(gfxCtx->overlay.p++, R_ITEM_ICON_X(button) << 2, R_ITEM_ICON_Y(button) << 2, (R_ITEM_ICON_X(button) + R_ITEM_ICON_WIDTH(button)) << 2, - (R_ITEM_ICON_Y(button) + R_ITEM_ICON_WIDTH(button)) << 2, - G_TX_RENDERTILE, - 0, 0, - R_ITEM_ICON_DD(button) * 2, - R_ITEM_ICON_DD(button) * 2); + (R_ITEM_ICON_Y(button) + R_ITEM_ICON_WIDTH(button)) << 2, G_TX_RENDERTILE, 0, 0, + R_ITEM_ICON_DD(button) * 2, R_ITEM_ICON_DD(button) * 2); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 3094); } -void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) -{ +void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) { s16 item; s16 ammo; GraphicsContext* gfxCtx; @@ -3386,70 +2873,56 @@ void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) item = gSaveContext.equips.button_items[button]; - if ((item == ITEM_STICK) || (item == ITEM_NUT) || - (item == ITEM_BOMB) || (item == ITEM_BOW) || - ((item >= ITEM_BOW_ARROW_FIRE) && (item <= ITEM_BOW_ARROW_LIGHT)) || - (item == ITEM_SLINGSHOT) || (item == ITEM_BOMBCHU) || (item == ITEM_BEAN)) - { - if ((item >= ITEM_BOW_ARROW_FIRE) && (item <= ITEM_BOW_ARROW_LIGHT)) + if ((item == ITEM_STICK) || (item == ITEM_NUT) || (item == ITEM_BOMB) || (item == ITEM_BOW) || + ((item >= ITEM_BOW_ARROW_FIRE) && (item <= ITEM_BOW_ARROW_LIGHT)) || (item == ITEM_SLINGSHOT) || + (item == ITEM_BOMBCHU) || (item == ITEM_BEAN)) { + if ((item >= ITEM_BOW_ARROW_FIRE) && (item <= ITEM_BOW_ARROW_LIGHT)) { item = ITEM_BOW; + } ammo = AMMO(item); gDPPipeSync(gfxCtx->overlay.p++); - if ((button == 0) && (gSaveContext.minigame_state == 1)) - { + if ((button == 0) && (gSaveContext.minigame_state == 1)) { ammo = globalCtx->interfaceCtx.hbaAmmo; - } - else if ((button == 0) && (globalCtx->unk_11E5C >= 2)) - { + } else if ((button == 0) && (globalCtx->unk_11E5C >= 2)) { ammo = globalCtx->unk_11E5C - 1; - } - else if ((button == 0) && (globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) - { + } else if ((button == 0) && (globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) { ammo = globalCtx->bombchuBowlingAmmo; - if (ammo < 0) + if (ammo < 0) { ammo = 0; - } - else if (((item == ITEM_BOW) && (AMMO(item) == CUR_CAPACITY(UPG_QUIVER))) || - ((item == ITEM_BOMB) && (AMMO(item) == CUR_CAPACITY(UPG_BOMB_BAG))) || - ((item == ITEM_SLINGSHOT) && (AMMO(item) == CUR_CAPACITY(UPG_BULLET_BAG))) || - ((item == ITEM_STICK) && (AMMO(item) == CUR_CAPACITY(UPG_STICKS))) || - ((item == ITEM_NUT) && (AMMO(item) == CUR_CAPACITY(UPG_NUTS))) || - ((item == ITEM_BOMBCHU) && (ammo == 50)) || - ((item == ITEM_BEAN) && (ammo == 15))) - { + } + } else if (((item == ITEM_BOW) && (AMMO(item) == CUR_CAPACITY(UPG_QUIVER))) || + ((item == ITEM_BOMB) && (AMMO(item) == CUR_CAPACITY(UPG_BOMB_BAG))) || + ((item == ITEM_SLINGSHOT) && (AMMO(item) == CUR_CAPACITY(UPG_BULLET_BAG))) || + ((item == ITEM_STICK) && (AMMO(item) == CUR_CAPACITY(UPG_STICKS))) || + ((item == ITEM_NUT) && (AMMO(item) == CUR_CAPACITY(UPG_NUTS))) || + ((item == ITEM_BOMBCHU) && (ammo == 50)) || ((item == ITEM_BEAN) && (ammo == 15))) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x78, 0xFF, 0x00, alpha); } - if (ammo == 0) + if (ammo == 0) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x64, 0x64, 0x64, alpha); + } - for (i = 0; ammo >= 10; i++) + for (i = 0; ammo >= 10; i++) { ammo -= 10; + } - if (i != 0) - gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, - &D_020035C0[i], - 8, 8, - R_ITEM_AMMO_X(button), R_ITEM_AMMO_Y(button), - 8, 8, - 1024, 1024); + if (i != 0) { + gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, &D_020035C0[i], 8, 8, R_ITEM_AMMO_X(button), + R_ITEM_AMMO_Y(button), 8, 8, 1024, 1024); + } - gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, - &D_020035C0[ammo], - 8, 8, - R_ITEM_AMMO_X(button) + 6, R_ITEM_AMMO_Y(button), - 8, 8, - 1024, 1024); + gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, &D_020035C0[ammo], 8, 8, R_ITEM_AMMO_X(button) + 6, + R_ITEM_AMMO_Y(button), 8, 8, 1024, 1024); } func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 3158); } -void Interface_DrawActionButton(GlobalContext* globalCtx) -{ +void Interface_DrawActionButton(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3461,33 +2934,28 @@ void Interface_DrawActionButton(GlobalContext* globalCtx) Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); - if (1) ; // Necessary to match + if (1) {} // Necessary to match - gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3177), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3177), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPVertex(gfxCtx->overlay.p++, interfaceCtx->vtx_128, 4, 0); - gDPLoadTextureBlock(gfxCtx->overlay.p++, - &D_02000A00[0], - G_IM_FMT_IA, - G_IM_SIZ_8b, - 32, 32, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gfxCtx->overlay.p++, &D_02000A00[0], G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); gSP1Quadrangle(gfxCtx->overlay.p++, 0, 2, 3, 1, 0); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 3187); } -void Interface_InitVertices(GlobalContext* globalCtx) -{ +void Interface_InitVertices(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; s16 i; interfaceCtx->vtx_128 = Graph_Alloc(globalCtx->state.gfxCtx, 8 * sizeof(Vtx)); + // clang-format off interfaceCtx->vtx_128[0].v.ob[0] = interfaceCtx->vtx_128[2].v.ob[0] = -14; interfaceCtx->vtx_128[1].v.ob[0] = @@ -3508,8 +2976,7 @@ void Interface_InitVertices(GlobalContext* globalCtx) interfaceCtx->vtx_128[6].v.ob[1] = interfaceCtx->vtx_128[7].v.ob[1] = interfaceCtx->vtx_128[4].v.ob[1] - XREG(28); - for (i = 0; i < 8; i += 4) - { + for (i = 0; i < 8; i += 4) { interfaceCtx->vtx_128[i].v.ob[2] = interfaceCtx->vtx_128[i+1].v.ob[2] = interfaceCtx->vtx_128[i+2].v.ob[2] = interfaceCtx->vtx_128[i+3].v.ob[2] = 0; @@ -3561,10 +3028,10 @@ void Interface_InitVertices(GlobalContext* globalCtx) interfaceCtx->vtx_12C[2].v.cn[2] = interfaceCtx->vtx_12C[3].v.cn[2] = interfaceCtx->vtx_12C[0].v.cn[3] = interfaceCtx->vtx_12C[1].v.cn[3] = interfaceCtx->vtx_12C[2].v.cn[3] = interfaceCtx->vtx_12C[3].v.cn[3] = 0xFF; + // clang-format on } -void func_8008A8B8(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3, s32 arg4) -{ +void func_8008A8B8(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; Vec3f sp40; Vec3f sp34; @@ -3585,8 +3052,7 @@ void func_8008A8B8(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3, s32 a func_800AB560(&interfaceCtx->view); } -void func_8008A994(InterfaceContext* interfaceCtx) -{ +void func_8008A994(InterfaceContext* interfaceCtx) { s32 sp18[4]; // clang-format off @@ -3606,13 +3072,8 @@ s16 sTimerDigitLeftPos[] = { 16, 25, 34, 42, 51 }; s16 sDigitWidth[] = { 9, 9, 8, 9, 9 }; // unused, most likely colors -s16 D_80125B1C[][3] = -{ - { 0x00, 0x96, 0x00 }, - { 0x64, 0xFF, 0x00 }, - { 0xFF, 0xFF, 0xFF }, - { 0x00, 0x00, 0x00 }, - { 0xFF, 0xFF, 0xFF }, +s16 D_80125B1C[][3] = { + { 0x00, 0x96, 0x00 }, { 0x64, 0xFF, 0x00 }, { 0xFF, 0xFF, 0xFF }, { 0x00, 0x00, 0x00 }, { 0xFF, 0xFF, 0xFF }, }; s16 sRupeeDigitsFirst[] = { 1, 0, 0 }; @@ -3620,14 +3081,13 @@ s16 sRupeeDigitsCount[] = { 2, 3, 3 }; s16 sSpoilingItemEntrances[] = { 0x01AD, 0x0153, 0x0153 }; -u16 D_80125B54 = 0xC220; // unused -u16 D_80125B58 = 0xC20C; // unused +u16 D_80125B54 = 0xC220; // unused +u16 D_80125B58 = 0xC20C; // unused s16 D_80125B5C[] = { 91, 91 }; // unused #ifdef NON_MATCHING // mostly regalloc, minor ordering and stack usage differences -void Interface_Draw(GlobalContext* globalCtx) -{ +void Interface_Draw(GlobalContext* globalCtx) { static s16 D_8015FFE0; static s16 D_8015FFE2; static s16 D_8015FFE4; @@ -3655,8 +3115,7 @@ void Interface_Draw(GlobalContext* globalCtx) gSPSegment(gfxCtx->overlay.p++, 0x08, interfaceCtx->icon_itemSegment); gSPSegment(gfxCtx->overlay.p++, 0x0B, interfaceCtx->mapSegment); - if (pauseCtx->flag == 0) - { + if (pauseCtx->flag == 0) { Interface_InitVertices(globalCtx); func_8008A994(interfaceCtx); Interface_DrawHealth(globalCtx); @@ -3666,15 +3125,9 @@ void Interface_Draw(GlobalContext* globalCtx) // Rupee Icon gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xC8, 0xFF, 0x64, interfaceCtx->magicAlpha); gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x50, 0x00, 0xFF); - gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, - D_02001F00, - 16, 16, - 26, 206, - 16, 16, - 1024, 1024); + gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, D_02001F00, 16, 16, 26, 206, 16, 16, 1024, 1024); - switch (globalCtx->sceneNum) - { + switch (globalCtx->sceneNum) { case SCENE_BMORI1: case SCENE_HIDAN: case SCENE_MIZUSIN: @@ -3689,53 +3142,38 @@ void Interface_Draw(GlobalContext* globalCtx) case SCENE_GANON_SONOGO: case SCENE_GANONTIKA_SONOGO: case SCENE_TAKARAYA: - if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] >= 0) - { + if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] >= 0) { // Small Key Icon gDPPipeSync(gfxCtx->overlay.p++); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xC8, 0xE6, 0xFF, interfaceCtx->magicAlpha); gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x14, 0xFF); - gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, - D_02001E00, - 16, 16, - 26, 190, - 16, 16, - 1024, 1024); + gfxCtx->overlay.p = + Draw_TextureIA8(gfxCtx->overlay.p, D_02001E00, 16, 16, 26, 190, 16, 16, 1024, 1024); // Small Key Counter gDPPipeSync(gfxCtx->overlay.p++); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->magicAlpha); - gDPSetCombineLERP(gfxCtx->overlay.p++, - 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, - 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, + PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); interfaceCtx->counterDigits[2] = 0; interfaceCtx->counterDigits[3] = gSaveContext.dungeon_keys[gSaveContext.dungeon_index]; - while (interfaceCtx->counterDigits[3] >= 10) - { + while (interfaceCtx->counterDigits[3] >= 10) { interfaceCtx->counterDigits[2]++; interfaceCtx->counterDigits[3] -= 10; } phi_s2 = 42; - if (interfaceCtx->counterDigits[2] != 0) - { - gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, - &D_02003040[interfaceCtx->counterDigits[2]], - 8, 16, - phi_s2, 190, - 8, 16, - 1024, 1024); + if (interfaceCtx->counterDigits[2] != 0) { + gfxCtx->overlay.p = + Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[interfaceCtx->counterDigits[2]], 8, 16, + phi_s2, 190, 8, 16, 1024, 1024); phi_s2 = 50; } - gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, - &D_02003040[interfaceCtx->counterDigits[3]], - 8, 16, - phi_s2, 190, - 8, 16, - 1024, 1024); + gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[interfaceCtx->counterDigits[3]], + 8, 16, phi_s2, 190, 8, 16, 1024, 1024); } phi_s2 = 42; @@ -3757,9 +3195,8 @@ void Interface_Draw(GlobalContext* globalCtx) else gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x64, 0x64, 0x64, interfaceCtx->magicAlpha); - gDPSetCombineLERP(gfxCtx->overlay.p++, - 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, - 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, + 0, PRIMITIVE, 0); interfaceCtx->counterDigits[0] = interfaceCtx->counterDigits[1] = 0; interfaceCtx->counterDigits[2] = gSaveContext.rupees; @@ -3767,14 +3204,12 @@ void Interface_Draw(GlobalContext* globalCtx) if ((interfaceCtx->counterDigits[2] >= 10000) || (interfaceCtx->counterDigits[2] < 0)) interfaceCtx->counterDigits[2] &= 0xDDD; - while (interfaceCtx->counterDigits[2] >= 100) - { + while (interfaceCtx->counterDigits[2] >= 100) { interfaceCtx->counterDigits[2] -= 100; interfaceCtx->counterDigits[0]++; } - while (interfaceCtx->counterDigits[2] >= 10) - { + while (interfaceCtx->counterDigits[2] >= 10) { interfaceCtx->counterDigits[2] -= 10; interfaceCtx->counterDigits[1]++; } @@ -3782,14 +3217,9 @@ void Interface_Draw(GlobalContext* globalCtx) phi_s0 = sRupeeDigitsFirst[CUR_UPG_VALUE(UPG_WALLET)]; phi_s1 = sRupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)]; - for (phi_s3 = 0; phi_s3 < phi_s1; phi_s3++, phi_s0++, phi_s2 += 8) - { - gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, - &D_02003040[interfaceCtx->counterDigits[phi_s0]], - 8, 16, - phi_s2, 206, - 8, 16, - 1024, 1024); + for (phi_s3 = 0; phi_s3 < phi_s1; phi_s3++, phi_s0++, phi_s2 += 8) { + gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[interfaceCtx->counterDigits[phi_s0]], 8, + 16, phi_s2, 206, 8, 16, 1024, 1024); } Interface_DrawMagicBar(globalCtx); @@ -3804,138 +3234,113 @@ void Interface_Draw(GlobalContext* globalCtx) gDPPipeSync(gfxCtx->overlay.p++); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->bAlpha); - gDPSetCombineLERP(gfxCtx->overlay.p++, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, + 0, TEXEL0, 0, PRIMITIVE, 0); - if (interfaceCtx->unk_1FA == 0) - { + if (interfaceCtx->unk_1FA == 0) { // B Button Icon & possibly Ammo Count - if (gSaveContext.equips.button_items[0] != ITEM_NONE) - { + if (gSaveContext.equips.button_items[0] != ITEM_NONE) { Interface_DrawItemIconTexture(globalCtx, (void*)(u32)interfaceCtx->icon_itemSegment, 0); if ((player->stateFlags1 & 0x00800000) || (globalCtx->unk_11E5C >= 2) || - ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) - { + ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, + PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, + 0); Interface_DrawAmmoCount(globalCtx, 0, interfaceCtx->bAlpha); } } - } - else - { + } else { // B Button Do Action Label gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->bAlpha); - gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, (u32)interfaceCtx->do_actionSegment + 0x180); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, - 0, 0x0000, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, + (u32)interfaceCtx->do_actionSegment + 0x180); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPLoadSync(gfxCtx->overlay.p++); gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 191, 683); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, - 3, 0x0000, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, 3, 0x0000, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 188, 60); R_B_LABEL_DD = 1024.0f / (WREG(37 + gSaveContext.language) / 100.0f); - gSPTextureRectangle(gfxCtx->overlay.p++, - R_B_LABEL_X(gSaveContext.language) << 2, R_B_LABEL_Y(gSaveContext.language) << 2, - (R_B_LABEL_X(gSaveContext.language) + 48) << 2, R_B_LABEL_Y(gSaveContext.language) << 2, - G_TX_RENDERTILE, - 0, 0, - R_B_LABEL_DD, R_B_LABEL_DD); + gSPTextureRectangle(gfxCtx->overlay.p++, R_B_LABEL_X(gSaveContext.language) << 2, + R_B_LABEL_Y(gSaveContext.language) << 2, (R_B_LABEL_X(gSaveContext.language) + 48) << 2, + R_B_LABEL_Y(gSaveContext.language) << 2, G_TX_RENDERTILE, 0, 0, R_B_LABEL_DD, + R_B_LABEL_DD); } gDPPipeSync(gfxCtx->overlay.p++); // C-Left Button Icon & Ammo Count - if (gSaveContext.equips.button_items[1] < 0xF0) - { + if (gSaveContext.equips.button_items[1] < 0xF0) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->cLeftAlpha); - gDPSetCombineLERP(gfxCtx->overlay.p++, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, + PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x1000), 1); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); Interface_DrawAmmoCount(globalCtx, 1, interfaceCtx->cLeftAlpha); } gDPPipeSync(gfxCtx->overlay.p++); // C-Down Button Icon & Ammo Count - if (gSaveContext.equips.button_items[2] < 0xF0) - { + if (gSaveContext.equips.button_items[2] < 0xF0) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->cDownAlpha); - gDPSetCombineLERP(gfxCtx->overlay.p++, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, + PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x2000), 2); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); Interface_DrawAmmoCount(globalCtx, 2, interfaceCtx->cDownAlpha); } gDPPipeSync(gfxCtx->overlay.p++); // C-Right Button Icon & Ammo Count - if (gSaveContext.equips.button_items[3] < 0xF0) - { + if (gSaveContext.equips.button_items[3] < 0xF0) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->cRightAlpha); - gDPSetCombineLERP(gfxCtx->overlay.p++, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, + PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x3000), 3); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); Interface_DrawAmmoCount(globalCtx, 3, interfaceCtx->cRightAlpha); } // A Button func_80094A14(globalCtx->state.gfxCtx); - func_8008A8B8(globalCtx, - R_A_BTN_Y, R_A_BTN_Y + 45, - R_A_BTN_X, R_A_BTN_X + 45); + func_8008A8B8(globalCtx, R_A_BTN_Y, R_A_BTN_Y + 45, R_A_BTN_X, R_A_BTN_X + 45); gSPClearGeometryMode(gfxCtx->overlay.p++, G_CULL_BOTH); - gDPSetCombineLERP(gfxCtx->overlay.p++, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - R_A_BTN_COLOR(0), R_A_BTN_COLOR(1), - R_A_BTN_COLOR(2), interfaceCtx->aAlpha); + gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, + 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_A_BTN_COLOR(0), R_A_BTN_COLOR(1), R_A_BTN_COLOR(2), + interfaceCtx->aAlpha); Interface_DrawActionButton(globalCtx); gDPPipeSync(gfxCtx->overlay.p++); - func_8008A8B8(globalCtx, - R_A_ICON_Y, R_A_ICON_Y + 45, - R_A_ICON_X, R_A_ICON_X + 45); + func_8008A8B8(globalCtx, R_A_ICON_Y, R_A_ICON_Y + 45, R_A_ICON_X, R_A_ICON_X + 45); gSPSetGeometryMode(gfxCtx->overlay.p++, G_CULL_BACK); - gDPSetCombineLERP(gfxCtx->overlay.p++, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->aAlpha); gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0x00); Matrix_Translate(0.0f, 0.0f, WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3701), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3701), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPVertex(gfxCtx->overlay.p++, &interfaceCtx->vtx_128[4], 4, 0); if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3)) @@ -3947,71 +3352,66 @@ void Interface_Draw(GlobalContext* globalCtx) func_8008A994(interfaceCtx); - if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 3)) - { + if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 3)) { // Inventory Equip Effects gSPSegment(gfxCtx->overlay.p++, 0x08, pauseCtx->unk_128); func_80094A14(globalCtx->state.gfxCtx); - gDPSetCombineLERP(gfxCtx->overlay.p++, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, + PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); gSPMatrix(gfxCtx->overlay.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); pauseCtx->vtx_168[16].v.ob[0] = pauseCtx->vtx_168[18].v.ob[0] = pauseCtx->unk_254 / 10; - pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] = pauseCtx->vtx_168[16].v.ob[0] + WREG(90) / 10; + pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] = + pauseCtx->vtx_168[16].v.ob[0] + WREG(90) / 10; pauseCtx->vtx_168[16].v.ob[1] = pauseCtx->vtx_168[17].v.ob[1] = pauseCtx->unk_256 / 10; - pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] = pauseCtx->vtx_168[16].v.ob[1] - WREG(90) / 10; + pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] = + pauseCtx->vtx_168[16].v.ob[1] - WREG(90) / 10; - if (pauseCtx->unk_24E < 0xBF) - { + if (pauseCtx->unk_24E < 0xBF) { // Normal Equip (icon goes from the inventory slot to the C button when equipping it) gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, pauseCtx->unk_258); gSPVertex(gfxCtx->overlay.p++, &pauseCtx->vtx_168[16], 4, 0); gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 1, gItemIcons[pauseCtx->unk_24E]); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, - 0, 0x0000, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0, 0x0000, G_TX_LOADTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPLoadSync(gfxCtx->overlay.p++); gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 1023, 128); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, - 8, 0x0000, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 8, 0x0000, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 124, 124); - } - else - { + } else { // Magic Arrow Equip Effect phi_s3_2 = pauseCtx->unk_24E - 0xBF; - gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, - sMagicArrowEffectsR[phi_s3_2], sMagicArrowEffectsG[phi_s3_2], + gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, sMagicArrowEffectsR[phi_s3_2], sMagicArrowEffectsG[phi_s3_2], sMagicArrowEffectsB[phi_s3_2], pauseCtx->unk_258); - if ((pauseCtx->unk_258 > 0) && (pauseCtx->unk_258 < 0xFF)) - { + if ((pauseCtx->unk_258 > 0) && (pauseCtx->unk_258 < 0xFF)) { phi_s3_2 = (pauseCtx->unk_258 / 8) / 2; - pauseCtx->vtx_168[16].v.ob[0] = pauseCtx->vtx_168[18].v.ob[0] = pauseCtx->vtx_168[16].v.ob[0] - phi_s3_2; - pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] = pauseCtx->vtx_168[16].v.ob[0] + phi_s3_2 * 2 + 32; - pauseCtx->vtx_168[16].v.ob[1] = pauseCtx->vtx_168[17].v.ob[1] = pauseCtx->vtx_168[16].v.ob[1] + phi_s3_2; - pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] = pauseCtx->vtx_168[16].v.ob[1] - phi_s3_2 * 2 - 32; + pauseCtx->vtx_168[16].v.ob[0] = pauseCtx->vtx_168[18].v.ob[0] = + pauseCtx->vtx_168[16].v.ob[0] - phi_s3_2; + pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] = + pauseCtx->vtx_168[16].v.ob[0] + phi_s3_2 * 2 + 32; + pauseCtx->vtx_168[16].v.ob[1] = pauseCtx->vtx_168[17].v.ob[1] = + pauseCtx->vtx_168[16].v.ob[1] + phi_s3_2; + pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] = + pauseCtx->vtx_168[16].v.ob[1] - phi_s3_2 * 2 - 32; } gSPVertex(gfxCtx->overlay.p++, &pauseCtx->vtx_168[16], 4, 0); gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, D_080895C0); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, - 0, 0x0000, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPLoadSync(gfxCtx->overlay.p++); gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 511, 512); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_8b, - 4, 0x0000, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_8b, 4, 0x0000, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 124, 124); } @@ -4020,108 +3420,82 @@ void Interface_Draw(GlobalContext* globalCtx) func_80094520(globalCtx->state.gfxCtx); - if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) - { - if (gSaveContext.minigame_state != 1) - { + if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) { + if (gSaveContext.minigame_state != 1) { // Carrots rendering if the action corresponds to riding a horse - if (interfaceCtx->unk_1EE == 8) - { + if (interfaceCtx->unk_1EE == 8) { // Load Carrot Icon gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 1, &D_02002100); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, - 0, 0x0000, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0, 0x0000, G_TX_LOADTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD); gDPLoadSync(gfxCtx->overlay.p++); gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 255, 256); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, - 4, 0x0000, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 4, 0x0000, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD); gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 60, 60); // Draw 6 carrots phi_s1 = ZREG(14); - for (phi_s3 = 1; phi_s3 < 7; phi_s3++) - { + for (phi_s3 = 1; phi_s3 < 7; phi_s3++) { // Carrot Color (based on availability) if ((interfaceCtx->unk_23A == 0) || (interfaceCtx->unk_23A < phi_s3)) gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x00, 0x96, 0xFF, interfaceCtx->aAlpha); else gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->aAlpha); - gSPTextureRectangle(gfxCtx->overlay.p++, - phi_s1 << 2, ZREG(15) << 2, - (phi_s1 + 16) << 2, (ZREG(15) + 16) << 2, - G_TX_RENDERTILE, - 0, 0, - 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, phi_s1 << 2, ZREG(15) << 2, (phi_s1 + 16) << 2, + (ZREG(15) + 16) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024); phi_s1 += 16; } } - } - else - { + } else { // Score for the Horseback Archery gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->bAlpha); // Target Icon gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_02002600); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, - 0, 0x0000, G_TX_LOADTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPLoadSync(gfxCtx->overlay.p++); gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 383, 342); gDPPipeSync(gfxCtx->overlay.p++); - gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, - 6, 0x0000, G_TX_RENDERTILE, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 6, 0x0000, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOLOD); gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 92, 60); - gSPTextureRectangle(gfxCtx->overlay.p++, - (WREG(32) + 28) << 2, ZREG(15) << 2, - (WREG(32) + 52) << 2, (ZREG(15) + 16) << 2, - G_TX_RENDERTILE, - 0, 0, - 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, (WREG(32) + 28) << 2, ZREG(15) << 2, (WREG(32) + 52) << 2, + (ZREG(15) + 16) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024); // Score Counter gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, - 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, + TEXEL0, 0, PRIMITIVE, 0); phi_s0 = 0; phi_s1 = WREG(32) + 6 * 9; - for (phi_s3 = 0; phi_s3 < 4; phi_s3++) - { - if (sHBAScoreDigits[phi_s3] != 0 || (phi_s0 != 0) || (phi_s3 >= 3)) - { - gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, - &D_02003040[sHBAScoreDigits[phi_s3]], - 8, 16, - phi_s1, ZREG(15) - 2, - sDigitWidth[0], VREG(42), - VREG(43) * 2, VREG(43) * 2); + for (phi_s3 = 0; phi_s3 < 4; phi_s3++) { + if (sHBAScoreDigits[phi_s3] != 0 || (phi_s0 != 0) || (phi_s3 >= 3)) { + gfxCtx->overlay.p = + Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[sHBAScoreDigits[phi_s3]], 8, 16, phi_s1, + ZREG(15) - 2, sDigitWidth[0], VREG(42), VREG(43) * 2, VREG(43) * 2); phi_s1 += 9; phi_s0++; } } gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, + PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); } } - if ((gSaveContext.timer_2_state == 5) && (func_8010BDBC(&globalCtx->msgCtx) == 5)) - { + if ((gSaveContext.timer_2_state == 5) && (func_8010BDBC(&globalCtx->msgCtx) == 5)) { // Trade quest timer reached 0 gSaveContext.cutscene_index = 0; globalCtx->sceneLoadFlag = 0x14; @@ -4132,8 +3506,7 @@ void Interface_Draw(GlobalContext* globalCtx) if ((gSaveContext.equips.button_items[0] != ITEM_SWORD_KOKIRI) && (gSaveContext.equips.button_items[0] != ITEM_SWORD_MASTER) && (gSaveContext.equips.button_items[0] != ITEM_SWORD_BGS) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE)) - { + (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE)) { if (gSaveContext.button_status[0] != BTN_ENABLED) gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; else @@ -4141,19 +3514,15 @@ void Interface_Draw(GlobalContext* globalCtx) } // Revert any spoiling trade quest items - for (phi_s3 = 0; phi_s3 < ARRAY_COUNT(gSpoilingItems); phi_s3++) - { - if (INV_CONTENT(ITEM_POCKET_EGG) == gSpoilingItems[phi_s3]) - { + for (phi_s3 = 0; phi_s3 < ARRAY_COUNT(gSpoilingItems); phi_s3++) { + if (INV_CONTENT(ITEM_POCKET_EGG) == gSpoilingItems[phi_s3]) { gSaveContext.event_inf[0] &= 0x7F80; osSyncPrintf("EVENT_INF=%x\n", gSaveContext.event_inf[0]); globalCtx->nextEntranceIndex = sSpoilingItemEntrances[phi_s3]; INV_CONTENT(gSpoilingItemReverts[phi_s3]) = gSpoilingItemReverts[phi_s3]; - for (phi_s0 = 1; phi_s0 < 4; phi_s0++) - { - if (gSaveContext.equips.button_items[phi_s0] == gSpoilingItems[phi_s3]) - { + for (phi_s0 = 1; phi_s0 < 4; phi_s0++) { + if (gSaveContext.equips.button_items[phi_s0] == gSpoilingItems[phi_s3]) { gSaveContext.equips.button_items[phi_s0] = gSpoilingItemReverts[phi_s3]; Interface_LoadItemIcon1(globalCtx, phi_s0); } @@ -4162,21 +3531,13 @@ void Interface_Draw(GlobalContext* globalCtx) } } - if ((globalCtx->pauseCtx.state == 0) && - (globalCtx->pauseCtx.flag == 0) && - (globalCtx->unk_10A20 == 0) && - (msgCtx->msgMode == 0) && - !(player->stateFlags2 & 0x01000000) && - (globalCtx->sceneLoadFlag == 0) && - (globalCtx->unk_1241B == 0) && - (func_800BFC84(globalCtx) == 0) && - (gSaveContext.minigame_state != 1) && + if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (globalCtx->unk_10A20 == 0) && + (msgCtx->msgMode == 0) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) && + (globalCtx->unk_1241B == 0) && (func_800BFC84(globalCtx) == 0) && (gSaveContext.minigame_state != 1) && (globalCtx->unk_11E5C < 2) && - !((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) - { + !((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { sp274 = 0; - switch (gSaveContext.timer_1_state) - { + switch (gSaveContext.timer_1_state) { case 1: gSaveContext.timer_1_state = 2; gSaveContext.timer_1_value = gSaveContext.health >> 1; @@ -4184,8 +3545,7 @@ void Interface_Draw(GlobalContext* globalCtx) break; case 2: D_8015FFE2--; - if (D_8015FFE2 == 0) - { + if (D_8015FFE2 == 0) { gSaveContext.timer_1_state = 3; D_8015FFE2 = 20; } @@ -4201,8 +3561,7 @@ void Interface_Draw(GlobalContext* globalCtx) case 6: case 12: D_8015FFE2--; - if (D_8015FFE2 == 0) - { + if (D_8015FFE2 == 0) { D_8015FFE2 = 20; if (gSaveContext.timer_1_state == 6) gSaveContext.timer_1_state = 7; @@ -4222,8 +3581,7 @@ void Interface_Draw(GlobalContext* globalCtx) gSaveContext.timer_y[0] -= phi_s3; D_8015FFE2--; - if (D_8015FFE2 == 0) - { + if (D_8015FFE2 == 0) { gSaveContext.timer_x[0] = 26; D_8015FFE2 = 20; @@ -4239,47 +3597,39 @@ void Interface_Draw(GlobalContext* globalCtx) } case 4: case 8: - if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8)) - { + if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8)) { if (gSaveContext.health_capacity > 0xA0) gSaveContext.timer_y[0] = 54; else gSaveContext.timer_y[0] = 46; } - if ((gSaveContext.timer_1_state >= 3) && (msgCtx->unk_E300 == 0)) - { + if ((gSaveContext.timer_1_state >= 3) && (msgCtx->unk_E300 == 0)) { D_8015FFE0--; - if (D_8015FFE0 == 0) - { + if (D_8015FFE0 == 0) { if (gSaveContext.timer_1_value != 0) gSaveContext.timer_1_value--; D_8015FFE0 = 20; - if (gSaveContext.timer_1_value == 0) - { + if (gSaveContext.timer_1_value == 0) { gSaveContext.timer_1_state = 10; - if (D_80125A5C != 0) - { + if (D_80125A5C != 0) { gSaveContext.health = 0; globalCtx->unk_11D58(globalCtx, -(gSaveContext.health + 2)); } D_80125A5C = 0; - } - else if (gSaveContext.timer_1_value > 60) - { + } else if (gSaveContext.timer_1_value > 60) { if (sTimerDigits[4] == 1) - Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - else if (gSaveContext.timer_1_value >= 11) - { + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, + &D_801333E0, &D_801333E8); + } else if (gSaveContext.timer_1_value >= 11) { if (sTimerDigits[4] & 1) - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - else - { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, + &D_801333E0, &D_801333E8); + } else { + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } } } @@ -4295,8 +3645,7 @@ void Interface_Draw(GlobalContext* globalCtx) gSaveContext.timer_y[0] -= phi_s3; D_8015FFE2--; - if (D_8015FFE2 == 0) - { + if (D_8015FFE2 == 0) { gSaveContext.timer_x[0] = 26; D_8015FFE2 = 20; @@ -4308,37 +3657,31 @@ void Interface_Draw(GlobalContext* globalCtx) gSaveContext.timer_1_state = 14; } case 14: - if (gSaveContext.timer_1_state == 14) - { + if (gSaveContext.timer_1_state == 14) { if (gSaveContext.health_capacity > 0xA0) gSaveContext.timer_y[0] = 54; else gSaveContext.timer_y[0] = 46; } - if (gSaveContext.timer_1_state >= 3) - { + if (gSaveContext.timer_1_state >= 3) { D_8015FFE0--; - if (D_8015FFE0 == 0) - { + if (D_8015FFE0 == 0) { gSaveContext.timer_1_value++; D_8015FFE0 = 20; - if (gSaveContext.timer_1_value == 3599) - { + if (gSaveContext.timer_1_value == 3599) { gSaveContext.timer_1_state = 15; D_8015FFE2 = 40; - } - else - { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + } else { + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } } } break; case 10: - if (gSaveContext.timer_2_state != 0) - { + if (gSaveContext.timer_2_state != 0) { gSaveContext.timer_x[1] = 140; gSaveContext.timer_y[1] = 80; D_8015FFE4 = D_8015FFE6 = 20; @@ -4349,9 +3692,7 @@ void Interface_Draw(GlobalContext* globalCtx) gSaveContext.timer_2_state = 8; gSaveContext.timer_1_state = 0; - } - else - { + } else { gSaveContext.timer_1_state = 0; } break; @@ -4359,8 +3700,7 @@ void Interface_Draw(GlobalContext* globalCtx) break; default: sp274 = 1; - switch (gSaveContext.timer_2_state) - { + switch (gSaveContext.timer_2_state) { case 1: case 7: gSaveContext.timer_x[1] = 140; @@ -4374,8 +3714,7 @@ void Interface_Draw(GlobalContext* globalCtx) case 2: case 8: D_8015FFE6--; - if (D_8015FFE6 == 0) - { + if (D_8015FFE6 == 0) { D_8015FFE6 = 20; if (gSaveContext.timer_2_state == 2) gSaveContext.timer_2_state = 3; @@ -4398,8 +3737,7 @@ void Interface_Draw(GlobalContext* globalCtx) gSaveContext.timer_y[1] -= phi_s3; D_8015FFE6--; - if (D_8015FFE6 == 0) - { + if (D_8015FFE6 == 0) { gSaveContext.timer_x[1] = 26; D_8015FFE6 = 20; @@ -4415,70 +3753,54 @@ void Interface_Draw(GlobalContext* globalCtx) } case 4: case 10: - if ((gSaveContext.timer_2_state == 4) || (gSaveContext.timer_2_state == 10)) - { + if ((gSaveContext.timer_2_state == 4) || (gSaveContext.timer_2_state == 10)) { if (gSaveContext.health_capacity > 0xA0) gSaveContext.timer_y[1] = 54; else gSaveContext.timer_y[1] = 46; } - if (gSaveContext.timer_2_state >= 3) - { + if (gSaveContext.timer_2_state >= 3) { D_8015FFE4--; - if (D_8015FFE4 == 0) - { + if (D_8015FFE4 == 0) { D_8015FFE4 = 20; - if (gSaveContext.timer_2_state == 4) - { + if (gSaveContext.timer_2_state == 4) { gSaveContext.timer_2_value--; osSyncPrintf("TOTAL_EVENT_TM=%d\n", gSaveContext.timer_2_value); - if (gSaveContext.timer_2_value <= 0) - { + if (gSaveContext.timer_2_value <= 0) { if (!Flags_GetSwitch(globalCtx, 0x37) || ((globalCtx->sceneNum != SCENE_GANON_DEMO) && (globalCtx->sceneNum != SCENE_GANON_FINAL) && (globalCtx->sceneNum != SCENE_GANON_SONOGO) && - (globalCtx->sceneNum != SCENE_GANONTIKA_SONOGO))) - { + (globalCtx->sceneNum != SCENE_GANONTIKA_SONOGO))) { gSaveContext.timer_2_state = 5; gSaveContext.cutscene_index = 0; D_8015FFE6 = 40; func_8010B680(globalCtx, 0x71B0, 0); func_8002DF54(globalCtx, 0, 8); - } - else - { + } else { gSaveContext.timer_2_state = 6; D_8015FFE6 = 40; } - } - else - { - if (gSaveContext.timer_2_value > 60) - { + } else { + if (gSaveContext.timer_2_value > 60) { if (sTimerDigits[4] == 1) - Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - else if (gSaveContext.timer_2_value > 10) - { + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); + } else if (gSaveContext.timer_2_value > 10) { if (sTimerDigits[4] & 1) - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - else - { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); + } else { + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); } } - } - else - { + } else { gSaveContext.timer_2_value++; - if (gSaveContext.event_inf[1] & 1) - { - if (gSaveContext.timer_2_value == 240) - { + if (gSaveContext.event_inf[1] & 1) { + if (gSaveContext.timer_2_value == 240) { func_8010B680(globalCtx, 0x6083, 0); gSaveContext.timer_2_state = 0; gSaveContext.event_inf[1] &= ~1; @@ -4486,9 +3808,9 @@ void Interface_Draw(GlobalContext* globalCtx) } } - if ((gSaveContext.timer_2_value % 60) == 0) - { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + if ((gSaveContext.timer_2_value % 60) == 0) { + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } } } @@ -4498,12 +3820,11 @@ void Interface_Draw(GlobalContext* globalCtx) if (D_8015FFE6 == 0) gSaveContext.timer_2_state = 0; break; - } + } } if (((gSaveContext.timer_1_state != 0) && (gSaveContext.timer_1_state != 10)) || - (gSaveContext.timer_2_state != 0)) - { + (gSaveContext.timer_2_state != 0)) { sTimerDigits[0] = sTimerDigits[1] = sTimerDigits[3] = 0; sTimerDigits[2] = 10; // digit 10 is used as ':' (colon) @@ -4512,19 +3833,16 @@ void Interface_Draw(GlobalContext* globalCtx) else sTimerDigits[4] = gSaveContext.timer_2_value; - while (sTimerDigits[4] >= 60) - { + while (sTimerDigits[4] >= 60) { sTimerDigits[1]++; - if (sTimerDigits[1] >= 10) - { + if (sTimerDigits[1] >= 10) { sTimerDigits[1] -= 10; sTimerDigits[0]++; } sTimerDigits[4] -= 60; } - while (sTimerDigits[4] >= 10) - { + while (sTimerDigits[4] >= 10) { sTimerDigits[4] -= 10; sTimerDigits[3]++; } @@ -4533,43 +3851,30 @@ void Interface_Draw(GlobalContext* globalCtx) gDPPipeSync(gfxCtx->overlay.p++); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0x00); - gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, - D_02002000, - 16, 16, - gSaveContext.timer_x[sp274], - gSaveContext.timer_y[sp274] + 2, - 16, 16, - 1024, 1024); + gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, D_02002000, 16, 16, gSaveContext.timer_x[sp274], + gSaveContext.timer_y[sp274] + 2, 16, 16, 1024, 1024); // Timer Counter gDPPipeSync(gfxCtx->overlay.p++); - gDPSetCombineLERP(gfxCtx->overlay.p++, - 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, - 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->overlay.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, + TEXEL0, 0, PRIMITIVE, 0); - if (gSaveContext.timer_1_state != 0) - { + if (gSaveContext.timer_1_state != 0) { if ((gSaveContext.timer_1_value < 10) && (gSaveContext.timer_1_state < 11)) gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0x32, 0x00, 0xFF); else gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); - } - else - { + } else { if ((gSaveContext.timer_2_value < 10) && (gSaveContext.timer_2_state < 6)) gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0x32, 0x00, 0xFF); else gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0x00, 0xFF); } - for (phi_s3 = 0; phi_s3 < 5; phi_s3++) - { - gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, - &D_02003040[sTimerDigits[phi_s3]], - 8, 16, + for (phi_s3 = 0; phi_s3 < 5; phi_s3++) { + gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[sTimerDigits[phi_s3]], 8, 16, gSaveContext.timer_x[sp274] + sTimerDigitLeftPos[phi_s3], - gSaveContext.timer_y[sp274], - sDigitWidth[phi_s3], VREG(42), + gSaveContext.timer_y[sp274], sDigitWidth[phi_s3], VREG(42), VREG(43) * 2, VREG(43) * 2); } } @@ -4579,8 +3884,7 @@ void Interface_Draw(GlobalContext* globalCtx) if (pauseCtx->flag == 3) func_8002AAB0(globalCtx); - if (interfaceCtx->unk_244 != 0) - { + if (interfaceCtx->unk_244 != 0) { gDPPipeSync(gfxCtx->overlay.p++); gSPDisplayList(gfxCtx->overlay.p++, sSetupDL_80125A60); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x00, 0x00, 0x00, interfaceCtx->unk_244); @@ -4600,52 +3904,40 @@ s16 sTimerDigits[5]; #ifdef NON_MATCHING // regalloc and minor ordering differences -void Interface_Update(GlobalContext* globalCtx) -{ +void Interface_Update(GlobalContext* globalCtx) { static u8 D_80125B60 = 0; static s16 D_80125B64 = 0; MessageContext* msgCtx = &globalCtx->msgCtx; InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; Player* player = PLAYER; - s16 alpha; // sp+0x3A + s16 alpha; // sp+0x3A s16 alpha1; // sp+0x38 u16 action; Input* input = &globalCtx->state.input[2]; - if (!~(input->padPressed | -0x201)) - { + if (!~(input->padPressed | -0x201)) { gSaveContext.language = 0; osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); - } - else if (!~(input->padPressed | -0x801)) - { + } else if (!~(input->padPressed | -0x801)) { gSaveContext.language = 1; osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); - } - else if (!~(input->padPressed | -0x101)) - { + } else if (!~(input->padPressed | -0x101)) { gSaveContext.language = 2; osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); } - if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) - { + if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) { if ((gSaveContext.minigame_state == 1) || (gSaveContext.scene_setup_index < 4) || - ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.scene_setup_index == 4))) - { - if ((msgCtx->msgMode == 0) || - ((msgCtx->msgMode != 0) && (globalCtx->sceneNum == SCENE_BOWLING))) - { - if (globalCtx->unk_10A20 == 0) - { + ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.scene_setup_index == 4))) { + if ((msgCtx->msgMode == 0) || ((msgCtx->msgMode != 0) && (globalCtx->sceneNum == SCENE_BOWLING))) { + if (globalCtx->unk_10A20 == 0) { func_80083108(globalCtx); } } } } - switch (gSaveContext.unk_13E8) - { + switch (gSaveContext.unk_13E8) { case 1: case 2: case 3: @@ -4687,8 +3979,7 @@ void Interface_Update(GlobalContext* globalCtx) if (interfaceCtx->magicAlpha != 0xFF) interfaceCtx->magicAlpha = alpha1; - switch (globalCtx->sceneNum) - { + switch (globalCtx->sceneNum) { case SCENE_SPOT00: case SCENE_SPOT01: case SCENE_SPOT02: @@ -4735,8 +4026,7 @@ void Interface_Update(GlobalContext* globalCtx) func_8008226C(globalCtx); - if (gSaveContext.health_accumulator != 0) - { + if (gSaveContext.health_accumulator != 0) { gSaveContext.health_accumulator -= 4; gSaveContext.health += 4; @@ -4745,10 +4035,10 @@ void Interface_Update(GlobalContext* globalCtx) osSyncPrintf("now_life=%d max_life=%d\n", gSaveContext.health, gSaveContext.health_capacity); - if (gSaveContext.health >= gSaveContext.health_capacity) - { + if (gSaveContext.health >= gSaveContext.health_capacity) { gSaveContext.health = gSaveContext.health_capacity; - osSyncPrintf("S_Private.now_life=%d S_Private.max_life=%d\n", gSaveContext.health, gSaveContext.health_capacity); + osSyncPrintf("S_Private.now_life=%d S_Private.max_life=%d\n", gSaveContext.health, + gSaveContext.health_capacity); gSaveContext.health_accumulator = 0; } } @@ -4756,57 +4046,36 @@ void Interface_Update(GlobalContext* globalCtx) Health_HandleCriticalAlarm(globalCtx); D_80125A58 = func_8008F2F8(globalCtx); - if (D_80125A58 == 1) - { - if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 2) - { + if (D_80125A58 == 1) { + if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 2) { D_80125A58 = 0; } - } - else if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) - { - if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 3) - { + } else if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) { + if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 3) { D_80125A58 = 0; } } Health_UpdateData(globalCtx); - if ((gSaveContext.timer_1_state >= 3) && - (globalCtx->pauseCtx.state == 0) && - (globalCtx->pauseCtx.flag == 0) && - (msgCtx->msgMode == 0) && - !(player->stateFlags2 & 0x01000000) && - (globalCtx->sceneLoadFlag == 0) && - (globalCtx->unk_1241B == 0) && - (func_800BFC84(globalCtx) == 0)) - { + if ((gSaveContext.timer_1_state >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && + (msgCtx->msgMode == 0) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) && + (globalCtx->unk_1241B == 0) && (func_800BFC84(globalCtx) == 0)) {} - } - - if (gSaveContext.rupee_accumulator != 0) - { - if (gSaveContext.rupee_accumulator > 0) - { - if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET)) - { + if (gSaveContext.rupee_accumulator != 0) { + if (gSaveContext.rupee_accumulator > 0) { + if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET)) { gSaveContext.rupee_accumulator--; gSaveContext.rupees++; Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - else - { + } else { // Translates to: "Rupee Amount MAX = %d" osSyncPrintf("ルピー数MAX = %d\n", CUR_CAPACITY(UPG_WALLET)); gSaveContext.rupees = CUR_CAPACITY(UPG_WALLET); gSaveContext.rupee_accumulator = 0; } - } - else if (gSaveContext.rupees != 0) - { - if (gSaveContext.rupee_accumulator <= -50) - { + } else if (gSaveContext.rupees != 0) { + if (gSaveContext.rupee_accumulator <= -50) { gSaveContext.rupee_accumulator += 10; gSaveContext.rupees -= 10; @@ -4814,34 +4083,27 @@ void Interface_Update(GlobalContext* globalCtx) gSaveContext.rupees = 0; Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - else - { + } else { gSaveContext.rupee_accumulator++; gSaveContext.rupees--; Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - } - else - { + } else { gSaveContext.rupee_accumulator = 0; } } - switch (interfaceCtx->unk_1EC) - { + switch (interfaceCtx->unk_1EC) { case 1: interfaceCtx->unk_1F4 = interfaceCtx->unk_1F4 + (31400.0f / WREG(5)); - if (interfaceCtx->unk_1F4 >= 15700.0f) - { + if (interfaceCtx->unk_1F4 >= 15700.0f) { interfaceCtx->unk_1F4 = -15700.0f; interfaceCtx->unk_1EC = 2; } break; case 2: interfaceCtx->unk_1F4 = interfaceCtx->unk_1F4 + (31400.0f / WREG(5)); - if (interfaceCtx->unk_1F4 >= 0.0f) - { + if (interfaceCtx->unk_1F4 >= 0.0f) { interfaceCtx->unk_1F4 = 0.0f; interfaceCtx->unk_1EC = 0; interfaceCtx->unk_1EE = interfaceCtx->unk_1F0; @@ -4853,16 +4115,14 @@ void Interface_Update(GlobalContext* globalCtx) break; case 3: interfaceCtx->unk_1F4 = interfaceCtx->unk_1F4 + (31400.0f / WREG(5)); - if (interfaceCtx->unk_1F4 >= 15700.0f) - { + if (interfaceCtx->unk_1F4 >= 15700.0f) { interfaceCtx->unk_1F4 = -15700.0f; interfaceCtx->unk_1EC = 2; } break; case 4: interfaceCtx->unk_1F4 = interfaceCtx->unk_1F4 + (31400.0f / WREG(5)); - if (interfaceCtx->unk_1F4 >= 0.0f) - { + if (interfaceCtx->unk_1F4 >= 0.0f) { interfaceCtx->unk_1F4 = 0.0f; interfaceCtx->unk_1EC = 0; interfaceCtx->unk_1EE = interfaceCtx->unk_1F0; @@ -4878,10 +4138,8 @@ void Interface_Update(GlobalContext* globalCtx) if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (msgCtx->msgMode == 0) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->unk_1241B == 0) && - ((globalCtx->csCtx.state == 0) || (func_8008E988(globalCtx) == 0))) - { - if ((gSaveContext.magic_acquired != 0) && (gSaveContext.magic_level == 0)) - { + ((globalCtx->csCtx.state == 0) || (func_8008E988(globalCtx) == 0))) { + if ((gSaveContext.magic_acquired != 0) && (gSaveContext.magic_level == 0)) { gSaveContext.magic_level = gSaveContext.double_magic + 1; gSaveContext.unk_13F0 = 8; osSyncPrintf(VT_FGCOL(YELLOW)); @@ -4897,38 +4155,27 @@ void Interface_Update(GlobalContext* globalCtx) Interface_UpdateMagicBar(globalCtx); } - if (gSaveContext.timer_1_state == 0) - { - if (((D_80125A58 == 1) || (D_80125A58 == 2) || (D_80125A58 == 4)) && - ((gSaveContext.health >> 1) != 0)) - { + if (gSaveContext.timer_1_state == 0) { + if (((D_80125A58 == 1) || (D_80125A58 == 2) || (D_80125A58 == 4)) && ((gSaveContext.health >> 1) != 0)) { gSaveContext.timer_1_state = 1; gSaveContext.timer_x[0] = 140; gSaveContext.timer_y[0] = 80; D_80125A5C = 1; } - } - else - { - if (((D_80125A58 == 0) || (D_80125A58 == 3)) && - (gSaveContext.timer_1_state < 5)) - { + } else { + if (((D_80125A58 == 0) || (D_80125A58 == 3)) && (gSaveContext.timer_1_state < 5)) { gSaveContext.timer_1_state = 0; } } - if (gSaveContext.minigame_state == 1) - { + if (gSaveContext.minigame_state == 1) { gSaveContext.minigame_score += interfaceCtx->unk_23C; interfaceCtx->unk_23C = 0; - if (sHBAScoreTier == 0) - { + if (sHBAScoreTier == 0) { if (gSaveContext.minigame_score >= 1000) sHBAScoreTier++; - } - else if (sHBAScoreTier == 1) - { + } else if (sHBAScoreTier == 1) { if (gSaveContext.minigame_score >= 1500) sHBAScoreTier++; } @@ -4938,34 +4185,28 @@ void Interface_Update(GlobalContext* globalCtx) sHBAScoreDigits[2] = 0; sHBAScoreDigits[3] = gSaveContext.minigame_score; - while (sHBAScoreDigits[3] >= 1000) - { + while (sHBAScoreDigits[3] >= 1000) { sHBAScoreDigits[0]++; sHBAScoreDigits[3] -= 1000; } - while (sHBAScoreDigits[3] >= 100) - { + while (sHBAScoreDigits[3] >= 100) { sHBAScoreDigits[1]++; sHBAScoreDigits[3] -= 100; } - while (sHBAScoreDigits[3] >= 10) - { + while (sHBAScoreDigits[3] >= 10) { sHBAScoreDigits[2]++; sHBAScoreDigits[3] -= 10; } } - if (gSaveContext.unk_1422 != 0) - { + if (gSaveContext.unk_1422 != 0) { if ((msgCtx->unk_E3F0 != 0x31) && (gSaveContext.unk_1422 == 1)) globalCtx->msgCtx.unk_E3EE = 4; - if (globalCtx->unk_10A26 != 0) - { - if (gSaveContext.unk_1422 != 2) - { + if (globalCtx->unk_10A26 != 0) { + if (gSaveContext.unk_1422 != 2) { D_80125B60 = 0; if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time <= 0xC001)) D_80125B60 = 1; @@ -4973,39 +4214,29 @@ void Interface_Update(GlobalContext* globalCtx) gSaveContext.unk_1422 = 2; D_80125B64 = D_8011FB40; D_8011FB40 = 400; - } - else if ((D_80125B60 == 0) && (gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time <= 0xC001)) - { + } else if ((D_80125B60 == 0) && (gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time <= 0xC001)) { + gSaveContext.unk_1422 = 0; + D_8011FB40 = D_80125B64; + globalCtx->msgCtx.unk_E3EE = 4; + } else if (gSaveContext.day_time > 0xC001) { gSaveContext.unk_1422 = 0; D_8011FB40 = D_80125B64; globalCtx->msgCtx.unk_E3EE = 4; } - else if (gSaveContext.day_time > 0xC001) - { - gSaveContext.unk_1422 = 0; - D_8011FB40 = D_80125B64; - globalCtx->msgCtx.unk_E3EE = 4; - } - } - else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3)) - { - if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time < 0xC001)) - { + } else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3)) { + if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time < 0xC001)) { gSaveContext.next_day_time = 0; globalCtx->fadeOutTransition = 4; gSaveContext.transition_type = 2; globalCtx->unk_11DE9 = 1; - } - else - { + } else { gSaveContext.next_day_time = 0x8001; globalCtx->fadeOutTransition = 5; gSaveContext.transition_type = 3; globalCtx->unk_11DE9 = 1; } - if (globalCtx->sceneNum == SCENE_SPOT13) - { + if (globalCtx->sceneNum == SCENE_SPOT13) { globalCtx->fadeOutTransition = 0xE; gSaveContext.transition_type = 0xE; } @@ -5017,9 +4248,7 @@ void Interface_Update(GlobalContext* globalCtx) func_800F6964(30); gSaveContext.seq_index = 0xFF; gSaveContext.night_sfx = 0xFF; - } - else - { + } else { gSaveContext.unk_1422 = 3; } } diff --git a/src/code/z_play.c b/src/code/z_play.c index 96378ada9f..8494f9b99b 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,39 +1,33 @@ #include #include -void func_800BC450(GlobalContext* globalCtx) -{ - func_8005A7A8(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], - globalCtx->unk_1242B - 1, globalCtx); +void func_800BC450(GlobalContext* globalCtx) { + func_8005A7A8(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], globalCtx->unk_1242B - 1, + globalCtx); } #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC490.s") -s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1) -{ +s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1) { return arg1 == globalCtx->unk_1242B; } -void func_800BC590(GlobalContext* globalCtx) -{ +void func_800BC590(GlobalContext* globalCtx) { osSyncPrintf("Game_play_shop_pr_vr_switch_set()\n"); - if (YREG(15) == 0x10) - { + if (YREG(15) == 0x10) { globalCtx->unk_1242B = 2; } } #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC5E0.s") -void func_800BC88C(GlobalContext* globalCtx) -{ +void func_800BC88C(GlobalContext* globalCtx) { globalCtx->unk_123F0 = -1; } -Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1) -{ - func_80093708(a1, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08, - globalCtx->lightCtx.unk_09, 0, globalCtx->lightCtx.unk_0A, 1000); +Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1) { + func_80093708(a1, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08, globalCtx->lightCtx.unk_09, 0, + globalCtx->lightCtx.unk_0A, 1000); } #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC8EC.s") @@ -48,8 +42,7 @@ Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1) #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFAE4.s") -s32 func_800BFC84(GlobalContext* globalCtx) -{ +s32 func_800BFC84(GlobalContext* globalCtx) { return globalCtx->csCtx.state != 0 || func_8008E988(globalCtx) != 0; } @@ -59,8 +52,7 @@ s32 func_800BFC84(GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFEC4.s") -void func_800BFF0C(GlobalContext* globalCtx, s32 a1) -{ +void func_800BFF0C(GlobalContext* globalCtx, s32 a1) { globalCtx->curSpawn = a1; globalCtx->linkActorEntry = NULL; globalCtx->unk_11DFC = NULL; @@ -85,8 +77,7 @@ void func_800BFF0C(GlobalContext* globalCtx, s32 a1) #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0230.s") -s16 func_800C030C(GlobalContext* globalCtx) -{ +s16 func_800C030C(GlobalContext* globalCtx) { return globalCtx->cameraCtx.unk_5C0; } @@ -120,8 +111,7 @@ s16 func_800C030C(GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0AF4.s") -void func_800C0B60(GlobalContext* globalCtx) -{ +void func_800C0B60(GlobalContext* globalCtx) { gSaveContext.respawn[RESPAWN_MODE_DOWN].temp_swch_flags = globalCtx->actorCtx.flags.tempSwch; gSaveContext.respawn[RESPAWN_MODE_DOWN].temp_collect_flags = globalCtx->actorCtx.flags.tempCollect; gSaveContext.respawn_flag = 1; @@ -130,48 +120,35 @@ void func_800C0B60(GlobalContext* globalCtx) globalCtx->fadeOutTransition = 2; } -void func_800C0BB4(GlobalContext* globalCtx) -{ +void func_800C0BB4(GlobalContext* globalCtx) { gSaveContext.respawn_flag = -1; globalCtx->sceneLoadFlag = 0x14; - if (globalCtx->sceneNum == SCENE_GANON_SONOGO || - globalCtx->sceneNum == SCENE_GANON_FINAL || - globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO || - globalCtx->sceneNum == SCENE_GANON_DEMO) - { + if (globalCtx->sceneNum == SCENE_GANON_SONOGO || globalCtx->sceneNum == SCENE_GANON_FINAL || + globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO || globalCtx->sceneNum == SCENE_GANON_DEMO) { globalCtx->nextEntranceIndex = 0x043F; Item_Give(globalCtx, ITEM_SWORD_MASTER); - } - else if (gSaveContext.entrance_index == 0x028A || - gSaveContext.entrance_index == 0x028E || - gSaveContext.entrance_index == 0x0292 || - gSaveContext.entrance_index == 0x0476) - { + } else if (gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E || + gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) { globalCtx->nextEntranceIndex = 0x01F9; - } - else - { + } else { globalCtx->nextEntranceIndex = gSaveContext.entrance_index; } globalCtx->fadeOutTransition = 2; } -void func_800C0C88(GlobalContext* globalCtx) -{ +void func_800C0C88(GlobalContext* globalCtx) { func_800C0AF4(globalCtx, 0, 0xDFF); func_800C0BB4(globalCtx); } #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0CB8.s") -s32 func_800C0D28(GlobalContext* globalCtx) -{ +s32 func_800C0D28(GlobalContext* globalCtx) { return globalCtx->unk_7B8 != 0; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0D34.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0DB4.s") - diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c index 3adf3bc21a..cf525ff24c 100644 --- a/src/code/z_player_call.c +++ b/src/code/z_player_call.c @@ -15,8 +15,7 @@ void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx); void PlayerCall_Update(Player* player, GlobalContext* globalCtx); void PlayerCall_Draw(Player* player, GlobalContext* globalCtx); -const ActorInit Player_InitVars = -{ +const ActorInit Player_InitVars = { ACTOR_PLAYER, ACTORTYPE_PLAYER, 0, @@ -29,35 +28,30 @@ const ActorInit Player_InitVars = (ActorFunc)PlayerCall_Draw, }; -void PlayerCall_InitFuncPtrs() -{ +void PlayerCall_InitFuncPtrs() { sPlayerCallInitFunc = KaleidoManager_GetRamAddr(func_80846CD8); sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(func_8084AB54); sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(func_80849EA8); sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(func_8084A5C4); } -void PlayerCall_Init(Player* player, GlobalContext* globalCtx) -{ +void PlayerCall_Init(Player* player, GlobalContext* globalCtx) { KaleidoScopeCall_LoadPlayer(); PlayerCall_InitFuncPtrs(); sPlayerCallInitFunc(player, globalCtx); } -void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx) -{ +void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx) { KaleidoScopeCall_LoadPlayer(); sPlayerCallDestroyFunc(player, globalCtx); } -void PlayerCall_Update(Player* player, GlobalContext* globalCtx) -{ +void PlayerCall_Update(Player* player, GlobalContext* globalCtx) { KaleidoScopeCall_LoadPlayer(); sPlayerCallUpdateFunc(player, globalCtx); } -void PlayerCall_Draw(Player* player, GlobalContext* globalCtx) -{ +void PlayerCall_Draw(Player* player, GlobalContext* globalCtx) { KaleidoScopeCall_LoadPlayer(); sPlayerCallDrawFunc(player, globalCtx); } diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 06d2741ff5..4ddb530fe8 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -3,33 +3,22 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008E750.s") -UNK_TYPE 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 - ); - +UNK_TYPE 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); } -UNK_TYPE func_8008E988(GlobalContext* globalCtx) -{ +UNK_TYPE func_8008E988(GlobalContext* globalCtx) { Player* player = PLAYER; return func_8008E8DC(globalCtx, player) || player->unk_6AD == 4; } -UNK_TYPE func_8008E9C4(Player* player) -{ +UNK_TYPE func_8008E9C4(Player* player) { return player->stateFlags1 & 0x10; } -UNK_TYPE func_8008E9D0(Player* player) -{ +UNK_TYPE func_8008E9D0(Player* player) { return LINK_IS_CHILD && player->currentShield == 2; } @@ -41,8 +30,7 @@ UNK_TYPE func_8008E9D0(Player* player) #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008EC04.s") -void func_8008EC70(Player* player) -{ +void func_8008EC70(Player* player) { player->unk_154 = player->unk_151; func_8008EC04(player, func_8008E9F8(player, player->unk_151)); player->unk_6AD = 0; @@ -50,19 +38,16 @@ 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, UNK_TYPE item, UNK_TYPE arg2) { Inventory_UpdateBottleItem(globalCtx, item, player->unk_150); - if (item != ITEM_BOTTLE) - { + if (item != ITEM_BOTTLE) { player->unk_152 = item; player->unk_151 = arg2; } player->unk_154 = arg2; } -void func_8008EDF0(Player* player) -{ +void func_8008EDF0(Player* player) { player->unk_664 = NULL; player->stateFlags2 &= ~0x2000; } @@ -71,8 +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) -{ +UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1) { globalCtx->unk_11E5C = (arg1 + 1); return 1; } @@ -81,69 +65,56 @@ UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1) #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008F034.s") -u8 func_8008F080(GlobalContext* globalCtx) -{ +u8 func_8008F080(GlobalContext* globalCtx) { Player* player = PLAYER; return player->currentMask; } -void func_8008F08C(GlobalContext* globalCtx) -{ +void func_8008F08C(GlobalContext* globalCtx) { Player* player = PLAYER; player->currentMask = 0; } -UNK_TYPE func_8008F098(GlobalContext* globalCtx) -{ +UNK_TYPE func_8008F098(GlobalContext* globalCtx) { Player* player = PLAYER; return player->currentShield == 3; } -UNK_TYPE func_8008F0AC(GlobalContext* globalCtx) -{ +UNK_TYPE 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, UNK_TYPE arg1) { s32 temp_v0 = arg1 - 0x15; - if (temp_v0 >= 0 && temp_v0 < 6) - { + if (temp_v0 >= 0 && temp_v0 < 6) { return temp_v0; } return -1; } -UNK_TYPE func_8008F104(Player* player) -{ +UNK_TYPE func_8008F104(Player* player) { return player->unk_151 == 0x10 || player->unk_151 == 0x11; } -UNK_TYPE func_8008F128(Player* player) -{ +UNK_TYPE func_8008F128(Player* player) { return func_8008F104(player) && player->heldActor == NULL; } -s32 func_8008F158(UNK_TYPE arg0) -{ +s32 func_8008F158(UNK_TYPE arg0) { s32 temp_v0 = arg0 - 2; - if (temp_v0 > 0 && temp_v0 < 6) - { + if (temp_v0 > 0 && temp_v0 < 6) { return temp_v0; } return 0; } -void func_8008F180(Player* player) -{ +void func_8008F180(Player* player) { func_8008F158(player->unk_151); } -UNK_TYPE func_8008F1A0(Player* player) -{ - if (player->unk_151 >= 5 && player->unk_151 < 8) - { +UNK_TYPE func_8008F1A0(Player* player) { + if (player->unk_151 >= 5 && player->unk_151 < 8) { return 1; } return 0; @@ -151,33 +122,27 @@ 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, UNK_TYPE arg1) { s32 temp_v0 = arg1 - 0x1E; - if (temp_v0 >= 0 && temp_v0 < 0xD) - { + if (temp_v0 >= 0 && temp_v0 < 0xD) { return temp_v0; } return -1; } -void func_8008F250(Player* player) -{ +void func_8008F250(Player* player) { func_8008F224(player, player->unk_151); } -s32 func_8008F270(Player* player, UNK_TYPE arg1) -{ +s32 func_8008F270(Player* player, UNK_TYPE arg1) { s32 temp_v0 = arg1 - 0x12; - if (temp_v0 >= 0 && temp_v0 < 2) - { + if (temp_v0 >= 0 && temp_v0 < 2) { return temp_v0; } return -1; } -s32 func_8008F29C(Player* player) -{ +s32 func_8008F29C(Player* player) { return func_8008F270(player, player->unk_151); } diff --git a/src/code/z_prenmi.c b/src/code/z_prenmi.c index 1ea8137044..26482f38ea 100644 --- a/src/code/z_prenmi.c +++ b/src/code/z_prenmi.c @@ -2,23 +2,20 @@ #include #include -void func_80092320(PreNMIContext* prenmiCtx) -{ +void func_80092320(PreNMIContext* prenmiCtx) { prenmiCtx->state.running = false; prenmiCtx->state.init = NULL; prenmiCtx->state.size = 0; } -void PreNMI_Update(PreNMIContext* prenmiCtx) -{ +void PreNMI_Update(PreNMIContext* prenmiCtx) { osSyncPrintf(VT_COL(YELLOW, BLACK) "prenmi_move\n" VT_RST); // Strings existing only in rodata ("../z_prenmi.c"); ("(int)volume = %d\n"); - if (prenmiCtx->timer == 0) - { + if (prenmiCtx->timer == 0) { ViConfig_UpdateVi(1); func_80092320(prenmiCtx); return; @@ -27,8 +24,7 @@ void PreNMI_Update(PreNMIContext* prenmiCtx) prenmiCtx->timer--; } -void PreNMI_Draw(PreNMIContext* prenmiCtx) -{ +void PreNMI_Draw(PreNMIContext* prenmiCtx) { GraphicsContext* gfxCtx = prenmiCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -45,21 +41,17 @@ void PreNMI_Draw(PreNMIContext* prenmiCtx) func_800C6B54(gfxArr, gfxCtx, "../z_prenmi.c", 112); } -void PreNMI_Main(PreNMIContext* prenmiCtx) -{ +void PreNMI_Main(PreNMIContext* prenmiCtx) { PreNMI_Update(prenmiCtx); PreNMI_Draw(prenmiCtx); prenmiCtx->state.unk_A0 = 1; } -void PreNMI_Destroy(PreNMIContext* prenmiCtx) -{ - +void PreNMI_Destroy(PreNMIContext* prenmiCtx) { } -void PreNMI_Init(PreNMIContext* prenmiCtx) -{ +void PreNMI_Init(PreNMIContext* prenmiCtx) { prenmiCtx->state.main = PreNMI_Main; prenmiCtx->state.destroy = PreNMI_Destroy; prenmiCtx->timer = 30; diff --git a/src/code/z_prenmi_buff.c b/src/code/z_prenmi_buff.c index 5616e3b798..9c5924bc98 100644 --- a/src/code/z_prenmi_buff.c +++ b/src/code/z_prenmi_buff.c @@ -1,20 +1,15 @@ #include #include -#define COLD_RESET 0 -#define NMI 1 +#define COLD_RESET 0 +#define NMI 1 - -void PreNmiBuff_Init(PreNmiBuff* this) -{ +void PreNmiBuff_Init(PreNmiBuff* this) { this->resetting = false; - if (osResetType == COLD_RESET) - { + if (osResetType == COLD_RESET) { this->resetCount = 0; this->duration = 0; - } - else - { + } else { this->resetCount++; this->duration += this->resetTime; } @@ -22,14 +17,11 @@ void PreNmiBuff_Init(PreNmiBuff* this) this->resetTime = 0; } - -void PreNmiBuff_SetReset(PreNmiBuff* this) -{ +void PreNmiBuff_SetReset(PreNmiBuff* this) { this->resetting = true; this->resetTime = osGetTime(); } -u32 PreNmiBuff_IsResetting(PreNmiBuff* this) -{ +u32 PreNmiBuff_IsResetting(PreNmiBuff* this) { return this->resetting; } diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index 27d7503152..4aa711e00d 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -133,29 +133,25 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094E54.s") -Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y) -{ +Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y) { return Draw_TexScroll(gfxCtx, x, y, 0, 0); } -Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) -{ +Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) { Gfx* displayList = Graph_Alloc(gfxCtx, 3 * sizeof(Gfx)); x %= 2048; y %= 2048; gDPTileSync(displayList); - gDPSetTileSize(displayList+1, 0, x, y, - (x+((width-1)<<2)), (y+((height-1)<<2))); - gSPEndDisplayList(displayList+2); + gDPSetTileSize(displayList + 1, 0, x, y, (x + ((width - 1) << 2)), (y + ((height - 1) << 2))); + gSPEndDisplayList(displayList + 2); return displayList; } -Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, - s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2) -{ +Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, + u32 y2, s32 width2, s32 height2) { Gfx* displayList = Graph_Alloc(gfxCtx, 5 * sizeof(Gfx)); x1 %= 2048; @@ -164,20 +160,16 @@ Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 w y2 %= 2048; gDPTileSync(displayList); - gDPSetTileSize(displayList+1, tile1, x1, y1, - (x1+((width1-1)<<2)), (y1+((height1-1)<<2))); - gDPTileSync(displayList+2); - gDPSetTileSize(displayList+3, tile2, x2, y2, - (x2+((width2-1)<<2)), (y2+((height2-1)<<2))); - gSPEndDisplayList(displayList+4); + gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2))); + gDPTileSync(displayList + 2); + gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2))); + gSPEndDisplayList(displayList + 4); return displayList; } -Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, - s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, - s32 red, s32 green, s32 blue, s32 alpha) -{ +Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, + u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha) { Gfx* displayList = Graph_Alloc(gfxCtx, 6 * sizeof(Gfx)); x1 %= 2048; @@ -186,13 +178,11 @@ Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y y2 %= 2048; gDPTileSync(displayList); - gDPSetTileSize(displayList+1, tile1, x1, y1, - (x1+((width1-1)<<2)), (y1+((height1-1)<<2))); - gDPTileSync(displayList+2); - gDPSetTileSize(displayList+3, tile2, x2, y2, - (x2+((width2-1)<<2)), (y2+((height2-1)<<2))); - gDPSetEnvColor(displayList+4, red, green, blue, alpha); - gSPEndDisplayList(displayList+5); + gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2))); + gDPTileSync(displayList + 2); + gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2))); + gDPSetEnvColor(displayList + 4, red, green, blue, alpha); + gSPEndDisplayList(displayList + 5); return displayList; } @@ -202,4 +192,3 @@ Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y #pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80095248.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80095974.s") - diff --git a/src/code/z_room.c b/src/code/z_room.c index 79c0d2bf6e..f9973bfeaf 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -9,14 +9,13 @@ void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags); Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f }; // unused -Gfx D_801270B0[] = -{ +Gfx D_801270B0[] = { gsDPPipeSync(), gsSPClearGeometryMode(G_ZBUFFER | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, SHADE, 0, 0, 0, SHADE, 0, 0, 0, SHADE), - gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | - G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE, + gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2), gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH), gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, 320, 240), @@ -24,21 +23,17 @@ Gfx D_801270B0[] = gsSPEndDisplayList(), }; -void (*sRoomDrawHandlers[])(GlobalContext* globalCtx, Room* room, u32 flags) = -{ +void (*sRoomDrawHandlers[])(GlobalContext* globalCtx, Room* room, u32 flags) = { func_80095AB4, func_80096F6C, func_80095D04, }; -void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3) -{ - +void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3) { } // Room Draw Polygon Type 0 -void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) -{ +void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) { s32 i; PolygonType0* polygon0; PolygonDlist* polygonDlist; @@ -48,16 +43,14 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_room.c", 193); - if (flags & 1) - { + if (flags & 1) { func_800342EC(&D_801270A0, globalCtx); gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment); func_80093C80(globalCtx); gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); } - if (flags & 2) - { + if (flags & 2) { func_8003435C(&D_801270A0, globalCtx); gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment); func_80093D84(globalCtx->state.gfxCtx); @@ -66,13 +59,14 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) polygon0 = &room->mesh->polygon0; polygonDlist = SEGMENTED_TO_VIRTUAL(polygon0->start); - for (i = 0; i < polygon0->num; i++) - { - if ((flags & 1) && (polygonDlist->opa != NULL)) + for (i = 0; i < polygon0->num; i++) { + if ((flags & 1) && (polygonDlist->opa != NULL)) { gSPDisplayList(gfxCtx->polyOpa.p++, polygonDlist->opa); + } - if ((flags & 2) && (polygonDlist->xlu != NULL)) + if ((flags & 2) && (polygonDlist->xlu != NULL)) { gSPDisplayList(gfxCtx->polyXlu.p++, polygonDlist->xlu); + } polygonDlist++; } @@ -82,10 +76,9 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) #define SHAPE_SORT_MAX 64 -typedef struct struct_80095D04 -{ +typedef struct struct_80095D04 { /* 0x00 */ PolygonDlist2* unk_00; - /* 0x04 */ f32 unk_04; + /* 0x04 */ f32 unk_04; /* 0x08 */ struct struct_80095D04* unk_08; /* 0x0C */ struct struct_80095D04* unk_0C; } struct_80095D04; // size = 0x10 @@ -93,8 +86,7 @@ typedef struct struct_80095D04 // Room Draw Polygon Type 2 #ifdef NON_MATCHING // this function still needs some work -void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) -{ +void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) { PolygonType2* polygon2; PolygonDlist2* polygonDlist; struct_80095D04 spB8[SHAPE_SORT_MAX]; @@ -120,16 +112,14 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(sp5C, globalCtx->state.gfxCtx, "../z_room.c", 287); - if (flags & 1) - { + if (flags & 1) { func_800342EC(&D_801270A0, globalCtx); gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment); func_80093C80(globalCtx); gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); } - if (flags & 2) - { + if (flags & 2) { func_8003435C(&D_801270A0, globalCtx); gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment); func_80093D84(globalCtx->state.gfxCtx); @@ -143,46 +133,36 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) __assert("polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317); sp78 = polygonDlist; - for (sp9C = 0; sp9C < polygon2->num; sp9C++) - { + for (sp9C = 0; sp9C < polygon2->num; sp9C++) { sp90.x = polygonDlist->pos.x; sp90.y = polygonDlist->pos.y; sp90.z = polygonDlist->pos.z; func_800A6E10(&globalCtx->mf_11D60, &sp90, &sp84, &sp80); temp_f0 = polygonDlist->unk_06; - if (-temp_f0 < sp84.z) - { + if (-temp_f0 < sp84.z) { temp_f2 = sp84.z - temp_f0; - if (temp_f2 < globalCtx->lightCtx.unk_0C) - { + if (temp_f2 < globalCtx->lightCtx.unk_0C) { spA4->unk_00 = polygonDlist; spA4->unk_04 = temp_f2; phi_v0 = spB4; - if (spB4 == 0) - { + if (spB4 == 0) { spB0 = spA4; spB4 = spA4; spA4->unk_0C = NULL; spA4->unk_08 = NULL; - } - else - { - do - { + } else { + do { if (spA4->unk_04 < phi_v0->unk_04) break; phi_v0 = phi_v0->unk_0C; } while (phi_v0 != NULL); - if (phi_v0 == NULL) - { + if (phi_v0 == NULL) { spA4->unk_08 = spB0; spA4->unk_0C = NULL; spB0->unk_0C = spA4; spB0 = spA4; - } - else - { + } else { phi_a0 = phi_v0->unk_08; spA4->unk_08 = phi_a0; if (phi_a0 == NULL) @@ -190,7 +170,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) else phi_a0->unk_0C = spA4; phi_v0->unk_08 = spA4; - spA4->unk_0C = (void *) phi_v0; + spA4->unk_0C = (void*)phi_v0; } } spA4 = spA4++; @@ -202,32 +182,25 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) iREG(87) = polygon2->num; sp9C = 1; - while (spB4 != NULL) - { + while (spB4 != NULL) { phi_s0 = spB4->unk_00; - if (iREG(86) != 0) - { + if (iREG(86) != 0) { phi_v1 = 0; - while (phi_v1 < polygon2->num) - { + while (phi_v1 < polygon2->num) { if (phi_s0 == sp78) break; phi_v1++; sp78++; } - if (((iREG(86) == 1) && (iREG(89) > sp9C)) || - ((iREG(86) == 2) && (iREG(89) == sp9C))) - { + if (((iREG(86) == 1) && (iREG(89) > sp9C)) || ((iREG(86) == 2) && (iREG(89) == sp9C))) { if ((flags & 1) && (phi_s0->opa != NULL)) gSPDisplayList(gfxCtx->polyOpa.p++, phi_s0->opa); if ((flags & 2) && (phi_s0->xlu != NULL)) gSPDisplayList(gfxCtx->polyXlu.p++, phi_s0->xlu); } - } - else - { + } else { if ((flags & 1) && (phi_s0->opa != NULL)) gSPDisplayList(gfxCtx->polyOpa.p++, phi_s0->opa); @@ -251,14 +224,12 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) #ifdef NON_MATCHING // long multiplication by 64 doesn't quite match -s32 func_80096238(void* data) -{ +s32 func_80096238(void* data) { OSTime timeBefore; OSTime timeAfter; OSTime time; - if (*(u32*)data == JPEG_MARKER) - { + if (*(u32*)data == JPEG_MARKER) { // Translates to: "EXPANDING JPEG DATA" osSyncPrintf("JPEGデータを展開します\n"); // Translates to: "JPEG DATA ADDRESS %08x" @@ -267,8 +238,7 @@ s32 func_80096238(void* data) osSyncPrintf("ワークバッファアドレス(Zバッファ)%08x\n", gZBuffer); timeBefore = osGetTime(); - if (!func_8006E418(data, gZBuffer, gGfxSPTaskOutputBuffer, sizeof(gGfxSPTaskOutputBuffer))) - { + if (!func_8006E418(data, gZBuffer, gGfxSPTaskOutputBuffer, sizeof(gGfxSPTaskOutputBuffer))) { timeAfter = osGetTime(); time = ((timeAfter - timeBefore) * 64) / 3000; @@ -280,9 +250,7 @@ s32 func_80096238(void* data) osSyncPrintf("元のバッファのサイズが150キロバイト無いと暴走するでしょう。\n"); bcopy(gZBuffer, data, sizeof(gZBuffer)); - } - else - { + } else { // Translates to: "FAILURE! WHY IS IT 〜" osSyncPrintf("失敗!なんで〜\n"); } @@ -296,8 +264,8 @@ s32 func_80096238(void* data) #ifdef NON_MATCHING // pointer arithmetic doesn't quite match -void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, u16 tlutCount, f32 frameX, f32 frameY) -{ +void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, + u16 tlutCount, f32 frameX, f32 frameY) { Gfx* displayListHead; uObjBg* bg; @@ -305,7 +273,7 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh func_80096238(SEGMENTED_TO_VIRTUAL(source)); displayListHead++; - gSPBranchList(displayListHead, displayListHead+5); + gSPBranchList(displayListHead, displayListHead + 5); bg = (void*)displayListHead; bg->b.imageX = 0; bg->b.imageW = width * 4; @@ -320,45 +288,36 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh bg->b.imagePal = 0; bg->b.imageFlip = 0; - if (fmt == G_IM_FMT_CI) - { - displayListHead = (void*)(bg+1); + if (fmt == G_IM_FMT_CI) { + displayListHead = (void*)(bg + 1); gDPLoadTLUT(displayListHead++, tlutCount, 256, tlut); - } - else - { - displayListHead = (void*)(bg+1); + } else { + displayListHead = (void*)(bg + 1); gDPPipeSync(displayListHead++); } - if ((fmt == G_IM_FMT_RGBA) && (SREG(26) == 0)) - { + if ((fmt == G_IM_FMT_RGBA) && (SREG(26) == 0)) { bg->b.frameW = width * 4; bg->b.frameH = height * 4; func_80104B00(bg); gDPSetOtherMode(displayListHead++, - mode0 | G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | - G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE, + mode0 | G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | + G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2); gSPBgRectCopy(displayListHead++, bg); - } - else - { + } else { bg->s.frameW = width * 4; bg->s.frameH = height * 4; bg->s.scaleW = 1024; bg->s.scaleH = 1024; bg->s.imageYorig = bg->b.imageY; gDPSetOtherMode(displayListHead++, - mode0 | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | - G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_THRESHOLD | G_ZS_PIXEL | AA_EN | - CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL | - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA) | - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA)); - gDPSetCombineLERP(displayListHead++, - 0, 0, 0, TEXEL0, 0, 0, 0, 1, - 0, 0, 0, TEXEL0, 0, 0, 0, 1); + mode0 | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | + G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_THRESHOLD | G_ZS_PIXEL | AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL | + GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA) | + GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA)); + gDPSetCombineLERP(displayListHead++, 0, 0, 0, TEXEL0, 0, 0, 0, 1, 0, 0, 0, TEXEL0, 0, 0, 0, 1); gSPObjRenderMode(displayListHead++, 0x0C); // unknown object render mode? gSPBgRect1Cyc(displayListHead++, bg); } @@ -367,13 +326,13 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh *displayList = displayListHead; } #else -void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, u16 tlutCount, f32 frameX, f32 frameY); +void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, + u16 tlutCount, f32 frameX, f32 frameY); #pragma GLOBAL_ASM("asm/non_matchings/code/z_room/func_8009638C.s") #endif // Room Draw Polygon Type 1 - Single Format -void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) -{ +void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) { Camera* camera; Gfx* spA8; PolygonType1* polygon1; @@ -396,33 +355,27 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) sp94 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2); sp90 = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4); - if (sp94 || sp98) - { + if (sp94 || sp98) { gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment); - if (sp94) - { + if (sp94) { func_80093D18(globalCtx->state.gfxCtx); gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, polygonDlist->opa); } - if (sp98) - { + if (sp98) { // gSPLoadUcodeL(gfxCtx->polyOpa.p++, rspS2DEX)? gSPLoadUcodeEx(gfxCtx->polyOpa.p++, D_00113070, D_001579A0, 0x800); - if (1) - { + if (1) { Vec3f sp60; spA8 = gfxCtx->polyOpa.p; func_8005AFB4(&sp60, camera); - func_8009638C(&spA8, polygon1->single.source, polygon1->single.tlut, - polygon1->single.width, polygon1->single.height, - polygon1->single.fmt, polygon1->single.siz, + func_8009638C(&spA8, polygon1->single.source, polygon1->single.tlut, polygon1->single.width, + polygon1->single.height, polygon1->single.fmt, polygon1->single.siz, polygon1->single.mode0, polygon1->single.tlutCount, - (sp60.x + sp60.z) * 1.2f + sp60.y * 0.6f, - sp60.y * 2.4f + (sp60.x + sp60.z) * 0.3f); + (sp60.x + sp60.z) * 1.2f + sp60.y * 0.6f, sp60.y * 2.4f + (sp60.x + sp60.z) * 0.3f); gfxCtx->polyOpa.p = spA8; } @@ -431,8 +384,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) } } - if (sp90) - { + if (sp90) { gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment); func_80093D84(globalCtx->state.gfxCtx); gSPMatrix(gfxCtx->polyXlu.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); @@ -442,16 +394,14 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_room.c", 691); } -typedef struct -{ +typedef struct { char unk_00[0x0E]; - s16 unk_0E; + s16 unk_0E; } struct_80041C10_ret; extern struct_80041C10_ret* func_80041C10(CollisionContext*, s32, s32); -BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) -{ +BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) { Camera* camera; s32 camId; s16 camId2; @@ -462,17 +412,18 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) camera = globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]; camId = camera->unk_148; camId2 = func_80041C10(&globalCtx->colCtx, camId, 50)->unk_0E; - if (camId2 >= 0) + if (camId2 >= 0) { camId = camId2; + } player = PLAYER; player->actor.params = (player->actor.params & 0xFF00) | camId; bgImage = SEGMENTED_TO_VIRTUAL(polygon1->multi.list); - for (i = 0; i < polygon1->multi.count; i++) - { - if (bgImage->id == camId) + for (i = 0; i < polygon1->multi.count; i++) { + if (bgImage->id == camId) { return bgImage; + } bgImage++; } @@ -486,8 +437,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) // Room Draw Polygon Type 1 - Multi Format #ifdef NON_MATCHING // regalloc differences -void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) -{ +void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) { Camera* camera; Gfx* spA8; BgImage* bgImage; @@ -512,33 +462,26 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) sp90 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2); sp8C = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4); - if (sp90 || sp94) - { + if (sp90 || sp94) { gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment); - if (sp90) - { + if (sp90) { func_80093D18(globalCtx->state.gfxCtx); gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, polygonDlist->opa); } - if (sp94) - { + if (sp94) { // gSPLoadUcodeL(gfxCtx->polyOpa.p++, rspS2DEX)? gSPLoadUcodeEx(gfxCtx->polyOpa.p++, D_00113070, D_001579A0, 0x800); - if (1) - { + if (1) { Vec3f sp5C; spA8 = gfxCtx->polyOpa.p; func_8005AFB4(&sp5C, camera); - func_8009638C(&spA8, bgImage->source, bgImage->tlut, - bgImage->width, bgImage->height, - bgImage->fmt, bgImage->siz, - bgImage->mode0, bgImage->tlutCount, - (sp5C.x + sp5C.z) * 1.2f + sp5C.y * 0.6f, - sp5C.y * 2.4f + (sp5C.x + sp5C.z) * 0.3f); + func_8009638C(&spA8, bgImage->source, bgImage->tlut, bgImage->width, bgImage->height, bgImage->fmt, + bgImage->siz, bgImage->mode0, bgImage->tlutCount, + (sp5C.x + sp5C.z) * 1.2f + sp5C.y * 0.6f, sp5C.y * 2.4f + (sp5C.x + sp5C.z) * 0.3f); gfxCtx->polyOpa.p = spA8; } @@ -547,8 +490,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) } } - if (sp8C) - { + if (sp8C) { gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment); func_80093D84(globalCtx->state.gfxCtx); gSPMatrix(gfxCtx->polyXlu.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); @@ -562,28 +504,26 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) #endif // Room Draw Polygon Type 1 -void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags) -{ +void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags) { PolygonType1* polygon1 = &room->mesh->polygon1; - if (polygon1->format == 1) + if (polygon1->format == 1) { func_80096680(globalCtx, room, flags); - else if (polygon1->format == 2) + } else if (polygon1->format == 2) { func_80096B6C(globalCtx, room, flags); - else + } else { LogUtils_HungupThread("../z_room.c", 841); + } } -void func_80096FD4(GlobalContext* globalCtx, Room* room) -{ +void func_80096FD4(GlobalContext* globalCtx, Room* room) { room->num = -1; room->segment = NULL; } #ifdef NON_MATCHING // regalloc differences -u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) -{ +u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) { RomFile* roomList; TransitionActorEntry* transitionActor; s32 i, j; @@ -598,30 +538,27 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) maxRoomSize = 0; roomList = globalCtx->roomList; - for (i = 0; i < globalCtx->nbRooms; i++) - { + for (i = 0; i < globalCtx->nbRooms; i++) { roomSize = roomList[i].vromEnd - roomList[i].vromStart; osSyncPrintf("ROOM%d size=%d\n", i, roomSize); if (maxRoomSize < roomSize) maxRoomSize = roomSize; } - if (globalCtx->nbTransitionActors != 0) - { + if (globalCtx->nbTransitionActors != 0) { j = 0; roomList = globalCtx->roomList; transitionActor = &globalCtx->transitionActorList[0]; LogUtils_LogThreadId("../z_room.c", 912); osSyncPrintf("game_play->room_rom_address.num = %d\n", globalCtx->nbRooms); - for (j = 0; j < globalCtx->nbTransitionActors; j++) - { + for (j = 0; j < globalCtx->nbTransitionActors; j++) { frontRoom = transitionActor->frontRoom; backRoom = transitionActor->backRoom; frontRoomSize = (frontRoom < 0) ? 0 : roomList[frontRoom].vromEnd - roomList[frontRoom].vromStart; backRoomSize = (backRoom < 0) ? 0 : roomList[backRoom].vromEnd - roomList[backRoom].vromStart; cumulRoomSize = (frontRoom != backRoom) ? frontRoomSize + backRoomSize : frontRoomSize; - osSyncPrintf("DOOR%d=<%d> ROOM1=<%d, %d> ROOM2=<%d, %d>\n", - j, cumulRoomSize, frontRoom, frontRoomSize, backRoom, backRoomSize); + osSyncPrintf("DOOR%d=<%d> ROOM1=<%d, %d> ROOM2=<%d, %d>\n", j, cumulRoomSize, frontRoom, frontRoomSize, + backRoom, backRoomSize); if (maxRoomSize < cumulRoomSize) maxRoomSize = cumulRoomSize; transitionActor++; @@ -642,7 +579,7 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) roomCtx->status = 0; if (gSaveContext.respawn_flag > 0) - nextRoomNum = gSaveContext.respawn[gSaveContext.respawn_flag-1].room_index; + nextRoomNum = gSaveContext.respawn[gSaveContext.respawn_flag - 1].room_index; else nextRoomNum = globalCtx->setupEntranceList[globalCtx->curSpawn].room; func_8009728C(globalCtx, roomCtx, nextRoomNum); @@ -653,30 +590,29 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) #pragma GLOBAL_ASM("asm/non_matchings/code/z_room/func_80096FE8.s") #endif -s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) -{ +s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) { u32 size; - if (0) ; // Necessary to match + if (0) {} // Necessary to match - if (roomCtx->status == 0) - { + if (roomCtx->status == 0) { roomCtx->prevRoom = roomCtx->curRoom; roomCtx->curRoom.num = roomNum; roomCtx->curRoom.segment = NULL; roomCtx->status = 1; - if (roomNum >= globalCtx->nbRooms) + if (roomNum >= globalCtx->nbRooms) { __assert("read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009); + } size = globalCtx->roomList[roomNum].vromEnd - globalCtx->roomList[roomNum].vromStart; roomCtx->unk_34 = (void*)ALIGN16((s32)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7)); - if (0) ; // Also necessary to match + if (0) {} // Also necessary to match osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1); - DmaMgr_SendRequest2(&roomCtx->dmaRequest, roomCtx->unk_34, globalCtx->roomList[roomNum].vromStart, size, - 0, &roomCtx->loadQueue, NULL, "../z_room.c", 1036); + DmaMgr_SendRequest2(&roomCtx->dmaRequest, roomCtx->unk_34, globalCtx->roomList[roomNum].vromStart, size, 0, + &roomCtx->loadQueue, NULL, "../z_room.c", 1036); roomCtx->unk_30 ^= 1; return 1; @@ -685,12 +621,9 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) return 0; } -s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) -{ - if (roomCtx->status == 1) - { - if (!osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK)) - { +s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) { + if (roomCtx->status == 1) { + if (!osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK)) { roomCtx->status = 0; roomCtx->curRoom.segment = roomCtx->unk_34; gSegments[3] = PHYSICAL_TO_VIRTUAL2(roomCtx->unk_34); @@ -708,25 +641,24 @@ s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) return 1; } -void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) -{ - if (room->segment != NULL) - { +void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) { + if (room->segment != NULL) { gSegments[3] = PHYSICAL_TO_VIRTUAL(room->segment); - if (room->mesh->polygon.type >= ARRAY_COUNTU(sRoomDrawHandlers)) + if (room->mesh->polygon.type >= ARRAY_COUNTU(sRoomDrawHandlers)) { __assert("this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125); + } sRoomDrawHandlers[room->mesh->polygon.type](globalCtx, room, flags); } } -void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx) -{ +void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx) { roomCtx->prevRoom.num = -1; roomCtx->prevRoom.segment = NULL; func_80031B14(globalCtx, &globalCtx->actorCtx); Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx); func_80080E04(globalCtx, roomCtx->curRoom.num); - if (!((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_SPOT20))) + if (!((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_SPOT20))) { func_800807A0(globalCtx); + } func_800F66C0(globalCtx->roomCtx.curRoom.echo); } diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 9aaf1db51f..cbd9347010 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -2,10 +2,8 @@ #include #include -void Sample_Calc(SampleContext* this) -{ - if (!~(this->state.input[0].padPressed | ~START_BUTTON)) - { +void Sample_Calc(SampleContext* this) { + if (!~(this->state.input[0].padPressed | ~START_BUTTON)) { SET_NEXT_GAMESTATE(&this->state, func_800BCA64, GlobalContext); this->state.running = false; } @@ -13,8 +11,7 @@ void Sample_Calc(SampleContext* this) // very close from matching, the only difference is the place of "mtx" in the stack #ifdef NON_MATCHING -void Sample_Draw(SampleContext* this) -{ +void Sample_Draw(SampleContext* this) { u32 pad; GraphicsContext* gfxCtx = this->state.gfxCtx; View* view = &this->view; @@ -49,19 +46,15 @@ void Sample_Draw(SampleContext* this) #pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/Sample_Draw.s") #endif -void Sample_Update(SampleContext* this) -{ +void Sample_Update(SampleContext* this) { Sample_Draw(this); Sample_Calc(this); } -void Sample_Destroy(SampleContext* this) -{ - +void Sample_Destroy(SampleContext* this) { } -void Sample_SetupView(SampleContext* this) -{ +void Sample_SetupView(SampleContext* this) { View* view; GraphicsContext* gfxCtx; u32 v0[4]; @@ -94,16 +87,14 @@ void Sample_SetupView(SampleContext* this) func_800AA358(view, &v1, &v2, &v3); } -void Sample_LoadTitleStatic(SampleContext* this) -{ +void Sample_LoadTitleStatic(SampleContext* this) { u32 size = _title_staticSegmentRomEnd - _title_staticSegmentRomStart; - + this->staticSegment = Game_Alloc(&this->state, size, "../z_sample.c", 163); DmaMgr_SendRequest1(this->staticSegment, _title_staticSegmentRomStart, size, "../z_sample.c", 164); } -void Sample_Init(SampleContext* this) -{ +void Sample_Init(SampleContext* this) { this->state.main = Sample_Update; this->state.destroy = Sample_Destroy; R_UPDATE_RATE = 1; diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 2bd5522961..c8c97459cb 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -4,26 +4,31 @@ RomFile sNaviMsgFiles[]; -s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) -{ +s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) { u32 size; objectCtx->status[objectCtx->num].id = objectId; size = gObjectTable[objectId].vromEnd - gObjectTable[objectId].vromStart; - osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", - objectId, (f64)(size / 1024.0f), objectCtx->status[objectCtx->num].segment); + osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectId, (f64)(size / 1024.0f), + objectCtx->status[objectCtx->num].segment); - osSyncPrintf("num=%d adrs=%x end=%x\n", - objectCtx->num, (s32)objectCtx->status[objectCtx->num].segment + size, objectCtx->spaceEnd); + osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (s32)objectCtx->status[objectCtx->num].segment + size, + objectCtx->spaceEnd); - if (!((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) && (((s32)objectCtx->status[objectCtx->num].segment + size) < (s32)objectCtx->spaceEnd))) - __assert("this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment", "../z_scene.c", 142); + if (!((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) && + (((s32)objectCtx->status[objectCtx->num].segment + size) < (s32)objectCtx->spaceEnd))) { + __assert("this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment", + "../z_scene.c", 142); + } - DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size, "../z_scene.c", 145); + DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size, + "../z_scene.c", 145); - if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1) - objectCtx->status[objectCtx->num + 1].segment = (void*)ALIGN16((s32)objectCtx->status[objectCtx->num].segment + size); + if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1) { + objectCtx->status[objectCtx->num + 1].segment = + (void*)ALIGN16((s32)objectCtx->status[objectCtx->num].segment + size); + } objectCtx->num++; objectCtx->unk_09 = objectCtx->num; @@ -31,35 +36,33 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) return objectCtx->num - 1; } -void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) -{ +void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) { GlobalContext* globalCtx2 = globalCtx; // Needs to be a new variable to match (possibly a sub struct?) u32 spaceSize; s32 i; - if (globalCtx2->sceneNum == SCENE_SPOT00) + if (globalCtx2->sceneNum == SCENE_SPOT00) { spaceSize = 1024000; - else if (globalCtx2->sceneNum == SCENE_GANON_DEMO) - { - if (gSaveContext.scene_setup_index != 4) + } else if (globalCtx2->sceneNum == SCENE_GANON_DEMO) { + if (gSaveContext.scene_setup_index != 4) { spaceSize = 1177600; - else + } else { spaceSize = 1024000; - } - else if (globalCtx2->sceneNum == SCENE_JYASINBOSS) + } + } else if (globalCtx2->sceneNum == SCENE_JYASINBOSS) { spaceSize = 1075200; - else if (globalCtx2->sceneNum == SCENE_KENJYANOMA) + } else if (globalCtx2->sceneNum == SCENE_KENJYANOMA) { spaceSize = 1075200; - else if (globalCtx2->sceneNum == SCENE_GANON_BOSS) + } else if (globalCtx2->sceneNum == SCENE_GANON_BOSS) { spaceSize = 1075200; - else + } else { spaceSize = 1024000; + } objectCtx->num = objectCtx->unk_09 = 0; objectCtx->mainKeepIndex = objectCtx->subKeepIndex = 0; - for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) - { + for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) { objectCtx->status[i].id = 0; } @@ -68,37 +71,32 @@ void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) osSyncPrintf("オブジェクト入れ替えバンク情報 %8.3fKB\n", (f64)(spaceSize / 1024.0f)); osSyncPrintf(VT_RST); - objectCtx->spaceStart = objectCtx->status[0].segment = Game_Alloc(&globalCtx->state, spaceSize, "../z_scene.c", 219); + objectCtx->spaceStart = objectCtx->status[0].segment = + Game_Alloc(&globalCtx->state, spaceSize, "../z_scene.c", 219); objectCtx->spaceEnd = (void*)((s32)objectCtx->spaceStart + spaceSize); objectCtx->mainKeepIndex = Object_Spawn(objectCtx, OBJECT_GAMEPLAY_KEEP); gSegments[4] = PHYSICAL_TO_VIRTUAL(objectCtx->status[objectCtx->mainKeepIndex].segment); } -void Object_UpdateBank(ObjectContext* objectCtx) -{ +void Object_UpdateBank(ObjectContext* objectCtx) { s32 i; ObjectStatus* status; RomFile* objectFile; u32 size; status = &objectCtx->status[0]; - for (i = 0; i < objectCtx->num; i++) - { - if (status->id < 0) - { - if (status->dmaRequest.vromAddr == 0) - { + for (i = 0; i < objectCtx->num; i++) { + if (status->id < 0) { + if (status->dmaRequest.vromAddr == 0) { osCreateMesgQueue(&status->loadQueue, &status->loadMsg, 1); objectFile = &gObjectTable[-status->id]; size = objectFile->vromEnd - objectFile->vromStart; - osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n", - i, (f64)(size / 1024.0f), status->segment); - DmaMgr_SendRequest2(&status->dmaRequest, status->segment, objectFile->vromStart, size, - 0, &status->loadQueue, NULL, "../z_scene.c", 266); - } - else if (!osRecvMesg(&status->loadQueue, NULL, OS_MESG_NOBLOCK)) - { + osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n", i, (f64)(size / 1024.0f), + status->segment); + DmaMgr_SendRequest2(&status->dmaRequest, status->segment, objectFile->vromStart, size, 0, + &status->loadQueue, NULL, "../z_scene.c", 266); + } else if (!osRecvMesg(&status->loadQueue, NULL, OS_MESG_NOBLOCK)) { status->id = -status->id; } } @@ -106,47 +104,43 @@ void Object_UpdateBank(ObjectContext* objectCtx) } } -s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) -{ +s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) { s32 i; - for (i = 0; i < objectCtx->num; i++) - { - if (ABS(objectCtx->status[i].id) == objectId) + for (i = 0; i < objectCtx->num; i++) { + if (ABS(objectCtx->status[i].id) == objectId) { return i; + } } return -1; } -s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex) -{ - if (objectCtx->status[bankIndex].id > 0) +s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex) { + if (objectCtx->status[bankIndex].id > 0) { return 1; - else + } else { return 0; + } } -void func_800981B8(ObjectContext* objectCtx) -{ +void func_800981B8(ObjectContext* objectCtx) { s32 i; s32 id; u32 size; - for (i = 0; i < objectCtx->num; i++) - { + for (i = 0; i < objectCtx->num; i++) { id = objectCtx->status[i].id; size = gObjectTable[id].vromEnd - gObjectTable[id].vromStart; - osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", - objectCtx->status[i].id, (f64)(size / 1024.0f), objectCtx->status[i].segment); - osSyncPrintf("num=%d adrs=%x end=%x\n", - objectCtx->num, (s32)objectCtx->status[i].segment + size, objectCtx->spaceEnd); + osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectCtx->status[i].id, (f64)(size / 1024.0f), + objectCtx->status[i].segment); + osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (s32)objectCtx->status[i].segment + size, + objectCtx->spaceEnd); DmaMgr_SendRequest1(objectCtx->status[i].segment, gObjectTable[id].vromStart, size, "../z_scene.c", 342); } } -void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) -{ +void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) { ObjectStatus* status = &objectCtx->status[bankIndex]; RomFile* objectFile = &gObjectTable[objectId]; u32 size; @@ -156,14 +150,15 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) status->dmaRequest.vromAddr = 0; size = objectFile->vromEnd - objectFile->vromStart; - osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n", - bankIndex, objectId, (f64)(size / 1024.0f)); + osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n", bankIndex, objectId, (f64)(size / 1024.0f)); - if (1) // Necessary to match + if (1) { // Necessary to match nextPtr = (void*)ALIGN16((s32)status->segment + size); + } - if (nextPtr >= objectCtx->spaceEnd) + if (nextPtr >= objectCtx->spaceEnd) { __assert("nextptr < this->endSegment", "../z_scene.c", 381); + } // Translates to: "OBJECT EXCHANGE FREE SIZE=%08x" osSyncPrintf("オブジェクト入れ替え空きサイズ=%08x\n", (s32)objectCtx->spaceEnd - (s32)nextPtr); @@ -171,25 +166,21 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) return nextPtr; } -s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd) -{ +s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd) { u32 cmdCode; - while (1) - { + while (1) { cmdCode = sceneCmd->base.code; - osSyncPrintf("*** Scene_Word = { code=%d, data1=%02x, data2=%04x } ***\n", - cmdCode, sceneCmd->base.data1, sceneCmd->base.data2); + osSyncPrintf("*** Scene_Word = { code=%d, data1=%02x, data2=%04x } ***\n", cmdCode, sceneCmd->base.data1, + sceneCmd->base.data2); - if (cmdCode == 0x14) + if (cmdCode == 0x14) { break; - - if (cmdCode <= 0x19) - { - gSceneCmdHandlers[cmdCode](globalCtx, sceneCmd); } - else - { + + if (cmdCode <= 0x19) { + gSceneCmdHandlers[cmdCode](globalCtx, sceneCmd); + } else { osSyncPrintf(VT_FGCOL(RED)); // Translates to: "code VARIABLE IS ABNORMAL" osSyncPrintf("code の値が異常です\n"); @@ -205,8 +196,7 @@ s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd) // Scene Command 0x00: Link Spawn List #ifdef NON_MATCHING // regalloc differences -void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd) { ActorEntry* linkEntry = (ActorEntry*)SEGMENTED_TO_VIRTUAL(cmd->spawnList.segment) + globalCtx->setupEntranceList[globalCtx->curSpawn].spawn; s16 linkObjectId; @@ -227,21 +217,18 @@ void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd); #endif // Scene Command 0x01: Actor List -void func_800985DC(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_800985DC(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->nbSetupActors = cmd->actorList.num; globalCtx->setupActorList = SEGMENTED_TO_VIRTUAL(cmd->actorList.segment); } // Scene Command 0x02: Cutscene Camera List -void func_80098630(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098630(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->unk_11DFC = SEGMENTED_TO_VIRTUAL(cmd->csCameraList.segment); } // Scene Command 0x03: Collision Header -void func_80098674(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098674(GlobalContext* globalCtx, SceneCmd* cmd) { CollisionHeader* colHeader; colHeader = SEGMENTED_TO_VIRTUAL(cmd->colHeader.segment); @@ -256,34 +243,30 @@ void func_80098674(GlobalContext* globalCtx, SceneCmd* cmd) } // Scene Command 0x04: Room List -void func_800987A4(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_800987A4(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->nbRooms = cmd->roomList.num; globalCtx->roomList = SEGMENTED_TO_VIRTUAL(cmd->roomList.segment); } // Scene Command 0x06: Entrance List -void func_800987F8(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_800987F8(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->setupEntranceList = SEGMENTED_TO_VIRTUAL(cmd->entranceList.segment); } // Scene Command 0x07: Special Files -void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd) -{ - if (cmd->specialFiles.keepObjectId != 0) - { +void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd) { + if (cmd->specialFiles.keepObjectId != 0) { globalCtx->objectCtx.subKeepIndex = Object_Spawn(&globalCtx->objectCtx, cmd->specialFiles.keepObjectId); gSegments[5] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); } - if (cmd->specialFiles.naviMsgNum != 0) + if (cmd->specialFiles.naviMsgNum != 0) { globalCtx->naviMsgSegment = func_800BFE5C(globalCtx, &sNaviMsgFiles[cmd->specialFiles.naviMsgNum - 1]); + } } // Scene Command 0x08: Room Behavior -void func_80098904(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098904(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->roomCtx.curRoom.unk_03 = cmd->roomBehavior.gpFlag1; globalCtx->roomCtx.curRoom.unk_02 = cmd->roomBehavior.gpFlag2 & 0xFF; globalCtx->roomCtx.curRoom.showInvisActors = (cmd->roomBehavior.gpFlag2 >> 8) & 1; @@ -291,16 +274,14 @@ void func_80098904(GlobalContext* globalCtx, SceneCmd* cmd) } // Scene Command 0x0A: Mesh Header -void func_80098958(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098958(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->roomCtx.curRoom.mesh = SEGMENTED_TO_VIRTUAL(cmd->mesh.segment); } // Scene Command 0x0B: Object List #ifdef NON_MATCHING // this function still needs some work -void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd) { s32 i, j, k; s16* objectEntry; ObjectStatus* status; @@ -313,21 +294,16 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd) k = 0; status = status2; i = globalCtx->objectCtx.unk_09; - while (i < globalCtx->objectCtx.num) - { - if (status->id != *objectEntry) - { + while (i < globalCtx->objectCtx.num) { + if (status->id != *objectEntry) { status3 = status2; - for (j = i; j < globalCtx->objectCtx.num; j++) - { + for (j = i; j < globalCtx->objectCtx.num; j++) { status3->id = 0; status3++; } globalCtx->objectCtx.num = i; func_80031A28(globalCtx, &globalCtx->actorCtx); - } - else - { + } else { i++; status++; k++; @@ -339,8 +315,7 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd) if (cmd->objectList.num > OBJECT_EXCHANGE_BANK_MAX) __assert("scene_info->object_bank.num <= OBJECT_EXCHANGE_BANK_MAX", "../z_scene.c", 705); - while (k < cmd->objectList.num) - { + while (k < cmd->objectList.num) { nextPtr = func_800982FC(&globalCtx->objectCtx, i, *objectEntry); if (i < OBJECT_EXCHANGE_BANK_MAX - 1) globalCtx->objectCtx.status[i + 1].segment = nextPtr; @@ -357,75 +332,69 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd); #endif // Scene Command 0x0C: Light List -void func_80098B74(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098B74(GlobalContext* globalCtx, SceneCmd* cmd) { s32 i; LightInfo* lightInfo; lightInfo = SEGMENTED_TO_VIRTUAL(cmd->lightList.segment); - for (i = 0; i < cmd->lightList.num; i++) - { + for (i = 0; i < cmd->lightList.num; i++) { Lights_Insert(globalCtx, &globalCtx->lightCtx, lightInfo); lightInfo++; } } // Scene Command 0x0D: Path List -void func_80098C24(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098C24(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->setupPathList = SEGMENTED_TO_VIRTUAL(cmd->pathList.segment); } // Scene Command 0x0E: Transition Actor List -void func_80098C68(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098C68(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->nbTransitionActors = cmd->transiActorList.num; globalCtx->transitionActorList = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.segment); } -void func_80098CBC(GlobalContext* globalCtx, u8* nbTransitionActors) -{ +void func_80098CBC(GlobalContext* globalCtx, u8* nbTransitionActors) { *nbTransitionActors = 0; } // Scene Command 0x0F: Light Setting List -void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->nbLightSettings = cmd->lightSettingList.num; globalCtx->lightSettingsList = SEGMENTED_TO_VIRTUAL(cmd->lightSettingList.segment); } // Scene Command 0x11: Skybox Settings -void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->skyboxId = cmd->skyboxSettings.skyboxId; globalCtx->gloomySky = globalCtx->unk_10A3C = cmd->skyboxSettings.unk_05; globalCtx->unk_10A42 = cmd->skyboxSettings.unk_06; } // Scene Command 0x12: Skybox Disables -void func_80098D5C(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098D5C(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->skyDisabled = cmd->skyboxDisables.unk_04; globalCtx->sunMoonDisabled = cmd->skyboxDisables.unk_05; } // Scene Command 0x10: Time Settings -void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd) { u32 dayTime; - if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) + if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) { gSaveContext.environment_time = gSaveContext.day_time = ((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f; + } - if (cmd->timeSettings.unk_06 != 0xFF) + if (cmd->timeSettings.unk_06 != 0xFF) { globalCtx->unk_10A26 = cmd->timeSettings.unk_06; - else + } else { globalCtx->unk_10A26 = 0; + } - if (gSaveContext.unk_1422 == 0) + if (gSaveContext.unk_1422 == 0) { D_8011FB40 = globalCtx->unk_10A26; + } dayTime = gSaveContext.day_time; globalCtx->unk_10A28 = -(Math_Sins(dayTime - 0x8000) * 120.0f) * 25.0f; @@ -435,23 +404,22 @@ void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd) globalCtx->unk_10A30 = (Math_Coss(dayTime - 0x8000) * 20.0f) * 25.0f; if (((globalCtx->unk_10A26 == 0) && (gSaveContext.cutscene_index < 0xFFF0)) || - (gSaveContext.entrance_index == 0x0604)) - { + (gSaveContext.entrance_index == 0x0604)) { gSaveContext.environment_time = gSaveContext.day_time; - if ((gSaveContext.environment_time >= 0x2AAC) && (gSaveContext.environment_time < 0x4555)) + if ((gSaveContext.environment_time >= 0x2AAC) && (gSaveContext.environment_time < 0x4555)) { gSaveContext.environment_time = 0x3556; - else if ((gSaveContext.environment_time >= 0x4555) && (gSaveContext.environment_time < 0x5556)) + } else if ((gSaveContext.environment_time >= 0x4555) && (gSaveContext.environment_time < 0x5556)) { gSaveContext.environment_time = 0x5556; - else if ((gSaveContext.environment_time >= 0xAAAB) && (gSaveContext.environment_time < 0xB556)) + } else if ((gSaveContext.environment_time >= 0xAAAB) && (gSaveContext.environment_time < 0xB556)) { gSaveContext.environment_time = 0xB556; - else if ((gSaveContext.environment_time >= 0xC001) && (gSaveContext.environment_time < 0xCAAC)) + } else if ((gSaveContext.environment_time >= 0xC001) && (gSaveContext.environment_time < 0xCAAC)) { gSaveContext.environment_time = 0xCAAC; + } } } // Scene Command 0x05: Wind Settings -void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd) { s8 temp1 = cmd->windSettings.unk_04; s8 temp2 = cmd->windSettings.unk_05; s8 temp3 = cmd->windSettings.unk_06; @@ -463,38 +431,33 @@ void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd) } // Scene Command 0x13: Exit List -void func_800990F0(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_800990F0(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->setupExitList = SEGMENTED_TO_VIRTUAL(cmd->exitList.segment); } // Scene Command 0x09: Undefined -void func_80099134(GlobalContext* globalCtx, SceneCmd* cmd) -{ - +void func_80099134(GlobalContext* globalCtx, SceneCmd* cmd) { } // Scene Command 0x15: Sound Settings -void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->soundCtx.musicSeq = cmd->soundSettings.musicSeq; globalCtx->soundCtx.nighttimeSFX = cmd->soundSettings.nighttimeSFX; - if (gSaveContext.seq_index == 0xFF) + if (gSaveContext.seq_index == 0xFF) { Audio_SetBGM(cmd->soundSettings.bgmId | 0xF0000000); + } } // Scene Command 0x16: Echo Setting -void func_8009918C(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_8009918C(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->roomCtx.curRoom.echo = cmd->echoSettings.echo; } // Scene Command 0x18: Alternate Headers #ifdef NON_MATCHING // minor ordering and regalloc differences -void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) { SceneCmd** altHeaders; SceneCmd* altHeader; @@ -502,31 +465,25 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) osSyncPrintf("\n[ZU]sceneset time =[%X]", gSaveContext.cutscene_index); osSyncPrintf("\n[ZU]sceneset counter=[%X]", gSaveContext.scene_setup_index); - if (gSaveContext.scene_setup_index != 0) - { + if (gSaveContext.scene_setup_index != 0) { altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment); altHeader = altHeaders[gSaveContext.scene_setup_index - 1]; - if (altHeader != NULL) - { + if (altHeader != NULL) { Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader)); (cmd + 1)->base.code = 0x14; - } - else - { + } else { // Translates to: "COUGHH! THERE IS NO SPECIFIED DATAAAAA!" osSyncPrintf("\nげぼはっ! 指定されたデータがないでええっす!"); - if (gSaveContext.scene_setup_index == 3) - { + if (gSaveContext.scene_setup_index == 3) { altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment); altHeader = altHeaders[gSaveContext.scene_setup_index - 2]; // Translates to: "USING ADULT DAY DATA THERE!" osSyncPrintf("\nそこで、大人の昼データを使用するでええっす!!"); - if (altHeader != NULL) - { + if (altHeader != NULL) { Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader)); (cmd + 1)->base.code = 0x14; } @@ -540,73 +497,47 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd); #endif // Scene Command 0x17: Cutscene Data -void func_8009934C(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_8009934C(GlobalContext* globalCtx, SceneCmd* cmd) { osSyncPrintf("\ngame_play->demo_play.data=[%x]", globalCtx->csCtx.segment); globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(cmd->cutsceneData.segment); } // Scene Command 0x19: Misc. Settings (Camera & World Map Area) -void func_800993C0(GlobalContext* globalCtx, SceneCmd* cmd) -{ +void func_800993C0(GlobalContext* globalCtx, SceneCmd* cmd) { YREG(15) = cmd->miscSettings.cameraMovement; gSaveContext.world_map_area = cmd->miscSettings.area; - if ((globalCtx->sceneNum == SCENE_SHOP1) || (globalCtx->sceneNum == SCENE_SYATEKIJYOU)) - { - if (LINK_AGE_IN_YEARS == YEARS_ADULT) - { + if ((globalCtx->sceneNum == SCENE_SHOP1) || (globalCtx->sceneNum == SCENE_SYATEKIJYOU)) { + if (LINK_AGE_IN_YEARS == YEARS_ADULT) { gSaveContext.world_map_area = 1; } } if (((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_GANON_TOU)) || - ((globalCtx->sceneNum >= SCENE_ENTRA) && (globalCtx->sceneNum <= SCENE_SHRINE_R))) - { - if (gSaveContext.cutscene_index < 0xFFF0) - { + ((globalCtx->sceneNum >= SCENE_ENTRA) && (globalCtx->sceneNum <= SCENE_SHRINE_R))) { + if (gSaveContext.cutscene_index < 0xFFF0) { gSaveContext.world_map_area_data |= gBitFlags[gSaveContext.world_map_area]; - osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.world_map_area_data, gSaveContext.world_map_area); + osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.world_map_area_data, + gSaveContext.world_map_area); } } } -void (*gSceneCmdHandlers[])(GlobalContext*, SceneCmd*) = -{ - func_80098508, - func_800985DC, - func_80098630, - func_80098674, - func_800987A4, - func_80099090, - func_800987F8, - func_8009883C, - func_80098904, - func_80099134, - func_80098958, - func_8009899C, - func_80098B74, - func_80098C24, - func_80098C68, - func_80098CC8, - func_80098D80, - func_80098D1C, - func_80098D5C, - func_800990F0, - NULL, - func_80099140, - func_8009918C, - func_8009934C, - func_800991A0, - func_800993C0, +void (*gSceneCmdHandlers[])(GlobalContext*, SceneCmd*) = { + func_80098508, func_800985DC, func_80098630, func_80098674, func_800987A4, func_80099090, func_800987F8, + func_8009883C, func_80098904, func_80099134, func_80098958, func_8009899C, func_80098B74, func_80098C24, + func_80098C68, func_80098CC8, func_80098D80, func_80098D1C, func_80098D5C, func_800990F0, NULL, + func_80099140, func_8009918C, func_8009934C, func_800991A0, func_800993C0, }; -#define ROM_FILE(name) { (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomEnd } -#define ROM_FILE_EMPTY(name) { (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomStart } -#define ROM_FILE_UNSET { 0 } +#define ROM_FILE(name) \ + { (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd } +#define ROM_FILE_EMPTY(name) \ + { (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomStart } +#define ROM_FILE_UNSET \ + { 0 } -RomFile sNaviMsgFiles[] = -{ +RomFile sNaviMsgFiles[] = { ROM_FILE(elf_message_field), ROM_FILE(elf_message_ydan), ROM_FILE_UNSET, @@ -616,8 +547,7 @@ s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD }; u32 gObjectTableSize = 402; -RomFile gObjectTable[] = -{ +RomFile gObjectTable[] = { ROM_FILE_UNSET, ROM_FILE(gameplay_keep), ROM_FILE(gameplay_field_keep), diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 54d69eb8c5..86d79168f9 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -1,1582 +1,538 @@ #include #include -EntranceInfo gEntranceTable[] = -{ - { 0x00, 0x00, 0, 1, 0x02, 0x02 }, - { 0x00, 0x00, 0, 1, 0x02, 0x02 }, - { 0x00, 0x00, 0, 1, 0x02, 0x02 }, - { 0x00, 0x00, 0, 1, 0x02, 0x02 }, - { 0x01, 0x00, 0, 1, 0x02, 0x02 }, - { 0x01, 0x00, 0, 1, 0x02, 0x02 }, - { 0x01, 0x00, 0, 1, 0x02, 0x02 }, - { 0x01, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x14, 0x00, 1, 1, 0x02, 0x02 }, - { 0x14, 0x00, 1, 1, 0x02, 0x02 }, - { 0x14, 0x00, 1, 1, 0x02, 0x02 }, - { 0x14, 0x00, 1, 1, 0x02, 0x02 }, - { 0x05, 0x00, 0, 1, 0x02, 0x02 }, - { 0x05, 0x00, 0, 1, 0x02, 0x02 }, - { 0x05, 0x00, 0, 1, 0x02, 0x02 }, - { 0x05, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x68, 0x00, 0, 1, 0x02, 0x02 }, - { 0x68, 0x00, 0, 1, 0x02, 0x02 }, - { 0x68, 0x00, 0, 1, 0x02, 0x02 }, - { 0x68, 0x00, 0, 1, 0x02, 0x02 }, - { 0x69, 0x00, 0, 1, 0x02, 0x02 }, - { 0x69, 0x00, 0, 1, 0x02, 0x02 }, - { 0x69, 0x00, 0, 1, 0x02, 0x02 }, - { 0x69, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x02, 0x00, 0, 1, 0x02, 0x02 }, - { 0x02, 0x00, 0, 1, 0x02, 0x02 }, - { 0x02, 0x00, 0, 1, 0x02, 0x02 }, - { 0x02, 0x00, 0, 1, 0x02, 0x02 }, - { 0x02, 0x00, 0, 1, 0x02, 0x02 }, - { 0x41, 0x00, 0, 1, 0x02, 0x26 }, - { 0x41, 0x00, 0, 1, 0x02, 0x26 }, - { 0x41, 0x00, 0, 1, 0x02, 0x26 }, - { 0x41, 0x00, 0, 1, 0x02, 0x26 }, - { 0x41, 0x00, 0, 1, 0x02, 0x02 }, - { 0x41, 0x00, 0, 1, 0x02, 0x02 }, - { 0x1B, 0x00, 1, 1, 0x03, 0x03 }, - { 0x1C, 0x00, 1, 1, 0x02, 0x02 }, - { 0x1D, 0x00, 1, 1, 0x03, 0x03 }, - { 0x1D, 0x00, 1, 1, 0x02, 0x02 }, - { 0x07, 0x00, 0, 1, 0x02, 0x02 }, - { 0x07, 0x00, 0, 1, 0x02, 0x02 }, - { 0x07, 0x00, 0, 1, 0x02, 0x02 }, - { 0x07, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x04, 0x20 }, - { 0x42, 0x00, 0, 1, 0x04, 0x20 }, - { 0x42, 0x00, 0, 1, 0x04, 0x20 }, - { 0x42, 0x00, 0, 1, 0x04, 0x20 }, - { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x38, 0x00, 0, 1, 0x04, 0x20 }, - { 0x38, 0x00, 0, 1, 0x04, 0x20 }, - { 0x38, 0x00, 0, 1, 0x04, 0x20 }, - { 0x38, 0x00, 0, 1, 0x04, 0x20 }, - { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x40, 0x00, 0, 1, 0x02, 0x26 }, - { 0x40, 0x00, 0, 1, 0x02, 0x26 }, - { 0x40, 0x00, 0, 1, 0x02, 0x26 }, - { 0x40, 0x00, 0, 1, 0x02, 0x26 }, - { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x0B, 0x0B }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x10, 0x00, 0, 1, 0x04, 0x20 }, - { 0x10, 0x00, 0, 1, 0x04, 0x20 }, - { 0x10, 0x00, 0, 1, 0x04, 0x20 }, - { 0x10, 0x00, 0, 1, 0x04, 0x20 }, - { 0x1E, 0x03, 1, 1, 0x03, 0x03 }, - { 0x1F, 0x03, 1, 1, 0x02, 0x02 }, - { 0x1E, 0x03, 1, 1, 0x02, 0x02 }, - { 0x1F, 0x03, 1, 1, 0x02, 0x02 }, - { 0x44, 0x00, 0, 1, 0x07, 0x07 }, - { 0x44, 0x00, 0, 1, 0x07, 0x07 }, - { 0x44, 0x00, 0, 1, 0x07, 0x07 }, - { 0x44, 0x00, 0, 1, 0x07, 0x07 }, - { 0x44, 0x00, 0, 1, 0x0D, 0x02 }, - { 0x44, 0x00, 0, 1, 0x0D, 0x02 }, - { 0x44, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, - { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, - { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, - { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, - { 0x45, 0x00, 0, 1, 0x22, 0x04 }, - { 0x46, 0x00, 0, 1, 0x22, 0x04 }, - { 0x45, 0x00, 0, 1, 0x22, 0x04 }, - { 0x46, 0x00, 0, 1, 0x22, 0x04 }, - { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x06, 0x00, 0, 1, 0x02, 0x02 }, - { 0x06, 0x00, 0, 1, 0x02, 0x02 }, - { 0x06, 0x00, 0, 1, 0x02, 0x02 }, - { 0x06, 0x00, 0, 1, 0x02, 0x02 }, - { 0x06, 0x00, 0, 1, 0x02, 0x02 }, - { 0x06, 0x00, 0, 1, 0x02, 0x02 }, - { 0x09, 0x00, 0, 1, 0x02, 0x02 }, - { 0x09, 0x00, 0, 1, 0x02, 0x02 }, - { 0x09, 0x00, 0, 1, 0x02, 0x02 }, - { 0x09, 0x00, 0, 1, 0x02, 0x02 }, - { 0x09, 0x00, 0, 1, 0x02, 0x02 }, - { 0x17, 0x00, 1, 1, 0x02, 0x02 }, - { 0x17, 0x00, 1, 1, 0x02, 0x02 }, - { 0x17, 0x00, 1, 1, 0x02, 0x02 }, - { 0x17, 0x00, 1, 1, 0x02, 0x02 }, - { 0x17, 0x00, 0, 1, 0x02, 0x02 }, - { 0x17, 0x00, 0, 1, 0x02, 0x02 }, - { 0x17, 0x00, 0, 1, 0x02, 0x02 }, - { 0x65, 0x00, 0, 1, 0x02, 0x02 }, - { 0x65, 0x00, 0, 1, 0x02, 0x02 }, - { 0x65, 0x00, 0, 1, 0x02, 0x02 }, - { 0x65, 0x00, 0, 1, 0x02, 0x02 }, - { 0x08, 0x00, 0, 1, 0x04, 0x04 }, - { 0x08, 0x00, 0, 1, 0x04, 0x04 }, - { 0x08, 0x00, 0, 1, 0x04, 0x04 }, - { 0x08, 0x00, 0, 1, 0x04, 0x04 }, - { 0x27, 0x00, 0, 1, 0x04, 0x04 }, - { 0x27, 0x00, 0, 1, 0x04, 0x04 }, - { 0x27, 0x00, 0, 1, 0x04, 0x04 }, - { 0x27, 0x00, 0, 1, 0x04, 0x04 }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, - { 0x47, 0x00, 0, 1, 0x0A, 0x0A }, - { 0x47, 0x00, 0, 1, 0x02, 0x0A }, - { 0x47, 0x00, 1, 1, 0x0A, 0x0A }, - { 0x47, 0x00, 0, 1, 0x0B, 0x0B }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, - { 0x47, 0x00, 0, 1, 0x02, 0x02 }, - { 0x47, 0x00, 0, 1, 0x02, 0x02 }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, - { 0x1E, 0x00, 1, 1, 0x03, 0x03 }, - { 0x1F, 0x00, 1, 1, 0x02, 0x02 }, - { 0x1E, 0x00, 1, 1, 0x02, 0x02 }, - { 0x1F, 0x00, 1, 1, 0x02, 0x02 }, - { 0x20, 0x00, 1, 1, 0x03, 0x03 }, - { 0x21, 0x00, 1, 1, 0x02, 0x02 }, - { 0x22, 0x00, 1, 1, 0x02, 0x02 }, - { 0x22, 0x00, 1, 1, 0x02, 0x02 }, - { 0x20, 0x00, 0, 1, 0x08, 0x08 }, - { 0x67, 0x00, 0, 1, 0x02, 0x02 }, - { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x34, 0x00, 0, 1, 0x04, 0x04 }, - { 0x34, 0x00, 0, 1, 0x04, 0x04 }, - { 0x34, 0x00, 0, 1, 0x04, 0x04 }, - { 0x34, 0x00, 0, 1, 0x04, 0x04 }, - { 0x34, 0x00, 0, 1, 0x04, 0x02 }, - { 0x34, 0x00, 0, 1, 0x10, 0x10 }, - { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, - { 0x01, 0x01, 1, 0, 0x02, 0x02 }, - { 0x01, 0x01, 1, 0, 0x02, 0x02 }, - { 0x01, 0x01, 1, 0, 0x02, 0x02 }, - { 0x01, 0x01, 1, 0, 0x02, 0x02 }, - { 0x26, 0x00, 0, 1, 0x04, 0x04 }, - { 0x26, 0x00, 0, 1, 0x04, 0x04 }, - { 0x26, 0x00, 0, 1, 0x04, 0x04 }, - { 0x26, 0x00, 0, 1, 0x04, 0x04 }, - { 0x51, 0x00, 0, 1, 0x03, 0x03 }, - { 0x51, 0x00, 0, 1, 0x02, 0x02 }, - { 0x51, 0x00, 0, 1, 0x03, 0x03 }, - { 0x51, 0x00, 0, 1, 0x02, 0x02 }, - { 0x51, 0x00, 0, 1, 0x04, 0x02 }, - { 0x51, 0x00, 0, 1, 0x21, 0x21 }, - { 0x51, 0x00, 0, 1, 0x21, 0x21 }, - { 0x51, 0x00, 0, 1, 0x23, 0x23 }, - { 0x51, 0x00, 0, 1, 0x03, 0x03 }, - { 0x51, 0x00, 1, 1, 0x02, 0x02 }, - { 0x51, 0x00, 0, 1, 0x23, 0x23 }, - { 0x51, 0x00, 0, 1, 0x03, 0x03 }, - { 0x51, 0x00, 0, 1, 0x29, 0x29 }, - { 0x51, 0x00, 1, 1, 0x03, 0x03 }, - { 0x52, 0x00, 0, 1, 0x03, 0x03 }, - { 0x52, 0x00, 0, 1, 0x02, 0x02 }, - { 0x52, 0x00, 0, 1, 0x03, 0x03 }, - { 0x52, 0x00, 0, 1, 0x02, 0x02 }, - { 0x52, 0x00, 0, 1, 0x26, 0x26 }, - { 0x52, 0x00, 0, 1, 0x21, 0x21 }, - { 0x52, 0x00, 1, 1, 0x21, 0x21 }, - { 0x52, 0x00, 0, 1, 0x21, 0x21 }, - { 0x52, 0x00, 1, 1, 0x02, 0x02 }, - { 0x53, 0x00, 0, 1, 0x03, 0x03 }, - { 0x53, 0x00, 0, 1, 0x02, 0x02 }, - { 0x53, 0x00, 0, 1, 0x03, 0x03 }, - { 0x53, 0x00, 0, 1, 0x02, 0x02 }, - { 0x53, 0x00, 0, 1, 0x04, 0x02 }, - { 0x53, 0x00, 1, 1, 0x02, 0x02 }, - { 0x54, 0x00, 1, 1, 0x03, 0x03 }, - { 0x54, 0x00, 1, 1, 0x02, 0x02 }, - { 0x54, 0x00, 1, 1, 0x03, 0x03 }, - { 0x54, 0x00, 1, 1, 0x02, 0x02 }, - { 0x55, 0x00, 0, 1, 0x03, 0x03 }, - { 0x55, 0x00, 0, 1, 0x02, 0x02 }, - { 0x55, 0x00, 0, 1, 0x03, 0x03 }, - { 0x55, 0x00, 0, 1, 0x02, 0x02 }, - { 0x55, 0x00, 1, 1, 0x0A, 0x0A }, - { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, - { 0x55, 0x00, 1, 1, 0x0A, 0x0A }, - { 0x55, 0x00, 0, 1, 0x0D, 0x0A }, - { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, - { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, - { 0x55, 0x00, 1, 1, 0x02, 0x02 }, - { 0x55, 0x00, 1, 1, 0x02, 0x02 }, - { 0x55, 0x00, 1, 1, 0x02, 0x02 }, - { 0x55, 0x00, 1, 1, 0x02, 0x02 }, - { 0x56, 0x00, 1, 1, 0x02, 0x02 }, - { 0x56, 0x00, 1, 1, 0x02, 0x02 }, - { 0x56, 0x00, 1, 1, 0x02, 0x02 }, - { 0x56, 0x00, 1, 1, 0x02, 0x02 }, - { 0x56, 0x00, 0, 1, 0x03, 0x03 }, - { 0x56, 0x00, 0, 1, 0x00, 0x00 }, - { 0x57, 0x00, 1, 1, 0x03, 0x03 }, - { 0x57, 0x00, 1, 1, 0x02, 0x02 }, - { 0x57, 0x00, 1, 1, 0x03, 0x03 }, - { 0x57, 0x00, 1, 1, 0x02, 0x02 }, - { 0x57, 0x00, 0, 1, 0x03, 0x03 }, - { 0x57, 0x00, 1, 1, 0x02, 0x02 }, - { 0x58, 0x00, 0, 1, 0x02, 0x02 }, - { 0x58, 0x00, 0, 1, 0x02, 0x02 }, - { 0x58, 0x00, 0, 1, 0x02, 0x02 }, - { 0x58, 0x00, 0, 1, 0x02, 0x02 }, - { 0x58, 0x00, 1, 1, 0x02, 0x02 }, - { 0x58, 0x00, 1, 1, 0x02, 0x02 }, - { 0x59, 0x00, 0, 1, 0x03, 0x03 }, - { 0x59, 0x00, 0, 1, 0x02, 0x02 }, - { 0x59, 0x00, 0, 1, 0x03, 0x03 }, - { 0x59, 0x00, 0, 1, 0x02, 0x02 }, - { 0x59, 0x00, 0, 1, 0x0D, 0x00 }, - { 0x59, 0x00, 0, 1, 0x02, 0x02 }, - { 0x59, 0x00, 1, 1, 0x02, 0x02 }, - { 0x59, 0x00, 0, 1, 0x02, 0x02 }, - { 0x59, 0x00, 1, 1, 0x02, 0x02 }, - { 0x5A, 0x00, 0, 1, 0x03, 0x03 }, - { 0x5A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x5A, 0x00, 0, 1, 0x03, 0x03 }, - { 0x5A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x5A, 0x00, 1, 1, 0x0C, 0x0A }, - { 0x5A, 0x00, 1, 1, 0x0A, 0x0A }, - { 0x5A, 0x00, 1, 1, 0x02, 0x02 }, - { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, - { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, - { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, - { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, - { 0x5C, 0x00, 1, 1, 0x02, 0x02 }, - { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, - { 0x5D, 0x00, 1, 1, 0x03, 0x03 }, - { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, - { 0x5D, 0x00, 1, 1, 0x03, 0x03 }, - { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, - { 0x5D, 0x00, 1, 1, 0x21, 0x21 }, - { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, - { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, - { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, - { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, - { 0x5F, 0x00, 0, 1, 0x03, 0x03 }, - { 0x5F, 0x00, 0, 1, 0x02, 0x02 }, - { 0x64, 0x00, 0, 1, 0x02, 0x02 }, - { 0x64, 0x00, 0, 1, 0x02, 0x02 }, - { 0x64, 0x00, 0, 1, 0x04, 0x02 }, - { 0x60, 0x00, 0, 1, 0x03, 0x03 }, - { 0x60, 0x00, 0, 1, 0x02, 0x02 }, - { 0x60, 0x00, 0, 1, 0x03, 0x03 }, - { 0x60, 0x00, 0, 1, 0x02, 0x02 }, - { 0x60, 0x00, 1, 1, 0x0A, 0x0A }, - { 0x60, 0x00, 0, 1, 0x03, 0x03 }, - { 0x60, 0x00, 0, 1, 0x02, 0x02 }, - { 0x60, 0x00, 1, 1, 0x02, 0x02 }, - { 0x60, 0x00, 1, 1, 0x03, 0x03 }, - { 0x60, 0x00, 1, 1, 0x03, 0x03 }, - { 0x61, 0x00, 0, 1, 0x02, 0x02 }, - { 0x61, 0x00, 0, 1, 0x02, 0x02 }, - { 0x61, 0x00, 0, 1, 0x02, 0x02 }, - { 0x61, 0x00, 0, 1, 0x02, 0x02 }, - { 0x61, 0x00, 0, 1, 0x03, 0x03 }, - { 0x61, 0x00, 0, 1, 0x02, 0x02 }, - { 0x62, 0x00, 0, 1, 0x02, 0x02 }, - { 0x62, 0x00, 0, 1, 0x02, 0x02 }, - { 0x62, 0x00, 0, 1, 0x02, 0x02 }, - { 0x62, 0x00, 0, 1, 0x02, 0x02 }, - { 0x62, 0x00, 0, 1, 0x02, 0x02 }, - { 0x62, 0x00, 1, 1, 0x02, 0x02 }, - { 0x58, 0x03, 0, 1, 0x00, 0x00 }, - { 0x58, 0x03, 0, 1, 0x00, 0x00 }, - { 0x58, 0x03, 0, 1, 0x00, 0x00 }, - { 0x58, 0x03, 0, 1, 0x00, 0x00 }, - { 0x63, 0x00, 0, 1, 0x03, 0x03 }, - { 0x63, 0x00, 0, 1, 0x02, 0x02 }, - { 0x63, 0x00, 0, 1, 0x03, 0x03 }, - { 0x63, 0x00, 0, 1, 0x02, 0x02 }, - { 0x63, 0x00, 0, 1, 0x20, 0x20 }, - { 0x63, 0x00, 0, 1, 0x2A, 0x2A }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x04, 0x00, 0, 1, 0x02, 0x02 }, - { 0x04, 0x00, 0, 1, 0x02, 0x02 }, - { 0x04, 0x00, 0, 1, 0x02, 0x02 }, - { 0x04, 0x00, 0, 1, 0x02, 0x02 }, - { 0x03, 0x00, 0, 1, 0x02, 0x02 }, - { 0x03, 0x00, 0, 1, 0x02, 0x02 }, - { 0x03, 0x00, 0, 1, 0x02, 0x02 }, - { 0x03, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x01, 0, 1, 0x04, 0x20 }, - { 0x42, 0x01, 0, 1, 0x04, 0x20 }, - { 0x42, 0x01, 0, 1, 0x04, 0x20 }, - { 0x42, 0x01, 0, 1, 0x04, 0x20 }, - { 0x23, 0x00, 0, 1, 0x03, 0x03 }, - { 0x24, 0x00, 0, 1, 0x02, 0x02 }, - { 0x25, 0x00, 0, 1, 0x02, 0x02 }, - { 0x25, 0x00, 0, 1, 0x02, 0x02 }, - { 0x04, 0x01, 1, 1, 0x02, 0x02 }, - { 0x04, 0x01, 1, 1, 0x02, 0x02 }, - { 0x04, 0x01, 1, 1, 0x02, 0x02 }, - { 0x04, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, - { 0x51, 0x01, 0, 1, 0x03, 0x03 }, - { 0x51, 0x01, 0, 1, 0x02, 0x02 }, - { 0x51, 0x01, 0, 1, 0x03, 0x03 }, - { 0x51, 0x01, 0, 1, 0x02, 0x02 }, - { 0x51, 0x02, 1, 1, 0x03, 0x03 }, - { 0x51, 0x02, 1, 1, 0x02, 0x02 }, - { 0x51, 0x02, 1, 1, 0x03, 0x03 }, - { 0x51, 0x02, 1, 1, 0x02, 0x02 }, - { 0x51, 0x03, 0, 1, 0x02, 0x02 }, - { 0x51, 0x03, 0, 1, 0x02, 0x02 }, - { 0x51, 0x03, 0, 1, 0x02, 0x02 }, - { 0x51, 0x03, 0, 1, 0x02, 0x02 }, - { 0x51, 0x04, 1, 1, 0x03, 0x03 }, - { 0x51, 0x04, 1, 1, 0x02, 0x02 }, - { 0x51, 0x04, 1, 1, 0x03, 0x03 }, - { 0x51, 0x04, 1, 1, 0x02, 0x02 }, - { 0x51, 0x05, 0, 1, 0x03, 0x03 }, - { 0x51, 0x05, 0, 1, 0x02, 0x02 }, - { 0x51, 0x05, 0, 1, 0x03, 0x03 }, - { 0x51, 0x05, 0, 1, 0x02, 0x02 }, - { 0x52, 0x01, 0, 1, 0x03, 0x03 }, - { 0x52, 0x01, 0, 1, 0x02, 0x02 }, - { 0x52, 0x01, 0, 1, 0x03, 0x03 }, - { 0x52, 0x01, 0, 1, 0x02, 0x02 }, - { 0x52, 0x02, 0, 1, 0x03, 0x03 }, - { 0x52, 0x02, 0, 1, 0x02, 0x02 }, - { 0x52, 0x02, 0, 1, 0x03, 0x03 }, - { 0x52, 0x02, 0, 1, 0x02, 0x02 }, - { 0x54, 0x01, 1, 1, 0x03, 0x03 }, - { 0x54, 0x01, 1, 1, 0x03, 0x03 }, - { 0x54, 0x01, 1, 1, 0x03, 0x03 }, - { 0x54, 0x01, 1, 1, 0x03, 0x03 }, - { 0x54, 0x02, 0, 1, 0x03, 0x03 }, - { 0x54, 0x02, 0, 1, 0x02, 0x02 }, - { 0x54, 0x02, 0, 1, 0x03, 0x03 }, - { 0x54, 0x02, 0, 1, 0x02, 0x02 }, - { 0x58, 0x01, 0, 1, 0x02, 0x02 }, - { 0x58, 0x01, 0, 1, 0x02, 0x02 }, - { 0x58, 0x01, 0, 1, 0x02, 0x02 }, - { 0x58, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5A, 0x01, 0, 1, 0x03, 0x03 }, - { 0x5A, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5A, 0x01, 0, 1, 0x03, 0x03 }, - { 0x5A, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, - { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, - { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, - { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, - { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, - { 0x60, 0x01, 0, 1, 0x03, 0x03 }, - { 0x60, 0x01, 0, 1, 0x02, 0x02 }, - { 0x60, 0x01, 0, 1, 0x03, 0x03 }, - { 0x60, 0x01, 0, 1, 0x02, 0x02 }, - { 0x60, 0x02, 0, 1, 0x03, 0x03 }, - { 0x60, 0x02, 0, 1, 0x02, 0x02 }, - { 0x60, 0x02, 0, 1, 0x03, 0x03 }, - { 0x60, 0x02, 0, 1, 0x02, 0x02 }, - { 0x62, 0x01, 0, 1, 0x02, 0x02 }, - { 0x62, 0x01, 0, 1, 0x02, 0x02 }, - { 0x62, 0x01, 0, 1, 0x02, 0x02 }, - { 0x62, 0x01, 0, 1, 0x02, 0x02 }, - { 0x38, 0x01, 0, 1, 0x04, 0x20 }, - { 0x38, 0x01, 0, 1, 0x04, 0x20 }, - { 0x38, 0x01, 0, 1, 0x04, 0x20 }, - { 0x38, 0x01, 0, 1, 0x04, 0x20 }, - { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, - { 0x20, 0x08, 0, 1, 0x04, 0x02 }, - { 0x21, 0x08, 0, 1, 0x04, 0x02 }, - { 0x22, 0x08, 0, 1, 0x04, 0x02 }, - { 0x22, 0x08, 0, 1, 0x04, 0x02 }, - { 0x20, 0x09, 0, 1, 0x04, 0x02 }, - { 0x21, 0x09, 0, 1, 0x04, 0x02 }, - { 0x22, 0x09, 0, 1, 0x04, 0x02 }, - { 0x22, 0x09, 0, 1, 0x04, 0x02 }, - { 0x20, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x21, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x22, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x22, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x54, 0x03, 1, 1, 0x03, 0x03 }, - { 0x54, 0x03, 1, 1, 0x02, 0x02 }, - { 0x54, 0x03, 1, 1, 0x03, 0x03 }, - { 0x54, 0x03, 1, 1, 0x02, 0x02 }, - { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x5C, 0x01, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x01, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x02, 0, 0, 0x03, 0x03 }, - { 0x5C, 0x02, 0, 0, 0x02, 0x02 }, - { 0x5C, 0x02, 0, 0, 0x03, 0x03 }, - { 0x5C, 0x02, 0, 0, 0x02, 0x02 }, - { 0x5C, 0x03, 0, 0, 0x03, 0x03 }, - { 0x5C, 0x03, 0, 0, 0x02, 0x02 }, - { 0x5C, 0x03, 0, 0, 0x03, 0x03 }, - { 0x5C, 0x03, 0, 0, 0x02, 0x02 }, - { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x05, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x05, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, - { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, - { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, - { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, - { 0x51, 0x06, 0, 1, 0x03, 0x03 }, - { 0x51, 0x06, 0, 1, 0x02, 0x02 }, - { 0x51, 0x06, 0, 1, 0x03, 0x03 }, - { 0x51, 0x06, 0, 1, 0x02, 0x02 }, - { 0x51, 0x07, 0, 1, 0x03, 0x03 }, - { 0x51, 0x07, 0, 1, 0x02, 0x02 }, - { 0x51, 0x07, 0, 1, 0x03, 0x03 }, - { 0x51, 0x07, 0, 1, 0x02, 0x02 }, - { 0x52, 0x03, 0, 1, 0x04, 0x02 }, - { 0x52, 0x03, 0, 1, 0x04, 0x02 }, - { 0x52, 0x03, 0, 1, 0x04, 0x02 }, - { 0x52, 0x03, 0, 1, 0x04, 0x02 }, - { 0x53, 0x01, 0, 1, 0x02, 0x02 }, - { 0x53, 0x01, 0, 1, 0x02, 0x02 }, - { 0x53, 0x01, 0, 1, 0x02, 0x02 }, - { 0x53, 0x01, 0, 1, 0x02, 0x02 }, - { 0x55, 0x01, 0, 1, 0x03, 0x03 }, - { 0x55, 0x01, 0, 1, 0x02, 0x02 }, - { 0x55, 0x01, 0, 1, 0x03, 0x03 }, - { 0x55, 0x01, 0, 1, 0x02, 0x02 }, - { 0x55, 0x02, 0, 1, 0x02, 0x02 }, - { 0x55, 0x02, 0, 1, 0x02, 0x02 }, - { 0x55, 0x02, 0, 1, 0x02, 0x02 }, - { 0x55, 0x02, 0, 1, 0x02, 0x02 }, - { 0x55, 0x03, 0, 1, 0x04, 0x04 }, - { 0x55, 0x03, 0, 1, 0x04, 0x04 }, - { 0x55, 0x03, 0, 1, 0x04, 0x04 }, - { 0x55, 0x03, 0, 1, 0x04, 0x04 }, - { 0x56, 0x01, 0, 1, 0x12, 0x12 }, - { 0x56, 0x01, 0, 1, 0x02, 0x02 }, - { 0x56, 0x01, 0, 1, 0x12, 0x12 }, - { 0x56, 0x01, 0, 1, 0x02, 0x02 }, - { 0x57, 0x01, 0, 1, 0x03, 0x03 }, - { 0x57, 0x01, 0, 1, 0x02, 0x02 }, - { 0x57, 0x01, 0, 1, 0x03, 0x03 }, - { 0x57, 0x01, 0, 1, 0x02, 0x02 }, - { 0x57, 0x02, 0, 1, 0x13, 0x13 }, - { 0x57, 0x02, 0, 1, 0x02, 0x02 }, - { 0x57, 0x02, 0, 1, 0x13, 0x13 }, - { 0x57, 0x02, 0, 1, 0x02, 0x02 }, - { 0x59, 0x01, 0, 1, 0x02, 0x02 }, - { 0x59, 0x01, 0, 1, 0x02, 0x02 }, - { 0x59, 0x01, 0, 1, 0x02, 0x02 }, - { 0x59, 0x01, 0, 1, 0x02, 0x02 }, - { 0x59, 0x02, 0, 1, 0x03, 0x03 }, - { 0x59, 0x02, 0, 1, 0x02, 0x02 }, - { 0x59, 0x02, 0, 1, 0x03, 0x03 }, - { 0x59, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5A, 0x02, 1, 1, 0x03, 0x03 }, - { 0x5A, 0x02, 1, 1, 0x02, 0x02 }, - { 0x5A, 0x02, 1, 1, 0x03, 0x03 }, - { 0x5A, 0x02, 1, 1, 0x02, 0x02 }, - { 0x5A, 0x03, 1, 1, 0x03, 0x03 }, - { 0x5A, 0x03, 1, 1, 0x02, 0x02 }, - { 0x5A, 0x03, 1, 1, 0x03, 0x03 }, - { 0x5A, 0x03, 1, 1, 0x02, 0x02 }, - { 0x5D, 0x01, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x01, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x02, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x02, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x03, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x03, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x03, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x03, 0, 1, 0x02, 0x02 }, - { 0x5F, 0x01, 0, 1, 0x03, 0x03 }, - { 0x5F, 0x01, 0, 1, 0x02, 0x02 }, - { 0x64, 0x01, 0, 1, 0x05, 0x05 }, - { 0x64, 0x01, 0, 1, 0x05, 0x05 }, - { 0x5F, 0x01, 0, 1, 0x00, 0x00 }, - { 0x60, 0x03, 0, 1, 0x03, 0x03 }, - { 0x60, 0x03, 0, 1, 0x02, 0x02 }, - { 0x60, 0x03, 0, 1, 0x03, 0x03 }, - { 0x60, 0x03, 0, 1, 0x02, 0x02 }, - { 0x61, 0x01, 0, 1, 0x02, 0x02 }, - { 0x61, 0x01, 0, 1, 0x02, 0x02 }, - { 0x61, 0x01, 0, 1, 0x02, 0x02 }, - { 0x61, 0x01, 0, 1, 0x02, 0x02 }, - { 0x61, 0x02, 0, 1, 0x02, 0x02 }, - { 0x61, 0x02, 0, 1, 0x02, 0x02 }, - { 0x61, 0x02, 0, 1, 0x02, 0x02 }, - { 0x61, 0x02, 0, 1, 0x02, 0x02 }, - { 0x03, 0x01, 1, 1, 0x02, 0x02 }, - { 0x03, 0x01, 1, 1, 0x02, 0x02 }, - { 0x03, 0x01, 1, 1, 0x02, 0x02 }, - { 0x03, 0x01, 1, 1, 0x02, 0x02 }, - { 0x00, 0x01, 1, 0, 0x02, 0x02 }, - { 0x00, 0x01, 1, 0, 0x02, 0x02 }, - { 0x00, 0x01, 1, 0, 0x02, 0x02 }, - { 0x00, 0x01, 1, 0, 0x02, 0x02 }, - { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, - { 0x20, 0x01, 0, 1, 0x03, 0x03 }, - { 0x21, 0x01, 0, 1, 0x02, 0x02 }, - { 0x22, 0x01, 0, 1, 0x02, 0x02 }, - { 0x22, 0x01, 0, 1, 0x02, 0x02 }, - { 0x20, 0x02, 0, 1, 0x03, 0x03 }, - { 0x21, 0x02, 0, 1, 0x02, 0x02 }, - { 0x22, 0x02, 0, 1, 0x02, 0x02 }, - { 0x22, 0x02, 0, 1, 0x02, 0x02 }, - { 0x20, 0x03, 1, 1, 0x03, 0x03 }, - { 0x21, 0x03, 1, 1, 0x02, 0x02 }, - { 0x22, 0x03, 1, 1, 0x02, 0x02 }, - { 0x22, 0x03, 1, 1, 0x02, 0x02 }, - { 0x55, 0x04, 0, 0, 0x04, 0x04 }, - { 0x55, 0x04, 0, 0, 0x04, 0x04 }, - { 0x55, 0x04, 0, 0, 0x04, 0x04 }, - { 0x55, 0x04, 0, 0, 0x04, 0x04 }, - { 0x55, 0x05, 0, 0, 0x04, 0x04 }, - { 0x55, 0x05, 0, 0, 0x04, 0x04 }, - { 0x55, 0x05, 0, 0, 0x04, 0x04 }, - { 0x55, 0x05, 0, 0, 0x04, 0x04 }, - { 0x1B, 0x02, 0, 0, 0x02, 0x02 }, - { 0x1C, 0x02, 0, 0, 0x02, 0x02 }, - { 0x1D, 0x02, 0, 0, 0x02, 0x02 }, - { 0x1D, 0x02, 0, 0, 0x02, 0x02 }, - { 0x34, 0x01, 0, 1, 0x04, 0x04 }, - { 0x34, 0x01, 0, 1, 0x04, 0x04 }, - { 0x34, 0x01, 0, 1, 0x04, 0x04 }, - { 0x34, 0x01, 0, 1, 0x04, 0x04 }, - { 0x1B, 0x01, 0, 1, 0x03, 0x03 }, - { 0x1C, 0x01, 0, 1, 0x02, 0x02 }, - { 0x1D, 0x01, 0, 1, 0x02, 0x02 }, - { 0x1D, 0x01, 0, 1, 0x02, 0x02 }, - { 0x51, 0x08, 1, 1, 0x03, 0x03 }, - { 0x51, 0x08, 1, 1, 0x02, 0x02 }, - { 0x51, 0x08, 1, 1, 0x03, 0x03 }, - { 0x51, 0x08, 1, 1, 0x02, 0x02 }, - { 0x51, 0x09, 0, 1, 0x03, 0x03 }, - { 0x51, 0x09, 0, 1, 0x03, 0x03 }, - { 0x51, 0x09, 0, 1, 0x03, 0x03 }, - { 0x51, 0x09, 0, 1, 0x03, 0x03 }, - { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, - { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, - { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, - { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, - { 0x55, 0x06, 0, 1, 0x02, 0x02 }, - { 0x55, 0x06, 0, 1, 0x02, 0x02 }, - { 0x55, 0x06, 0, 1, 0x02, 0x02 }, - { 0x55, 0x06, 0, 1, 0x02, 0x02 }, - { 0x51, 0x0B, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x51, 0x0B, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x51, 0x0C, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x51, 0x0C, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x51, 0x0D, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0D, 0, 1, 0x04, 0x02 }, - { 0x51, 0x0D, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0D, 0, 1, 0x04, 0x02 }, - { 0x45, 0x01, 0, 1, 0x03, 0x03 }, - { 0x46, 0x01, 0, 1, 0x02, 0x02 }, - { 0x45, 0x01, 0, 1, 0x03, 0x03 }, - { 0x46, 0x01, 0, 1, 0x02, 0x02 }, - { 0x1E, 0x01, 1, 1, 0x03, 0x03 }, - { 0x1F, 0x01, 1, 1, 0x02, 0x02 }, - { 0x1E, 0x01, 1, 1, 0x02, 0x02 }, - { 0x1F, 0x01, 1, 1, 0x02, 0x02 }, - { 0x20, 0x04, 1, 1, 0x03, 0x03 }, - { 0x21, 0x04, 1, 1, 0x02, 0x02 }, - { 0x22, 0x04, 1, 1, 0x02, 0x02 }, - { 0x22, 0x04, 1, 1, 0x02, 0x02 }, - { 0x20, 0x05, 0, 1, 0x04, 0x02 }, - { 0x21, 0x05, 0, 1, 0x04, 0x02 }, - { 0x22, 0x05, 0, 1, 0x04, 0x02 }, - { 0x22, 0x05, 0, 1, 0x04, 0x02 }, - { 0x52, 0x04, 0, 1, 0x02, 0x02 }, - { 0x52, 0x04, 0, 1, 0x02, 0x02 }, - { 0x52, 0x04, 0, 1, 0x02, 0x02 }, - { 0x52, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x04, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x04, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x04, 0, 1, 0x02, 0x02 }, - { 0x63, 0x01, 0, 0, 0x03, 0x03 }, - { 0x63, 0x01, 0, 0, 0x02, 0x02 }, - { 0x63, 0x01, 0, 0, 0x03, 0x03 }, - { 0x63, 0x01, 0, 0, 0x02, 0x02 }, - { 0x07, 0x01, 0, 1, 0x02, 0x02 }, - { 0x07, 0x01, 0, 1, 0x02, 0x02 }, - { 0x07, 0x01, 0, 1, 0x02, 0x02 }, - { 0x07, 0x01, 0, 1, 0x02, 0x02 }, - { 0x07, 0x02, 1, 1, 0x02, 0x02 }, - { 0x07, 0x02, 1, 1, 0x02, 0x02 }, - { 0x07, 0x02, 1, 1, 0x02, 0x02 }, - { 0x07, 0x02, 1, 1, 0x02, 0x02 }, - { 0x5D, 0x05, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x05, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x06, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x06, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x06, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x06, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x07, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x07, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x07, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x07, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x08, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x08, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x08, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x08, 0, 1, 0x02, 0x02 }, - { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, - { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, - { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, - { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, - { 0x44, 0x01, 0, 1, 0x02, 0x02 }, - { 0x44, 0x01, 0, 1, 0x02, 0x02 }, - { 0x44, 0x01, 0, 1, 0x02, 0x02 }, - { 0x44, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x09, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x09, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x09, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x09, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0A, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0A, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0B, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0B, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0C, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0C, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x63, 0x02, 0, 1, 0x03, 0x03 }, - { 0x63, 0x02, 0, 1, 0x02, 0x02 }, - { 0x63, 0x02, 0, 1, 0x03, 0x03 }, - { 0x63, 0x02, 0, 1, 0x02, 0x02 }, - { 0x63, 0x03, 0, 1, 0x03, 0x03 }, - { 0x63, 0x03, 0, 1, 0x02, 0x02 }, - { 0x63, 0x03, 0, 1, 0x03, 0x03 }, - { 0x63, 0x03, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x56, 0x00, 0, 1, 0x02, 0x02 }, - { 0x47, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x06, 0x01, 1, 1, 0x02, 0x02 }, - { 0x06, 0x01, 1, 1, 0x02, 0x02 }, - { 0x06, 0x01, 1, 1, 0x02, 0x02 }, - { 0x06, 0x01, 1, 1, 0x02, 0x02 }, - { 0x36, 0x00, 0, 1, 0x04, 0x20 }, - { 0x36, 0x00, 0, 1, 0x04, 0x20 }, - { 0x36, 0x00, 0, 1, 0x04, 0x20 }, - { 0x36, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, - { 0x13, 0x00, 1, 1, 0x02, 0x02 }, - { 0x13, 0x00, 1, 1, 0x02, 0x02 }, - { 0x13, 0x00, 1, 1, 0x02, 0x02 }, - { 0x13, 0x00, 1, 1, 0x02, 0x02 }, - { 0x15, 0x00, 1, 1, 0x02, 0x02 }, - { 0x15, 0x00, 1, 1, 0x02, 0x02 }, - { 0x15, 0x00, 1, 1, 0x02, 0x02 }, - { 0x15, 0x00, 1, 1, 0x02, 0x02 }, - { 0x57, 0x06, 0, 1, 0x04, 0x02 }, - { 0x57, 0x06, 0, 1, 0x04, 0x02 }, - { 0x57, 0x06, 0, 1, 0x04, 0x02 }, - { 0x57, 0x06, 0, 1, 0x04, 0x02 }, - { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, - { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, - { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, - { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, - { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, - { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, - { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, - { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, - { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, - { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, - { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, - { 0x43, 0x03, 0, 1, 0x02, 0x02 }, - { 0x43, 0x03, 0, 1, 0x02, 0x02 }, - { 0x43, 0x03, 0, 1, 0x02, 0x02 }, - { 0x43, 0x03, 0, 1, 0x02, 0x02 }, - { 0x43, 0x04, 0, 1, 0x02, 0x02 }, - { 0x43, 0x04, 0, 1, 0x02, 0x02 }, - { 0x43, 0x04, 0, 1, 0x02, 0x02 }, - { 0x43, 0x04, 0, 1, 0x02, 0x02 }, - { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, - { 0x55, 0x07, 0, 0, 0x04, 0x04 }, - { 0x55, 0x07, 0, 0, 0x04, 0x04 }, - { 0x55, 0x07, 0, 0, 0x04, 0x04 }, - { 0x55, 0x07, 0, 0, 0x04, 0x04 }, - { 0x55, 0x08, 0, 0, 0x04, 0x04 }, - { 0x55, 0x08, 0, 0, 0x04, 0x04 }, - { 0x55, 0x08, 0, 0, 0x04, 0x04 }, - { 0x55, 0x08, 0, 0, 0x04, 0x04 }, - { 0x5F, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5F, 0x02, 0, 1, 0x02, 0x02 }, - { 0x64, 0x02, 0, 1, 0x02, 0x02 }, - { 0x64, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5F, 0x02, 0, 1, 0x00, 0x00 }, - { 0x52, 0x05, 0, 1, 0x04, 0x02 }, - { 0x52, 0x05, 0, 1, 0x04, 0x02 }, - { 0x52, 0x05, 0, 1, 0x04, 0x02 }, - { 0x52, 0x05, 0, 1, 0x04, 0x02 }, - { 0x52, 0x06, 0, 1, 0x04, 0x02 }, - { 0x52, 0x06, 0, 1, 0x04, 0x02 }, - { 0x52, 0x06, 0, 1, 0x04, 0x02 }, - { 0x52, 0x06, 0, 1, 0x04, 0x02 }, - { 0x52, 0x07, 0, 1, 0x04, 0x02 }, - { 0x52, 0x07, 0, 1, 0x04, 0x02 }, - { 0x52, 0x07, 0, 1, 0x04, 0x02 }, - { 0x52, 0x07, 0, 1, 0x04, 0x02 }, - { 0x52, 0x08, 0, 1, 0x04, 0x02 }, - { 0x52, 0x08, 0, 1, 0x04, 0x02 }, - { 0x52, 0x08, 0, 1, 0x04, 0x02 }, - { 0x52, 0x08, 0, 1, 0x04, 0x02 }, - { 0x53, 0x02, 0, 1, 0x04, 0x02 }, - { 0x53, 0x02, 0, 1, 0x04, 0x02 }, - { 0x53, 0x02, 0, 1, 0x04, 0x02 }, - { 0x53, 0x02, 0, 1, 0x04, 0x02 }, - { 0x53, 0x03, 0, 1, 0x03, 0x03 }, - { 0x53, 0x03, 0, 1, 0x03, 0x03 }, - { 0x53, 0x03, 0, 1, 0x03, 0x03 }, - { 0x53, 0x03, 0, 1, 0x03, 0x03 }, - { 0x53, 0x04, 0, 1, 0x03, 0x03 }, - { 0x53, 0x04, 0, 1, 0x03, 0x03 }, - { 0x53, 0x04, 0, 1, 0x03, 0x03 }, - { 0x53, 0x04, 0, 1, 0x03, 0x03 }, - { 0x53, 0x05, 0, 1, 0x03, 0x03 }, - { 0x53, 0x05, 0, 1, 0x03, 0x03 }, - { 0x53, 0x05, 0, 1, 0x03, 0x03 }, - { 0x53, 0x05, 0, 1, 0x03, 0x03 }, - { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, - { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, - { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, - { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, - { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, - { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, - { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, - { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, - { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x63, 0x04, 0, 1, 0x04, 0x02 }, - { 0x63, 0x04, 0, 1, 0x04, 0x02 }, - { 0x63, 0x04, 0, 1, 0x04, 0x02 }, - { 0x63, 0x04, 0, 1, 0x04, 0x02 }, - { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, - { 0x30, 0x00, 0, 0, 0x04, 0x20 }, - { 0x30, 0x00, 0, 0, 0x04, 0x20 }, - { 0x30, 0x00, 0, 1, 0x04, 0x20 }, - { 0x30, 0x00, 0, 1, 0x04, 0x20 }, - { 0x31, 0x00, 0, 1, 0x04, 0x20 }, - { 0x31, 0x00, 0, 1, 0x04, 0x20 }, - { 0x31, 0x00, 0, 1, 0x04, 0x20 }, - { 0x31, 0x00, 0, 1, 0x04, 0x20 }, - { 0x1E, 0x04, 0, 1, 0x04, 0x02 }, - { 0x1F, 0x04, 0, 1, 0x04, 0x02 }, - { 0x1E, 0x04, 0, 1, 0x04, 0x02 }, - { 0x1F, 0x04, 0, 1, 0x04, 0x02 }, - { 0x32, 0x00, 0, 1, 0x02, 0x02 }, - { 0x32, 0x00, 0, 1, 0x02, 0x02 }, - { 0x32, 0x00, 0, 1, 0x02, 0x02 }, - { 0x32, 0x00, 0, 1, 0x02, 0x02 }, - { 0x59, 0x05, 0, 1, 0x03, 0x03 }, - { 0x59, 0x05, 0, 1, 0x03, 0x03 }, - { 0x59, 0x05, 0, 1, 0x03, 0x03 }, - { 0x59, 0x05, 0, 1, 0x03, 0x03 }, - { 0x35, 0x00, 0, 1, 0x04, 0x02 }, - { 0x35, 0x00, 0, 1, 0x04, 0x02 }, - { 0x35, 0x00, 0, 1, 0x04, 0x02 }, - { 0x35, 0x00, 0, 1, 0x04, 0x02 }, - { 0x37, 0x00, 0, 1, 0x04, 0x20 }, - { 0x37, 0x00, 0, 1, 0x04, 0x20 }, - { 0x37, 0x00, 0, 1, 0x04, 0x20 }, - { 0x37, 0x00, 0, 1, 0x04, 0x20 }, - { 0x39, 0x00, 0, 1, 0x04, 0x04 }, - { 0x39, 0x00, 0, 1, 0x04, 0x04 }, - { 0x39, 0x00, 0, 1, 0x04, 0x04 }, - { 0x39, 0x00, 0, 1, 0x04, 0x04 }, - { 0x5D, 0x0D, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0D, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0E, 0, 1, 0x03, 0x05 }, - { 0x5D, 0x0E, 0, 1, 0x02, 0x04 }, - { 0x5D, 0x0E, 0, 1, 0x03, 0x05 }, - { 0x5D, 0x0E, 0, 1, 0x02, 0x04 }, - { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, - { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, - { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, - { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, - { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, - { 0x20, 0x06, 0, 1, 0x04, 0x02 }, - { 0x21, 0x06, 0, 1, 0x04, 0x02 }, - { 0x22, 0x06, 0, 1, 0x04, 0x02 }, - { 0x22, 0x06, 0, 1, 0x04, 0x02 }, - { 0x20, 0x07, 0, 1, 0x04, 0x02 }, - { 0x21, 0x07, 0, 1, 0x04, 0x02 }, - { 0x22, 0x07, 0, 1, 0x04, 0x02 }, - { 0x22, 0x07, 0, 1, 0x04, 0x02 }, - { 0x1E, 0x02, 0, 1, 0x04, 0x02 }, - { 0x1F, 0x02, 0, 1, 0x04, 0x02 }, - { 0x1E, 0x02, 0, 1, 0x03, 0x03 }, - { 0x1F, 0x02, 0, 1, 0x02, 0x02 }, - { 0x58, 0x02, 0, 1, 0x02, 0x02 }, - { 0x58, 0x02, 0, 1, 0x02, 0x02 }, - { 0x58, 0x02, 0, 1, 0x02, 0x02 }, - { 0x58, 0x02, 0, 1, 0x02, 0x02 }, - { 0x57, 0x03, 0, 1, 0x03, 0x03 }, - { 0x57, 0x03, 0, 1, 0x03, 0x03 }, - { 0x57, 0x03, 0, 1, 0x03, 0x03 }, - { 0x57, 0x03, 0, 1, 0x03, 0x03 }, - { 0x57, 0x04, 0, 1, 0x04, 0x02 }, - { 0x57, 0x04, 0, 1, 0x04, 0x02 }, - { 0x57, 0x04, 0, 1, 0x04, 0x02 }, - { 0x57, 0x04, 0, 1, 0x04, 0x02 }, - { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, - { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, - { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, - { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, - { 0x59, 0x03, 0, 1, 0x03, 0x03 }, - { 0x59, 0x03, 0, 1, 0x02, 0x02 }, - { 0x59, 0x03, 0, 1, 0x03, 0x03 }, - { 0x59, 0x03, 0, 1, 0x02, 0x02 }, - { 0x59, 0x04, 0, 1, 0x02, 0x02 }, - { 0x59, 0x04, 0, 1, 0x02, 0x02 }, - { 0x59, 0x04, 0, 1, 0x02, 0x02 }, - { 0x59, 0x04, 0, 1, 0x02, 0x02 }, - { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, - { 0x30, 0x01, 0, 0, 0x04, 0x20 }, - { 0x30, 0x01, 0, 0, 0x04, 0x20 }, - { 0x30, 0x01, 0, 1, 0x04, 0x20 }, - { 0x30, 0x01, 0, 1, 0x04, 0x20 }, - { 0x30, 0x02, 0, 0, 0x04, 0x20 }, - { 0x30, 0x02, 0, 0, 0x04, 0x20 }, - { 0x30, 0x02, 0, 1, 0x04, 0x20 }, - { 0x30, 0x02, 0, 1, 0x04, 0x20 }, - { 0x06, 0x02, 0, 0, 0x02, 0x02 }, - { 0x06, 0x02, 0, 0, 0x02, 0x02 }, - { 0x06, 0x02, 0, 0, 0x02, 0x02 }, - { 0x06, 0x02, 0, 0, 0x02, 0x02 }, - { 0x06, 0x03, 0, 0, 0x02, 0x02 }, - { 0x06, 0x03, 0, 0, 0x02, 0x02 }, - { 0x06, 0x03, 0, 0, 0x02, 0x02 }, - { 0x06, 0x03, 0, 0, 0x02, 0x02 }, - { 0x06, 0x04, 0, 1, 0x02, 0x02 }, - { 0x06, 0x04, 0, 1, 0x02, 0x02 }, - { 0x06, 0x04, 0, 1, 0x02, 0x02 }, - { 0x06, 0x04, 0, 1, 0x02, 0x02 }, - { 0x62, 0x02, 0, 1, 0x04, 0x02 }, - { 0x62, 0x02, 0, 1, 0x04, 0x02 }, - { 0x62, 0x02, 0, 1, 0x04, 0x02 }, - { 0x62, 0x02, 0, 1, 0x04, 0x02 }, - { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, - { 0x02, 0x01, 1, 1, 0x02, 0x02 }, - { 0x02, 0x01, 1, 1, 0x02, 0x02 }, - { 0x02, 0x01, 1, 1, 0x02, 0x02 }, - { 0x02, 0x01, 1, 1, 0x02, 0x02 }, - { 0x12, 0x00, 1, 0, 0x02, 0x02 }, - { 0x12, 0x00, 1, 0, 0x02, 0x02 }, - { 0x12, 0x00, 1, 0, 0x02, 0x02 }, - { 0x12, 0x00, 1, 0, 0x02, 0x02 }, - { 0x11, 0x00, 1, 0, 0x02, 0x02 }, - { 0x11, 0x00, 1, 0, 0x02, 0x02 }, - { 0x11, 0x00, 1, 0, 0x02, 0x02 }, - { 0x11, 0x00, 1, 0, 0x02, 0x02 }, - { 0x18, 0x00, 1, 1, 0x02, 0x02 }, - { 0x18, 0x00, 1, 1, 0x02, 0x02 }, - { 0x18, 0x00, 1, 1, 0x02, 0x02 }, - { 0x18, 0x00, 1, 1, 0x02, 0x02 }, - { 0x16, 0x00, 1, 1, 0x02, 0x02 }, - { 0x16, 0x00, 1, 1, 0x02, 0x02 }, - { 0x16, 0x00, 1, 1, 0x02, 0x02 }, - { 0x16, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x19, 0x00, 1, 1, 0x02, 0x02 }, - { 0x19, 0x00, 1, 1, 0x02, 0x02 }, - { 0x19, 0x00, 1, 1, 0x02, 0x02 }, - { 0x19, 0x00, 1, 1, 0x02, 0x02 }, - { 0x05, 0x01, 1, 1, 0x03, 0x02 }, - { 0x05, 0x01, 1, 1, 0x02, 0x02 }, - { 0x05, 0x01, 1, 1, 0x03, 0x02 }, - { 0x05, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, - { 0x63, 0x05, 0, 1, 0x04, 0x02 }, - { 0x63, 0x05, 0, 1, 0x04, 0x02 }, - { 0x63, 0x05, 0, 1, 0x04, 0x02 }, - { 0x63, 0x05, 0, 1, 0x04, 0x02 }, - { 0x28, 0x00, 0, 1, 0x04, 0x04 }, - { 0x28, 0x00, 0, 1, 0x04, 0x04 }, - { 0x28, 0x00, 0, 1, 0x04, 0x04 }, - { 0x28, 0x00, 0, 1, 0x04, 0x04 }, - { 0x29, 0x00, 0, 1, 0x04, 0x04 }, - { 0x29, 0x00, 0, 1, 0x04, 0x04 }, - { 0x29, 0x00, 0, 1, 0x04, 0x04 }, - { 0x29, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, - { 0x55, 0x09, 0, 0, 0x04, 0x04 }, - { 0x55, 0x09, 0, 0, 0x04, 0x04 }, - { 0x55, 0x09, 0, 0, 0x04, 0x04 }, - { 0x55, 0x09, 0, 0, 0x04, 0x04 }, - { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, - { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, - { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, - { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, - { 0x52, 0x09, 0, 1, 0x04, 0x04 }, - { 0x52, 0x09, 0, 1, 0x04, 0x04 }, - { 0x52, 0x09, 0, 1, 0x04, 0x04 }, - { 0x52, 0x09, 0, 1, 0x04, 0x04 }, - { 0x48, 0x00, 0, 1, 0x02, 0x26 }, - { 0x48, 0x00, 0, 1, 0x02, 0x26 }, - { 0x48, 0x00, 0, 1, 0x02, 0x26 }, - { 0x48, 0x00, 0, 1, 0x02, 0x26 }, - { 0x48, 0x01, 0, 1, 0x04, 0x20 }, - { 0x48, 0x01, 0, 1, 0x04, 0x20 }, - { 0x48, 0x01, 0, 1, 0x04, 0x20 }, - { 0x48, 0x01, 0, 1, 0x04, 0x20 }, - { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x60, 0x04, 0, 1, 0x02, 0x02 }, - { 0x60, 0x04, 0, 1, 0x02, 0x02 }, - { 0x60, 0x04, 0, 1, 0x02, 0x02 }, - { 0x60, 0x04, 0, 1, 0x02, 0x02 }, - { 0x49, 0x00, 0, 1, 0x02, 0x20 }, - { 0x49, 0x00, 0, 1, 0x02, 0x20 }, - { 0x49, 0x00, 0, 1, 0x02, 0x20 }, - { 0x49, 0x00, 0, 1, 0x02, 0x20 }, - { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x23, 0x01, 0, 1, 0x04, 0x02 }, - { 0x24, 0x01, 0, 1, 0x04, 0x02 }, - { 0x25, 0x01, 0, 1, 0x04, 0x02 }, - { 0x25, 0x01, 0, 1, 0x04, 0x02 }, - { 0x51, 0x0F, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0F, 0, 1, 0x04, 0x02 }, - { 0x51, 0x0F, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0F, 0, 1, 0x04, 0x02 }, - { 0x60, 0x05, 0, 1, 0x04, 0x02 }, - { 0x60, 0x05, 0, 1, 0x04, 0x02 }, - { 0x60, 0x05, 0, 1, 0x04, 0x02 }, - { 0x60, 0x05, 0, 1, 0x04, 0x02 }, - { 0x5F, 0x04, 0, 1, 0x03, 0x03 }, - { 0x5F, 0x04, 0, 1, 0x02, 0x02 }, - { 0x64, 0x04, 0, 1, 0x02, 0x02 }, - { 0x64, 0x04, 0, 1, 0x02, 0x02 }, - { 0x61, 0x03, 0, 1, 0x02, 0x02 }, - { 0x61, 0x03, 0, 1, 0x02, 0x02 }, - { 0x61, 0x03, 0, 1, 0x02, 0x02 }, - { 0x61, 0x03, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, - { 0x63, 0x06, 0, 0, 0x02, 0x26 }, - { 0x63, 0x06, 0, 0, 0x02, 0x26 }, - { 0x63, 0x06, 0, 0, 0x02, 0x26 }, - { 0x63, 0x06, 0, 0, 0x02, 0x26 }, - { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, - { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, - { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, - { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, - { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, - { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, - { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, - { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, - { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, - { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, - { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, - { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, - { 0x57, 0x05, 0, 1, 0x02, 0x02 }, - { 0x57, 0x05, 0, 1, 0x02, 0x02 }, - { 0x57, 0x05, 0, 1, 0x02, 0x02 }, - { 0x57, 0x05, 0, 1, 0x02, 0x02 }, - { 0x07, 0x03, 0, 1, 0x02, 0x02 }, - { 0x07, 0x03, 0, 1, 0x02, 0x02 }, - { 0x07, 0x03, 0, 1, 0x02, 0x02 }, - { 0x07, 0x03, 0, 1, 0x02, 0x02 }, - { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x61, 0x04, 0, 1, 0x02, 0x02 }, - { 0x61, 0x04, 0, 1, 0x02, 0x02 }, - { 0x61, 0x04, 0, 1, 0x02, 0x02 }, - { 0x61, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5F, 0x03, 0, 1, 0x03, 0x03 }, - { 0x5F, 0x03, 0, 1, 0x02, 0x02 }, - { 0x64, 0x03, 0, 1, 0x02, 0x02 }, - { 0x64, 0x03, 0, 1, 0x02, 0x02 }, - { 0x5F, 0x03, 0, 1, 0x00, 0x00 }, - { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x48, 0x02, 1, 1, 0x04, 0x20 }, - { 0x48, 0x02, 1, 1, 0x04, 0x20 }, - { 0x48, 0x02, 1, 1, 0x04, 0x20 }, - { 0x48, 0x02, 1, 1, 0x04, 0x20 }, - { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x53, 0x06, 0, 1, 0x03, 0x03 }, - { 0x53, 0x06, 0, 1, 0x03, 0x03 }, - { 0x53, 0x06, 0, 1, 0x03, 0x03 }, - { 0x53, 0x06, 0, 1, 0x03, 0x03 }, - { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, - { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, - { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, - { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, - { 0x52, 0x0D, 0, 1, 0x03, 0x03 }, - { 0x52, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x52, 0x0D, 0, 1, 0x03, 0x03 }, - { 0x52, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, - { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, - { 0x66, 0x00, 0, 1, 0x02, 0x02 }, - { 0x66, 0x00, 0, 1, 0x02, 0x02 }, - { 0x66, 0x00, 0, 1, 0x02, 0x02 }, - { 0x66, 0x00, 0, 1, 0x02, 0x02 }, - { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, - { 0x32, 0x01, 0, 1, 0x02, 0x02 }, - { 0x32, 0x01, 0, 1, 0x02, 0x02 }, - { 0x32, 0x01, 0, 1, 0x02, 0x02 }, - { 0x32, 0x01, 0, 1, 0x02, 0x02 }, - { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x33, 0x00, 0, 1, 0x04, 0x20 }, - { 0x33, 0x00, 0, 1, 0x04, 0x20 }, - { 0x33, 0x00, 0, 1, 0x04, 0x20 }, - { 0x33, 0x00, 0, 1, 0x04, 0x20 }, - { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, - { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, - { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, - { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, - { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, - { 0x50, 0x00, 0, 1, 0x04, 0x20 }, - { 0x50, 0x00, 0, 1, 0x04, 0x20 }, - { 0x50, 0x00, 0, 1, 0x04, 0x20 }, - { 0x50, 0x00, 0, 1, 0x04, 0x20 }, - { 0x52, 0x0E, 0, 1, 0x03, 0x03 }, - { 0x52, 0x0E, 0, 1, 0x02, 0x02 }, - { 0x52, 0x0E, 0, 1, 0x03, 0x03 }, - { 0x52, 0x0E, 0, 1, 0x02, 0x02 }, - { 0x63, 0x08, 0, 0, 0x20, 0x20 }, - { 0x63, 0x08, 0, 0, 0x20, 0x20 }, - { 0x63, 0x08, 0, 0, 0x20, 0x20 }, - { 0x63, 0x08, 0, 0, 0x20, 0x20 }, - { 0x63, 0x09, 0, 0, 0x02, 0x02 }, - { 0x63, 0x09, 0, 0, 0x02, 0x02 }, - { 0x63, 0x09, 0, 0, 0x02, 0x02 }, - { 0x63, 0x09, 0, 0, 0x02, 0x02 }, - { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x61, 0x05, 0, 1, 0x02, 0x02 }, - { 0x61, 0x05, 0, 1, 0x02, 0x02 }, - { 0x61, 0x05, 0, 1, 0x02, 0x02 }, - { 0x61, 0x05, 0, 1, 0x02, 0x02 }, - { 0x53, 0x07, 0, 1, 0x03, 0x03 }, - { 0x53, 0x07, 0, 1, 0x03, 0x03 }, - { 0x53, 0x07, 0, 1, 0x03, 0x03 }, - { 0x53, 0x07, 0, 1, 0x03, 0x03 }, - { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x41, 0x01, 0, 1, 0x02, 0x02 }, - { 0x41, 0x01, 0, 1, 0x02, 0x02 }, - { 0x41, 0x01, 0, 1, 0x02, 0x02 }, - { 0x41, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, - { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, - { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, - { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, - { 0x5C, 0x07, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x07, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x07, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x07, 0, 1, 0x02, 0x02 }, - { 0x53, 0x08, 0, 1, 0x03, 0x03 }, - { 0x53, 0x08, 0, 1, 0x03, 0x03 }, - { 0x53, 0x08, 0, 1, 0x03, 0x03 }, - { 0x53, 0x08, 0, 1, 0x03, 0x03 }, - { 0x03, 0x02, 0, 1, 0x02, 0x02 }, - { 0x03, 0x02, 0, 1, 0x02, 0x02 }, - { 0x03, 0x02, 0, 1, 0x02, 0x02 }, - { 0x03, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, - { 0x43, 0x05, 0, 1, 0x02, 0x02 }, - { 0x43, 0x05, 0, 1, 0x02, 0x02 }, - { 0x43, 0x05, 0, 1, 0x02, 0x02 }, - { 0x43, 0x05, 0, 1, 0x02, 0x02 }, - { 0x43, 0x06, 0, 1, 0x02, 0x02 }, - { 0x43, 0x06, 0, 1, 0x02, 0x02 }, - { 0x43, 0x06, 0, 1, 0x02, 0x02 }, - { 0x43, 0x06, 0, 1, 0x02, 0x02 }, - { 0x51, 0x11, 0, 1, 0x03, 0x03 }, - { 0x51, 0x11, 0, 1, 0x02, 0x02 }, - { 0x51, 0x11, 0, 1, 0x03, 0x03 }, - { 0x51, 0x11, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, - { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, - { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, - { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, - { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x37, 0x01, 0, 1, 0x04, 0x20 }, - { 0x37, 0x01, 0, 1, 0x04, 0x20 }, - { 0x37, 0x01, 0, 1, 0x04, 0x20 }, - { 0x37, 0x01, 0, 1, 0x04, 0x20 }, - { 0x08, 0x01, 0, 1, 0x04, 0x04 }, - { 0x08, 0x01, 0, 1, 0x04, 0x04 }, - { 0x08, 0x01, 0, 1, 0x04, 0x04 }, - { 0x08, 0x01, 0, 1, 0x04, 0x04 }, - { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x09, 0x01, 0, 1, 0x02, 0x02 }, - { 0x09, 0x01, 0, 1, 0x02, 0x02 }, - { 0x09, 0x01, 0, 1, 0x02, 0x02 }, - { 0x09, 0x01, 0, 1, 0x02, 0x02 }, - { 0x52, 0x0F, 0, 1, 0x03, 0x03 }, - { 0x52, 0x0F, 0, 1, 0x02, 0x02 }, - { 0x52, 0x0F, 0, 1, 0x03, 0x03 }, - { 0x52, 0x0F, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, - { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, - { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, - { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, - { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, - { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x17, 0x02, 1, 1, 0x02, 0x02 }, - { 0x17, 0x02, 1, 1, 0x02, 0x02 }, - { 0x17, 0x02, 1, 1, 0x02, 0x02 }, - { 0x17, 0x02, 1, 1, 0x02, 0x02 }, - { 0x4A, 0x01, 0, 0, 0x03, 0x03 }, - { 0x4A, 0x01, 0, 0, 0x02, 0x02 }, - { 0x4A, 0x01, 0, 0, 0x03, 0x03 }, - { 0x4A, 0x01, 0, 0, 0x02, 0x02 }, - { 0x43, 0x07, 0, 1, 0x02, 0x02 }, - { 0x43, 0x07, 0, 1, 0x02, 0x02 }, - { 0x43, 0x07, 0, 1, 0x02, 0x02 }, - { 0x43, 0x07, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x56, 0x02, 0, 1, 0x12, 0x12 }, - { 0x56, 0x02, 0, 1, 0x02, 0x02 }, - { 0x56, 0x02, 0, 1, 0x12, 0x12 }, - { 0x56, 0x02, 0, 1, 0x02, 0x02 }, - { 0x57, 0x08, 0, 1, 0x02, 0x02 }, - { 0x57, 0x08, 0, 1, 0x02, 0x02 }, - { 0x57, 0x08, 0, 1, 0x02, 0x02 }, - { 0x57, 0x08, 0, 1, 0x02, 0x02 }, - { 0x56, 0x03, 0, 1, 0x03, 0x03 }, - { 0x56, 0x03, 0, 1, 0x03, 0x03 }, - { 0x56, 0x03, 0, 1, 0x03, 0x03 }, - { 0x56, 0x03, 0, 1, 0x03, 0x03 }, - { 0x57, 0x09, 0, 1, 0x03, 0x03 }, - { 0x57, 0x09, 0, 1, 0x03, 0x03 }, - { 0x57, 0x09, 0, 1, 0x03, 0x03 }, - { 0x57, 0x09, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, +EntranceInfo gEntranceTable[] = { + { 0x00, 0x00, 0, 1, 0x02, 0x02 }, { 0x00, 0x00, 0, 1, 0x02, 0x02 }, { 0x00, 0x00, 0, 1, 0x02, 0x02 }, + { 0x00, 0x00, 0, 1, 0x02, 0x02 }, { 0x01, 0x00, 0, 1, 0x02, 0x02 }, { 0x01, 0x00, 0, 1, 0x02, 0x02 }, + { 0x01, 0x00, 0, 1, 0x02, 0x02 }, { 0x01, 0x00, 0, 1, 0x02, 0x02 }, { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, + { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, + { 0x14, 0x00, 1, 1, 0x02, 0x02 }, { 0x14, 0x00, 1, 1, 0x02, 0x02 }, { 0x14, 0x00, 1, 1, 0x02, 0x02 }, + { 0x14, 0x00, 1, 1, 0x02, 0x02 }, { 0x05, 0x00, 0, 1, 0x02, 0x02 }, { 0x05, 0x00, 0, 1, 0x02, 0x02 }, + { 0x05, 0x00, 0, 1, 0x02, 0x02 }, { 0x05, 0x00, 0, 1, 0x02, 0x02 }, { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, + { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, + { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, + { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, { 0x68, 0x00, 0, 1, 0x02, 0x02 }, { 0x68, 0x00, 0, 1, 0x02, 0x02 }, + { 0x68, 0x00, 0, 1, 0x02, 0x02 }, { 0x68, 0x00, 0, 1, 0x02, 0x02 }, { 0x69, 0x00, 0, 1, 0x02, 0x02 }, + { 0x69, 0x00, 0, 1, 0x02, 0x02 }, { 0x69, 0x00, 0, 1, 0x02, 0x02 }, { 0x69, 0x00, 0, 1, 0x02, 0x02 }, + { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, + { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, + { 0x02, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, + { 0x41, 0x00, 0, 1, 0x02, 0x26 }, { 0x41, 0x00, 0, 1, 0x02, 0x26 }, { 0x41, 0x00, 0, 1, 0x02, 0x26 }, + { 0x41, 0x00, 0, 1, 0x02, 0x26 }, { 0x41, 0x00, 0, 1, 0x02, 0x02 }, { 0x41, 0x00, 0, 1, 0x02, 0x02 }, + { 0x1B, 0x00, 1, 1, 0x03, 0x03 }, { 0x1C, 0x00, 1, 1, 0x02, 0x02 }, { 0x1D, 0x00, 1, 1, 0x03, 0x03 }, + { 0x1D, 0x00, 1, 1, 0x02, 0x02 }, { 0x07, 0x00, 0, 1, 0x02, 0x02 }, { 0x07, 0x00, 0, 1, 0x02, 0x02 }, + { 0x07, 0x00, 0, 1, 0x02, 0x02 }, { 0x07, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x04, 0x20 }, + { 0x42, 0x00, 0, 1, 0x04, 0x20 }, { 0x42, 0x00, 0, 1, 0x04, 0x20 }, { 0x42, 0x00, 0, 1, 0x04, 0x20 }, + { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, { 0x38, 0x00, 0, 1, 0x04, 0x20 }, { 0x38, 0x00, 0, 1, 0x04, 0x20 }, + { 0x38, 0x00, 0, 1, 0x04, 0x20 }, { 0x38, 0x00, 0, 1, 0x04, 0x20 }, { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, + { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, + { 0x40, 0x00, 0, 1, 0x02, 0x26 }, { 0x40, 0x00, 0, 1, 0x02, 0x26 }, { 0x40, 0x00, 0, 1, 0x02, 0x26 }, + { 0x40, 0x00, 0, 1, 0x02, 0x26 }, { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, + { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, + { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, + { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, + { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, + { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x0B, 0x0B }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, + { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, + { 0x10, 0x00, 0, 1, 0x04, 0x20 }, { 0x10, 0x00, 0, 1, 0x04, 0x20 }, { 0x10, 0x00, 0, 1, 0x04, 0x20 }, + { 0x10, 0x00, 0, 1, 0x04, 0x20 }, { 0x1E, 0x03, 1, 1, 0x03, 0x03 }, { 0x1F, 0x03, 1, 1, 0x02, 0x02 }, + { 0x1E, 0x03, 1, 1, 0x02, 0x02 }, { 0x1F, 0x03, 1, 1, 0x02, 0x02 }, { 0x44, 0x00, 0, 1, 0x07, 0x07 }, + { 0x44, 0x00, 0, 1, 0x07, 0x07 }, { 0x44, 0x00, 0, 1, 0x07, 0x07 }, { 0x44, 0x00, 0, 1, 0x07, 0x07 }, + { 0x44, 0x00, 0, 1, 0x0D, 0x02 }, { 0x44, 0x00, 0, 1, 0x0D, 0x02 }, { 0x44, 0x00, 0, 1, 0x03, 0x03 }, + { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, + { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, + { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, { 0x45, 0x00, 0, 1, 0x22, 0x04 }, + { 0x46, 0x00, 0, 1, 0x22, 0x04 }, { 0x45, 0x00, 0, 1, 0x22, 0x04 }, { 0x46, 0x00, 0, 1, 0x22, 0x04 }, + { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, + { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, + { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, + { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, + { 0x09, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, + { 0x17, 0x00, 1, 1, 0x02, 0x02 }, { 0x17, 0x00, 1, 1, 0x02, 0x02 }, { 0x17, 0x00, 1, 1, 0x02, 0x02 }, + { 0x17, 0x00, 1, 1, 0x02, 0x02 }, { 0x17, 0x00, 0, 1, 0x02, 0x02 }, { 0x17, 0x00, 0, 1, 0x02, 0x02 }, + { 0x17, 0x00, 0, 1, 0x02, 0x02 }, { 0x65, 0x00, 0, 1, 0x02, 0x02 }, { 0x65, 0x00, 0, 1, 0x02, 0x02 }, + { 0x65, 0x00, 0, 1, 0x02, 0x02 }, { 0x65, 0x00, 0, 1, 0x02, 0x02 }, { 0x08, 0x00, 0, 1, 0x04, 0x04 }, + { 0x08, 0x00, 0, 1, 0x04, 0x04 }, { 0x08, 0x00, 0, 1, 0x04, 0x04 }, { 0x08, 0x00, 0, 1, 0x04, 0x04 }, + { 0x27, 0x00, 0, 1, 0x04, 0x04 }, { 0x27, 0x00, 0, 1, 0x04, 0x04 }, { 0x27, 0x00, 0, 1, 0x04, 0x04 }, + { 0x27, 0x00, 0, 1, 0x04, 0x04 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, + { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x0A, 0x0A }, + { 0x47, 0x00, 0, 1, 0x02, 0x0A }, { 0x47, 0x00, 1, 1, 0x0A, 0x0A }, { 0x47, 0x00, 0, 1, 0x0B, 0x0B }, + { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x02, 0x02 }, { 0x47, 0x00, 0, 1, 0x02, 0x02 }, + { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x1E, 0x00, 1, 1, 0x03, 0x03 }, + { 0x1F, 0x00, 1, 1, 0x02, 0x02 }, { 0x1E, 0x00, 1, 1, 0x02, 0x02 }, { 0x1F, 0x00, 1, 1, 0x02, 0x02 }, + { 0x20, 0x00, 1, 1, 0x03, 0x03 }, { 0x21, 0x00, 1, 1, 0x02, 0x02 }, { 0x22, 0x00, 1, 1, 0x02, 0x02 }, + { 0x22, 0x00, 1, 1, 0x02, 0x02 }, { 0x20, 0x00, 0, 1, 0x08, 0x08 }, { 0x67, 0x00, 0, 1, 0x02, 0x02 }, + { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, + { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, { 0x34, 0x00, 0, 1, 0x04, 0x04 }, { 0x34, 0x00, 0, 1, 0x04, 0x04 }, + { 0x34, 0x00, 0, 1, 0x04, 0x04 }, { 0x34, 0x00, 0, 1, 0x04, 0x04 }, { 0x34, 0x00, 0, 1, 0x04, 0x02 }, + { 0x34, 0x00, 0, 1, 0x10, 0x10 }, { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, + { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, { 0x01, 0x01, 1, 0, 0x02, 0x02 }, + { 0x01, 0x01, 1, 0, 0x02, 0x02 }, { 0x01, 0x01, 1, 0, 0x02, 0x02 }, { 0x01, 0x01, 1, 0, 0x02, 0x02 }, + { 0x26, 0x00, 0, 1, 0x04, 0x04 }, { 0x26, 0x00, 0, 1, 0x04, 0x04 }, { 0x26, 0x00, 0, 1, 0x04, 0x04 }, + { 0x26, 0x00, 0, 1, 0x04, 0x04 }, { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 0, 1, 0x02, 0x02 }, + { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 0, 1, 0x02, 0x02 }, { 0x51, 0x00, 0, 1, 0x04, 0x02 }, + { 0x51, 0x00, 0, 1, 0x21, 0x21 }, { 0x51, 0x00, 0, 1, 0x21, 0x21 }, { 0x51, 0x00, 0, 1, 0x23, 0x23 }, + { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 1, 1, 0x02, 0x02 }, { 0x51, 0x00, 0, 1, 0x23, 0x23 }, + { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 0, 1, 0x29, 0x29 }, { 0x51, 0x00, 1, 1, 0x03, 0x03 }, + { 0x52, 0x00, 0, 1, 0x03, 0x03 }, { 0x52, 0x00, 0, 1, 0x02, 0x02 }, { 0x52, 0x00, 0, 1, 0x03, 0x03 }, + { 0x52, 0x00, 0, 1, 0x02, 0x02 }, { 0x52, 0x00, 0, 1, 0x26, 0x26 }, { 0x52, 0x00, 0, 1, 0x21, 0x21 }, + { 0x52, 0x00, 1, 1, 0x21, 0x21 }, { 0x52, 0x00, 0, 1, 0x21, 0x21 }, { 0x52, 0x00, 1, 1, 0x02, 0x02 }, + { 0x53, 0x00, 0, 1, 0x03, 0x03 }, { 0x53, 0x00, 0, 1, 0x02, 0x02 }, { 0x53, 0x00, 0, 1, 0x03, 0x03 }, + { 0x53, 0x00, 0, 1, 0x02, 0x02 }, { 0x53, 0x00, 0, 1, 0x04, 0x02 }, { 0x53, 0x00, 1, 1, 0x02, 0x02 }, + { 0x54, 0x00, 1, 1, 0x03, 0x03 }, { 0x54, 0x00, 1, 1, 0x02, 0x02 }, { 0x54, 0x00, 1, 1, 0x03, 0x03 }, + { 0x54, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x00, 0, 1, 0x03, 0x03 }, { 0x55, 0x00, 0, 1, 0x02, 0x02 }, + { 0x55, 0x00, 0, 1, 0x03, 0x03 }, { 0x55, 0x00, 0, 1, 0x02, 0x02 }, { 0x55, 0x00, 1, 1, 0x0A, 0x0A }, + { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, { 0x55, 0x00, 1, 1, 0x0A, 0x0A }, { 0x55, 0x00, 0, 1, 0x0D, 0x0A }, + { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, { 0x55, 0x00, 1, 1, 0x02, 0x02 }, + { 0x55, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x00, 1, 1, 0x02, 0x02 }, + { 0x56, 0x00, 1, 1, 0x02, 0x02 }, { 0x56, 0x00, 1, 1, 0x02, 0x02 }, { 0x56, 0x00, 1, 1, 0x02, 0x02 }, + { 0x56, 0x00, 1, 1, 0x02, 0x02 }, { 0x56, 0x00, 0, 1, 0x03, 0x03 }, { 0x56, 0x00, 0, 1, 0x00, 0x00 }, + { 0x57, 0x00, 1, 1, 0x03, 0x03 }, { 0x57, 0x00, 1, 1, 0x02, 0x02 }, { 0x57, 0x00, 1, 1, 0x03, 0x03 }, + { 0x57, 0x00, 1, 1, 0x02, 0x02 }, { 0x57, 0x00, 0, 1, 0x03, 0x03 }, { 0x57, 0x00, 1, 1, 0x02, 0x02 }, + { 0x58, 0x00, 0, 1, 0x02, 0x02 }, { 0x58, 0x00, 0, 1, 0x02, 0x02 }, { 0x58, 0x00, 0, 1, 0x02, 0x02 }, + { 0x58, 0x00, 0, 1, 0x02, 0x02 }, { 0x58, 0x00, 1, 1, 0x02, 0x02 }, { 0x58, 0x00, 1, 1, 0x02, 0x02 }, + { 0x59, 0x00, 0, 1, 0x03, 0x03 }, { 0x59, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x00, 0, 1, 0x03, 0x03 }, + { 0x59, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x00, 0, 1, 0x0D, 0x00 }, { 0x59, 0x00, 0, 1, 0x02, 0x02 }, + { 0x59, 0x00, 1, 1, 0x02, 0x02 }, { 0x59, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x00, 1, 1, 0x02, 0x02 }, + { 0x5A, 0x00, 0, 1, 0x03, 0x03 }, { 0x5A, 0x00, 0, 1, 0x02, 0x02 }, { 0x5A, 0x00, 0, 1, 0x03, 0x03 }, + { 0x5A, 0x00, 0, 1, 0x02, 0x02 }, { 0x5A, 0x00, 1, 1, 0x0C, 0x0A }, { 0x5A, 0x00, 1, 1, 0x0A, 0x0A }, + { 0x5A, 0x00, 1, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, + { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, + { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, + { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, { 0x5C, 0x00, 1, 1, 0x02, 0x02 }, { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, + { 0x5D, 0x00, 1, 1, 0x03, 0x03 }, { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, { 0x5D, 0x00, 1, 1, 0x03, 0x03 }, + { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, { 0x5D, 0x00, 1, 1, 0x21, 0x21 }, { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, + { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, + { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, + { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, + { 0x5F, 0x00, 0, 1, 0x03, 0x03 }, { 0x5F, 0x00, 0, 1, 0x02, 0x02 }, { 0x64, 0x00, 0, 1, 0x02, 0x02 }, + { 0x64, 0x00, 0, 1, 0x02, 0x02 }, { 0x64, 0x00, 0, 1, 0x04, 0x02 }, { 0x60, 0x00, 0, 1, 0x03, 0x03 }, + { 0x60, 0x00, 0, 1, 0x02, 0x02 }, { 0x60, 0x00, 0, 1, 0x03, 0x03 }, { 0x60, 0x00, 0, 1, 0x02, 0x02 }, + { 0x60, 0x00, 1, 1, 0x0A, 0x0A }, { 0x60, 0x00, 0, 1, 0x03, 0x03 }, { 0x60, 0x00, 0, 1, 0x02, 0x02 }, + { 0x60, 0x00, 1, 1, 0x02, 0x02 }, { 0x60, 0x00, 1, 1, 0x03, 0x03 }, { 0x60, 0x00, 1, 1, 0x03, 0x03 }, + { 0x61, 0x00, 0, 1, 0x02, 0x02 }, { 0x61, 0x00, 0, 1, 0x02, 0x02 }, { 0x61, 0x00, 0, 1, 0x02, 0x02 }, + { 0x61, 0x00, 0, 1, 0x02, 0x02 }, { 0x61, 0x00, 0, 1, 0x03, 0x03 }, { 0x61, 0x00, 0, 1, 0x02, 0x02 }, + { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 0, 1, 0x02, 0x02 }, + { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 1, 1, 0x02, 0x02 }, + { 0x58, 0x03, 0, 1, 0x00, 0x00 }, { 0x58, 0x03, 0, 1, 0x00, 0x00 }, { 0x58, 0x03, 0, 1, 0x00, 0x00 }, + { 0x58, 0x03, 0, 1, 0x00, 0x00 }, { 0x63, 0x00, 0, 1, 0x03, 0x03 }, { 0x63, 0x00, 0, 1, 0x02, 0x02 }, + { 0x63, 0x00, 0, 1, 0x03, 0x03 }, { 0x63, 0x00, 0, 1, 0x02, 0x02 }, { 0x63, 0x00, 0, 1, 0x20, 0x20 }, + { 0x63, 0x00, 0, 1, 0x2A, 0x2A }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, + { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, + { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, + { 0x04, 0x00, 0, 1, 0x02, 0x02 }, { 0x04, 0x00, 0, 1, 0x02, 0x02 }, { 0x04, 0x00, 0, 1, 0x02, 0x02 }, + { 0x04, 0x00, 0, 1, 0x02, 0x02 }, { 0x03, 0x00, 0, 1, 0x02, 0x02 }, { 0x03, 0x00, 0, 1, 0x02, 0x02 }, + { 0x03, 0x00, 0, 1, 0x02, 0x02 }, { 0x03, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x01, 0, 1, 0x04, 0x20 }, + { 0x42, 0x01, 0, 1, 0x04, 0x20 }, { 0x42, 0x01, 0, 1, 0x04, 0x20 }, { 0x42, 0x01, 0, 1, 0x04, 0x20 }, + { 0x23, 0x00, 0, 1, 0x03, 0x03 }, { 0x24, 0x00, 0, 1, 0x02, 0x02 }, { 0x25, 0x00, 0, 1, 0x02, 0x02 }, + { 0x25, 0x00, 0, 1, 0x02, 0x02 }, { 0x04, 0x01, 1, 1, 0x02, 0x02 }, { 0x04, 0x01, 1, 1, 0x02, 0x02 }, + { 0x04, 0x01, 1, 1, 0x02, 0x02 }, { 0x04, 0x01, 1, 1, 0x02, 0x02 }, { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, + { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, + { 0x51, 0x01, 0, 1, 0x03, 0x03 }, { 0x51, 0x01, 0, 1, 0x02, 0x02 }, { 0x51, 0x01, 0, 1, 0x03, 0x03 }, + { 0x51, 0x01, 0, 1, 0x02, 0x02 }, { 0x51, 0x02, 1, 1, 0x03, 0x03 }, { 0x51, 0x02, 1, 1, 0x02, 0x02 }, + { 0x51, 0x02, 1, 1, 0x03, 0x03 }, { 0x51, 0x02, 1, 1, 0x02, 0x02 }, { 0x51, 0x03, 0, 1, 0x02, 0x02 }, + { 0x51, 0x03, 0, 1, 0x02, 0x02 }, { 0x51, 0x03, 0, 1, 0x02, 0x02 }, { 0x51, 0x03, 0, 1, 0x02, 0x02 }, + { 0x51, 0x04, 1, 1, 0x03, 0x03 }, { 0x51, 0x04, 1, 1, 0x02, 0x02 }, { 0x51, 0x04, 1, 1, 0x03, 0x03 }, + { 0x51, 0x04, 1, 1, 0x02, 0x02 }, { 0x51, 0x05, 0, 1, 0x03, 0x03 }, { 0x51, 0x05, 0, 1, 0x02, 0x02 }, + { 0x51, 0x05, 0, 1, 0x03, 0x03 }, { 0x51, 0x05, 0, 1, 0x02, 0x02 }, { 0x52, 0x01, 0, 1, 0x03, 0x03 }, + { 0x52, 0x01, 0, 1, 0x02, 0x02 }, { 0x52, 0x01, 0, 1, 0x03, 0x03 }, { 0x52, 0x01, 0, 1, 0x02, 0x02 }, + { 0x52, 0x02, 0, 1, 0x03, 0x03 }, { 0x52, 0x02, 0, 1, 0x02, 0x02 }, { 0x52, 0x02, 0, 1, 0x03, 0x03 }, + { 0x52, 0x02, 0, 1, 0x02, 0x02 }, { 0x54, 0x01, 1, 1, 0x03, 0x03 }, { 0x54, 0x01, 1, 1, 0x03, 0x03 }, + { 0x54, 0x01, 1, 1, 0x03, 0x03 }, { 0x54, 0x01, 1, 1, 0x03, 0x03 }, { 0x54, 0x02, 0, 1, 0x03, 0x03 }, + { 0x54, 0x02, 0, 1, 0x02, 0x02 }, { 0x54, 0x02, 0, 1, 0x03, 0x03 }, { 0x54, 0x02, 0, 1, 0x02, 0x02 }, + { 0x58, 0x01, 0, 1, 0x02, 0x02 }, { 0x58, 0x01, 0, 1, 0x02, 0x02 }, { 0x58, 0x01, 0, 1, 0x02, 0x02 }, + { 0x58, 0x01, 0, 1, 0x02, 0x02 }, { 0x5A, 0x01, 0, 1, 0x03, 0x03 }, { 0x5A, 0x01, 0, 1, 0x02, 0x02 }, + { 0x5A, 0x01, 0, 1, 0x03, 0x03 }, { 0x5A, 0x01, 0, 1, 0x02, 0x02 }, { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, + { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, + { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, + { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, + { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, + { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, + { 0x60, 0x01, 0, 1, 0x03, 0x03 }, { 0x60, 0x01, 0, 1, 0x02, 0x02 }, { 0x60, 0x01, 0, 1, 0x03, 0x03 }, + { 0x60, 0x01, 0, 1, 0x02, 0x02 }, { 0x60, 0x02, 0, 1, 0x03, 0x03 }, { 0x60, 0x02, 0, 1, 0x02, 0x02 }, + { 0x60, 0x02, 0, 1, 0x03, 0x03 }, { 0x60, 0x02, 0, 1, 0x02, 0x02 }, { 0x62, 0x01, 0, 1, 0x02, 0x02 }, + { 0x62, 0x01, 0, 1, 0x02, 0x02 }, { 0x62, 0x01, 0, 1, 0x02, 0x02 }, { 0x62, 0x01, 0, 1, 0x02, 0x02 }, + { 0x38, 0x01, 0, 1, 0x04, 0x20 }, { 0x38, 0x01, 0, 1, 0x04, 0x20 }, { 0x38, 0x01, 0, 1, 0x04, 0x20 }, + { 0x38, 0x01, 0, 1, 0x04, 0x20 }, { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, + { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, { 0x20, 0x08, 0, 1, 0x04, 0x02 }, + { 0x21, 0x08, 0, 1, 0x04, 0x02 }, { 0x22, 0x08, 0, 1, 0x04, 0x02 }, { 0x22, 0x08, 0, 1, 0x04, 0x02 }, + { 0x20, 0x09, 0, 1, 0x04, 0x02 }, { 0x21, 0x09, 0, 1, 0x04, 0x02 }, { 0x22, 0x09, 0, 1, 0x04, 0x02 }, + { 0x22, 0x09, 0, 1, 0x04, 0x02 }, { 0x20, 0x0A, 0, 1, 0x04, 0x02 }, { 0x21, 0x0A, 0, 1, 0x04, 0x02 }, + { 0x22, 0x0A, 0, 1, 0x04, 0x02 }, { 0x22, 0x0A, 0, 1, 0x04, 0x02 }, { 0x54, 0x03, 1, 1, 0x03, 0x03 }, + { 0x54, 0x03, 1, 1, 0x02, 0x02 }, { 0x54, 0x03, 1, 1, 0x03, 0x03 }, { 0x54, 0x03, 1, 1, 0x02, 0x02 }, + { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, + { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, { 0x5C, 0x01, 0, 1, 0x03, 0x03 }, { 0x5C, 0x01, 0, 1, 0x02, 0x02 }, + { 0x5C, 0x01, 0, 1, 0x03, 0x03 }, { 0x5C, 0x01, 0, 1, 0x02, 0x02 }, { 0x5C, 0x02, 0, 0, 0x03, 0x03 }, + { 0x5C, 0x02, 0, 0, 0x02, 0x02 }, { 0x5C, 0x02, 0, 0, 0x03, 0x03 }, { 0x5C, 0x02, 0, 0, 0x02, 0x02 }, + { 0x5C, 0x03, 0, 0, 0x03, 0x03 }, { 0x5C, 0x03, 0, 0, 0x02, 0x02 }, { 0x5C, 0x03, 0, 0, 0x03, 0x03 }, + { 0x5C, 0x03, 0, 0, 0x02, 0x02 }, { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, + { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, { 0x5C, 0x05, 0, 1, 0x03, 0x03 }, + { 0x5C, 0x05, 0, 1, 0x02, 0x02 }, { 0x5C, 0x05, 0, 1, 0x03, 0x03 }, { 0x5C, 0x05, 0, 1, 0x02, 0x02 }, + { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, + { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, { 0x51, 0x06, 0, 1, 0x03, 0x03 }, { 0x51, 0x06, 0, 1, 0x02, 0x02 }, + { 0x51, 0x06, 0, 1, 0x03, 0x03 }, { 0x51, 0x06, 0, 1, 0x02, 0x02 }, { 0x51, 0x07, 0, 1, 0x03, 0x03 }, + { 0x51, 0x07, 0, 1, 0x02, 0x02 }, { 0x51, 0x07, 0, 1, 0x03, 0x03 }, { 0x51, 0x07, 0, 1, 0x02, 0x02 }, + { 0x52, 0x03, 0, 1, 0x04, 0x02 }, { 0x52, 0x03, 0, 1, 0x04, 0x02 }, { 0x52, 0x03, 0, 1, 0x04, 0x02 }, + { 0x52, 0x03, 0, 1, 0x04, 0x02 }, { 0x53, 0x01, 0, 1, 0x02, 0x02 }, { 0x53, 0x01, 0, 1, 0x02, 0x02 }, + { 0x53, 0x01, 0, 1, 0x02, 0x02 }, { 0x53, 0x01, 0, 1, 0x02, 0x02 }, { 0x55, 0x01, 0, 1, 0x03, 0x03 }, + { 0x55, 0x01, 0, 1, 0x02, 0x02 }, { 0x55, 0x01, 0, 1, 0x03, 0x03 }, { 0x55, 0x01, 0, 1, 0x02, 0x02 }, + { 0x55, 0x02, 0, 1, 0x02, 0x02 }, { 0x55, 0x02, 0, 1, 0x02, 0x02 }, { 0x55, 0x02, 0, 1, 0x02, 0x02 }, + { 0x55, 0x02, 0, 1, 0x02, 0x02 }, { 0x55, 0x03, 0, 1, 0x04, 0x04 }, { 0x55, 0x03, 0, 1, 0x04, 0x04 }, + { 0x55, 0x03, 0, 1, 0x04, 0x04 }, { 0x55, 0x03, 0, 1, 0x04, 0x04 }, { 0x56, 0x01, 0, 1, 0x12, 0x12 }, + { 0x56, 0x01, 0, 1, 0x02, 0x02 }, { 0x56, 0x01, 0, 1, 0x12, 0x12 }, { 0x56, 0x01, 0, 1, 0x02, 0x02 }, + { 0x57, 0x01, 0, 1, 0x03, 0x03 }, { 0x57, 0x01, 0, 1, 0x02, 0x02 }, { 0x57, 0x01, 0, 1, 0x03, 0x03 }, + { 0x57, 0x01, 0, 1, 0x02, 0x02 }, { 0x57, 0x02, 0, 1, 0x13, 0x13 }, { 0x57, 0x02, 0, 1, 0x02, 0x02 }, + { 0x57, 0x02, 0, 1, 0x13, 0x13 }, { 0x57, 0x02, 0, 1, 0x02, 0x02 }, { 0x59, 0x01, 0, 1, 0x02, 0x02 }, + { 0x59, 0x01, 0, 1, 0x02, 0x02 }, { 0x59, 0x01, 0, 1, 0x02, 0x02 }, { 0x59, 0x01, 0, 1, 0x02, 0x02 }, + { 0x59, 0x02, 0, 1, 0x03, 0x03 }, { 0x59, 0x02, 0, 1, 0x02, 0x02 }, { 0x59, 0x02, 0, 1, 0x03, 0x03 }, + { 0x59, 0x02, 0, 1, 0x02, 0x02 }, { 0x5A, 0x02, 1, 1, 0x03, 0x03 }, { 0x5A, 0x02, 1, 1, 0x02, 0x02 }, + { 0x5A, 0x02, 1, 1, 0x03, 0x03 }, { 0x5A, 0x02, 1, 1, 0x02, 0x02 }, { 0x5A, 0x03, 1, 1, 0x03, 0x03 }, + { 0x5A, 0x03, 1, 1, 0x02, 0x02 }, { 0x5A, 0x03, 1, 1, 0x03, 0x03 }, { 0x5A, 0x03, 1, 1, 0x02, 0x02 }, + { 0x5D, 0x01, 0, 1, 0x03, 0x03 }, { 0x5D, 0x01, 0, 1, 0x02, 0x02 }, { 0x5D, 0x01, 0, 1, 0x03, 0x03 }, + { 0x5D, 0x01, 0, 1, 0x02, 0x02 }, { 0x5D, 0x02, 0, 1, 0x03, 0x03 }, { 0x5D, 0x02, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x02, 0, 1, 0x03, 0x03 }, { 0x5D, 0x02, 0, 1, 0x02, 0x02 }, { 0x5D, 0x03, 0, 1, 0x03, 0x03 }, + { 0x5D, 0x03, 0, 1, 0x02, 0x02 }, { 0x5D, 0x03, 0, 1, 0x03, 0x03 }, { 0x5D, 0x03, 0, 1, 0x02, 0x02 }, + { 0x5F, 0x01, 0, 1, 0x03, 0x03 }, { 0x5F, 0x01, 0, 1, 0x02, 0x02 }, { 0x64, 0x01, 0, 1, 0x05, 0x05 }, + { 0x64, 0x01, 0, 1, 0x05, 0x05 }, { 0x5F, 0x01, 0, 1, 0x00, 0x00 }, { 0x60, 0x03, 0, 1, 0x03, 0x03 }, + { 0x60, 0x03, 0, 1, 0x02, 0x02 }, { 0x60, 0x03, 0, 1, 0x03, 0x03 }, { 0x60, 0x03, 0, 1, 0x02, 0x02 }, + { 0x61, 0x01, 0, 1, 0x02, 0x02 }, { 0x61, 0x01, 0, 1, 0x02, 0x02 }, { 0x61, 0x01, 0, 1, 0x02, 0x02 }, + { 0x61, 0x01, 0, 1, 0x02, 0x02 }, { 0x61, 0x02, 0, 1, 0x02, 0x02 }, { 0x61, 0x02, 0, 1, 0x02, 0x02 }, + { 0x61, 0x02, 0, 1, 0x02, 0x02 }, { 0x61, 0x02, 0, 1, 0x02, 0x02 }, { 0x03, 0x01, 1, 1, 0x02, 0x02 }, + { 0x03, 0x01, 1, 1, 0x02, 0x02 }, { 0x03, 0x01, 1, 1, 0x02, 0x02 }, { 0x03, 0x01, 1, 1, 0x02, 0x02 }, + { 0x00, 0x01, 1, 0, 0x02, 0x02 }, { 0x00, 0x01, 1, 0, 0x02, 0x02 }, { 0x00, 0x01, 1, 0, 0x02, 0x02 }, + { 0x00, 0x01, 1, 0, 0x02, 0x02 }, { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, + { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, { 0x20, 0x01, 0, 1, 0x03, 0x03 }, + { 0x21, 0x01, 0, 1, 0x02, 0x02 }, { 0x22, 0x01, 0, 1, 0x02, 0x02 }, { 0x22, 0x01, 0, 1, 0x02, 0x02 }, + { 0x20, 0x02, 0, 1, 0x03, 0x03 }, { 0x21, 0x02, 0, 1, 0x02, 0x02 }, { 0x22, 0x02, 0, 1, 0x02, 0x02 }, + { 0x22, 0x02, 0, 1, 0x02, 0x02 }, { 0x20, 0x03, 1, 1, 0x03, 0x03 }, { 0x21, 0x03, 1, 1, 0x02, 0x02 }, + { 0x22, 0x03, 1, 1, 0x02, 0x02 }, { 0x22, 0x03, 1, 1, 0x02, 0x02 }, { 0x55, 0x04, 0, 0, 0x04, 0x04 }, + { 0x55, 0x04, 0, 0, 0x04, 0x04 }, { 0x55, 0x04, 0, 0, 0x04, 0x04 }, { 0x55, 0x04, 0, 0, 0x04, 0x04 }, + { 0x55, 0x05, 0, 0, 0x04, 0x04 }, { 0x55, 0x05, 0, 0, 0x04, 0x04 }, { 0x55, 0x05, 0, 0, 0x04, 0x04 }, + { 0x55, 0x05, 0, 0, 0x04, 0x04 }, { 0x1B, 0x02, 0, 0, 0x02, 0x02 }, { 0x1C, 0x02, 0, 0, 0x02, 0x02 }, + { 0x1D, 0x02, 0, 0, 0x02, 0x02 }, { 0x1D, 0x02, 0, 0, 0x02, 0x02 }, { 0x34, 0x01, 0, 1, 0x04, 0x04 }, + { 0x34, 0x01, 0, 1, 0x04, 0x04 }, { 0x34, 0x01, 0, 1, 0x04, 0x04 }, { 0x34, 0x01, 0, 1, 0x04, 0x04 }, + { 0x1B, 0x01, 0, 1, 0x03, 0x03 }, { 0x1C, 0x01, 0, 1, 0x02, 0x02 }, { 0x1D, 0x01, 0, 1, 0x02, 0x02 }, + { 0x1D, 0x01, 0, 1, 0x02, 0x02 }, { 0x51, 0x08, 1, 1, 0x03, 0x03 }, { 0x51, 0x08, 1, 1, 0x02, 0x02 }, + { 0x51, 0x08, 1, 1, 0x03, 0x03 }, { 0x51, 0x08, 1, 1, 0x02, 0x02 }, { 0x51, 0x09, 0, 1, 0x03, 0x03 }, + { 0x51, 0x09, 0, 1, 0x03, 0x03 }, { 0x51, 0x09, 0, 1, 0x03, 0x03 }, { 0x51, 0x09, 0, 1, 0x03, 0x03 }, + { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, + { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, { 0x55, 0x06, 0, 1, 0x02, 0x02 }, { 0x55, 0x06, 0, 1, 0x02, 0x02 }, + { 0x55, 0x06, 0, 1, 0x02, 0x02 }, { 0x55, 0x06, 0, 1, 0x02, 0x02 }, { 0x51, 0x0B, 0, 1, 0x05, 0x05 }, + { 0x51, 0x0B, 0, 1, 0x04, 0x02 }, { 0x51, 0x0B, 0, 1, 0x05, 0x05 }, { 0x51, 0x0B, 0, 1, 0x04, 0x02 }, + { 0x51, 0x0C, 0, 1, 0x05, 0x05 }, { 0x51, 0x0C, 0, 1, 0x04, 0x02 }, { 0x51, 0x0C, 0, 1, 0x05, 0x05 }, + { 0x51, 0x0C, 0, 1, 0x04, 0x02 }, { 0x51, 0x0D, 0, 1, 0x05, 0x05 }, { 0x51, 0x0D, 0, 1, 0x04, 0x02 }, + { 0x51, 0x0D, 0, 1, 0x05, 0x05 }, { 0x51, 0x0D, 0, 1, 0x04, 0x02 }, { 0x45, 0x01, 0, 1, 0x03, 0x03 }, + { 0x46, 0x01, 0, 1, 0x02, 0x02 }, { 0x45, 0x01, 0, 1, 0x03, 0x03 }, { 0x46, 0x01, 0, 1, 0x02, 0x02 }, + { 0x1E, 0x01, 1, 1, 0x03, 0x03 }, { 0x1F, 0x01, 1, 1, 0x02, 0x02 }, { 0x1E, 0x01, 1, 1, 0x02, 0x02 }, + { 0x1F, 0x01, 1, 1, 0x02, 0x02 }, { 0x20, 0x04, 1, 1, 0x03, 0x03 }, { 0x21, 0x04, 1, 1, 0x02, 0x02 }, + { 0x22, 0x04, 1, 1, 0x02, 0x02 }, { 0x22, 0x04, 1, 1, 0x02, 0x02 }, { 0x20, 0x05, 0, 1, 0x04, 0x02 }, + { 0x21, 0x05, 0, 1, 0x04, 0x02 }, { 0x22, 0x05, 0, 1, 0x04, 0x02 }, { 0x22, 0x05, 0, 1, 0x04, 0x02 }, + { 0x52, 0x04, 0, 1, 0x02, 0x02 }, { 0x52, 0x04, 0, 1, 0x02, 0x02 }, { 0x52, 0x04, 0, 1, 0x02, 0x02 }, + { 0x52, 0x04, 0, 1, 0x02, 0x02 }, { 0x5D, 0x04, 0, 1, 0x03, 0x03 }, { 0x5D, 0x04, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x04, 0, 1, 0x03, 0x03 }, { 0x5D, 0x04, 0, 1, 0x02, 0x02 }, { 0x63, 0x01, 0, 0, 0x03, 0x03 }, + { 0x63, 0x01, 0, 0, 0x02, 0x02 }, { 0x63, 0x01, 0, 0, 0x03, 0x03 }, { 0x63, 0x01, 0, 0, 0x02, 0x02 }, + { 0x07, 0x01, 0, 1, 0x02, 0x02 }, { 0x07, 0x01, 0, 1, 0x02, 0x02 }, { 0x07, 0x01, 0, 1, 0x02, 0x02 }, + { 0x07, 0x01, 0, 1, 0x02, 0x02 }, { 0x07, 0x02, 1, 1, 0x02, 0x02 }, { 0x07, 0x02, 1, 1, 0x02, 0x02 }, + { 0x07, 0x02, 1, 1, 0x02, 0x02 }, { 0x07, 0x02, 1, 1, 0x02, 0x02 }, { 0x5D, 0x05, 0, 1, 0x03, 0x03 }, + { 0x5D, 0x05, 0, 1, 0x02, 0x02 }, { 0x5D, 0x05, 0, 1, 0x03, 0x03 }, { 0x5D, 0x05, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x06, 0, 1, 0x03, 0x03 }, { 0x5D, 0x06, 0, 1, 0x02, 0x02 }, { 0x5D, 0x06, 0, 1, 0x03, 0x03 }, + { 0x5D, 0x06, 0, 1, 0x02, 0x02 }, { 0x5D, 0x07, 0, 1, 0x03, 0x03 }, { 0x5D, 0x07, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x07, 0, 1, 0x03, 0x03 }, { 0x5D, 0x07, 0, 1, 0x02, 0x02 }, { 0x5D, 0x08, 0, 1, 0x03, 0x03 }, + { 0x5D, 0x08, 0, 1, 0x02, 0x02 }, { 0x5D, 0x08, 0, 1, 0x03, 0x03 }, { 0x5D, 0x08, 0, 1, 0x02, 0x02 }, + { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, + { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, { 0x44, 0x01, 0, 1, 0x02, 0x02 }, { 0x44, 0x01, 0, 1, 0x02, 0x02 }, + { 0x44, 0x01, 0, 1, 0x02, 0x02 }, { 0x44, 0x01, 0, 1, 0x02, 0x02 }, { 0x5D, 0x09, 0, 1, 0x03, 0x03 }, + { 0x5D, 0x09, 0, 1, 0x02, 0x02 }, { 0x5D, 0x09, 0, 1, 0x03, 0x03 }, { 0x5D, 0x09, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x0A, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0A, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0A, 0, 1, 0x03, 0x03 }, + { 0x5D, 0x0A, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0B, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0B, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x0B, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0B, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0C, 0, 1, 0x03, 0x03 }, + { 0x5D, 0x0C, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0C, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0C, 0, 1, 0x02, 0x02 }, + { 0x63, 0x02, 0, 1, 0x03, 0x03 }, { 0x63, 0x02, 0, 1, 0x02, 0x02 }, { 0x63, 0x02, 0, 1, 0x03, 0x03 }, + { 0x63, 0x02, 0, 1, 0x02, 0x02 }, { 0x63, 0x03, 0, 1, 0x03, 0x03 }, { 0x63, 0x03, 0, 1, 0x02, 0x02 }, + { 0x63, 0x03, 0, 1, 0x03, 0x03 }, { 0x63, 0x03, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, + { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, + { 0x56, 0x00, 0, 1, 0x02, 0x02 }, { 0x47, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, + { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, + { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x01, 1, 1, 0x02, 0x02 }, { 0x06, 0x01, 1, 1, 0x02, 0x02 }, + { 0x06, 0x01, 1, 1, 0x02, 0x02 }, { 0x06, 0x01, 1, 1, 0x02, 0x02 }, { 0x36, 0x00, 0, 1, 0x04, 0x20 }, + { 0x36, 0x00, 0, 1, 0x04, 0x20 }, { 0x36, 0x00, 0, 1, 0x04, 0x20 }, { 0x36, 0x00, 0, 1, 0x04, 0x20 }, + { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, + { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, { 0x13, 0x00, 1, 1, 0x02, 0x02 }, { 0x13, 0x00, 1, 1, 0x02, 0x02 }, + { 0x13, 0x00, 1, 1, 0x02, 0x02 }, { 0x13, 0x00, 1, 1, 0x02, 0x02 }, { 0x15, 0x00, 1, 1, 0x02, 0x02 }, + { 0x15, 0x00, 1, 1, 0x02, 0x02 }, { 0x15, 0x00, 1, 1, 0x02, 0x02 }, { 0x15, 0x00, 1, 1, 0x02, 0x02 }, + { 0x57, 0x06, 0, 1, 0x04, 0x02 }, { 0x57, 0x06, 0, 1, 0x04, 0x02 }, { 0x57, 0x06, 0, 1, 0x04, 0x02 }, + { 0x57, 0x06, 0, 1, 0x04, 0x02 }, { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, + { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, + { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, + { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, + { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, + { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, + { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, { 0x43, 0x03, 0, 1, 0x02, 0x02 }, + { 0x43, 0x03, 0, 1, 0x02, 0x02 }, { 0x43, 0x03, 0, 1, 0x02, 0x02 }, { 0x43, 0x03, 0, 1, 0x02, 0x02 }, + { 0x43, 0x04, 0, 1, 0x02, 0x02 }, { 0x43, 0x04, 0, 1, 0x02, 0x02 }, { 0x43, 0x04, 0, 1, 0x02, 0x02 }, + { 0x43, 0x04, 0, 1, 0x02, 0x02 }, { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, + { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, + { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, + { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, + { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, + { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, { 0x55, 0x07, 0, 0, 0x04, 0x04 }, + { 0x55, 0x07, 0, 0, 0x04, 0x04 }, { 0x55, 0x07, 0, 0, 0x04, 0x04 }, { 0x55, 0x07, 0, 0, 0x04, 0x04 }, + { 0x55, 0x08, 0, 0, 0x04, 0x04 }, { 0x55, 0x08, 0, 0, 0x04, 0x04 }, { 0x55, 0x08, 0, 0, 0x04, 0x04 }, + { 0x55, 0x08, 0, 0, 0x04, 0x04 }, { 0x5F, 0x02, 0, 1, 0x02, 0x02 }, { 0x5F, 0x02, 0, 1, 0x02, 0x02 }, + { 0x64, 0x02, 0, 1, 0x02, 0x02 }, { 0x64, 0x02, 0, 1, 0x02, 0x02 }, { 0x5F, 0x02, 0, 1, 0x00, 0x00 }, + { 0x52, 0x05, 0, 1, 0x04, 0x02 }, { 0x52, 0x05, 0, 1, 0x04, 0x02 }, { 0x52, 0x05, 0, 1, 0x04, 0x02 }, + { 0x52, 0x05, 0, 1, 0x04, 0x02 }, { 0x52, 0x06, 0, 1, 0x04, 0x02 }, { 0x52, 0x06, 0, 1, 0x04, 0x02 }, + { 0x52, 0x06, 0, 1, 0x04, 0x02 }, { 0x52, 0x06, 0, 1, 0x04, 0x02 }, { 0x52, 0x07, 0, 1, 0x04, 0x02 }, + { 0x52, 0x07, 0, 1, 0x04, 0x02 }, { 0x52, 0x07, 0, 1, 0x04, 0x02 }, { 0x52, 0x07, 0, 1, 0x04, 0x02 }, + { 0x52, 0x08, 0, 1, 0x04, 0x02 }, { 0x52, 0x08, 0, 1, 0x04, 0x02 }, { 0x52, 0x08, 0, 1, 0x04, 0x02 }, + { 0x52, 0x08, 0, 1, 0x04, 0x02 }, { 0x53, 0x02, 0, 1, 0x04, 0x02 }, { 0x53, 0x02, 0, 1, 0x04, 0x02 }, + { 0x53, 0x02, 0, 1, 0x04, 0x02 }, { 0x53, 0x02, 0, 1, 0x04, 0x02 }, { 0x53, 0x03, 0, 1, 0x03, 0x03 }, + { 0x53, 0x03, 0, 1, 0x03, 0x03 }, { 0x53, 0x03, 0, 1, 0x03, 0x03 }, { 0x53, 0x03, 0, 1, 0x03, 0x03 }, + { 0x53, 0x04, 0, 1, 0x03, 0x03 }, { 0x53, 0x04, 0, 1, 0x03, 0x03 }, { 0x53, 0x04, 0, 1, 0x03, 0x03 }, + { 0x53, 0x04, 0, 1, 0x03, 0x03 }, { 0x53, 0x05, 0, 1, 0x03, 0x03 }, { 0x53, 0x05, 0, 1, 0x03, 0x03 }, + { 0x53, 0x05, 0, 1, 0x03, 0x03 }, { 0x53, 0x05, 0, 1, 0x03, 0x03 }, { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, + { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, + { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, + { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, + { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, + { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, + { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, + { 0x63, 0x04, 0, 1, 0x04, 0x02 }, { 0x63, 0x04, 0, 1, 0x04, 0x02 }, { 0x63, 0x04, 0, 1, 0x04, 0x02 }, + { 0x63, 0x04, 0, 1, 0x04, 0x02 }, { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, + { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, + { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, + { 0x30, 0x00, 0, 0, 0x04, 0x20 }, { 0x30, 0x00, 0, 0, 0x04, 0x20 }, { 0x30, 0x00, 0, 1, 0x04, 0x20 }, + { 0x30, 0x00, 0, 1, 0x04, 0x20 }, { 0x31, 0x00, 0, 1, 0x04, 0x20 }, { 0x31, 0x00, 0, 1, 0x04, 0x20 }, + { 0x31, 0x00, 0, 1, 0x04, 0x20 }, { 0x31, 0x00, 0, 1, 0x04, 0x20 }, { 0x1E, 0x04, 0, 1, 0x04, 0x02 }, + { 0x1F, 0x04, 0, 1, 0x04, 0x02 }, { 0x1E, 0x04, 0, 1, 0x04, 0x02 }, { 0x1F, 0x04, 0, 1, 0x04, 0x02 }, + { 0x32, 0x00, 0, 1, 0x02, 0x02 }, { 0x32, 0x00, 0, 1, 0x02, 0x02 }, { 0x32, 0x00, 0, 1, 0x02, 0x02 }, + { 0x32, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x05, 0, 1, 0x03, 0x03 }, { 0x59, 0x05, 0, 1, 0x03, 0x03 }, + { 0x59, 0x05, 0, 1, 0x03, 0x03 }, { 0x59, 0x05, 0, 1, 0x03, 0x03 }, { 0x35, 0x00, 0, 1, 0x04, 0x02 }, + { 0x35, 0x00, 0, 1, 0x04, 0x02 }, { 0x35, 0x00, 0, 1, 0x04, 0x02 }, { 0x35, 0x00, 0, 1, 0x04, 0x02 }, + { 0x37, 0x00, 0, 1, 0x04, 0x20 }, { 0x37, 0x00, 0, 1, 0x04, 0x20 }, { 0x37, 0x00, 0, 1, 0x04, 0x20 }, + { 0x37, 0x00, 0, 1, 0x04, 0x20 }, { 0x39, 0x00, 0, 1, 0x04, 0x04 }, { 0x39, 0x00, 0, 1, 0x04, 0x04 }, + { 0x39, 0x00, 0, 1, 0x04, 0x04 }, { 0x39, 0x00, 0, 1, 0x04, 0x04 }, { 0x5D, 0x0D, 0, 1, 0x03, 0x03 }, + { 0x5D, 0x0D, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0D, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0D, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x0E, 0, 1, 0x03, 0x05 }, { 0x5D, 0x0E, 0, 1, 0x02, 0x04 }, { 0x5D, 0x0E, 0, 1, 0x03, 0x05 }, + { 0x5D, 0x0E, 0, 1, 0x02, 0x04 }, { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, + { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, { 0x20, 0x06, 0, 1, 0x04, 0x02 }, { 0x21, 0x06, 0, 1, 0x04, 0x02 }, + { 0x22, 0x06, 0, 1, 0x04, 0x02 }, { 0x22, 0x06, 0, 1, 0x04, 0x02 }, { 0x20, 0x07, 0, 1, 0x04, 0x02 }, + { 0x21, 0x07, 0, 1, 0x04, 0x02 }, { 0x22, 0x07, 0, 1, 0x04, 0x02 }, { 0x22, 0x07, 0, 1, 0x04, 0x02 }, + { 0x1E, 0x02, 0, 1, 0x04, 0x02 }, { 0x1F, 0x02, 0, 1, 0x04, 0x02 }, { 0x1E, 0x02, 0, 1, 0x03, 0x03 }, + { 0x1F, 0x02, 0, 1, 0x02, 0x02 }, { 0x58, 0x02, 0, 1, 0x02, 0x02 }, { 0x58, 0x02, 0, 1, 0x02, 0x02 }, + { 0x58, 0x02, 0, 1, 0x02, 0x02 }, { 0x58, 0x02, 0, 1, 0x02, 0x02 }, { 0x57, 0x03, 0, 1, 0x03, 0x03 }, + { 0x57, 0x03, 0, 1, 0x03, 0x03 }, { 0x57, 0x03, 0, 1, 0x03, 0x03 }, { 0x57, 0x03, 0, 1, 0x03, 0x03 }, + { 0x57, 0x04, 0, 1, 0x04, 0x02 }, { 0x57, 0x04, 0, 1, 0x04, 0x02 }, { 0x57, 0x04, 0, 1, 0x04, 0x02 }, + { 0x57, 0x04, 0, 1, 0x04, 0x02 }, { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, + { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, { 0x59, 0x03, 0, 1, 0x03, 0x03 }, + { 0x59, 0x03, 0, 1, 0x02, 0x02 }, { 0x59, 0x03, 0, 1, 0x03, 0x03 }, { 0x59, 0x03, 0, 1, 0x02, 0x02 }, + { 0x59, 0x04, 0, 1, 0x02, 0x02 }, { 0x59, 0x04, 0, 1, 0x02, 0x02 }, { 0x59, 0x04, 0, 1, 0x02, 0x02 }, + { 0x59, 0x04, 0, 1, 0x02, 0x02 }, { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, + { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, + { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, + { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, + { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, { 0x30, 0x01, 0, 0, 0x04, 0x20 }, { 0x30, 0x01, 0, 0, 0x04, 0x20 }, + { 0x30, 0x01, 0, 1, 0x04, 0x20 }, { 0x30, 0x01, 0, 1, 0x04, 0x20 }, { 0x30, 0x02, 0, 0, 0x04, 0x20 }, + { 0x30, 0x02, 0, 0, 0x04, 0x20 }, { 0x30, 0x02, 0, 1, 0x04, 0x20 }, { 0x30, 0x02, 0, 1, 0x04, 0x20 }, + { 0x06, 0x02, 0, 0, 0x02, 0x02 }, { 0x06, 0x02, 0, 0, 0x02, 0x02 }, { 0x06, 0x02, 0, 0, 0x02, 0x02 }, + { 0x06, 0x02, 0, 0, 0x02, 0x02 }, { 0x06, 0x03, 0, 0, 0x02, 0x02 }, { 0x06, 0x03, 0, 0, 0x02, 0x02 }, + { 0x06, 0x03, 0, 0, 0x02, 0x02 }, { 0x06, 0x03, 0, 0, 0x02, 0x02 }, { 0x06, 0x04, 0, 1, 0x02, 0x02 }, + { 0x06, 0x04, 0, 1, 0x02, 0x02 }, { 0x06, 0x04, 0, 1, 0x02, 0x02 }, { 0x06, 0x04, 0, 1, 0x02, 0x02 }, + { 0x62, 0x02, 0, 1, 0x04, 0x02 }, { 0x62, 0x02, 0, 1, 0x04, 0x02 }, { 0x62, 0x02, 0, 1, 0x04, 0x02 }, + { 0x62, 0x02, 0, 1, 0x04, 0x02 }, { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x4A, 0x00, 0, 1, 0x02, 0x02 }, + { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x4A, 0x00, 0, 1, 0x02, 0x02 }, { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, + { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x02, 0x01, 1, 1, 0x02, 0x02 }, + { 0x02, 0x01, 1, 1, 0x02, 0x02 }, { 0x02, 0x01, 1, 1, 0x02, 0x02 }, { 0x02, 0x01, 1, 1, 0x02, 0x02 }, + { 0x12, 0x00, 1, 0, 0x02, 0x02 }, { 0x12, 0x00, 1, 0, 0x02, 0x02 }, { 0x12, 0x00, 1, 0, 0x02, 0x02 }, + { 0x12, 0x00, 1, 0, 0x02, 0x02 }, { 0x11, 0x00, 1, 0, 0x02, 0x02 }, { 0x11, 0x00, 1, 0, 0x02, 0x02 }, + { 0x11, 0x00, 1, 0, 0x02, 0x02 }, { 0x11, 0x00, 1, 0, 0x02, 0x02 }, { 0x18, 0x00, 1, 1, 0x02, 0x02 }, + { 0x18, 0x00, 1, 1, 0x02, 0x02 }, { 0x18, 0x00, 1, 1, 0x02, 0x02 }, { 0x18, 0x00, 1, 1, 0x02, 0x02 }, + { 0x16, 0x00, 1, 1, 0x02, 0x02 }, { 0x16, 0x00, 1, 1, 0x02, 0x02 }, { 0x16, 0x00, 1, 1, 0x02, 0x02 }, + { 0x16, 0x00, 1, 1, 0x02, 0x02 }, { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, + { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, { 0x19, 0x00, 1, 1, 0x02, 0x02 }, + { 0x19, 0x00, 1, 1, 0x02, 0x02 }, { 0x19, 0x00, 1, 1, 0x02, 0x02 }, { 0x19, 0x00, 1, 1, 0x02, 0x02 }, + { 0x05, 0x01, 1, 1, 0x03, 0x02 }, { 0x05, 0x01, 1, 1, 0x02, 0x02 }, { 0x05, 0x01, 1, 1, 0x03, 0x02 }, + { 0x05, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, + { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, + { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, + { 0x63, 0x05, 0, 1, 0x04, 0x02 }, { 0x63, 0x05, 0, 1, 0x04, 0x02 }, { 0x63, 0x05, 0, 1, 0x04, 0x02 }, + { 0x63, 0x05, 0, 1, 0x04, 0x02 }, { 0x28, 0x00, 0, 1, 0x04, 0x04 }, { 0x28, 0x00, 0, 1, 0x04, 0x04 }, + { 0x28, 0x00, 0, 1, 0x04, 0x04 }, { 0x28, 0x00, 0, 1, 0x04, 0x04 }, { 0x29, 0x00, 0, 1, 0x04, 0x04 }, + { 0x29, 0x00, 0, 1, 0x04, 0x04 }, { 0x29, 0x00, 0, 1, 0x04, 0x04 }, { 0x29, 0x00, 0, 1, 0x04, 0x04 }, + { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, + { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, + { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x09, 0, 0, 0x04, 0x04 }, + { 0x55, 0x09, 0, 0, 0x04, 0x04 }, { 0x55, 0x09, 0, 0, 0x04, 0x04 }, { 0x55, 0x09, 0, 0, 0x04, 0x04 }, + { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, + { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, { 0x52, 0x09, 0, 1, 0x04, 0x04 }, { 0x52, 0x09, 0, 1, 0x04, 0x04 }, + { 0x52, 0x09, 0, 1, 0x04, 0x04 }, { 0x52, 0x09, 0, 1, 0x04, 0x04 }, { 0x48, 0x00, 0, 1, 0x02, 0x26 }, + { 0x48, 0x00, 0, 1, 0x02, 0x26 }, { 0x48, 0x00, 0, 1, 0x02, 0x26 }, { 0x48, 0x00, 0, 1, 0x02, 0x26 }, + { 0x48, 0x01, 0, 1, 0x04, 0x20 }, { 0x48, 0x01, 0, 1, 0x04, 0x20 }, { 0x48, 0x01, 0, 1, 0x04, 0x20 }, + { 0x48, 0x01, 0, 1, 0x04, 0x20 }, { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, + { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, { 0x60, 0x04, 0, 1, 0x02, 0x02 }, + { 0x60, 0x04, 0, 1, 0x02, 0x02 }, { 0x60, 0x04, 0, 1, 0x02, 0x02 }, { 0x60, 0x04, 0, 1, 0x02, 0x02 }, + { 0x49, 0x00, 0, 1, 0x02, 0x20 }, { 0x49, 0x00, 0, 1, 0x02, 0x20 }, { 0x49, 0x00, 0, 1, 0x02, 0x20 }, + { 0x49, 0x00, 0, 1, 0x02, 0x20 }, { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, + { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x23, 0x01, 0, 1, 0x04, 0x02 }, { 0x24, 0x01, 0, 1, 0x04, 0x02 }, + { 0x25, 0x01, 0, 1, 0x04, 0x02 }, { 0x25, 0x01, 0, 1, 0x04, 0x02 }, { 0x51, 0x0F, 0, 1, 0x05, 0x05 }, + { 0x51, 0x0F, 0, 1, 0x04, 0x02 }, { 0x51, 0x0F, 0, 1, 0x05, 0x05 }, { 0x51, 0x0F, 0, 1, 0x04, 0x02 }, + { 0x60, 0x05, 0, 1, 0x04, 0x02 }, { 0x60, 0x05, 0, 1, 0x04, 0x02 }, { 0x60, 0x05, 0, 1, 0x04, 0x02 }, + { 0x60, 0x05, 0, 1, 0x04, 0x02 }, { 0x5F, 0x04, 0, 1, 0x03, 0x03 }, { 0x5F, 0x04, 0, 1, 0x02, 0x02 }, + { 0x64, 0x04, 0, 1, 0x02, 0x02 }, { 0x64, 0x04, 0, 1, 0x02, 0x02 }, { 0x61, 0x03, 0, 1, 0x02, 0x02 }, + { 0x61, 0x03, 0, 1, 0x02, 0x02 }, { 0x61, 0x03, 0, 1, 0x02, 0x02 }, { 0x61, 0x03, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, + { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, + { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, + { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, + { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, + { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, + { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, + { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, { 0x63, 0x06, 0, 0, 0x02, 0x26 }, + { 0x63, 0x06, 0, 0, 0x02, 0x26 }, { 0x63, 0x06, 0, 0, 0x02, 0x26 }, { 0x63, 0x06, 0, 0, 0x02, 0x26 }, + { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, + { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, + { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, + { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, + { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, + { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, + { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, + { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, + { 0x57, 0x05, 0, 1, 0x02, 0x02 }, { 0x57, 0x05, 0, 1, 0x02, 0x02 }, { 0x57, 0x05, 0, 1, 0x02, 0x02 }, + { 0x57, 0x05, 0, 1, 0x02, 0x02 }, { 0x07, 0x03, 0, 1, 0x02, 0x02 }, { 0x07, 0x03, 0, 1, 0x02, 0x02 }, + { 0x07, 0x03, 0, 1, 0x02, 0x02 }, { 0x07, 0x03, 0, 1, 0x02, 0x02 }, { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, + { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, + { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, + { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, { 0x61, 0x04, 0, 1, 0x02, 0x02 }, { 0x61, 0x04, 0, 1, 0x02, 0x02 }, + { 0x61, 0x04, 0, 1, 0x02, 0x02 }, { 0x61, 0x04, 0, 1, 0x02, 0x02 }, { 0x5F, 0x03, 0, 1, 0x03, 0x03 }, + { 0x5F, 0x03, 0, 1, 0x02, 0x02 }, { 0x64, 0x03, 0, 1, 0x02, 0x02 }, { 0x64, 0x03, 0, 1, 0x02, 0x02 }, + { 0x5F, 0x03, 0, 1, 0x00, 0x00 }, { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, + { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, { 0x48, 0x02, 1, 1, 0x04, 0x20 }, + { 0x48, 0x02, 1, 1, 0x04, 0x20 }, { 0x48, 0x02, 1, 1, 0x04, 0x20 }, { 0x48, 0x02, 1, 1, 0x04, 0x20 }, + { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, + { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, { 0x53, 0x06, 0, 1, 0x03, 0x03 }, { 0x53, 0x06, 0, 1, 0x03, 0x03 }, + { 0x53, 0x06, 0, 1, 0x03, 0x03 }, { 0x53, 0x06, 0, 1, 0x03, 0x03 }, { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, + { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, + { 0x52, 0x0D, 0, 1, 0x03, 0x03 }, { 0x52, 0x0D, 0, 1, 0x02, 0x02 }, { 0x52, 0x0D, 0, 1, 0x03, 0x03 }, + { 0x52, 0x0D, 0, 1, 0x02, 0x02 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, + { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, + { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, + { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, { 0x66, 0x00, 0, 1, 0x02, 0x02 }, { 0x66, 0x00, 0, 1, 0x02, 0x02 }, + { 0x66, 0x00, 0, 1, 0x02, 0x02 }, { 0x66, 0x00, 0, 1, 0x02, 0x02 }, { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, + { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, + { 0x32, 0x01, 0, 1, 0x02, 0x02 }, { 0x32, 0x01, 0, 1, 0x02, 0x02 }, { 0x32, 0x01, 0, 1, 0x02, 0x02 }, + { 0x32, 0x01, 0, 1, 0x02, 0x02 }, { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, + { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, { 0x33, 0x00, 0, 1, 0x04, 0x20 }, + { 0x33, 0x00, 0, 1, 0x04, 0x20 }, { 0x33, 0x00, 0, 1, 0x04, 0x20 }, { 0x33, 0x00, 0, 1, 0x04, 0x20 }, + { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, + { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, + { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, { 0x50, 0x00, 0, 1, 0x04, 0x20 }, { 0x50, 0x00, 0, 1, 0x04, 0x20 }, + { 0x50, 0x00, 0, 1, 0x04, 0x20 }, { 0x50, 0x00, 0, 1, 0x04, 0x20 }, { 0x52, 0x0E, 0, 1, 0x03, 0x03 }, + { 0x52, 0x0E, 0, 1, 0x02, 0x02 }, { 0x52, 0x0E, 0, 1, 0x03, 0x03 }, { 0x52, 0x0E, 0, 1, 0x02, 0x02 }, + { 0x63, 0x08, 0, 0, 0x20, 0x20 }, { 0x63, 0x08, 0, 0, 0x20, 0x20 }, { 0x63, 0x08, 0, 0, 0x20, 0x20 }, + { 0x63, 0x08, 0, 0, 0x20, 0x20 }, { 0x63, 0x09, 0, 0, 0x02, 0x02 }, { 0x63, 0x09, 0, 0, 0x02, 0x02 }, + { 0x63, 0x09, 0, 0, 0x02, 0x02 }, { 0x63, 0x09, 0, 0, 0x02, 0x02 }, { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, + { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, + { 0x61, 0x05, 0, 1, 0x02, 0x02 }, { 0x61, 0x05, 0, 1, 0x02, 0x02 }, { 0x61, 0x05, 0, 1, 0x02, 0x02 }, + { 0x61, 0x05, 0, 1, 0x02, 0x02 }, { 0x53, 0x07, 0, 1, 0x03, 0x03 }, { 0x53, 0x07, 0, 1, 0x03, 0x03 }, + { 0x53, 0x07, 0, 1, 0x03, 0x03 }, { 0x53, 0x07, 0, 1, 0x03, 0x03 }, { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, + { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, + { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, + { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, { 0x41, 0x01, 0, 1, 0x02, 0x02 }, { 0x41, 0x01, 0, 1, 0x02, 0x02 }, + { 0x41, 0x01, 0, 1, 0x02, 0x02 }, { 0x41, 0x01, 0, 1, 0x02, 0x02 }, { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, + { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, + { 0x5C, 0x07, 0, 1, 0x03, 0x03 }, { 0x5C, 0x07, 0, 1, 0x02, 0x02 }, { 0x5C, 0x07, 0, 1, 0x03, 0x03 }, + { 0x5C, 0x07, 0, 1, 0x02, 0x02 }, { 0x53, 0x08, 0, 1, 0x03, 0x03 }, { 0x53, 0x08, 0, 1, 0x03, 0x03 }, + { 0x53, 0x08, 0, 1, 0x03, 0x03 }, { 0x53, 0x08, 0, 1, 0x03, 0x03 }, { 0x03, 0x02, 0, 1, 0x02, 0x02 }, + { 0x03, 0x02, 0, 1, 0x02, 0x02 }, { 0x03, 0x02, 0, 1, 0x02, 0x02 }, { 0x03, 0x02, 0, 1, 0x02, 0x02 }, + { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, + { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, { 0x43, 0x05, 0, 1, 0x02, 0x02 }, { 0x43, 0x05, 0, 1, 0x02, 0x02 }, + { 0x43, 0x05, 0, 1, 0x02, 0x02 }, { 0x43, 0x05, 0, 1, 0x02, 0x02 }, { 0x43, 0x06, 0, 1, 0x02, 0x02 }, + { 0x43, 0x06, 0, 1, 0x02, 0x02 }, { 0x43, 0x06, 0, 1, 0x02, 0x02 }, { 0x43, 0x06, 0, 1, 0x02, 0x02 }, + { 0x51, 0x11, 0, 1, 0x03, 0x03 }, { 0x51, 0x11, 0, 1, 0x02, 0x02 }, { 0x51, 0x11, 0, 1, 0x03, 0x03 }, + { 0x51, 0x11, 0, 1, 0x02, 0x02 }, { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, + { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, + { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, { 0x37, 0x01, 0, 1, 0x04, 0x20 }, { 0x37, 0x01, 0, 1, 0x04, 0x20 }, + { 0x37, 0x01, 0, 1, 0x04, 0x20 }, { 0x37, 0x01, 0, 1, 0x04, 0x20 }, { 0x08, 0x01, 0, 1, 0x04, 0x04 }, + { 0x08, 0x01, 0, 1, 0x04, 0x04 }, { 0x08, 0x01, 0, 1, 0x04, 0x04 }, { 0x08, 0x01, 0, 1, 0x04, 0x04 }, + { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, + { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, + { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, { 0x09, 0x01, 0, 1, 0x02, 0x02 }, + { 0x09, 0x01, 0, 1, 0x02, 0x02 }, { 0x09, 0x01, 0, 1, 0x02, 0x02 }, { 0x09, 0x01, 0, 1, 0x02, 0x02 }, + { 0x52, 0x0F, 0, 1, 0x03, 0x03 }, { 0x52, 0x0F, 0, 1, 0x02, 0x02 }, { 0x52, 0x0F, 0, 1, 0x03, 0x03 }, + { 0x52, 0x0F, 0, 1, 0x02, 0x02 }, { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, + { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, + { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, + { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, + { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, { 0x17, 0x02, 1, 1, 0x02, 0x02 }, { 0x17, 0x02, 1, 1, 0x02, 0x02 }, + { 0x17, 0x02, 1, 1, 0x02, 0x02 }, { 0x17, 0x02, 1, 1, 0x02, 0x02 }, { 0x4A, 0x01, 0, 0, 0x03, 0x03 }, + { 0x4A, 0x01, 0, 0, 0x02, 0x02 }, { 0x4A, 0x01, 0, 0, 0x03, 0x03 }, { 0x4A, 0x01, 0, 0, 0x02, 0x02 }, + { 0x43, 0x07, 0, 1, 0x02, 0x02 }, { 0x43, 0x07, 0, 1, 0x02, 0x02 }, { 0x43, 0x07, 0, 1, 0x02, 0x02 }, + { 0x43, 0x07, 0, 1, 0x02, 0x02 }, { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, + { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, + { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, + { 0x56, 0x02, 0, 1, 0x12, 0x12 }, { 0x56, 0x02, 0, 1, 0x02, 0x02 }, { 0x56, 0x02, 0, 1, 0x12, 0x12 }, + { 0x56, 0x02, 0, 1, 0x02, 0x02 }, { 0x57, 0x08, 0, 1, 0x02, 0x02 }, { 0x57, 0x08, 0, 1, 0x02, 0x02 }, + { 0x57, 0x08, 0, 1, 0x02, 0x02 }, { 0x57, 0x08, 0, 1, 0x02, 0x02 }, { 0x56, 0x03, 0, 1, 0x03, 0x03 }, + { 0x56, 0x03, 0, 1, 0x03, 0x03 }, { 0x56, 0x03, 0, 1, 0x03, 0x03 }, { 0x56, 0x03, 0, 1, 0x03, 0x03 }, + { 0x57, 0x09, 0, 1, 0x03, 0x03 }, { 0x57, 0x09, 0, 1, 0x03, 0x03 }, { 0x57, 0x09, 0, 1, 0x03, 0x03 }, + { 0x57, 0x09, 0, 1, 0x03, 0x03 }, { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, + { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, }; -#define TITLED_SCENE(name, title, unk_10, config, unk_12) \ -{ \ - (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomEnd, \ - (u32)_##title##SegmentRomStart, (u32)_##title##SegmentRomEnd, \ - unk_10, config, unk_12 \ -} +#define TITLED_SCENE(name, title, unk_10, config, unk_12) \ + { \ + (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd, (u32)_##title##SegmentRomStart, \ + (u32)_##title##SegmentRomEnd, unk_10, config, unk_12 \ + } #define UNTITLED_SCENE(name, unk_10, config, unk_12) \ -{ \ - (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomEnd, \ - 0, 0, \ - unk_10, config, unk_12 \ -} + { (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd, 0, 0, unk_10, config, unk_12 } -Scene gSceneTable[] = -{ +Scene gSceneTable[] = { TITLED_SCENE(ydan_scene, g_pn_06, 1, 19, 2), TITLED_SCENE(ddan_scene, g_pn_08, 1, 20, 3), TITLED_SCENE(bdan_scene, g_pn_07, 1, 21, 4), @@ -1689,8 +645,7 @@ Scene gSceneTable[] = UNTITLED_SCENE(testroom_scene, 0, 0, 0), }; -Gfx sDefaultDisplayList[] = -{ +Gfx sDefaultDisplayList[] = { gsSPSegment(0x08, D_80127098), gsSPSegment(0x09, D_80127098), gsSPSegment(0x0A, D_80127098), @@ -1704,31 +659,28 @@ Gfx sDefaultDisplayList[] = }; // Computes next entrance index based on age and day time to set the fade out transition -void func_800994A0(GlobalContext* globalCtx) -{ +void func_800994A0(GlobalContext* globalCtx) { s16 computedEntranceIndex; - if (gSaveContext.night_flag) - { - if (LINK_IS_CHILD) + if (gSaveContext.night_flag) { + if (LINK_IS_CHILD) { computedEntranceIndex = globalCtx->nextEntranceIndex + 1; - else + } else { computedEntranceIndex = globalCtx->nextEntranceIndex + 3; - } - else - { - if (LINK_IS_CHILD) + } + } else { + if (LINK_IS_CHILD) { computedEntranceIndex = globalCtx->nextEntranceIndex; - else + } else { computedEntranceIndex = globalCtx->nextEntranceIndex + 2; + } } globalCtx->fadeOutTransition = gEntranceTable[computedEntranceIndex].fadeOutTransition; } // Scene Draw Config 0 -void func_80099550(GlobalContext* globalCtx) -{ +void func_80099550(GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; @@ -1743,8 +695,7 @@ void func_80099550(GlobalContext* globalCtx) u32 D_8012A2F8[] = { 0x0200BA18, 0x0200CA18 }; // Scene Draw Config 19 -void func_800995DC(GlobalContext* globalCtx) -{ +void func_800995DC(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -1755,9 +706,8 @@ void func_800995DC(GlobalContext* globalCtx) func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 4763); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - (gameplayFrames % 128), (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - (gameplayFrames % 128), (gameplayFrames * 1) % 128, + 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80); @@ -1770,8 +720,7 @@ void func_800995DC(GlobalContext* globalCtx) } // Scene Draw Config 28 -void func_80099760(GlobalContext* globalCtx) -{ +void func_80099760(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -1781,9 +730,8 @@ void func_80099760(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 2) % 256, 0, 64, 32, - 1, 0, (gameplayFrames * 2) % 128, 64, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 256, 0, 64, 32, 1, 0, + (gameplayFrames * 2) % 128, 64, 32)); gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80); @@ -1795,8 +743,7 @@ u32 D_8012A300[] = { 0x02012378, 0x02013378 }; u32 D_8012A308[] = { 0x02011F78, 0x02014778, 0x02014378, 0x02013F78, 0x02014B78, 0x02013B78, 0x02012F78, 0x02012B78 }; // Scene Draw Config 20 -void func_80099878(GlobalContext* globalCtx) -{ +void func_80099878(GlobalContext* globalCtx) { u32 gameplayFrames; s32 pad; Gfx* displayListHead; @@ -1812,13 +759,11 @@ void func_80099878(GlobalContext* globalCtx) gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A300[gSaveContext.night_flag])); gSPSegment(gfxCtx->polyOpa.p++, 0x09, SEGMENTED_TO_VIRTUAL(D_8012A308[(s32)(gameplayFrames & 14) >> 1])); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 1) % 256, 0, 64, 32, - 1, 0, (gameplayFrames * 1) % 128, 64, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 256, 0, 64, 32, 1, 0, + (gameplayFrames * 1) % 128, 64, 32)); gSPSegment(gfxCtx->polyOpa.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 1) % 128, 32, 32, - 1, 0, (gameplayFrames * 2) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 128, 32, 32, 1, 0, + (gameplayFrames * 2) % 128, 32, 32)); { s32 pad2[2]; } // Necessary to match stack usage @@ -1841,8 +786,7 @@ void func_80099878(GlobalContext* globalCtx) } // Scene Draw Config 30 -void func_80099BD8(GlobalContext* globalCtx) -{ +void func_80099BD8(GlobalContext* globalCtx) { f32 temp; Gfx* displayListHead; GraphicsContext* gfxCtx; @@ -1857,15 +801,13 @@ void func_80099BD8(GlobalContext* globalCtx) gSPSegment(gfxCtx->polyXlu.p++, 0x08, displayListHead); gSPSegment(gfxCtx->polyOpa.p++, 0x08, displayListHead); - gDPSetPrimColor(displayListHead++, 0, 0, - 0xFF - (u8)(185.0f * temp), 0xFF - (u8)(145.0f * temp), + gDPSetPrimColor(displayListHead++, 0, 0, 0xFF - (u8)(185.0f * temp), 0xFF - (u8)(145.0f * temp), 0xFF - (u8)(105.0f * temp), 0xFF); gSPEndDisplayList(displayListHead++); gSPSegment(gfxCtx->polyXlu.p++, 0x09, displayListHead); gSPSegment(gfxCtx->polyOpa.p++, 0x09, displayListHead); - gDPSetPrimColor(displayListHead++, 0, 0, - 0x4C + (u8)(6.0f * temp), 0x4C + (u8)(34.0f * temp), + gDPSetPrimColor(displayListHead++, 0, 0, 0x4C + (u8)(6.0f * temp), 0x4C + (u8)(34.0f * temp), 0x4C + (u8)(74.0f * temp), 0xFF); gSPEndDisplayList(displayListHead++); @@ -1877,8 +819,7 @@ void func_80099BD8(GlobalContext* globalCtx) gSPSegment(gfxCtx->polyOpa.p++, 0x0B, displayListHead); gSPSegment(gfxCtx->polyXlu.p++, 0x0B, displayListHead); - gDPSetPrimColor(displayListHead++, 0, 0, - 0x59 + (u8)(166.0f * temp), 0x59 + (u8)(166.0f * temp), + gDPSetPrimColor(displayListHead++, 0, 0, 0x59 + (u8)(166.0f * temp), 0x59 + (u8)(166.0f * temp), 0x59 + (u8)(166.0f * temp), 0xFF); gDPPipeSync(displayListHead++); gDPSetEnvColor(displayListHead++, 0, 0, 0, globalCtx->unk_11D30[0]); @@ -1886,8 +827,7 @@ void func_80099BD8(GlobalContext* globalCtx) gSPSegment(gfxCtx->polyOpa.p++, 0x0C, displayListHead); gSPSegment(gfxCtx->polyXlu.p++, 0x0C, displayListHead); - gDPSetPrimColor(displayListHead++, 0, 0, - 0xFF + (u8)(179.0f * temp), 0xFF + (u8)(179.0f * temp), + gDPSetPrimColor(displayListHead++, 0, 0, 0xFF + (u8)(179.0f * temp), 0xFF + (u8)(179.0f * temp), 0xFF + (u8)(179.0f * temp), 0xFF); gDPPipeSync(displayListHead++); gDPSetEnvColor(displayListHead++, 0, 0, 0, globalCtx->unk_11D30[0]); @@ -1901,8 +841,7 @@ void func_80099BD8(GlobalContext* globalCtx) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 5145); - if (gSaveContext.scene_setup_index == 5) - { + if (gSaveContext.scene_setup_index == 5) { D_8015FCF0 = 1; D_8015FCF8.x = -20.0f; D_8015FCF8.y = 1220.0f; @@ -1914,8 +853,7 @@ void func_80099BD8(GlobalContext* globalCtx) } // Scene Draw Config 31 -void func_8009A45C(GlobalContext* globalCtx) -{ +void func_8009A45C(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -1925,27 +863,20 @@ void func_8009A45C(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 1) % 64, 256, 16)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 64, 256, 16)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - (gameplayFrames % 128), (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); - gSPSegment(gfxCtx->polyOpa.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 0, 32, 32, - 1, 0, 127 - (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - (gameplayFrames % 128), (gameplayFrames * 1) % 128, + 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + gSPSegment( + gfxCtx->polyOpa.p++, 0x0A, + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 32, 1, 0, 127 - (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyOpa.p++, 0x0B, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x0C, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 50) % 2048, 8, 512, - 1, 0, (gameplayFrames * 60) % 2048, 8, 512)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 50) % 2048, 8, 512, 1, 0, + (gameplayFrames * 60) % 2048, 8, 512)); gSPSegment(gfxCtx->polyOpa.p++, 0x0D, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 0, 32, 64, - 1, 0, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (gameplayFrames * 1) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80); @@ -1957,8 +888,7 @@ void func_8009A45C(GlobalContext* globalCtx) } // Scene Draw Config 32 -void func_8009A798(GlobalContext* globalCtx) -{ +void func_8009A798(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -1968,20 +898,17 @@ void func_8009A798(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 2) % 256, 64, 64)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 256, 64, 64)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); gSPSegment(gfxCtx->polyOpa.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - (gameplayFrames * 1) % 128, (gameplayFrames * 1) % 256, 32, 64, - 1, 0, 0, 32, 128)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - (gameplayFrames * 1) % 128, + (gameplayFrames * 1) % 256, 32, 64, 1, 0, 0, 32, 128)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -1993,8 +920,7 @@ void func_8009A798(GlobalContext* globalCtx) } // Scene Draw Config 33 -void func_8009A9DC(GlobalContext* globalCtx) -{ +void func_8009A9DC(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2004,13 +930,11 @@ void func_8009A9DC(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 256, 32, 64, - 1, gameplayFrames % 128, (gameplayFrames * 3) % 256, 32, 64)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 256, 32, + 64, 1, gameplayFrames % 128, (gameplayFrames * 3) % 256, 32, 64)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2022,8 +946,7 @@ void func_8009A9DC(GlobalContext* globalCtx) } // Scene Draw Config 48 -void func_8009AB98(GlobalContext* globalCtx) -{ +void func_8009AB98(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2032,9 +955,7 @@ void func_8009AB98(GlobalContext* globalCtx) func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 5317); gameplayFrames = globalCtx->gameplayFrames; - gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, gameplayFrames % 64, 256, 16)); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, Draw_TexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 64, 256, 16)); gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80); @@ -2046,8 +967,7 @@ void func_8009AB98(GlobalContext* globalCtx) } // Scene Draw Config 39 -void func_8009ACA8(GlobalContext* globalCtx) -{ +void func_8009ACA8(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2057,12 +977,9 @@ void func_8009ACA8(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); - gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, gameplayFrames % 64, 256, 16)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); + gSPSegment(gfxCtx->polyXlu.p++, 0x09, Draw_TexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 64, 256, 16)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2074,8 +991,7 @@ void func_8009ACA8(GlobalContext* globalCtx) } // Scene Draw Config 24 -void func_8009AE30(GlobalContext* globalCtx) -{ +void func_8009AE30(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2085,16 +1001,15 @@ void func_8009AE30(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; - if (globalCtx->sceneNum == SCENE_HAKADAN_BS) + if (globalCtx->sceneNum == SCENE_HAKADAN_BS) { gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 2) % 128, 0, 32, 32, - 1, (gameplayFrames * 2) % 128, 0, 32, 32)); - else + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 128, 0, 32, 32, 1, + (gameplayFrames * 2) % 128, 0, 32, 32)); + } else { gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 2) % 128, 0, 32, 32, - 1, (gameplayFrames * 2) % 128, 0, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 128, 0, 32, 32, 1, + (gameplayFrames * 2) % 128, 0, 32, 32)); + } gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2108,8 +1023,7 @@ void func_8009AE30(GlobalContext* globalCtx) u32 D_8012A328[] = { 0x0200BD20, 0x0200B920 }; // Scene Draw Config 40 -void func_8009AFE0(GlobalContext* globalCtx) -{ +void func_8009AFE0(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2119,8 +1033,7 @@ void func_8009AFE0(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 3) % 128, 32, 32)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 3) % 128, 32, 32)); { s32 pad[2]; } // Necessary to match stack usage @@ -2132,8 +1045,7 @@ void func_8009AFE0(GlobalContext* globalCtx) u32 D_8012A330[] = { 0x02014C30, 0x02015830 }; // Scene Draw Config 23 -void func_8009B0FC(GlobalContext* globalCtx) -{ +void func_8009B0FC(GlobalContext* globalCtx) { u32 gameplayFrames; s32 spB0; s32 spAC; @@ -2143,7 +1055,7 @@ void func_8009B0FC(GlobalContext* globalCtx) gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 5535); - if (1) ; // Necessary to match + if (1) {} // Necessary to match spB0 = (globalCtx->unk_11D30[1] >> 8) & 0xFF; spAC = globalCtx->unk_11D30[1] & 0xFF; @@ -2151,81 +1063,56 @@ void func_8009B0FC(GlobalContext* globalCtx) gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A330[gSaveContext.night_flag])); - if (spB0 == 1) + if (spB0 == 1) { gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 1, 0, 32, 32, - 1, 0, 0, 32, 32, + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, spAC)); - else if (spB0 < 1) + } else if (spB0 < 1) { gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 1, 0, 32, 32, - 1, 0, 0, 32, 32, + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, 0xFF)); - else + } else { gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 1, 0, 32, 32, - 1, 0, 0, 32, 32, + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, 0xA0)); - - if (spB0 == 2) - gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 1, 0, 32, 32, - 1, 0, 0, 32, 32, - 0, 0, 0, spAC)); - else if (spB0 < 2) - gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 1, 0, 32, 32, - 1, 0, 0, 32, 32, - 0, 0, 0, 0xFF)); - else - gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 1, 0, 32, 32, - 1, 0, 0, 32, 32, - 0, 0, 0, 0xA0)); - - if (spB0 != 0) - { - gSPSegment(gfxCtx->polyOpa.p++, 0x0A, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 1, 0, 32, 32, - 1, 0, 0, 32, 32, - 0, 0, 0, 0xA0)); - gSPSegment(gfxCtx->polyOpa.p++, 0x0B, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 3, 0, 32, 32, - 1, 0, 0, 32, 32, - 0, 0, 0, 0xB4)); } - else - { + + if (spB0 == 2) { + gSPSegment(gfxCtx->polyOpa.p++, 0x09, + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32, + 0, 0, 0, spAC)); + } else if (spB0 < 2) { + gSPSegment(gfxCtx->polyOpa.p++, 0x09, + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32, + 0, 0, 0, 0xFF)); + } else { + gSPSegment(gfxCtx->polyOpa.p++, 0x09, + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32, + 0, 0, 0, 0xA0)); + } + + if (spB0 != 0) { gSPSegment(gfxCtx->polyOpa.p++, 0x0A, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 1) % 128, 0, 32, 32, - 1, 0, 0, 32, 32, - 0, 0, 0, 0xA0 + (s32)((spAC / 200.0f) * 95.0f))); + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32, + 0, 0, 0, 0xA0)); gSPSegment(gfxCtx->polyOpa.p++, 0x0B, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 3, 0, 32, 32, - 1, 0, 0, 32, 32, + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 3, 0, 32, 32, 1, 0, 0, 32, 32, + 0, 0, 0, 0xB4)); + } else { + gSPSegment(gfxCtx->polyOpa.p++, 0x0A, + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 128, 0, 32, 32, 1, 0, 0, + 32, 32, 0, 0, 0, 0xA0 + (s32)((spAC / 200.0f) * 95.0f))); + gSPSegment(gfxCtx->polyOpa.p++, 0x0B, + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 3, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, 0xB9 + (s32)((spAC / 200.0f) * 70.0f))); } gSPSegment(gfxCtx->polyXlu.p++, 0x0C, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 1, gameplayFrames * 1, 32, 32, - 1, 0, 127 - (gameplayFrames * 1), 32, 32, - 0, 0, 0, 0x80)); + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, gameplayFrames * 1, 32, 32, 1, + 0, 127 - (gameplayFrames * 1), 32, 32, 0, 0, 0, 0x80)); gSPSegment(gfxCtx->polyXlu.p++, 0x0D, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames * 4, 0, 32, 32, - 1, gameplayFrames * 4, 0, 32, 32, - 0, 0, 0, 0x80)); + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 4, 0, 32, 32, 1, + gameplayFrames * 4, 0, 32, 32, 0, 0, 0, 0x80)); { s32 pad[2]; } // Necessary to match stack usage @@ -2233,8 +1120,7 @@ void func_8009B0FC(GlobalContext* globalCtx) } // Scene Draw Config 29 -void func_8009B86C(GlobalContext* globalCtx) -{ +void func_8009B86C(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2244,9 +1130,7 @@ void func_8009B86C(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, gameplayFrames * 1, 0, 32, 32, - 1, 0, 0, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, globalCtx->unk_11D30[0]); @@ -2258,8 +1142,7 @@ void func_8009B86C(GlobalContext* globalCtx) } // Scene Draw Config 34 -void func_8009B9BC(GlobalContext* globalCtx) -{ +void func_8009B9BC(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2268,9 +1151,7 @@ void func_8009B9BC(GlobalContext* globalCtx) func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 5822); gameplayFrames = globalCtx->gameplayFrames; - gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, gameplayFrames % 64, 4, 16)); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, Draw_TexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 64, 4, 16)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2279,8 +1160,7 @@ void func_8009B9BC(GlobalContext* globalCtx) } // Scene Draw Config 35 -void func_8009BAA4(GlobalContext* globalCtx) -{ +void func_8009BAA4(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2290,14 +1170,13 @@ void func_8009BAA4(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); - if (globalCtx->sceneNum == SCENE_HAIRAL_NIWA) + if (globalCtx->sceneNum == SCENE_HAIRAL_NIWA) { gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 10) % 256, 32, 64)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 10) % 256, 32, 64)); + } gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2309,14 +1188,13 @@ void func_8009BAA4(GlobalContext* globalCtx) } // Scene Draw Config 36 -void func_8009BC44(GlobalContext* globalCtx) -{ +void func_8009BC44(GlobalContext* globalCtx) { u32 gameplayFrames; s8 sp83; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - if (1) ; // Necessary to match + if (1) {} // Necessary to match sp83 = coss((globalCtx->gameplayFrames * 1500) & 0xFFFF) >> 8; @@ -2325,21 +1203,18 @@ void func_8009BC44(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; - if (globalCtx->sceneNum == SCENE_GANON_TOU) - { + if (globalCtx->sceneNum == SCENE_GANON_TOU) { gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 1) % 256, 64, 64)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 256, 64, 64)); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 255 - (gameplayFrames * 1) % 256, 64, 64, - 1, 0, (gameplayFrames * 1) % 256, 64, 64)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 255 - (gameplayFrames * 1) % 256, 64, 64, 1, 0, + (gameplayFrames * 1) % 256, 64, 64)); } gSPSegment(gfxCtx->polyOpa.p++, 0x0B, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 255 - (gameplayFrames * 1) % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, (gameplayFrames * 1) % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 255 - (gameplayFrames * 1) % 128, + (gameplayFrames * 1) % 128, 32, 32, 1, (gameplayFrames * 1) % 128, + (gameplayFrames * 1) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2357,20 +1232,17 @@ void func_8009BC44(GlobalContext* globalCtx) // Screen Shake for Ganon's Tower Collapse #ifdef NON_MATCHING // regalloc differences -void func_8009BEEC(GlobalContext* globalCtx) -{ +void func_8009BEEC(GlobalContext* globalCtx) { s32 var; - if (globalCtx->gameplayFrames % 128 == 13) - { + if (globalCtx->gameplayFrames % 128 == 13) { var = func_80092F88(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 2); func_80092DAC(var, 10000); func_80092E70(var, 4, 0, 0, 0); func_80092DF0(var, 127); } - if ((globalCtx->gameplayFrames % 64 == 0) && (Math_Rand_ZeroOne() > 0.6f)) - { + if ((globalCtx->gameplayFrames % 64 == 0) && (Math_Rand_ZeroOne() > 0.6f)) { var = func_80092F88(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 3); func_80092DAC(var, 32000.0f + (Math_Rand_ZeroOne() * 3000.0f)); func_80092E70(var, 10.0f - (Math_Rand_ZeroOne() * 9.0f), 0, 0, 0); @@ -2383,14 +1255,13 @@ void func_8009BEEC(GlobalContext* globalCtx); #endif // Scene Draw Config 38 -void func_8009C0AC(GlobalContext* globalCtx) -{ +void func_8009C0AC(GlobalContext* globalCtx) { u32 gameplayFrames; s8 sp7B; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - if (1) ; // Necessary to match + if (1) {} // Necessary to match sp7B = coss((globalCtx->gameplayFrames * 1500) & 0xFFFF) >> 8; @@ -2399,17 +1270,14 @@ void func_8009C0AC(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 1) % 512, 64, 128, - 1, 0, 511 - (gameplayFrames * 1) % 512, 64, 128)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 512, 64, 128, 1, 0, + 511 - (gameplayFrames * 1) % 512, 64, 128)); gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 1) % 256, 32, 64, - 1, 0, 255 - (gameplayFrames * 1) % 256, 32, 64)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 256, 32, 64, 1, 0, + 255 - (gameplayFrames * 1) % 256, 32, 64)); gSPSegment(gfxCtx->polyXlu.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 20) % 2048, 16, 512, - 1, 0, (gameplayFrames * 30) % 2048, 16, 512)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 20) % 2048, 16, 512, 1, 0, + (gameplayFrames * 30) % 2048, 16, 512)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2423,13 +1291,9 @@ void func_8009C0AC(GlobalContext* globalCtx) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6004); - if (Flags_GetSwitch(globalCtx, 0x37)) - { - if ((globalCtx->sceneNum == SCENE_GANON_DEMO) || - (globalCtx->sceneNum == SCENE_GANON_FINAL) || - (globalCtx->sceneNum == SCENE_GANON_SONOGO) || - (globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO)) - { + if (Flags_GetSwitch(globalCtx, 0x37)) { + if ((globalCtx->sceneNum == SCENE_GANON_DEMO) || (globalCtx->sceneNum == SCENE_GANON_FINAL) || + (globalCtx->sceneNum == SCENE_GANON_SONOGO) || (globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO)) { func_8009BEEC(globalCtx); } } @@ -2438,13 +1302,12 @@ void func_8009C0AC(GlobalContext* globalCtx) u32 D_8012A338[] = { 0x0200FAC0, 0x0200F8C0 }; // Scene Draw Config 37 -void func_8009C3EC(GlobalContext* globalCtx) -{ +void func_8009C3EC(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - if (0) ; // Necessary to match + if (0) {} // Necessary to match gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6042); @@ -2452,13 +1315,11 @@ void func_8009C3EC(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A338[gSaveContext.night_flag])); gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); { s32 pad[2]; } // Necessary to match stack usage @@ -2472,8 +1333,7 @@ void func_8009C3EC(GlobalContext* globalCtx) } // Scene Draw Config 42 -void func_8009C608(GlobalContext* globalCtx) -{ +void func_8009C608(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2483,20 +1343,16 @@ void func_8009C608(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 1) % 64, 256, 16)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 64, 256, 16)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 60) % 2048, 8, 512, - 1, 0, (gameplayFrames * 50) % 2048, 8, 512)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 60) % 2048, 8, 512, 1, 0, + (gameplayFrames * 50) % 2048, 8, 512)); gSPSegment(gfxCtx->polyOpa.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - (gameplayFrames * 1) % 128, 0, 32, 32, - 1, (gameplayFrames * 1) % 128, 0, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - (gameplayFrames * 1) % 128, 0, 32, 32, 1, + (gameplayFrames * 1) % 128, 0, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x0B, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 1023 - (gameplayFrames * 6) % 1024, 16, 256, - 1, 0, 1023 - (gameplayFrames * 3) % 1024, 16, 256)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 1023 - (gameplayFrames * 6) % 1024, 16, 256, 1, 0, + 1023 - (gameplayFrames * 3) % 1024, 16, 256)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2508,8 +1364,7 @@ void func_8009C608(GlobalContext* globalCtx) } // Scene Draw Config 43 -void func_8009C8B8(GlobalContext* globalCtx) -{ +void func_8009C8B8(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2519,16 +1374,12 @@ void func_8009C8B8(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 0, 32, 32, - 1, 0, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 32, 1, 0, (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, 255 - (gameplayFrames * 10) % 256, 32, 64)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, 255 - (gameplayFrames * 10) % 256, 32, 64)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2540,8 +1391,7 @@ void func_8009C8B8(GlobalContext* globalCtx) } // Scene Draw Config 47 -void func_8009CAC0(GlobalContext* globalCtx) -{ +void func_8009CAC0(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2551,9 +1401,8 @@ void func_8009CAC0(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2567,13 +1416,12 @@ void func_8009CAC0(GlobalContext* globalCtx) u32 D_8012A340[] = { 0x0200F8C0, 0x020100C0 }; // Scene Draw Config 27 -void func_8009CC00(GlobalContext* globalCtx) -{ +void func_8009CC00(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - if (0) ; // Necessary to match + if (0) {} // Necessary to match gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6290); @@ -2581,13 +1429,11 @@ void func_8009CC00(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A340[gSaveContext.night_flag])); gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); { s32 pad[2]; } // Necessary to match stack usage @@ -2600,10 +1446,8 @@ void func_8009CC00(GlobalContext* globalCtx) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6320); } -Gfx* Draw_TwoTexScrollPrimColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, - s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, - s32 red, s32 green, s32 blue, s32 alpha) -{ +Gfx* Draw_TwoTexScrollPrimColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, + u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha) { Gfx* displayList = Graph_Alloc(gfxCtx, 10 * sizeof(Gfx)); x1 %= 2048; @@ -2612,20 +1456,17 @@ Gfx* Draw_TwoTexScrollPrimColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y2 %= 2048; gDPTileSync(displayList); - gDPSetTileSize(displayList+1, tile1, x1, y1, - (x1+((width1-1)<<2)), (y1+((height1-1)<<2))); - gDPTileSync(displayList+2); - gDPSetTileSize(displayList+3, tile2, x2, y2, - (x2+((width2-1)<<2)), (y2+((height2-1)<<2))); - gDPSetPrimColor(displayList+4, 0, 0, red, green, blue, alpha); - gSPEndDisplayList(displayList+5); + gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2))); + gDPTileSync(displayList + 2); + gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2))); + gDPSetPrimColor(displayList + 4, 0, 0, red, green, blue, alpha); + gSPEndDisplayList(displayList + 5); return displayList; } // Scene Draw Config 50 -void func_8009CF84(GlobalContext* globalCtx) -{ +void func_8009CF84(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2635,10 +1476,10 @@ void func_8009CF84(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScrollPrimColor(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 0xFF, 0xFF, 0xFF, globalCtx->unk_11D30[0] + 127)); + Draw_TwoTexScrollPrimColor(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, + (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, + (gameplayFrames * 1) % 128, 32, 32, 0xFF, 0xFF, 0xFF, + globalCtx->unk_11D30[0] + 127)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2650,8 +1491,7 @@ void func_8009CF84(GlobalContext* globalCtx) } // Scene Draw Config 41 -void func_8009D0E8(GlobalContext* globalCtx) -{ +void func_8009D0E8(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2661,18 +1501,14 @@ void func_8009D0E8(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TexScroll(globalCtx->state.gfxCtx, - 127 - (gameplayFrames * 4) % 128, 0, 32, 32)); + Draw_TexScroll(globalCtx->state.gfxCtx, 127 - (gameplayFrames * 4) % 128, 0, 32, 32)); gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 5) % 64, 16, 16)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 5) % 64, 16, 16)); gSPSegment(gfxCtx->polyOpa.p++, 0x0A, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, 63 - (gameplayFrames * 2) % 64, 16, 16)); - gSPSegment(gfxCtx->polyXlu.p++, 0x0B, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 127 - (gameplayFrames * 3) % 128, 32, 32, - 1, 0, 0, 32, 32)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, 63 - (gameplayFrames * 2) % 64, 16, 16)); + gSPSegment( + gfxCtx->polyXlu.p++, 0x0B, + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 127 - (gameplayFrames * 3) % 128, 32, 32, 1, 0, 0, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2686,8 +1522,7 @@ void func_8009D0E8(GlobalContext* globalCtx) u32 D_8012A348[] = { 0x02005210, 0x02005010 }; // Scene Draw Config 44 -void func_8009D31C(GlobalContext* globalCtx) -{ +void func_8009D31C(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* gfxArr[4]; s32 pad[2]; @@ -2710,8 +1545,7 @@ u32 D_8012A350[] = { 0x02006550, 0x02003550 }; u32 D_8012A358[] = { 0x02002350, 0x02001350 }; // Scene Draw Config 45 -void func_8009D438(GlobalContext* globalCtx) -{ +void func_8009D438(GlobalContext* globalCtx) { s32 var; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2719,10 +1553,11 @@ void func_8009D438(GlobalContext* globalCtx) gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6560); - if (LINK_IS_ADULT) + if (LINK_IS_ADULT) { var = 1; - else + } else { var = gSaveContext.night_flag; + } gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A358[var])); gSPSegment(gfxCtx->polyOpa.p++, 0x09, SEGMENTED_TO_VIRTUAL(D_8012A350[var])); @@ -2737,8 +1572,7 @@ void func_8009D438(GlobalContext* globalCtx) } // Scene Draw Config 46 -void func_8009D5B4(GlobalContext* globalCtx) -{ +void func_8009D5B4(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2748,12 +1582,10 @@ void func_8009D5B4(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 3) % 128, 32, 32)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 3) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 1023 - (gameplayFrames * 3) % 1024, 16, 256, - 1, 0, 1023 - (gameplayFrames * 6) % 1024, 16, 256)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 1023 - (gameplayFrames * 3) % 1024, 16, 256, 1, 0, + 1023 - (gameplayFrames * 6) % 1024, 16, 256)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2767,13 +1599,12 @@ void func_8009D5B4(GlobalContext* globalCtx) u32 D_8012A360[] = { 0x02014D90, 0x02014590 }; // Scene Draw Config 22 -void func_8009D758(GlobalContext* globalCtx) -{ +void func_8009D758(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - if (0) ; // Necessary to match + if (0) {} // Necessary to match gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6640); @@ -2781,13 +1612,11 @@ void func_8009D758(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A360[gSaveContext.night_flag])); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyOpa.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); { s32 pad[2]; } // Necessary to match stack usage @@ -2803,8 +1632,7 @@ void func_8009D758(GlobalContext* globalCtx) u32 D_8012A368[] = { 0x02018920, 0x02018020 }; // Scene Draw Config 25 -void func_8009D974(GlobalContext* globalCtx) -{ +void func_8009D974(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* gfxArr[4]; s32 pad[2]; @@ -2818,8 +1646,7 @@ void func_8009D974(GlobalContext* globalCtx) } // Scene Draw Config 1 -void func_8009DA30(GlobalContext* globalCtx) -{ +void func_8009DA30(GlobalContext* globalCtx) { u32 gameplayFrames; Gfx* displayListHead; GraphicsContext* gfxCtx; @@ -2832,13 +1659,11 @@ void func_8009DA30(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128, + 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2848,21 +1673,17 @@ void func_8009DA30(GlobalContext* globalCtx) gSPSegment(gfxCtx->polyXlu.p++, 0x0A, displayListHead); - if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC555)) - { + if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC555)) { gSPEndDisplayList(displayListHead); - } - else - { - if (gSaveContext.day_time > 0xC555) - { - if (globalCtx->unk_11D30[0] != 255) + } else { + if (gSaveContext.day_time > 0xC555) { + if (globalCtx->unk_11D30[0] != 255) { Math_ApproxS(&globalCtx->unk_11D30[0], 255, 5); - } - else if (gSaveContext.day_time >= 0x4000) - { - if (globalCtx->unk_11D30[0] != 0) + } + } else if (gSaveContext.day_time >= 0x4000) { + if (globalCtx->unk_11D30[0] != 0) { Math_ApproxS(&globalCtx->unk_11D30[0], 0, 10); + } } gDPSetPrimColor(displayListHead++, 0, 0, 0xFF, 0xFF, 0xFF, globalCtx->unk_11D30[0]); @@ -2876,8 +1697,7 @@ void func_8009DA30(GlobalContext* globalCtx) u32 D_8012A370[] = { 0x02015B50, 0x02016B50 }; // Scene Draw Config 2 -void func_8009DD5C(GlobalContext* globalCtx) -{ +void func_8009DD5C(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* gfxArr[4]; s32 pad[2]; @@ -2897,8 +1717,7 @@ void func_8009DD5C(GlobalContext* globalCtx) } // Scene Draw Config 3 -void func_8009DE78(GlobalContext* globalCtx) -{ +void func_8009DE78(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2908,17 +1727,14 @@ void func_8009DE78(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 6) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 6) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 6) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 6) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2930,8 +1746,7 @@ void func_8009DE78(GlobalContext* globalCtx) } // Scene Draw Config 4 -void func_8009E0B8(GlobalContext* globalCtx) -{ +void func_8009E0B8(GlobalContext* globalCtx) { u32 gameplayFrames; u8 spA3; u16 spA0; @@ -2949,13 +1764,11 @@ void func_8009E0B8(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128, + 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2963,12 +1776,13 @@ void func_8009E0B8(GlobalContext* globalCtx) gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80); - if (gSaveContext.scene_setup_index == 4) + if (gSaveContext.scene_setup_index == 4) { spA3 = 255 - (u8)globalCtx->unk_11D30[0]; - else if (gSaveContext.scene_setup_index == 6) + } else if (gSaveContext.scene_setup_index == 6) { spA0 = globalCtx->unk_11D30[0] + 500; - else if (((gSaveContext.scene_setup_index < 4) || LINK_IS_ADULT) && (gSaveContext.event_chk_inf[0] & 0x80)) + } else if (((gSaveContext.scene_setup_index < 4) || LINK_IS_ADULT) && (gSaveContext.event_chk_inf[0] & 0x80)) { spA0 = 2150; + } gSPSegment(gfxCtx->polyOpa.p++, 0x0A, displayListHead); gDPPipeSync(displayListHead++); @@ -2982,16 +1796,14 @@ void func_8009E0B8(GlobalContext* globalCtx) gSPEndDisplayList(displayListHead); gSPSegment(gfxCtx->polyOpa.p++, 0x0C, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (s16)(-globalCtx->unk_11D30[0] * 0.02f), 32, 16, - 1, 0, (s16)(-globalCtx->unk_11D30[0] * 0.02f), 32, 16)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (s16)(-globalCtx->unk_11D30[0] * 0.02f), 32, 16, 1, 0, + (s16)(-globalCtx->unk_11D30[0] * 0.02f), 32, 16)); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7044); } // Scene Draw Config 5 -void func_8009E54C(GlobalContext* globalCtx) -{ +void func_8009E54C(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -2999,21 +1811,17 @@ void func_8009E54C(GlobalContext* globalCtx) gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7058); - if ((gSaveContext.scene_setup_index > 3) || - (LINK_IS_ADULT && !(gSaveContext.event_chk_inf[6] & 0x200))) + if ((gSaveContext.scene_setup_index > 3) || (LINK_IS_ADULT && !(gSaveContext.event_chk_inf[6] & 0x200))) { globalCtx->unk_11D30[0] = 87; + } gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, gameplayFrames, gameplayFrames, 32, 32, - 1, 0, 0, 32, 32, - 0, 0, 0, globalCtx->unk_11D30[0] + 0xA8)); + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames, gameplayFrames, 32, 32, 1, 0, 0, + 32, 32, 0, 0, 0, globalCtx->unk_11D30[0] + 0xA8)); gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, - 0, -gameplayFrames, -gameplayFrames, 32, 32, - 1, 0, 0, 16, 64, - 0, 0, 0, globalCtx->unk_11D30[0] + 0xA8)); + Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, -gameplayFrames, -gameplayFrames, 32, 32, 1, 0, 0, + 16, 64, 0, 0, 0, globalCtx->unk_11D30[0] + 0xA8)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0xFF, 0xFF, 0xFF, 0x80); @@ -3024,8 +1832,7 @@ void func_8009E54C(GlobalContext* globalCtx) u32 D_8012A378[] = { 0x02008F98, 0x02008FD8 }; // Scene Draw Config 6 -void func_8009E730(GlobalContext* globalCtx) -{ +void func_8009E730(GlobalContext* globalCtx) { u32 gameplayFrames; u32 var; GraphicsContext* gfxCtx; @@ -3036,12 +1843,11 @@ void func_8009E730(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; var = 127 - (gameplayFrames * 1) % 128; - if (LINK_IS_ADULT) + if (LINK_IS_ADULT) { var = 0; + } gSPSegment(gfxCtx->polyOpa.p++, 0x0C, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 0, 64, 32, - 1, 0, var, 64, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 64, 32, 1, 0, var, 64, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -3054,8 +1860,7 @@ void func_8009E730(GlobalContext* globalCtx) } // Scene Draw Config 7 -void func_8009E8C0(GlobalContext* globalCtx) -{ +void func_8009E8C0(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3065,17 +1870,13 @@ void func_8009E8C0(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 1) % 128, 0, 32, 32, - 1, 0, 0, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 128, 0, 32, 32, 1, 0, 0, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 255 - (gameplayFrames * 2) % 256, 64, 64, - 1, 0, 255 - (gameplayFrames * 2) % 256, 64, 64)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 255 - (gameplayFrames * 2) % 256, 64, 64, 1, 0, + 255 - (gameplayFrames * 2) % 256, 64, 64)); gSPSegment(gfxCtx->polyXlu.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 1) % 128, 32, 32, - 1, 0, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 128, 32, 32, 1, 0, + (gameplayFrames * 1) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -3087,8 +1888,7 @@ void func_8009E8C0(GlobalContext* globalCtx) } // Scene Draw Config 8 -void func_8009EAD8(GlobalContext* globalCtx) -{ +void func_8009EAD8(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3098,29 +1898,23 @@ void func_8009EAD8(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 3) % 1024, 32, 256, - 1, 0, (gameplayFrames * 3) % 1024, 32, 256)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 3) % 1024, 32, 256, 1, 0, + (gameplayFrames * 3) % 1024, 32, 256)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 1) % 256, 64, 64, - 1, 0, (gameplayFrames * 1) % 256, 64, 64)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 256, 64, 64, 1, 0, + (gameplayFrames * 1) % 256, 64, 64)); gSPSegment(gfxCtx->polyXlu.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 2) % 128, 32, 32, - 1, 0, (gameplayFrames * 2) % 128, 32, 32)); - gSPSegment(gfxCtx->polyOpa.p++, 0x0B, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 0, 32, 32, - 1, 0, 127 - (gameplayFrames * 3) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 2) % 128, 32, 32, 1, 0, + (gameplayFrames * 2) % 128, 32, 32)); + gSPSegment( + gfxCtx->polyOpa.p++, 0x0B, + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 32, 1, 0, 127 - (gameplayFrames * 3) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x0C, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 1) % 128, 32, 32, - 1, 0, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 128, 32, 32, 1, 0, + (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x0D, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, (gameplayFrames * 1) % 64, 16, 16, - 1, 0, (gameplayFrames * 1) % 64, 16, 16)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 64, 16, 16, 1, 0, + (gameplayFrames * 1) % 64, 16, 16)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -3132,25 +1926,22 @@ void func_8009EAD8(GlobalContext* globalCtx) } // Scene Draw Config 9 -void func_8009EE44(GlobalContext* globalCtx) -{ +void func_8009EE44(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - if (0) ; // Necessary to match + if (0) {} // Necessary to match gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7274); gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, gameplayFrames % 128, 0, 32, 16, - 1, gameplayFrames % 128, 0, 32, 16)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 128, 0, 32, 16, 1, gameplayFrames % 128, + 0, 32, 16)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, gameplayFrames % 128, 32, 32, + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, gameplayFrames % 128, 32, 32, 1, gameplayFrames % 128, gameplayFrames % 128, 32, 32)); gDPPipeSync(gfxCtx->polyXlu.p++); @@ -3159,10 +1950,8 @@ void func_8009EE44(GlobalContext* globalCtx) gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); - if ((globalCtx->unk_11D30[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO)) - { - if (globalCtx->unk_11D30[1] == 50) - { + if ((globalCtx->unk_11D30[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO)) { + if (globalCtx->unk_11D30[1] == 50) { func_8002F7DC(&PLAYER->actor, NA_SE_EV_CHICKEN_CRY_M); globalCtx->unk_11D30[0] = 1; } @@ -3173,8 +1962,7 @@ void func_8009EE44(GlobalContext* globalCtx) } // Scene Draw Config 10 -void func_8009F074(GlobalContext* globalCtx) -{ +void func_8009F074(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3184,9 +1972,7 @@ void func_8009F074(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 0, 32, 32, - 1, 0, 127 - gameplayFrames % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 32, 1, 0, 127 - gameplayFrames % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -3200,8 +1986,7 @@ void func_8009F074(GlobalContext* globalCtx) u32 D_8012A380[] = { 0x02009678, 0x0200DE78 }; // Scene Draw Config 11 -void func_8009F1B4(GlobalContext* globalCtx) -{ +void func_8009F1B4(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* gfxArr[4]; s32 pad[2]; @@ -3215,8 +2000,7 @@ void func_8009F1B4(GlobalContext* globalCtx) } // Scene Draw Config 12 -void func_8009F270(GlobalContext* globalCtx) -{ +void func_8009F270(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3226,13 +2010,11 @@ void func_8009F270(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, gameplayFrames % 128, 32, 32, - 1, 0, gameplayFrames % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, gameplayFrames % 128, 32, 32, 1, 0, + gameplayFrames % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, gameplayFrames % 128, 32, 32, - 1, 0, gameplayFrames % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, gameplayFrames % 128, 32, 32, 1, 0, + gameplayFrames % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -3244,8 +2026,7 @@ void func_8009F270(GlobalContext* globalCtx) } // Scene Draw Config 13 -void func_8009F40C(GlobalContext* globalCtx) -{ +void func_8009F40C(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3255,13 +2036,11 @@ void func_8009F40C(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128, + 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -3273,8 +2052,7 @@ void func_8009F40C(GlobalContext* globalCtx) } // Scene Draw Config 14 -void func_8009F5D4(GlobalContext* globalCtx) -{ +void func_8009F5D4(GlobalContext* globalCtx) { Gfx* displayListHead; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3286,21 +2064,17 @@ void func_8009F5D4(GlobalContext* globalCtx) gSPSegment(gfxCtx->polyXlu.p++, 0x08, displayListHead); - if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC000)) - { + if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC000)) { gSPEndDisplayList(displayListHead); - } - else - { - if (gSaveContext.day_time > 0xC000) - { - if (globalCtx->unk_11D30[0] != 255) + } else { + if (gSaveContext.day_time > 0xC000) { + if (globalCtx->unk_11D30[0] != 255) { Math_ApproxS(&globalCtx->unk_11D30[0], 255, 5); - } - else if (gSaveContext.day_time >= 0x4000) - { - if (globalCtx->unk_11D30[0] != 0) + } + } else if (gSaveContext.day_time >= 0x4000) { + if (globalCtx->unk_11D30[0] != 0) { Math_ApproxS(&globalCtx->unk_11D30[0], 0, 10); + } } gDPSetPrimColor(displayListHead++, 0, 0, 0xFF, 0xFF, 0xFF, globalCtx->unk_11D30[0]); @@ -3318,8 +2092,7 @@ void func_8009F5D4(GlobalContext* globalCtx) } // Scene Draw Config 15 -void func_8009F7D4(GlobalContext* globalCtx) -{ +void func_8009F7D4(GlobalContext* globalCtx) { s8 sp6F; s8 sp6E; u32 gameplayFrames; @@ -3337,9 +2110,8 @@ void func_8009F7D4(GlobalContext* globalCtx) sp6E = (sp6E >> 1) + 192; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, gameplayFrames % 128, 32, 32, - 1, 0, gameplayFrames % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, gameplayFrames % 128, 32, 32, 1, 0, + gameplayFrames % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, sp6F, sp6E, 0xFF, 0x80); @@ -3353,8 +2125,7 @@ void func_8009F7D4(GlobalContext* globalCtx) u32 D_8012A388[] = { 0x02009808, 0x02008FC8 }; // Scene Draw Config 16 -void func_8009F9D0(GlobalContext* globalCtx) -{ +void func_8009F9D0(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3364,9 +2135,8 @@ void func_8009F9D0(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 127 - gameplayFrames % 128, 32, 32, - 1, gameplayFrames % 128, 0, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 127 - gameplayFrames % 128, 32, 32, 1, + gameplayFrames % 128, 0, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -3384,8 +2154,7 @@ void func_8009F9D0(GlobalContext* globalCtx) u32 D_8012A390[] = { 0x020081E0, 0x0200FBE0 }; // Scene Draw Config 17 -void func_8009FB74(GlobalContext* globalCtx) -{ +void func_8009FB74(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* gfxArr[4]; s32 pad[2]; @@ -3405,8 +2174,7 @@ void func_8009FB74(GlobalContext* globalCtx) } // Scene Draw Config 18 -void func_8009FC90(GlobalContext* globalCtx) -{ +void func_8009FC90(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3416,13 +2184,12 @@ void func_8009FC90(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 127 - gameplayFrames % 128, 32, 32, - 1, 127 - gameplayFrames % 128, 0, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 127 - gameplayFrames % 128, 32, 32, 1, + 127 - gameplayFrames % 128, 0, 32, 32)); gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 3) % 128, 127 - (gameplayFrames * 6) % 128, 32, 32, - 1, (gameplayFrames * 6) % 128, 127 - (gameplayFrames * 3) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 3) % 128, + 127 - (gameplayFrames * 6) % 128, 32, 32, 1, (gameplayFrames * 6) % 128, + 127 - (gameplayFrames * 3) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x40); @@ -3438,8 +2205,7 @@ f32 D_8012A398 = 0.0f; // Scene Draw Config 21 #ifdef NON_MATCHING // regalloc differences and single equivalent instruction difference -void func_8009FE58(GlobalContext* globalCtx) -{ +void func_8009FE58(GlobalContext* globalCtx) { static s16 D_8012A39C = 538; static s16 D_8012A3A0 = 4272; u32 gameplayFrames; @@ -3451,22 +2217,17 @@ void func_8009FE58(GlobalContext* globalCtx) func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7712); gameplayFrames = globalCtx->gameplayFrames; - if (globalCtx->sceneNum == SCENE_BDAN) - { + if (globalCtx->sceneNum == SCENE_BDAN) { gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, gameplayFrames % 128, (gameplayFrames * 2) % 128, 32, 32, - 1, 127 - gameplayFrames % 128, (gameplayFrames * 2) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 128, (gameplayFrames * 2) % 128, 32, + 32, 1, 127 - gameplayFrames % 128, (gameplayFrames * 2) % 128, 32, 32)); gSPSegment(gfxCtx->polyOpa.p++, 0x0B, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 0, 255 - (gameplayFrames * 4) % 256, 32, 64, - 1, 0, 255 - (gameplayFrames * 4) % 256, 32, 64)); - } - else - { + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 255 - (gameplayFrames * 4) % 256, 32, 64, 1, 0, + 255 - (gameplayFrames * 4) % 256, 32, 64)); + } else { gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TexScroll(globalCtx->state.gfxCtx, - (127 - (gameplayFrames * 1)) % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TexScroll(globalCtx->state.gfxCtx, (127 - (gameplayFrames * 1)) % 128, + (gameplayFrames * 1) % 128, 32, 32)); } gDPPipeSync(gfxCtx->polyOpa.p++); @@ -3475,43 +2236,32 @@ void func_8009FE58(GlobalContext* globalCtx) gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80); - if (func_800C0D28(globalCtx) != 1) - { + if (func_800C0D28(globalCtx) != 1) { D_8012A39C += 1820; D_8012A3A0 += 1820; temp = 0.020000001f; - func_800AA76C(&globalCtx->view, - Math_Coss(D_8012A39C) * (0.00009587531f * temp), - Math_Sins(D_8012A39C) * (0.00009587531f * temp), - Math_Sins(D_8012A3A0) * (0.00009587531f * temp)); - func_800AA78C(&globalCtx->view, - 1.0f + (Math_Sins(D_8012A3A0) * (0.79999995f * temp)), + func_800AA76C(&globalCtx->view, Math_Coss(D_8012A39C) * (0.00009587531f * temp), + Math_Sins(D_8012A39C) * (0.00009587531f * temp), Math_Sins(D_8012A3A0) * (0.00009587531f * temp)); + func_800AA78C(&globalCtx->view, 1.0f + (Math_Sins(D_8012A3A0) * (0.79999995f * temp)), 1.0f + (Math_Coss(D_8012A3A0) * (0.39999998f * temp)), 1.0f + (Math_Coss(D_8012A39C) * (1 * temp))); func_800AA7AC(&globalCtx->view, 0.95f); - switch (globalCtx->unk_11D30[0]) - { + switch (globalCtx->unk_11D30[0]) { case 0: break; case 1: - if (globalCtx->unk_11D30[1] < 1200) - { + if (globalCtx->unk_11D30[1] < 1200) { globalCtx->unk_11D30[1] += 200; - } - else - { + } else { globalCtx->unk_11D30[0]++; } break; case 2: - if (globalCtx->unk_11D30[1] > 0) - { + if (globalCtx->unk_11D30[1] > 0) { globalCtx->unk_11D30[1] -= 30; - } - else - { + } else { globalCtx->unk_11D30[1] = 0; globalCtx->unk_11D30[0] = 0; } @@ -3538,8 +2288,7 @@ void func_8009FE58(GlobalContext* globalCtx); #endif // Scene Draw Config 26 -void func_800A0334(GlobalContext* globalCtx) -{ +void func_800A0334(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3549,17 +2298,14 @@ void func_800A0334(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyXlu.p++, 0x08, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 512, 32, 128, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 512, 32, 128)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 512, 32, + 128, 1, gameplayFrames % 128, (gameplayFrames * 1) % 512, 32, 128)); gSPSegment(gfxCtx->polyXlu.p++, 0x09, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gSPSegment(gfxCtx->polyOpa.p++, 0x0A, - Draw_TwoTexScroll(globalCtx->state.gfxCtx, - 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, - 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, + 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -3571,20 +2317,17 @@ void func_800A0334(GlobalContext* globalCtx) } // Scene Draw Config 52 -void func_800A055C(GlobalContext* globalCtx) -{ +void func_800A055C(GlobalContext* globalCtx) { func_8009BEEC(globalCtx); } // Scene Draw Config 51 -void func_800A057C(GlobalContext* globalCtx) -{ +void func_800A057C(GlobalContext* globalCtx) { func_8009BEEC(globalCtx); } // Scene Draw Config 49 -void func_800A059C(GlobalContext* globalCtx) -{ +void func_800A059C(GlobalContext* globalCtx) { u32 gameplayFrames; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; @@ -3594,11 +2337,9 @@ void func_800A059C(GlobalContext* globalCtx) gameplayFrames = globalCtx->gameplayFrames; gSPSegment(gfxCtx->polyOpa.p++, 0x08, - Draw_TexScroll(globalCtx->state.gfxCtx, - 127 - (gameplayFrames * 2) % 128, 0, 32, 64)); + Draw_TexScroll(globalCtx->state.gfxCtx, 127 - (gameplayFrames * 2) % 128, 0, 32, 64)); gSPSegment(gfxCtx->polyOpa.p++, 0x09, - Draw_TexScroll(globalCtx->state.gfxCtx, - 0, (gameplayFrames * 2) % 512, 128, 128)); + Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 512, 128, 128)); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -3609,72 +2350,23 @@ void func_800A059C(GlobalContext* globalCtx) func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7910); } -void (*sSceneDrawHandlers[])(GlobalContext*) = -{ - func_80099550, - func_8009DA30, - func_8009DD5C, - func_8009DE78, - func_8009E0B8, - func_8009E54C, - func_8009E730, - func_8009E8C0, - func_8009EAD8, - func_8009EE44, - func_8009F074, - func_8009F1B4, - func_8009F270, - func_8009F40C, - func_8009F5D4, - func_8009F7D4, - func_8009F9D0, - func_8009FB74, - func_8009FC90, - func_800995DC, - func_80099878, - func_8009FE58, - func_8009D758, - func_8009B0FC, - func_8009AE30, - func_8009D974, - func_800A0334, - func_8009CC00, - func_80099760, - func_8009B86C, - func_80099BD8, - func_8009A45C, - func_8009A798, - func_8009A9DC, - func_8009B9BC, - func_8009BAA4, - func_8009BC44, - func_8009C3EC, - func_8009C0AC, - func_8009ACA8, - func_8009AFE0, - func_8009D0E8, - func_8009C608, - func_8009C8B8, - func_8009D31C, - func_8009D438, - func_8009D5B4, - func_8009CAC0, - func_8009AB98, - func_800A059C, - func_8009CF84, - func_800A057C, - func_800A055C, +void (*sSceneDrawHandlers[])(GlobalContext*) = { + func_80099550, func_8009DA30, func_8009DD5C, func_8009DE78, func_8009E0B8, func_8009E54C, func_8009E730, + func_8009E8C0, func_8009EAD8, func_8009EE44, func_8009F074, func_8009F1B4, func_8009F270, func_8009F40C, + func_8009F5D4, func_8009F7D4, func_8009F9D0, func_8009FB74, func_8009FC90, func_800995DC, func_80099878, + func_8009FE58, func_8009D758, func_8009B0FC, func_8009AE30, func_8009D974, func_800A0334, func_8009CC00, + func_80099760, func_8009B86C, func_80099BD8, func_8009A45C, func_8009A798, func_8009A9DC, func_8009B9BC, + func_8009BAA4, func_8009BC44, func_8009C3EC, func_8009C0AC, func_8009ACA8, func_8009AFE0, func_8009D0E8, + func_8009C608, func_8009C8B8, func_8009D31C, func_8009D438, func_8009D5B4, func_8009CAC0, func_8009AB98, + func_800A059C, func_8009CF84, func_800A057C, func_800A055C, }; -void Scene_Draw(GlobalContext* globalCtx) -{ +void Scene_Draw(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - if (HREG(80) == 0x11) - { - if (HREG(95) != 0x11) - { + if (HREG(80) == 0x11) { + if (HREG(95) != 0x11) { HREG(95) = 0x11; HREG(81) = 1; HREG(82) = 1; @@ -3694,17 +2386,17 @@ void Scene_Draw(GlobalContext* globalCtx) gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 8104); - if (HREG(81) == 1) - { + if (HREG(81) == 1) { gSPDisplayList(gfxCtx->polyOpa.p++, sDefaultDisplayList); gSPDisplayList(gfxCtx->polyXlu.p++, sDefaultDisplayList); } func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 8109); - if (HREG(82) == 1) + if (HREG(82) == 1) { sSceneDrawHandlers[globalCtx->sceneConfig](globalCtx); - } - else + } + } else { sSceneDrawHandlers[globalCtx->sceneConfig](globalCtx); + } } diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 9b51b29cbb..d43e77dfee 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -174,4 +174,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_skelanime/func_800A56F0.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_skelanime/func_800A5774.s") - diff --git a/src/code/z_skin.c b/src/code/z_skin.c index 617a633c13..ca907bb17e 100644 --- a/src/code/z_skin.c +++ b/src/code/z_skin.c @@ -20,4 +20,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_skin/func_800A63CC.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_skin/func_800A6408.s") - diff --git a/src/code/z_skin_awb.c b/src/code/z_skin_awb.c index aaffdcadb9..4e4530025f 100644 --- a/src/code/z_skin_awb.c +++ b/src/code/z_skin_awb.c @@ -10,4 +10,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_awb/func_800A698C.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_awb/func_800A6AC4.s") - diff --git a/src/code/z_skin_matrix.c b/src/code/z_skin_matrix.c index 2c7a215fe7..27d703f301 100644 --- a/src/code/z_skin_matrix.c +++ b/src/code/z_skin_matrix.c @@ -40,4 +40,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_matrix/func_800A7EC0.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_matrix/func_800A8030.s") - diff --git a/src/code/z_sram.c b/src/code/z_sram.c index dd9578f0ee..0f2bcaa64f 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -24,4 +24,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_sram/func_800A9CD4.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_sram/func_800A9D28.s") - diff --git a/src/code/z_view.c b/src/code/z_view.c index 84eb4770d2..defbbb8cfb 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -60,4 +60,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AB9EC.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800ABE74.s") - diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c index e15d619ac5..1fa3ba4521 100644 --- a/src/code/z_vimode.c +++ b/src/code/z_vimode.c @@ -16,4 +16,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_vimode/func_800ACA98.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_vimode/func_800ACAF8.s") - diff --git a/src/code/z_vismono.c b/src/code/z_vismono.c index 75956af41a..239e81ce06 100644 --- a/src/code/z_vismono.c +++ b/src/code/z_vismono.c @@ -12,4 +12,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_vismono/func_800AD5C0.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_vismono/func_800AD870.s") - diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index c468b4b299..8008c6aca7 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -12,4 +12,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box/func_800AF218.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box/func_800B0E50.s") - diff --git a/src/code/z_vr_box_draw.c b/src/code/z_vr_box_draw.c index 6af1a46ea1..4161c46157 100644 --- a/src/code/z_vr_box_draw.c +++ b/src/code/z_vr_box_draw.c @@ -6,4 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box_draw/func_800B10C4.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box_draw/func_800B1744.s") - diff --git a/src/libultra_boot_O1/__osDequeueThread.c b/src/libultra_boot_O1/__osDequeueThread.c index 8c6e493f24..50b6aeeff8 100644 --- a/src/libultra_boot_O1/__osDequeueThread.c +++ b/src/libultra_boot_O1/__osDequeueThread.c @@ -1,19 +1,16 @@ #include -void __osDequeueThread(OSThread **queue, OSThread *thread) -{ - register OSThread **a2; - register OSThread *a3; +void __osDequeueThread(OSThread** queue, OSThread* thread) { + register OSThread** a2; + register OSThread* a3; a2 = queue; a3 = *a2; - while (a3 != NULL) - { - if (a3 == thread) - { + while (a3 != NULL) { + if (a3 == thread) { *a2 = thread->next; return; } a2 = &a3->next; a3 = *a2; } -} \ No newline at end of file +} diff --git a/src/libultra_boot_O1/__osGetHWIntrRoutine.c b/src/libultra_boot_O1/__osGetHWIntrRoutine.c index ae01749be1..a9b633adb4 100644 --- a/src/libultra_boot_O1/__osGetHWIntrRoutine.c +++ b/src/libultra_boot_O1/__osGetHWIntrRoutine.c @@ -1,7 +1,6 @@ #include -void __osGetHWIntrRoutine(s32 idx, OSMesgQueue** outQueue, OSMesg* outMsg) -{ +void __osGetHWIntrRoutine(s32 idx, OSMesgQueue** outQueue, OSMesg* outMsg) { *outQueue = __osHwIntTable[idx].queue; *outMsg = __osHwIntTable[idx].msg; } diff --git a/src/libultra_boot_O1/__osResetGlobalIntMask.c b/src/libultra_boot_O1/__osResetGlobalIntMask.c index b89026781f..9479289fb1 100644 --- a/src/libultra_boot_O1/__osResetGlobalIntMask.c +++ b/src/libultra_boot_O1/__osResetGlobalIntMask.c @@ -1,10 +1,9 @@ #include -void __osResetGlobalIntMask(u32 mask) -{ +void __osResetGlobalIntMask(u32 mask) { register s32 prevInt; prevInt = __osDisableInt(); __OSGlobalIntMask &= ~(mask & ~0x401); __osRestoreInt(prevInt); -} \ No newline at end of file +} diff --git a/src/libultra_boot_O1/__osSetGlobalIntMask.c b/src/libultra_boot_O1/__osSetGlobalIntMask.c index cccce7a842..15200ac55e 100644 --- a/src/libultra_boot_O1/__osSetGlobalIntMask.c +++ b/src/libultra_boot_O1/__osSetGlobalIntMask.c @@ -1,10 +1,9 @@ #include -void __osSetGlobalIntMask(u32 mask) -{ +void __osSetGlobalIntMask(u32 mask) { register s32 prevInt; prevInt = __osDisableInt(); __OSGlobalIntMask |= mask; __osRestoreInt(prevInt); -} \ No newline at end of file +} diff --git a/src/libultra_boot_O1/__osSetHWIntrRoutine.c b/src/libultra_boot_O1/__osSetHWIntrRoutine.c index a2def2038d..48f5a85dbb 100644 --- a/src/libultra_boot_O1/__osSetHWIntrRoutine.c +++ b/src/libultra_boot_O1/__osSetHWIntrRoutine.c @@ -1,7 +1,6 @@ #include -void __osSetHWIntrRoutine(s32 idx, OSMesgQueue* queue, OSMesg msg) -{ +void __osSetHWIntrRoutine(s32 idx, OSMesgQueue* queue, OSMesg msg) { register int prevInt; prevInt = __osDisableInt(); diff --git a/src/libultra_boot_O1/initialize.c b/src/libultra_boot_O1/initialize.c index f3f8117c71..903a9212aa 100644 --- a/src/libultra_boot_O1/initialize.c +++ b/src/libultra_boot_O1/initialize.c @@ -1,12 +1,11 @@ #include #include -typedef struct -{ - u32 ins_00; //lui k0, 0x8000 - u32 ins_04; //addiu k0, k0, 0x39e0 - u32 ins_08; //jr k0 ; __osException - u32 ins_0C; //nop +typedef struct { + u32 ins_00; // lui k0, 0x8000 + u32 ins_04; // addiu k0, k0, 0x39e0 + u32 ins_08; // jr k0 ; __osException + u32 ins_0C; // nop } struct_exceptionPreamble; u64 osClockRate = 62500000; @@ -16,14 +15,13 @@ u32 __OSGlobalIntMask = 0x003FFF01; u32 D_800145C0; -void __createSpeedParam(void) -{ +void __createSpeedParam(void) { __Dom1SpeedParam.type = DEVICE_TYPE_INIT; __Dom1SpeedParam.latency = HW_REG(PI_BSD_DOM1_LAT_REG, u32); __Dom1SpeedParam.pulse = HW_REG(PI_BSD_DOM1_PWD_REG, u32); __Dom1SpeedParam.pageSize = HW_REG(PI_BSD_DOM1_PGS_REG, u32); __Dom1SpeedParam.relDuration = HW_REG(PI_BSD_DOM1_RLS_REG, u32); - + __Dom2SpeedParam.type = DEVICE_TYPE_INIT; __Dom2SpeedParam.latency = HW_REG(PI_BSD_DOM2_LAT_REG, u32); __Dom2SpeedParam.pulse = HW_REG(PI_BSD_DOM2_PWD_REG, u32); @@ -31,25 +29,26 @@ void __createSpeedParam(void) __Dom2SpeedParam.relDuration = HW_REG(PI_BSD_DOM2_RLS_REG, u32); } -void __osInitialize_common(void) -{ +void __osInitialize_common(void) { u32 sp2C; D_800145C0 = 1; __osSetSR(__osGetSR() | 0x20000000); __osSetFpcCsr(0x1000800); __osSetWatchLo(0x4900000); - - while (__osSiRawReadIo((void*)0x1fc007fc, &sp2C)) - ; - while (__osSiRawWriteIo((void*)0x1fc007fc, sp2C | 8)) + while (__osSiRawReadIo((void*)0x1fc007fc, &sp2C)) { ; - - *(struct_exceptionPreamble*)0x80000000 = *(struct_exceptionPreamble*)__osExceptionPreamble; //TLB miss - *(struct_exceptionPreamble*)0x80000080 = *(struct_exceptionPreamble*)__osExceptionPreamble; //XTLB miss - *(struct_exceptionPreamble*)0x80000100 = *(struct_exceptionPreamble*)__osExceptionPreamble; //cache errors - *(struct_exceptionPreamble*)0x80000180 = *(struct_exceptionPreamble*)__osExceptionPreamble; //general exceptions + } + + while (__osSiRawWriteIo((void*)0x1fc007fc, sp2C | 8)) { + ; + } + + *(struct_exceptionPreamble*)0x80000000 = *(struct_exceptionPreamble*)__osExceptionPreamble; // TLB miss + *(struct_exceptionPreamble*)0x80000080 = *(struct_exceptionPreamble*)__osExceptionPreamble; // XTLB miss + *(struct_exceptionPreamble*)0x80000100 = *(struct_exceptionPreamble*)__osExceptionPreamble; // cache errors + *(struct_exceptionPreamble*)0x80000180 = *(struct_exceptionPreamble*)__osExceptionPreamble; // general exceptions osWritebackDCache(0x80000000, 0x190); osInvalICache(0x80000000, 0x190); @@ -59,25 +58,28 @@ void __osInitialize_common(void) osClockRate = (u64)((osClockRate * 3ll) / 4ull); - if (!osResetType) + if (!osResetType) { bzero(osAppNmiBuffer, 0x40); + } - if (osTvType == 0) + if (osTvType == 0) { osViClock = VI_PAL_CLOCK; - else if (osTvType == 2) + } else if (osTvType == 2) { osViClock = VI_MPAL_CLOCK; - else + } else { osViClock = VI_NTSC_CLOCK; + } - if (__osGetCause() & 0x1000) - while (true) + if (__osGetCause() & 0x1000) { + while (true) { ; + } + } HW_REG(AI_CONTROL_REG, u32) = 1; HW_REG(AI_DACRATE_REG, u32) = 0x3fff; HW_REG(AI_BITRATE_REG, u32) = 0xf; } -void __osInitialize_autodetect() -{ +void __osInitialize_autodetect() { } diff --git a/src/libultra_boot_O1/osCreateMesgQueue.c b/src/libultra_boot_O1/osCreateMesgQueue.c index 3f5ccb4b73..3282c16ffe 100644 --- a/src/libultra_boot_O1/osCreateMesgQueue.c +++ b/src/libultra_boot_O1/osCreateMesgQueue.c @@ -1,7 +1,6 @@ #include -void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count) -{ +void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count) { mq->mtqueue = __osThreadTail; mq->fullqueue = __osThreadTail; mq->validCount = 0; diff --git a/src/libultra_boot_O1/osCreateThread.c b/src/libultra_boot_O1/osCreateThread.c index d46cf33353..d62f0c2cc6 100644 --- a/src/libultra_boot_O1/osCreateThread.c +++ b/src/libultra_boot_O1/osCreateThread.c @@ -1,13 +1,12 @@ #include OSThread* __osThreadTail[2] = { NULL, (OSThread*)-1 }; -OSThread *__osRunQueue = __osThreadTail; -OSThread *__osActiveQueue = __osThreadTail; -OSThread *__osRunningThread = NULL; +OSThread* __osRunQueue = __osThreadTail; +OSThread* __osActiveQueue = __osThreadTail; +OSThread* __osRunningThread = NULL; OSThread* __osFaultedThread = NULL; -void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri) -{ +void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri) { register u32 s0; u32 t8; diff --git a/src/libultra_boot_O1/osDestroyThread.c b/src/libultra_boot_O1/osDestroyThread.c index d5ad074d18..5fa3186647 100644 --- a/src/libultra_boot_O1/osDestroyThread.c +++ b/src/libultra_boot_O1/osDestroyThread.c @@ -1,30 +1,27 @@ #include -void osDestroyThread(OSThread *thread) -{ +void osDestroyThread(OSThread* thread) { register s32 int_disabled; - - register OSThread *s1; - register OSThread *s2; + + register OSThread* s1; + register OSThread* s2; int_disabled = __osDisableInt(); - if (thread == NULL) + if (thread == NULL) { thread = __osRunningThread; - else if (thread->state != OS_STATE_STOPPED) + } else if (thread->state != OS_STATE_STOPPED) { __osDequeueThread(thread->queue, thread); + } - if (__osActiveQueue == thread) + if (__osActiveQueue == thread) { __osActiveQueue = __osActiveQueue->tlnext; - else - { + } else { s1 = __osActiveQueue; - while (s1->priority != -1) - { + while (s1->priority != -1) { s2 = s1->tlnext; - if (s2 == thread) - { + if (s2 == thread) { s1->tlnext = thread->tlnext; break; } @@ -32,8 +29,9 @@ void osDestroyThread(OSThread *thread) } } - if (thread == __osRunningThread) + if (thread == __osRunningThread) { __osDispatchThread(); + } __osRestoreInt(int_disabled); } diff --git a/src/libultra_boot_O1/osGetMemSize.c b/src/libultra_boot_O1/osGetMemSize.c index dba9d90f72..f1f175224a 100644 --- a/src/libultra_boot_O1/osGetMemSize.c +++ b/src/libultra_boot_O1/osGetMemSize.c @@ -2,8 +2,7 @@ #define STEP 0x100000 -u32 osGetMemSize(void) -{ +u32 osGetMemSize(void) { u32* ptr; u32 size; u32 data0; @@ -11,21 +10,21 @@ u32 osGetMemSize(void) size = 0x400000; - while(size < 0x800000) - { + while (size < 0x800000) { ptr = (u32*)(0xA0000000 + size); data0 = *ptr; - data1 = ptr[STEP/4-1]; + data1 = ptr[STEP / 4 - 1]; *ptr ^= ~0; - ptr[STEP/4-1] ^= ~0; + ptr[STEP / 4 - 1] ^= ~0; - if ((*ptr != (data0 ^ ~0)) || (ptr[STEP/4-1] != (data1 ^ ~0))) + if ((*ptr != (data0 ^ ~0)) || (ptr[STEP / 4 - 1] != (data1 ^ ~0))) { return size; + } *ptr = data0; - ptr[STEP/4-1] = data1; + ptr[STEP / 4 - 1] = data1; size += STEP; } diff --git a/src/libultra_boot_O1/osGetThreadId.c b/src/libultra_boot_O1/osGetThreadId.c index 9a0ca9dce8..5c2dd5d092 100644 --- a/src/libultra_boot_O1/osGetThreadId.c +++ b/src/libultra_boot_O1/osGetThreadId.c @@ -1,9 +1,9 @@ #include -OSId osGetThreadId(OSThread* thread) -{ - if (thread == NULL) +OSId osGetThreadId(OSThread* thread) { + if (thread == NULL) { thread = __osRunningThread; + } return thread->id; } diff --git a/src/libultra_boot_O1/osGetThreadPri.c b/src/libultra_boot_O1/osGetThreadPri.c index 4d8f97f6e7..d6a7c91607 100644 --- a/src/libultra_boot_O1/osGetThreadPri.c +++ b/src/libultra_boot_O1/osGetThreadPri.c @@ -1,9 +1,9 @@ #include -OSPri osGetThreadPri(OSThread* thread) -{ - if (thread == NULL) +OSPri osGetThreadPri(OSThread* thread) { + if (thread == NULL) { thread = __osRunningThread; + } return thread->priority; } diff --git a/src/libultra_boot_O1/osGetTime.c b/src/libultra_boot_O1/osGetTime.c index a2fd07510e..9cf6e53079 100644 --- a/src/libultra_boot_O1/osGetTime.c +++ b/src/libultra_boot_O1/osGetTime.c @@ -1,7 +1,6 @@ #include -OSTime osGetTime(void) -{ +OSTime osGetTime(void) { u32 sp34; u32 sp30; u64 t1; diff --git a/src/libultra_boot_O1/osJamMesg.c b/src/libultra_boot_O1/osJamMesg.c index 47c7390a89..87c49979d2 100644 --- a/src/libultra_boot_O1/osJamMesg.c +++ b/src/libultra_boot_O1/osJamMesg.c @@ -1,6 +1,6 @@ #include -s32 osJamMesg(OSMesgQueue *mq, OSMesg msg, s32 flag) { +s32 osJamMesg(OSMesgQueue* mq, OSMesg msg, s32 flag) { register s32 int_disabled; int_disabled = __osDisableInt(); while (mq->validCount >= mq->msgCount) { diff --git a/src/libultra_boot_O1/osRecvMesg.c b/src/libultra_boot_O1/osRecvMesg.c index 7f78cbd27f..f49716cd63 100644 --- a/src/libultra_boot_O1/osRecvMesg.c +++ b/src/libultra_boot_O1/osRecvMesg.c @@ -1,13 +1,10 @@ #include -s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag) -{ +s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag) { register s32 s0 = __osDisableInt(); - while (mq->validCount == 0) - { - if (flag == OS_MESG_NOBLOCK) - { + while (mq->validCount == 0) { + if (flag == OS_MESG_NOBLOCK) { __osRestoreInt(s0); return -1; } @@ -15,14 +12,16 @@ s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag) __osEnqueueAndYield(mq); } - if (msg != NULL) + if (msg != NULL) { *msg = mq->msg[mq->first]; + } mq->first = (mq->first + 1) % mq->msgCount; mq->validCount--; - if (mq->fullqueue->next != NULL) + if (mq->fullqueue->next != NULL) { osStartThread(__osPopThread(&mq->fullqueue)); + } __osRestoreInt(s0); diff --git a/src/libultra_boot_O1/osSendMesg.c b/src/libultra_boot_O1/osSendMesg.c index 0355f08ff4..53b9147546 100644 --- a/src/libultra_boot_O1/osSendMesg.c +++ b/src/libultra_boot_O1/osSendMesg.c @@ -1,19 +1,14 @@ #include -s32 osSendMesg(OSMesgQueue* mq, OSMesg mesg, s32 flag) -{ +s32 osSendMesg(OSMesgQueue* mq, OSMesg mesg, s32 flag) { register u32 s0 = __osDisableInt(); register u32 index; - while (mq->validCount >= mq->msgCount) - { - if (flag == OS_MESG_BLOCK) - { + while (mq->validCount >= mq->msgCount) { + if (flag == OS_MESG_BLOCK) { __osRunningThread->state = 8; __osEnqueueAndYield(&mq->fullqueue); - } - else - { + } else { __osRestoreInt(s0); return -1; } @@ -23,8 +18,9 @@ s32 osSendMesg(OSMesgQueue* mq, OSMesg mesg, s32 flag) mq->msg[index] = mesg; mq->validCount++; - if (mq->mtqueue->next != NULL) + if (mq->mtqueue->next != NULL) { osStartThread(__osPopThread(&mq->mtqueue)); + } __osRestoreInt(s0); diff --git a/src/libultra_boot_O1/osSetEventMesg.c b/src/libultra_boot_O1/osSetEventMesg.c index a40a50a2e3..97123969de 100644 --- a/src/libultra_boot_O1/osSetEventMesg.c +++ b/src/libultra_boot_O1/osSetEventMesg.c @@ -4,23 +4,21 @@ __OSEventState __osEventStateTab[16]; u32 __osPreNMI = 0; -void osSetEventMesg(OSEvent e, OSMesgQueue *mq, OSMesg msg) -{ +void osSetEventMesg(OSEvent e, OSMesgQueue* mq, OSMesg msg) { register u32 int_disabled; - __OSEventState *msgs; - + __OSEventState* msgs; + int_disabled = __osDisableInt(); msgs = __osEventStateTab + e; msgs->queue = mq; msgs->msg = msg; - if (e == OS_EVENT_PRENMI) - { - if (__osShutdown && !__osPreNMI) + if (e == OS_EVENT_PRENMI) { + if (__osShutdown && !__osPreNMI) { osSendMesg(mq, msg, 0); + } __osPreNMI = true; } __osRestoreInt(int_disabled); - } diff --git a/src/libultra_boot_O1/osSetThreadPri.c b/src/libultra_boot_O1/osSetThreadPri.c index 158eb3a63e..483488e507 100644 --- a/src/libultra_boot_O1/osSetThreadPri.c +++ b/src/libultra_boot_O1/osSetThreadPri.c @@ -1,22 +1,19 @@ #include -void osSetThreadPri(OSThread* thread, OSPri pri) -{ +void osSetThreadPri(OSThread* thread, OSPri pri) { register u32 s0 = __osDisableInt(); - if (thread == NULL) + if (thread == NULL) { thread = __osRunningThread; + } - if (thread->priority != pri) - { + if (thread->priority != pri) { thread->priority = pri; - if (thread != __osRunningThread && thread->state != 1) - { + if (thread != __osRunningThread && thread->state != 1) { __osDequeueThread(thread->queue, thread); __osEnqueueThread(thread->queue, thread); } - if (__osRunningThread->priority < __osRunQueue->priority) - { + if (__osRunningThread->priority < __osRunQueue->priority) { __osRunningThread->state = 2; __osEnqueueAndYield(&__osRunQueue); } diff --git a/src/libultra_boot_O1/osStartThread.c b/src/libultra_boot_O1/osStartThread.c index bbb514e3e4..f64fa902d9 100644 --- a/src/libultra_boot_O1/osStartThread.c +++ b/src/libultra_boot_O1/osStartThread.c @@ -1,38 +1,29 @@ #include -void osStartThread(OSThread* thread) -{ +void osStartThread(OSThread* thread) { register u32 s0 = __osDisableInt(); - switch (thread->state) - { - case 8: - thread->state = 2; - __osEnqueueThread(&__osRunQueue, thread); - break; - case 1: - if (thread->queue == NULL || thread->queue == &__osRunQueue) - { + switch (thread->state) { + case 8: thread->state = 2; __osEnqueueThread(&__osRunQueue, thread); - } - else - { - thread->state = 8; - __osEnqueueThread(thread->queue, thread); - __osEnqueueThread(&__osRunQueue, __osPopThread(thread->queue)); - } - break; + break; + case 1: + if (thread->queue == NULL || thread->queue == &__osRunQueue) { + thread->state = 2; + __osEnqueueThread(&__osRunQueue, thread); + } else { + thread->state = 8; + __osEnqueueThread(thread->queue, thread); + __osEnqueueThread(&__osRunQueue, __osPopThread(thread->queue)); + } + break; } - if (__osRunningThread == NULL) - { + if (__osRunningThread == NULL) { __osDispatchThread(); - } - else - { - if (__osRunningThread->priority < __osRunQueue->priority) - { + } else { + if (__osRunningThread->priority < __osRunQueue->priority) { __osRunningThread->state = 2; __osEnqueueAndYield(&__osRunQueue); } diff --git a/src/libultra_boot_O1/osStopThread.c b/src/libultra_boot_O1/osStopThread.c index 4f3ecd905b..4d5db6afde 100644 --- a/src/libultra_boot_O1/osStopThread.c +++ b/src/libultra_boot_O1/osStopThread.c @@ -1,26 +1,25 @@ #include -void osStopThread(OSThread* thread) -{ +void osStopThread(OSThread* thread) { register u32 s0 = __osDisableInt(); register u32 state; - if (thread == NULL) + if (thread == NULL) { state = 4; - else + } else { state = thread->state; + } - switch (state) - { - case 4: - __osRunningThread->state = 1; - __osEnqueueAndYield(NULL); - break; - case 2: - case 8: - thread->state = 1; - __osDequeueThread(thread->queue, thread); - break; + switch (state) { + case 4: + __osRunningThread->state = 1; + __osEnqueueAndYield(NULL); + break; + case 2: + case 8: + thread->state = 1; + __osDequeueThread(thread->queue, thread); + break; } __osRestoreInt(s0); diff --git a/src/libultra_boot_O1/osViExtendVStart.c b/src/libultra_boot_O1/osViExtendVStart.c index 3180311ad7..8a09b2ae9d 100644 --- a/src/libultra_boot_O1/osViExtendVStart.c +++ b/src/libultra_boot_O1/osViExtendVStart.c @@ -1,6 +1,5 @@ #include -void osViExtendVStart(u32 arg0) -{ +void osViExtendVStart(u32 arg0) { __additional_scanline = arg0; } diff --git a/src/libultra_boot_O1/osViModePalLan1.c b/src/libultra_boot_O1/osViModePalLan1.c index c516be9a29..47c6c915eb 100644 --- a/src/libultra_boot_O1/osViModePalLan1.c +++ b/src/libultra_boot_O1/osViModePalLan1.c @@ -1,33 +1,32 @@ #include -OSViMode osViModePalLan1 = -{ - 0x10, //type - { //comRegs - 0x311E, //ctrl - 0x140, //width - 0x4541E3A, //burst - 0x271, //vSync - 0x170C69, //hSync - 0xC6F0C6D, //leap - 0x800300, //hStart - 0x200, //xScale - 0 //vCurrent +OSViMode osViModePalLan1 = { + 0x10, // type + { + // comRegs + 0x311E, // ctrl + 0x140, // width + 0x4541E3A, // burst + 0x271, // vSync + 0x170C69, // hSync + 0xC6F0C6D, // leap + 0x800300, // hStart + 0x200, // xScale + 0 // vCurrent }, - { //fldRegs - { - 0x280, //origin - 0x400, //yScale - 0x5F0239, //vStart - 0x9026B, //vBurst - 2, //vIntr - }, - { - 0x280, //origin - 0x400, //yScale - 0x5F0239, //vStart - 0x9026B, //vBurst - 2 //vIntr - } - } + { // fldRegs + { + 0x280, // origin + 0x400, // yScale + 0x5F0239, // vStart + 0x9026B, // vBurst + 2, // vIntr + }, + { + 0x280, // origin + 0x400, // yScale + 0x5F0239, // vStart + 0x9026B, // vBurst + 2 // vIntr + } }, }; diff --git a/src/libultra_boot_O1/osVirtualToPhysical.c b/src/libultra_boot_O1/osVirtualToPhysical.c index e6d65f3a72..b7c118b4bc 100644 --- a/src/libultra_boot_O1/osVirtualToPhysical.c +++ b/src/libultra_boot_O1/osVirtualToPhysical.c @@ -1,12 +1,13 @@ #include -u32 osVirtualToPhysical(void* vaddr) -{ - if ((u32)vaddr >= 0x80000000 && (u32)vaddr < 0xA0000000) +u32 osVirtualToPhysical(void* vaddr) { + if ((u32)vaddr >= 0x80000000 && (u32)vaddr < 0xA0000000) { return (u32)vaddr & 0x1FFFFFFF; + } - if ((u32)vaddr >= 0xA0000000 && (u32)vaddr < 0xC0000000) + if ((u32)vaddr >= 0xA0000000 && (u32)vaddr < 0xC0000000) { return (u32)vaddr & 0x1FFFFFFF; + } return __osProbeTLB(vaddr); } diff --git a/src/libultra_boot_O1/osYieldThread.c b/src/libultra_boot_O1/osYieldThread.c index 7ed1597790..e289cc9731 100644 --- a/src/libultra_boot_O1/osYieldThread.c +++ b/src/libultra_boot_O1/osYieldThread.c @@ -1,7 +1,6 @@ #include -void osYieldThread() -{ +void osYieldThread() { register u32 prevInt; prevInt = __osDisableInt(); diff --git a/src/libultra_boot_O1/piacs.c b/src/libultra_boot_O1/piacs.c index ab1db132a0..e48cfbcc0b 100644 --- a/src/libultra_boot_O1/piacs.c +++ b/src/libultra_boot_O1/piacs.c @@ -5,24 +5,22 @@ u32 __osPiAccessQueueEnabled = 0; OSMesg piAccessBuf; OSMesgQueue __osPiAccessQueue; -void __osPiCreateAccessQueue(void) -{ +void __osPiCreateAccessQueue(void) { __osPiAccessQueueEnabled = 1; osCreateMesgQueue(&__osPiAccessQueue, &piAccessBuf, 1); osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK); } -void __osPiGetAccess(void) -{ +void __osPiGetAccess(void) { OSMesg mesg; - if (!__osPiAccessQueueEnabled) + if (!__osPiAccessQueueEnabled) { __osPiCreateAccessQueue(); + } osRecvMesg(&__osPiAccessQueue, &mesg, OS_MESG_BLOCK); } -void __osPiRelAccess(void) -{ +void __osPiRelAccess(void) { osSendMesg(&__osPiAccessQueue, 0, OS_MESG_NOBLOCK); } diff --git a/src/libultra_boot_O1/timerintr.c b/src/libultra_boot_O1/timerintr.c index 020dc31324..83c882a3b2 100644 --- a/src/libultra_boot_O1/timerintr.c +++ b/src/libultra_boot_O1/timerintr.c @@ -7,8 +7,7 @@ u32 __osViIntrCount; u32 __osTimerCounter; OSTimer* __osTimerList = &__osBaseTimer; -void __osTimerServicesInit() -{ +void __osTimerServicesInit() { __osCurrentTime = 0; __osBaseCounter = 0; __osViIntrCount = 0; @@ -20,9 +19,8 @@ void __osTimerServicesInit() __osTimerList->msg = NULL; } -void __osTimerInterrupt() -{ - OSTimer *sp24; +void __osTimerInterrupt() { + OSTimer* sp24; u32 sp20; u32 sp1c; if (__osTimerList->next == __osTimerList) { @@ -58,13 +56,13 @@ void __osTimerInterrupt() } } -void __osSetTimerIntr(OSTime tim) -{ +void __osSetTimerIntr(OSTime tim) { OSTime NewTime; u32 savedMask; - if (tim < 468) + if (tim < 468) { tim = 468; + } savedMask = __osDisableInt(); @@ -74,9 +72,8 @@ void __osSetTimerIntr(OSTime tim) __osRestoreInt(savedMask); } -OSTime __osInsertTimer(OSTimer *a0) -{ - OSTimer *sp34; +OSTime __osInsertTimer(OSTimer* a0) { + OSTimer* sp34; u64 sp28; s32 intDisabled; intDisabled = __osDisableInt(); diff --git a/src/libultra_boot_O2/_Ldtob.c b/src/libultra_boot_O2/_Ldtob.c index 4a72dfd337..57a49cc8cc 100644 --- a/src/libultra_boot_O2/_Ldtob.c +++ b/src/libultra_boot_O2/_Ldtob.c @@ -5,8 +5,8 @@ #define BUFF_LEN 0x20 -s16 _Ldunscale(s16 *, _Pft *); -void _Genld(_Pft *, u8, u8 *, s16, s16); +s16 _Ldunscale(s16*, _Pft*); +void _Genld(_Pft*, u8, u8*, s16, s16); const double D_800122E0[] = { 10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L, 10e127L, 10e255L }; @@ -43,9 +43,9 @@ const double D_800122E0[] = { 10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L #define _D3 3 #endif -void _Ldtob(_Pft *args, u8 type) { +void _Ldtob(_Pft* args, u8 type) { u8 buff[BUFF_LEN]; - u8 *ptr; + u8* ptr; u32 sp70; f64 val; /* maybe struct? */ @@ -159,9 +159,9 @@ void _Ldtob(_Pft *args, u8 type) { _Genld((_Pft*)args, type, ptr, nsig, exp); } -s16 _Ldunscale(s16 *pex, _Pft *px) { +s16 _Ldunscale(s16* pex, _Pft* px) { - unsigned short *ps = (unsigned short *) px; + unsigned short* ps = (unsigned short*)px; short xchar = (ps[_D0] & _DMASK) >> _DOFF; if (xchar == _DMAX) { /* NaN or INF */ *pex = 0; @@ -179,16 +179,15 @@ s16 _Ldunscale(s16 *pex, _Pft *px) { } } -void _Genld(_Pft *px, u8 code, u8 *p, s16 nsig, s16 xexp) { +void _Genld(_Pft* px, u8 code, u8* p, s16 nsig, s16 xexp) { u8 point = '.'; if (nsig <= 0) { nsig = 1, - p = (u8 *) "0"; + p = (u8*)"0"; } - if (code == 'f' - || ((code == 'g' || code == 'G') && (-4 <= xexp) && (xexp < px->prec))) { /* 'f' format */ + if (code == 'f' || ((code == 'g' || code == 'G') && (-4 <= xexp) && (xexp < px->prec))) { /* 'f' format */ ++xexp; /* change to leading digit count */ if (code != 'f') { /* fixup for 'g' */ if (!(px->flags & FLAGS_HASH) && nsig < px->prec) { @@ -257,7 +256,7 @@ void _Genld(_Pft *px, u8 code, u8 *p, s16 nsig, s16 xexp) { px->n1 += nsig; px->nz1 = px->prec - nsig; } - p = (u8 *) &px->s[px->n1]; /* put exponent */ + p = (u8*)&px->s[px->n1]; /* put exponent */ *p++ = code; if (0 <= xexp) { *p++ = '+'; @@ -273,11 +272,10 @@ void _Genld(_Pft *px, u8 code, u8 *p, s16 nsig, s16 xexp) { } *p++ = xexp / 10 + '0', xexp %= 10; *p++ = xexp + '0'; - px->n2 = p - (u8 *) &px->s[px->n1]; + px->n2 = p - (u8*)&px->s[px->n1]; } if ((px->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) { /* pad with leading zeros */ - int n = - px->n0 + px->n1 + px->nz1 + px->n2 + px->nz2; + int n = px->n0 + px->n1 + px->nz1 + px->n2 + px->nz2; if (n < px->width) { px->nz0 = px->width - n; diff --git a/src/libultra_boot_O2/_Litob.c b/src/libultra_boot_O2/_Litob.c index 15206217c6..5b2329cd34 100644 --- a/src/libultra_boot_O2/_Litob.c +++ b/src/libultra_boot_O2/_Litob.c @@ -8,28 +8,31 @@ u8 D_8000AF70[] = "0123456789abcdef"; u8 D_8000AF84[] = "0123456789ABCDEF"; -void _Litob(_Pft *args, u8 type) { +void _Litob(_Pft* args, u8 type) { u8 buff[BUFF_LEN]; - const u8 *num_map; + const u8* num_map; s32 base; s32 buff_ind; u64 num; lldiv_t quotrem; - if (type == 'X') + if (type == 'X') { num_map = D_8000AF84; - else + } else { num_map = D_8000AF70; + } base = (type == 'o') ? 8 : ((type != 'x' && type != 'X') ? 10 : 16); buff_ind = BUFF_LEN; num = args->v.ll; - if ((type == 'd' || type == 'i') && args->v.ll < 0) + if ((type == 'd' || type == 'i') && args->v.ll < 0) { num = -num; + } - if (num != 0 || args->prec != 0) + if (num != 0 || args->prec != 0) { buff[--buff_ind] = num_map[num % base]; + } args->v.ll = num / base; @@ -43,12 +46,14 @@ void _Litob(_Pft *args, u8 type) { memcpy(args->s, buff + buff_ind, args->n1); - if (args->n1 < args->prec) + if (args->n1 < args->prec) { args->nz0 = args->prec - args->n1; + } if (args->prec < 0 && (args->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) { buff_ind = args->width - args->n0 - args->nz0 - args->n1; - if (buff_ind > 0) + if (buff_ind > 0) { args->nz0 += buff_ind; + } } } diff --git a/src/libultra_boot_O2/_Printf.c b/src/libultra_boot_O2/_Printf.c index cbb803bbdc..a5f922d562 100644 --- a/src/libultra_boot_O2/_Printf.c +++ b/src/libultra_boot_O2/_Printf.c @@ -3,38 +3,37 @@ #include #include -#define ATOI(i, a) \ - for (i = 0; *a >= '0' && *a <= '9'; a++) \ - if (i < 999) \ +#define ATOI(i, a) \ + for (i = 0; *a >= '0' && *a <= '9'; a++) \ + if (i < 999) \ i = *a + i * 10 - '0'; -#define _PROUT(fmt, _size) \ - if (_size > 0) { \ - arg = (void*)pfn(arg, fmt, _size); \ - if (arg != 0) \ - x.nchar += _size; \ - else \ - return x.nchar; \ +#define _PROUT(fmt, _size) \ + if (_size > 0) { \ + arg = (void*)pfn(arg, fmt, _size); \ + if (arg != 0) \ + x.nchar += _size; \ + else \ + return x.nchar; \ } -#define _PAD(m, src, extracond) \ - if (extracond && m > 0) { \ - int i; \ - int j; \ - for (j = m; j > 0; j -= i) { \ - if ((u32) j > 32) \ - i = 32; \ - else \ - i = j; \ - _PROUT(src, i); \ - } \ +#define _PAD(m, src, extracond) \ + if (extracond && m > 0) { \ + int i; \ + int j; \ + for (j = m; j > 0; j -= i) { \ + if ((u32)j > 32) \ + i = 32; \ + else \ + i = j; \ + _PROUT(src, i); \ + } \ } char spaces[] = " "; char zeroes[] = "00000000000000000000000000000000"; -void _Putfld(_Pft *, va_list *, u8, u8 *); +void _Putfld(_Pft*, va_list*, u8, u8*); -s32 _Printf(char *(*pfn)(char *, const char *, size_t), char *arg, const char *fmt, va_list ap) -{ +s32 _Printf(char* (*pfn)(char*, const char*, size_t), char* arg, const char* fmt, va_list ap) { _Pft x; x.nchar = 0; while (1) { @@ -47,15 +46,15 @@ s32 _Printf(char *(*pfn)(char *, const char *, size_t), char *arg, const char *f u8 ac[0x20]; - s = (u8 *)fmt; + s = (u8*)fmt; while ((c = *s) != 0 && c != '%') { s++; } - _PROUT(fmt, s - (u8 *)fmt); + _PROUT(fmt, s - (u8*)fmt); if (c == 0) { return x.nchar; } - fmt = (char *) ++s; + fmt = (char*)++s; x.flags = 0; for (; (t = strchr(fchar, *s)) != NULL; s++) { x.flags |= fbit[t - fchar]; @@ -92,23 +91,21 @@ s32 _Printf(char *(*pfn)(char *, const char *, size_t), char *arg, const char *f s++; } _Putfld(&x, &ap, *s, ac); - x.width -= x.n0 + x.nz0 + x.n1 + x.nz1 - + x.n2 + x.nz2; + x.width -= x.n0 + x.nz0 + x.n1 + x.nz1 + x.n2 + x.nz2; _PAD(x.width, spaces, !(x.flags & FLAGS_MINUS)); - _PROUT((char *) ac, x.n0); + _PROUT((char*)ac, x.n0); _PAD(x.nz0, zeroes, 1); _PROUT(x.s, x.n1); _PAD(x.nz1, zeroes, 1); - _PROUT((char *) (&x.s[x.n1]), x.n2) + _PROUT((char*)(&x.s[x.n1]), x.n2) _PAD(x.nz2, zeroes, 1); _PAD(x.width, spaces, x.flags & FLAGS_MINUS); - fmt = (char *) s + 1; + fmt = (char*)s + 1; } } void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac) { - px->n0 = px->nz0 = px->n1 = px->nz1 = px->n2 = - px->nz2 = 0; + px->n0 = px->nz0 = px->n1 = px->nz1 = px->n2 = px->nz2 = 0; switch (code) { @@ -127,7 +124,7 @@ void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac) { } if (px->qual == 'h') { - px->v.ll = (s16) px->v.ll; + px->v.ll = (s16)px->v.ll; } if (px->v.ll < 0) { @@ -138,7 +135,7 @@ void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac) { ac[px->n0++] = ' '; } - px->s = (char *) &ac[px->n0]; + px->s = (char*)&ac[px->n0]; _Litob(px, code); break; @@ -156,9 +153,9 @@ void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac) { } if (px->qual == 'h') { - px->v.ll = (u16) px->v.ll; + px->v.ll = (u16)px->v.ll; } else if (px->qual == 0) { - px->v.ll = (u32) px->v.ll; + px->v.ll = (u32)px->v.ll; } if (px->flags & FLAGS_HASH) { @@ -168,7 +165,7 @@ void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac) { ac[px->n0++] = code; } } - px->s = (char *) &ac[px->n0]; + px->s = (char*)&ac[px->n0]; _Litob(px, code); break; @@ -189,30 +186,30 @@ void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac) { } } - px->s = (char *) &ac[px->n0]; + px->s = (char*)&ac[px->n0]; _Ldtob(px, code); break; case 'n': if (px->qual == 'h') { - *(va_arg(*pap, u16 *)) = px->nchar; + *(va_arg(*pap, u16*)) = px->nchar; } else if (px->qual == 'l') { - *va_arg(*pap, u32 *) = px->nchar; + *va_arg(*pap, u32*) = px->nchar; } else if (px->qual == 'L') { - *va_arg(*pap, u64 *) = px->nchar; + *va_arg(*pap, u64*) = px->nchar; } else { - *va_arg(*pap, u32 *) = px->nchar; + *va_arg(*pap, u32*) = px->nchar; } break; case 'p': - px->v.ll = (long) va_arg(*pap, void *); - px->s = (char *) &ac[px->n0]; + px->v.ll = (long)va_arg(*pap, void*); + px->s = (char*)&ac[px->n0]; _Litob(px, 'x'); break; case 's': - px->s = va_arg(*pap, char *); + px->s = va_arg(*pap, char*); px->n1 = strlen(px->s); if (px->prec >= 0 && px->n1 > px->prec) { px->n1 = px->prec; @@ -227,4 +224,4 @@ void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac) { ac[px->n0++] = code; break; } -} \ No newline at end of file +} diff --git a/src/libultra_boot_O2/__osDevMgrMain.c b/src/libultra_boot_O2/__osDevMgrMain.c index b3d8cd971d..9065b903c0 100644 --- a/src/libultra_boot_O2/__osDevMgrMain.c +++ b/src/libultra_boot_O2/__osDevMgrMain.c @@ -1,8 +1,7 @@ #include #include -void __osDevMgrMain(void* arg) -{ +void __osDevMgrMain(void* arg) { OSIoMesg* ioMesg; OSMesg sp70; OSMesg sp6C; @@ -16,17 +15,16 @@ void __osDevMgrMain(void* arg) arg0 = (OSMgrArgs*)arg; ioMesg = NULL; - while (true) - { + while (true) { osRecvMesg(arg0->cmdQueue, (OSMesg)&ioMesg, OS_MESG_BLOCK); - if ((ioMesg->piHandle != NULL) && (ioMesg->piHandle->type == DEVICE_TYPE_64DD) && - ((ioMesg->piHandle->transferInfo.cmdType == 0) || (ioMesg->piHandle->transferInfo.cmdType == 1))) - { + if ((ioMesg->piHandle != NULL) && (ioMesg->piHandle->type == DEVICE_TYPE_64DD) && + ((ioMesg->piHandle->transferInfo.cmdType == 0) || (ioMesg->piHandle->transferInfo.cmdType == 1))) { transfer = &ioMesg->piHandle->transferInfo; block = &transfer->block[transfer->blockNum]; transfer->sectorNum = -1; - if (transfer->transferMode != 3) + if (transfer->transferMode != 3) { block->dramAddr = (void*)((u32)block->dramAddr - block->sectorSize); + } phi_s2 = ((transfer->transferMode == 2) && (ioMesg->piHandle->transferInfo.cmdType == 0)) ? 1 : 0; @@ -34,38 +32,36 @@ void __osDevMgrMain(void* arg) __osResetGlobalIntMask(0x00100401); __osEPiRawWriteIo(ioMesg->piHandle, 0x05000510, transfer->bmCtlShadow | 0x80000000); - while (true) - { + while (true) { osRecvMesg(arg0->eventQueue, &sp70, OS_MESG_BLOCK); transfer = &ioMesg->piHandle->transferInfo; block = &transfer->block[transfer->blockNum]; - if (block->errStatus == 0x1D) - { + if (block->errStatus == 0x1D) { __osEPiRawWriteIo(ioMesg->piHandle, 0x05000510, transfer->bmCtlShadow | 0x10000000); __osEPiRawWriteIo(ioMesg->piHandle, 0x05000510, transfer->bmCtlShadow); __osEPiRawReadIo(ioMesg->piHandle, 0x05000508, &sp54); - if (sp54 & 0x02000000) + if (sp54 & 0x02000000) { __osEPiRawWriteIo(ioMesg->piHandle, 0x05000510, transfer->bmCtlShadow | 0x1000000); + } block->errStatus = 4; HW_REG(PI_STATUS_REG, u32) = PI_STATUS_CLEAR_INTR; __osSetGlobalIntMask(0x00100C01); } osSendMesg(ioMesg->hdr.retQueue, ioMesg, OS_MESG_NOBLOCK); - if ((phi_s2 != 1) || (ioMesg->piHandle->transferInfo.block[0].errStatus != 0)) + if ((phi_s2 != 1) || (ioMesg->piHandle->transferInfo.block[0].errStatus != 0)) { break; + } phi_s2 = 0; } osSendMesg(arg0->acccessQueue, 0, OS_MESG_NOBLOCK); - if (ioMesg->piHandle->transferInfo.blockNum == 1) + if (ioMesg->piHandle->transferInfo.blockNum == 1) { osYieldThread(); - } - else - { - switch (ioMesg->hdr.type) - { + } + } else { + switch (ioMesg->hdr.type) { case 11: osRecvMesg(arg0->acccessQueue, &sp6C, OS_MESG_BLOCK); phi_s0 = arg0->piDmaCallback(OS_READ, ioMesg->devAddr, ioMesg->dramAddr, ioMesg->size); @@ -76,11 +72,13 @@ void __osDevMgrMain(void* arg) break; case 15: osRecvMesg(arg0->acccessQueue, &sp6C, OS_MESG_BLOCK); - phi_s0 = arg0->epiDmaCallback(ioMesg->piHandle, OS_READ, ioMesg->devAddr, ioMesg->dramAddr, ioMesg->size); + phi_s0 = arg0->epiDmaCallback(ioMesg->piHandle, OS_READ, ioMesg->devAddr, ioMesg->dramAddr, + ioMesg->size); break; case 16: osRecvMesg(arg0->acccessQueue, &sp6C, OS_MESG_BLOCK); - phi_s0 = arg0->epiDmaCallback(ioMesg->piHandle, OS_WRITE, ioMesg->devAddr, ioMesg->dramAddr, ioMesg->size); + phi_s0 = arg0->epiDmaCallback(ioMesg->piHandle, OS_WRITE, ioMesg->devAddr, ioMesg->dramAddr, + ioMesg->size); break; case 10: osSendMesg(ioMesg->hdr.retQueue, ioMesg, OS_MESG_NOBLOCK); @@ -91,8 +89,7 @@ void __osDevMgrMain(void* arg) break; } - if (phi_s0 == 0) - { + if (phi_s0 == 0) { osRecvMesg(arg0->eventQueue, &sp70, OS_MESG_BLOCK); osSendMesg(ioMesg->hdr.retQueue, ioMesg, OS_MESG_NOBLOCK); osSendMesg(arg0->acccessQueue, NULL, OS_MESG_NOBLOCK); diff --git a/src/libultra_boot_O2/__osEPiRawReadIo.c b/src/libultra_boot_O2/__osEPiRawReadIo.c index d448810157..b1e9b88d00 100644 --- a/src/libultra_boot_O2/__osEPiRawReadIo.c +++ b/src/libultra_boot_O2/__osEPiRawReadIo.c @@ -1,45 +1,49 @@ #include #include -s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data) -{ +s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data) { s32 status; OSPiHandle* curHandle; - while (status = HW_REG(PI_STATUS_REG, u32), status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) + while (status = HW_REG(PI_STATUS_REG, u32), status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { ; + } - if (__osCurrentHandle[handle->domain]->type != handle->type) - { + if (__osCurrentHandle[handle->domain]->type != handle->type) { curHandle = __osCurrentHandle[handle->domain]; - if (handle->domain == 0) - { - if (curHandle->latency != handle->latency) + if (handle->domain == 0) { + if (curHandle->latency != handle->latency) { HW_REG(PI_BSD_DOM1_LAT_REG, u32) = handle->latency; + } - if (curHandle->pageSize != handle->pageSize) + if (curHandle->pageSize != handle->pageSize) { HW_REG(PI_BSD_DOM1_PGS_REG, u32) = handle->pageSize; + } - if (curHandle->relDuration != handle->relDuration) + if (curHandle->relDuration != handle->relDuration) { HW_REG(PI_BSD_DOM1_RLS_REG, u32) = handle->relDuration; + } - if (curHandle->pulse != handle->pulse) + if (curHandle->pulse != handle->pulse) { HW_REG(PI_BSD_DOM1_PWD_REG, u32) = handle->pulse; - } - else - { - if (curHandle->latency != handle->latency) + } + } else { + if (curHandle->latency != handle->latency) { HW_REG(PI_BSD_DOM2_LAT_REG, u32) = handle->latency; + } - if (curHandle->pageSize != handle->pageSize) + if (curHandle->pageSize != handle->pageSize) { HW_REG(PI_BSD_DOM2_PGS_REG, u32) = handle->pageSize; + } - if (curHandle->relDuration != handle->relDuration) + if (curHandle->relDuration != handle->relDuration) { HW_REG(PI_BSD_DOM2_RLS_REG, u32) = handle->relDuration; + } - if (curHandle->pulse != handle->pulse) + if (curHandle->pulse != handle->pulse) { HW_REG(PI_BSD_DOM2_PWD_REG, u32) = handle->pulse; + } } curHandle->type = handle->type; diff --git a/src/libultra_boot_O2/__osEPiRawStartDma.c b/src/libultra_boot_O2/__osEPiRawStartDma.c index dcd5f44d9b..cc28a6ca9d 100644 --- a/src/libultra_boot_O2/__osEPiRawStartDma.c +++ b/src/libultra_boot_O2/__osEPiRawStartDma.c @@ -1,45 +1,49 @@ #include #include -s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size) -{ +s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size) { s32 status; OSPiHandle* curHandle; - while (status = HW_REG(PI_STATUS_REG, u32), status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) + while (status = HW_REG(PI_STATUS_REG, u32), status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { ; + } - if (__osCurrentHandle[handle->domain]->type != handle->type) - { + if (__osCurrentHandle[handle->domain]->type != handle->type) { curHandle = __osCurrentHandle[handle->domain]; - if (handle->domain == 0) - { - if (curHandle->latency != handle->latency) + if (handle->domain == 0) { + if (curHandle->latency != handle->latency) { HW_REG(PI_BSD_DOM1_LAT_REG, u32) = handle->latency; + } - if (curHandle->pageSize != handle->pageSize) + if (curHandle->pageSize != handle->pageSize) { HW_REG(PI_BSD_DOM1_PGS_REG, u32) = handle->pageSize; + } - if (curHandle->relDuration != handle->relDuration) + if (curHandle->relDuration != handle->relDuration) { HW_REG(PI_BSD_DOM1_RLS_REG, u32) = handle->relDuration; + } - if (curHandle->pulse != handle->pulse) + if (curHandle->pulse != handle->pulse) { HW_REG(PI_BSD_DOM1_PWD_REG, u32) = handle->pulse; - } - else - { - if (curHandle->latency != handle->latency) + } + } else { + if (curHandle->latency != handle->latency) { HW_REG(PI_BSD_DOM2_LAT_REG, u32) = handle->latency; + } - if (curHandle->pageSize != handle->pageSize) + if (curHandle->pageSize != handle->pageSize) { HW_REG(PI_BSD_DOM2_PGS_REG, u32) = handle->pageSize; + } - if (curHandle->relDuration != handle->relDuration) + if (curHandle->relDuration != handle->relDuration) { HW_REG(PI_BSD_DOM2_RLS_REG, u32) = handle->relDuration; + } - if (curHandle->pulse != handle->pulse) + if (curHandle->pulse != handle->pulse) { HW_REG(PI_BSD_DOM2_PWD_REG, u32) = handle->pulse; + } } curHandle->type = handle->type; @@ -52,17 +56,16 @@ s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dr HW_REG(PI_DRAM_ADDR_REG, void*) = (void*)osVirtualToPhysical(dramAddr); HW_REG(PI_CART_ADDR_REG, void*) = (void*)((handle->baseAddress | cartAddr) & 0x1fffffff); - switch (direction) - { - case OS_READ: - HW_REG(PI_WR_LEN_REG, u32) = size - 1; - break; - case OS_WRITE: - HW_REG(PI_RD_LEN_REG, u32) = size - 1; - break; - default: - return -1; - break; + switch (direction) { + case OS_READ: + HW_REG(PI_WR_LEN_REG, u32) = size - 1; + break; + case OS_WRITE: + HW_REG(PI_RD_LEN_REG, u32) = size - 1; + break; + default: + return -1; + break; } return 0; diff --git a/src/libultra_boot_O2/__osEPiRawWriteIo.c b/src/libultra_boot_O2/__osEPiRawWriteIo.c index 517c7397aa..08d817bfa3 100644 --- a/src/libultra_boot_O2/__osEPiRawWriteIo.c +++ b/src/libultra_boot_O2/__osEPiRawWriteIo.c @@ -1,45 +1,49 @@ #include #include -s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) -{ +s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) { s32 status; OSPiHandle* curHandle; - while (status = HW_REG(PI_STATUS_REG, u32), status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) + while (status = HW_REG(PI_STATUS_REG, u32), status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { ; + } - if (__osCurrentHandle[handle->domain]->type != handle->type) - { + if (__osCurrentHandle[handle->domain]->type != handle->type) { curHandle = __osCurrentHandle[handle->domain]; - if (handle->domain == 0) - { - if (curHandle->latency != handle->latency) + if (handle->domain == 0) { + if (curHandle->latency != handle->latency) { HW_REG(PI_BSD_DOM1_LAT_REG, u32) = handle->latency; + } - if (curHandle->pageSize != handle->pageSize) + if (curHandle->pageSize != handle->pageSize) { HW_REG(PI_BSD_DOM1_PGS_REG, u32) = handle->pageSize; + } - if (curHandle->relDuration != handle->relDuration) + if (curHandle->relDuration != handle->relDuration) { HW_REG(PI_BSD_DOM1_RLS_REG, u32) = handle->relDuration; + } - if (curHandle->pulse != handle->pulse) + if (curHandle->pulse != handle->pulse) { HW_REG(PI_BSD_DOM1_PWD_REG, u32) = handle->pulse; - } - else - { - if (curHandle->latency != handle->latency) + } + } else { + if (curHandle->latency != handle->latency) { HW_REG(PI_BSD_DOM2_LAT_REG, u32) = handle->latency; + } - if (curHandle->pageSize != handle->pageSize) + if (curHandle->pageSize != handle->pageSize) { HW_REG(PI_BSD_DOM2_PGS_REG, u32) = handle->pageSize; + } - if (curHandle->relDuration != handle->relDuration) + if (curHandle->relDuration != handle->relDuration) { HW_REG(PI_BSD_DOM2_RLS_REG, u32) = handle->relDuration; + } - if (curHandle->pulse != handle->pulse) + if (curHandle->pulse != handle->pulse) { HW_REG(PI_BSD_DOM2_PWD_REG, u32) = handle->pulse; + } } curHandle->type = handle->type; diff --git a/src/libultra_boot_O2/__osPiRawStartDma.c b/src/libultra_boot_O2/__osPiRawStartDma.c index 0957a0ebcb..589a63b3ba 100644 --- a/src/libultra_boot_O2/__osPiRawStartDma.c +++ b/src/libultra_boot_O2/__osPiRawStartDma.c @@ -1,30 +1,27 @@ #include #include -s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size) -{ +s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void* dram_addr, size_t size) { register int status; status = HW_REG(PI_STATUS_REG, u32); - while (status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) - { + while (status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { status = HW_REG(PI_STATUS_REG, u32); } - HW_REG(PI_DRAM_ADDR_REG, void *) = (void *)osVirtualToPhysical(dram_addr); + HW_REG(PI_DRAM_ADDR_REG, void*) = (void*)osVirtualToPhysical(dram_addr); - HW_REG(PI_CART_ADDR_REG, void *) = (void *)((osRomBase | cart_addr) & 0x1fffffff); + HW_REG(PI_CART_ADDR_REG, void*) = (void*)((osRomBase | cart_addr) & 0x1fffffff); - switch (dir) - { - case OS_READ: - HW_REG(PI_WR_LEN_REG, u32) = size - 1; - break; - case OS_WRITE: - HW_REG(PI_RD_LEN_REG, u32) = size - 1; - break; - default: - return -1; - break; + switch (dir) { + case OS_READ: + HW_REG(PI_WR_LEN_REG, u32) = size - 1; + break; + case OS_WRITE: + HW_REG(PI_RD_LEN_REG, u32) = size - 1; + break; + default: + return -1; + break; } return 0; -} \ No newline at end of file +} diff --git a/src/libultra_boot_O2/__osSiDeviceBusy.c b/src/libultra_boot_O2/__osSiDeviceBusy.c index 983bd071d0..8bb777745d 100644 --- a/src/libultra_boot_O2/__osSiDeviceBusy.c +++ b/src/libultra_boot_O2/__osSiDeviceBusy.c @@ -1,12 +1,12 @@ #include #include -u32 __osSiDeviceBusy() -{ +u32 __osSiDeviceBusy() { register u32 status; status = HW_REG(SI_STATUS_REG, u32); - if (status & (SI_STATUS_DMA_BUSY | SI_STATUS_IO_READ_BUSY)) + if (status & (SI_STATUS_DMA_BUSY | SI_STATUS_IO_READ_BUSY)) { return true; - else + } else { return false; + } } diff --git a/src/libultra_boot_O2/__osSiRawReadIo.c b/src/libultra_boot_O2/__osSiRawReadIo.c index c3bb394f03..fa26c8e2aa 100644 --- a/src/libultra_boot_O2/__osSiRawReadIo.c +++ b/src/libultra_boot_O2/__osSiRawReadIo.c @@ -1,10 +1,10 @@ #include #include -s32 __osSiRawReadIo(void *a0, u32 *a1) -{ - if (__osSiDeviceBusy()) +s32 __osSiRawReadIo(void* a0, u32* a1) { + if (__osSiDeviceBusy()) { return -1; + } *a1 = HW_REG((u32)a0, u32); return 0; -} \ No newline at end of file +} diff --git a/src/libultra_boot_O2/__osSiRawWriteIo.c b/src/libultra_boot_O2/__osSiRawWriteIo.c index c7ff8eab78..7658b5a97b 100644 --- a/src/libultra_boot_O2/__osSiRawWriteIo.c +++ b/src/libultra_boot_O2/__osSiRawWriteIo.c @@ -1,10 +1,10 @@ #include #include -s32 __osSiRawWriteIo(void *a0, u32 a1) -{ - if (__osSiDeviceBusy()) +s32 __osSiRawWriteIo(void* a0, u32 a1) { + if (__osSiDeviceBusy()) { return -1; + } HW_REG((u32)a0, u32) = a1; return 0; -} \ No newline at end of file +} diff --git a/src/libultra_boot_O2/__osViGetCurrentContext.c b/src/libultra_boot_O2/__osViGetCurrentContext.c index b629c77f73..fea88be8fd 100644 --- a/src/libultra_boot_O2/__osViGetCurrentContext.c +++ b/src/libultra_boot_O2/__osViGetCurrentContext.c @@ -1,6 +1,5 @@ #include -OSViContext* __osViGetCurrentContext() -{ +OSViContext* __osViGetCurrentContext() { return __osViCurr; } diff --git a/src/libultra_boot_O2/__osViInit.c b/src/libultra_boot_O2/__osViInit.c index a660a1de26..becce34ab9 100644 --- a/src/libultra_boot_O2/__osViInit.c +++ b/src/libultra_boot_O2/__osViInit.c @@ -1,12 +1,11 @@ #include #include -OSViContext vi[2] = {0}; +OSViContext vi[2] = { 0 }; OSViContext* __osViCurr = &vi[0]; OSViContext* __osViNext = &vi[1]; -void __osViInit() -{ +void __osViInit() { bzero(vi, sizeof(vi)); __osViCurr = &vi[0]; __osViNext = &vi[1]; @@ -15,19 +14,21 @@ void __osViInit() __osViCurr->retraceCount = 1; __osViNext->buffer = (void*)0x80000000; __osViCurr->buffer = (void*)0x80000000; - - if (osTvType == 0) + + if (osTvType == 0) { __osViNext->modep = &osViModePalLan1; - else if (osTvType == 2) + } else if (osTvType == 2) { __osViNext->modep = &osViModeMpalLan1; - else + } else { __osViNext->modep = &osViModeNtscLan1; + } __osViNext->state = 0x20; __osViNext->features = __osViNext->modep->comRegs.ctrl; - while (HW_REG(VI_CURRENT_REG, u32) > 10) + while (HW_REG(VI_CURRENT_REG, u32) > 10) { ; + } HW_REG(VI_CONTROL_REG, u32) = 0; __osViSwapContext(); diff --git a/src/libultra_boot_O2/__osViSwapContext.c b/src/libultra_boot_O2/__osViSwapContext.c index 93f8ede354..4dcc4c8703 100644 --- a/src/libultra_boot_O2/__osViSwapContext.c +++ b/src/libultra_boot_O2/__osViSwapContext.c @@ -1,10 +1,9 @@ #include #include -void __osViSwapContext() -{ - register OSViMode *s0; - register OSViContext *s1; +void __osViSwapContext() { + register OSViMode* s0; + register OSViContext* s1; u32 origin; u32 hStart; u32 vstart; diff --git a/src/libultra_boot_O2/osCartRomInit.c b/src/libultra_boot_O2/osCartRomInit.c index 5492a61f5a..eef5be9fdb 100644 --- a/src/libultra_boot_O2/osCartRomInit.c +++ b/src/libultra_boot_O2/osCartRomInit.c @@ -3,8 +3,7 @@ OSPiHandle __CartRomHandle; -OSPiHandle* osCartRomInit() -{ +OSPiHandle* osCartRomInit() { register u32 a; register s32 status; register u32 prevInt; @@ -17,8 +16,7 @@ OSPiHandle* osCartRomInit() __osPiGetAccess(); - if (!D_8000AF10) - { + if (!D_8000AF10) { __osPiRelAccess(); return &__CartRomHandle; } @@ -30,8 +28,9 @@ OSPiHandle* osCartRomInit() __CartRomHandle.speed = 0; bzero(&__CartRomHandle.transferInfo, sizeof(__OSTranxInfo)); - while (status = HW_REG(PI_STATUS_REG, u32), status & PI_STATUS_ERROR) + while (status = HW_REG(PI_STATUS_REG, u32), status & PI_STATUS_ERROR) { ; + } lastLatency = HW_REG(PI_BSD_DOM1_LAT_REG, u32); lastPageSize = HW_REG(PI_BSD_DOM1_PGS_REG, u32); diff --git a/src/libultra_boot_O2/osDriveRomInit.c b/src/libultra_boot_O2/osDriveRomInit.c index 2428161e82..4dd49a6299 100644 --- a/src/libultra_boot_O2/osDriveRomInit.c +++ b/src/libultra_boot_O2/osDriveRomInit.c @@ -3,8 +3,7 @@ OSPiHandle __DriveRomHandle; -OSPiHandle* osDriveRomInit() -{ +OSPiHandle* osDriveRomInit() { register s32 status; register u32 a; register s32 prevInt; @@ -12,8 +11,7 @@ OSPiHandle* osDriveRomInit() __osPiGetAccess(); - if (!D_8000AC70) - { + if (!D_8000AC70) { __osPiRelAccess(); return &__DriveRomHandle; } @@ -25,8 +23,9 @@ OSPiHandle* osDriveRomInit() __DriveRomHandle.speed = 0; bzero(&__DriveRomHandle.transferInfo, sizeof(__OSTranxInfo)); - while (status = HW_REG(PI_STATUS_REG, u32), status & PI_STATUS_ERROR) + while (status = HW_REG(PI_STATUS_REG, u32), status & PI_STATUS_ERROR) { ; + } HW_REG(PI_BSD_DOM1_LAT_REG, u32) = 0xff; HW_REG(PI_BSD_DOM1_PGS_REG, u32) = 0; diff --git a/src/libultra_boot_O2/osEPiReadIo.c b/src/libultra_boot_O2/osEPiReadIo.c index 9953c8529f..964330c305 100644 --- a/src/libultra_boot_O2/osEPiReadIo.c +++ b/src/libultra_boot_O2/osEPiReadIo.c @@ -1,7 +1,6 @@ #include -s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data) -{ +s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data) { register s32 ret; __osPiGetAccess(); @@ -9,4 +8,4 @@ s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data) __osPiRelAccess(); return ret; -} \ No newline at end of file +} diff --git a/src/libultra_boot_O2/osEPiStartDma.c b/src/libultra_boot_O2/osEPiStartDma.c index a2c2b8d5a7..83fc694a34 100644 --- a/src/libultra_boot_O2/osEPiStartDma.c +++ b/src/libultra_boot_O2/osEPiStartDma.c @@ -1,21 +1,23 @@ #include -s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction) -{ +s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction) { s32 ret; - if (!__osPiDevMgr.initialized) + if (!__osPiDevMgr.initialized) { return -1; + } mb->piHandle = handle; - if (direction == OS_READ) + if (direction == OS_READ) { mb->hdr.type = 0xf; - else + } else { mb->hdr.type = 0x10; + } - if (mb->hdr.pri == 1) + if (mb->hdr.pri == 1) { ret = osJamMesg(osPiGetCmdQueue(), (OSMesg)mb, 0); - else + } else { ret = osSendMesg(osPiGetCmdQueue(), (OSMesg)mb, 0); + } return ret; -} \ No newline at end of file +} diff --git a/src/libultra_boot_O2/osEPiWriteIo.c b/src/libultra_boot_O2/osEPiWriteIo.c index ef1cc385f4..5d4f61a2fc 100644 --- a/src/libultra_boot_O2/osEPiWriteIo.c +++ b/src/libultra_boot_O2/osEPiWriteIo.c @@ -1,7 +1,6 @@ #include -s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) -{ +s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) { register s32 ret; __osPiGetAccess(); diff --git a/src/libultra_boot_O2/osPiGetCmdQueue.c b/src/libultra_boot_O2/osPiGetCmdQueue.c index 159c423783..1f097a9269 100644 --- a/src/libultra_boot_O2/osPiGetCmdQueue.c +++ b/src/libultra_boot_O2/osPiGetCmdQueue.c @@ -1,9 +1,9 @@ #include -OSMesgQueue* osPiGetCmdQueue() -{ - if (!__osPiDevMgr.initialized) +OSMesgQueue* osPiGetCmdQueue() { + if (!__osPiDevMgr.initialized) { return NULL; + } return __osPiDevMgr.cmdQueue; } diff --git a/src/libultra_boot_O2/osViBlack.c b/src/libultra_boot_O2/osViBlack.c index 4a122496c2..753619b8b1 100644 --- a/src/libultra_boot_O2/osViBlack.c +++ b/src/libultra_boot_O2/osViBlack.c @@ -1,8 +1,7 @@ #include // TODO: name magic constants -void osViBlack(u8 active) -{ +void osViBlack(u8 active) { register u32 int_disabled = __osDisableInt(); if (active) { __osViNext->state |= 0x20; diff --git a/src/libultra_boot_O2/osViGetNextFramebuffer.c b/src/libultra_boot_O2/osViGetNextFramebuffer.c index 83eaa2705f..a8b642603a 100644 --- a/src/libultra_boot_O2/osViGetNextFramebuffer.c +++ b/src/libultra_boot_O2/osViGetNextFramebuffer.c @@ -1,9 +1,8 @@ #include -void* osViGetNextFramebuffer() -{ +void* osViGetNextFramebuffer() { s32 prevInt = __osDisableInt(); void* buff = __osViNext->buffer; __osRestoreInt(prevInt); return buff; -} \ No newline at end of file +} diff --git a/src/libultra_boot_O2/osViModeFpalLan1.c b/src/libultra_boot_O2/osViModeFpalLan1.c index c620ad53d9..47b36d7ad9 100644 --- a/src/libultra_boot_O2/osViModeFpalLan1.c +++ b/src/libultra_boot_O2/osViModeFpalLan1.c @@ -1,33 +1,32 @@ #include -OSViMode osViModeFpalLan1 = -{ - 0x2C, //type - { //comRegs - 0x311E, //ctrl - 0x140, //width - 0x4541E3A, //burst - 0x271, //vSync - 0x170C69, //hSync - 0xC6F0C6D, //leap - 0x800300, //hStart - 0x200, //xScale - 0 //vCurrent +OSViMode osViModeFpalLan1 = { + 0x2C, // type + { + // comRegs + 0x311E, // ctrl + 0x140, // width + 0x4541E3A, // burst + 0x271, // vSync + 0x170C69, // hSync + 0xC6F0C6D, // leap + 0x800300, // hStart + 0x200, // xScale + 0 // vCurrent }, - { //fldRegs - { - 0x280, //origin - 0x400, //yScale - 0x2F0269, //vStart - 0x9026B, //vBurst - 2, //vIntr - }, - { - 0x280, //origin - 0x400, //yScale - 0x2F0269, //vStart - 0x9026B, //vBurst - 2 //vIntr - } - } + { // fldRegs + { + 0x280, // origin + 0x400, // yScale + 0x2F0269, // vStart + 0x9026B, // vBurst + 2, // vIntr + }, + { + 0x280, // origin + 0x400, // yScale + 0x2F0269, // vStart + 0x9026B, // vBurst + 2 // vIntr + } }, }; diff --git a/src/libultra_boot_O2/osViModeMpalLan1.c b/src/libultra_boot_O2/osViModeMpalLan1.c index 805cd450b3..7557468f82 100644 --- a/src/libultra_boot_O2/osViModeMpalLan1.c +++ b/src/libultra_boot_O2/osViModeMpalLan1.c @@ -1,33 +1,34 @@ #include -OSViMode osViModeMpalLan1 = -{ - 0x1E, //type - { //comRegs - 0x311E, //ctrl - 0x140, //width - 0x4651E39, //burst - 0x20D, //vSync - 0x40C11, //hSync - 0xC190C1A, //leap - 0x6C02EC, //hStart - 0x200, //xScale - 0, //vCurrent +OSViMode osViModeMpalLan1 = { + 0x1E, // type + { + // comRegs + 0x311E, // ctrl + 0x140, // width + 0x4651E39, // burst + 0x20D, // vSync + 0x40C11, // hSync + 0xC190C1A, // leap + 0x6C02EC, // hStart + 0x200, // xScale + 0, // vCurrent }, - { //fldRegs - { //[0] - 0x280, //origin - 0x400, //yScale - 0x2501FF, //vStart - 0xE0204, //vBurst - 2, //vIntr - }, - { //[1] - 0x280, //origin - 0x400, //yScale - 0x2501FF, //vStart - 0xE0204, //vBurst - 2, //vIntr - } - } + { // fldRegs + { + // [0] + 0x280, // origin + 0x400, // yScale + 0x2501FF, // vStart + 0xE0204, // vBurst + 2, // vIntr + }, + { + // [1] + 0x280, // origin + 0x400, // yScale + 0x2501FF, // vStart + 0xE0204, // vBurst + 2, // vIntr + } }, }; diff --git a/src/libultra_boot_O2/osViModeNtscLan1.c b/src/libultra_boot_O2/osViModeNtscLan1.c index 99573758e8..1026faae8f 100644 --- a/src/libultra_boot_O2/osViModeNtscLan1.c +++ b/src/libultra_boot_O2/osViModeNtscLan1.c @@ -1,33 +1,34 @@ #include -OSViMode osViModeNtscLan1 = -{ - 2, //type - { //comRegs - 0x311E, //ctrl - 0x140, //width - 0x3E52239, //burst - 0x20D, //vSync - 0xC15, //hSync - 0xC150C15, //leap - 0x6C02EC, //hStart - 0x200, //xScale - 0, //vCurrent +OSViMode osViModeNtscLan1 = { + 2, // type + { + // comRegs + 0x311E, // ctrl + 0x140, // width + 0x3E52239, // burst + 0x20D, // vSync + 0xC15, // hSync + 0xC150C15, // leap + 0x6C02EC, // hStart + 0x200, // xScale + 0, // vCurrent }, - { //fldRegs - { //[0] - 0x280, //origin - 0x400, //yScale - 0x2501FF, //vStart - 0xE0204, //vBurst - 2, //vIntr - }, - { //[1] - 0x280, //origin - 0x400, //yScale - 0x2501FF, //vStart - 0xE0204, //vBurst - 2, //vIntr - } - } + { // fldRegs + { + // [0] + 0x280, // origin + 0x400, // yScale + 0x2501FF, // vStart + 0xE0204, // vBurst + 2, // vIntr + }, + { + // [1] + 0x280, // origin + 0x400, // yScale + 0x2501FF, // vStart + 0xE0204, // vBurst + 2, // vIntr + } }, }; diff --git a/src/libultra_boot_O2/osViSetMode.c b/src/libultra_boot_O2/osViSetMode.c index 5d29da826e..6b7a5e21a2 100644 --- a/src/libultra_boot_O2/osViSetMode.c +++ b/src/libultra_boot_O2/osViSetMode.c @@ -1,7 +1,6 @@ #include -void osViSetMode(OSViMode *mode) -{ +void osViSetMode(OSViMode* mode) { register u32 int_disabled = __osDisableInt(); __osViNext->modep = mode; __osViNext->state = 1; diff --git a/src/libultra_boot_O2/osViSetSpecialFeatures.c b/src/libultra_boot_O2/osViSetSpecialFeatures.c index 06d040a513..ab949ba317 100644 --- a/src/libultra_boot_O2/osViSetSpecialFeatures.c +++ b/src/libultra_boot_O2/osViSetSpecialFeatures.c @@ -1,7 +1,6 @@ #include -void osViSetSpecialFeatures(u32 func) -{ +void osViSetSpecialFeatures(u32 func) { register u32 int_disabled = __osDisableInt(); if (func & OS_VI_GAMMA_ON) { __osViNext->features |= OS_VI_GAMMA; diff --git a/src/libultra_boot_O2/osViSetXScale.c b/src/libultra_boot_O2/osViSetXScale.c index 128b64c991..3c3103c462 100644 --- a/src/libultra_boot_O2/osViSetXScale.c +++ b/src/libultra_boot_O2/osViSetXScale.c @@ -1,7 +1,6 @@ #include -void osViSetXScale(f32 value) -{ +void osViSetXScale(f32 value) { register u32 nomValue; register u32 saveMask; diff --git a/src/libultra_boot_O2/osViSetYScale.c b/src/libultra_boot_O2/osViSetYScale.c index bf34f28e16..91f12fed2c 100644 --- a/src/libultra_boot_O2/osViSetYScale.c +++ b/src/libultra_boot_O2/osViSetYScale.c @@ -1,7 +1,6 @@ #include -void osViSetYScale(float scale) -{ +void osViSetYScale(float scale) { register s32 prevInt; prevInt = __osDisableInt(); diff --git a/src/libultra_boot_O2/osViSwapBuffer.c b/src/libultra_boot_O2/osViSwapBuffer.c index eb6b05d31d..c671a50f00 100644 --- a/src/libultra_boot_O2/osViSwapBuffer.c +++ b/src/libultra_boot_O2/osViSwapBuffer.c @@ -1,7 +1,6 @@ #include -void osViSwapBuffer(void *vaddr) -{ +void osViSwapBuffer(void* vaddr) { u32 int_disabled = __osDisableInt(); __osViNext->buffer = vaddr; __osViNext->state |= 0x10; // TODO: figure out what this flag means diff --git a/src/libultra_boot_O2/pimgr.c b/src/libultra_boot_O2/pimgr.c index c15d7b9194..581f66f480 100644 --- a/src/libultra_boot_O2/pimgr.c +++ b/src/libultra_boot_O2/pimgr.c @@ -1,6 +1,6 @@ #include -OSMgrArgs __osPiDevMgr = {0}; +OSMgrArgs __osPiDevMgr = { 0 }; OSPiHandle __Dom1SpeedParam; OSPiHandle __Dom2SpeedParam; @@ -11,31 +11,27 @@ OSMesg piEventBuf[2]; OSThread __osThreadSave; OSPiHandle* __osPiTable = NULL; -OSPiHandle* __osCurrentHandle[] = -{ +OSPiHandle* __osCurrentHandle[] = { &__Dom1SpeedParam, &__Dom2SpeedParam, }; - -void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt) -{ +void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt) { u32 int_disabled; OSPri newPri; OSPri currentPri; - if (!__osPiDevMgr.initialized) - { + if (!__osPiDevMgr.initialized) { osCreateMesgQueue(cmdQ, cmdBuf, cmdMsgCnt); osCreateMesgQueue(&piEventQueue, piEventBuf, 1); - if (!__osPiAccessQueueEnabled) + if (!__osPiAccessQueueEnabled) { __osPiCreateAccessQueue(); + } osSetEventMesg(OS_EVENT_PI, &piEventQueue, (OSMesg)0x22222222); newPri = -1; currentPri = osGetThreadPri(NULL); - if (currentPri < pri) - { + if (currentPri < pri) { newPri = currentPri; osSetThreadPri(NULL, pri); } @@ -49,12 +45,13 @@ void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgC __osPiDevMgr.piDmaCallback = __osPiRawStartDma; __osPiDevMgr.epiDmaCallback = __osEPiRawStartDma; - osCreateThread(&piThread, 0, __osDevMgrMain, (void *)&__osPiDevMgr, piStackThread + sizeof(piStackThread), pri); + osCreateThread(&piThread, 0, __osDevMgrMain, (void*)&__osPiDevMgr, piStackThread + sizeof(piStackThread), pri); osStartThread(&piThread); __osRestoreInt(int_disabled); - if (newPri != -1) + if (newPri != -1) { osSetThreadPri(NULL, newPri); + } } } diff --git a/src/libultra_boot_O2/sprintf.c b/src/libultra_boot_O2/sprintf.c index 58510a35c2..2ff0b33e06 100644 --- a/src/libultra_boot_O2/sprintf.c +++ b/src/libultra_boot_O2/sprintf.c @@ -1,26 +1,25 @@ #include -char* proutSprintf(char* dst, const char *fmt, size_t size) -{ +char* proutSprintf(char* dst, const char* fmt, size_t size) { return (char*)memcpy(dst, fmt, size) + size; } -s32 vsprintf(char* dst, const char* fmt, va_list args) -{ +s32 vsprintf(char* dst, const char* fmt, va_list args) { s32 ret = _Printf(&proutSprintf, dst, fmt, args); - if (ret > -1) + if (ret > -1) { dst[ret] = 0; + } return ret; } -s32 sprintf(char* dst, const char* fmt, ...) -{ +s32 sprintf(char* dst, const char* fmt, ...) { s32 ret; va_list args; va_start(args, fmt); ret = _Printf(&proutSprintf, dst, fmt, args); - if (ret > -1) + if (ret > -1) { dst[ret] = 0; + } return ret; } diff --git a/src/libultra_boot_O2/string.c b/src/libultra_boot_O2/string.c index 771caf1a3d..529ba37d8f 100644 --- a/src/libultra_boot_O2/string.c +++ b/src/libultra_boot_O2/string.c @@ -1,33 +1,30 @@ #include -const u8 *strchr(const u8 *str, s32 ch) -{ +const u8* strchr(const u8* str, s32 ch) { u8 c = ch; - while (*str != c) - { - if (*str == 0) + while (*str != c) { + if (*str == 0) { return NULL; + } str++; } return str; } -size_t strlen(const u8 *str) -{ - const u8 *ptr = str; - while (*ptr) +size_t strlen(const u8* str) { + const u8* ptr = str; + while (*ptr) { ptr++; + } return ptr - str; } -void *memcpy(void *dst, const void *src, size_t size) -{ - u8 *_dst = dst; - const u8 *_src = src; - while (size > 0) - { +void* memcpy(void* dst, const void* src, size_t size) { + u8* _dst = dst; + const u8* _src = src; + while (size > 0) { *_dst++ = *_src++; size--; } return dst; -} \ No newline at end of file +} diff --git a/src/libultra_boot_O2/vimgr.c b/src/libultra_boot_O2/vimgr.c index de54494f99..d2839078ef 100644 --- a/src/libultra_boot_O2/vimgr.c +++ b/src/libultra_boot_O2/vimgr.c @@ -1,7 +1,6 @@ #include -typedef struct -{ +typedef struct { u16 unk00; u8 unk02; u32 unk04; @@ -16,18 +15,16 @@ OSMesgQueue viEventQueue; OSMesg viEventBuf[6]; viMesgStruct viRetraceMsg; viMesgStruct viCounterMsg; -OSMgrArgs __osViDevMgr = {0}; +OSMgrArgs __osViDevMgr = { 0 }; u32 __additional_scanline = 0; void viMgrMain(void*); -void osCreateViManager(OSPri pri) -{ +void osCreateViManager(OSPri pri) { u32 int_disabled; OSPri newPri; OSPri currentPri; - if (!__osViDevMgr.initialized) - { + if (!__osViDevMgr.initialized) { __osTimerServicesInit(); __additional_scanline = 0; osCreateMesgQueue(&viEventQueue, viEventBuf, 5); @@ -41,8 +38,7 @@ void osCreateViManager(OSPri pri) osSetEventMesg(OS_EVENT_COUNTER, &viEventQueue, &viCounterMsg); newPri = -1; currentPri = osGetThreadPri(NULL); - if (currentPri < pri) - { + if (currentPri < pri) { newPri = currentPri; osSetThreadPri(NULL, pri); } @@ -56,19 +52,17 @@ void osCreateViManager(OSPri pri) __osViDevMgr.piDmaCallback = NULL; __osViDevMgr.epiDmaCallback = NULL; - osCreateThread(&viThread, 0, &viMgrMain, &__osViDevMgr, viThreadStack+sizeof(viThreadStack), pri); + osCreateThread(&viThread, 0, &viMgrMain, &__osViDevMgr, viThreadStack + sizeof(viThreadStack), pri); __osViInit(); osStartThread(&viThread); __osRestoreInt(int_disabled); - if (newPri != -1) - { + if (newPri != -1) { osSetThreadPri(NULL, newPri); } } } -void viMgrMain(void* vargs) -{ +void viMgrMain(void* vargs) { OSMgrArgs* args; static u16 viRetrace; u32 addTime; @@ -77,49 +71,47 @@ void viMgrMain(void* vargs) temp = 0; mesg = NULL; - viRetrace = __osViGetCurrentContext()->retraceCount; - if (viRetrace == 0) + viRetrace = __osViGetCurrentContext()->retraceCount; + if (viRetrace == 0) { viRetrace = 1; + } args = (OSMgrArgs*)vargs; - while (1) - { + while (1) { osRecvMesg(args->eventQueue, (OSMesg)&mesg, OS_MESG_BLOCK); - switch (mesg->unk00) - { - case 13: - __osViSwapContext(); - viRetrace--; - if (!viRetrace) - { - OSViContext* ctx = __osViGetCurrentContext(); - if (ctx->mq) - osSendMesg(ctx->mq, ctx->msg, OS_MESG_NOBLOCK); - viRetrace = ctx->retraceCount; - } + switch (mesg->unk00) { + case 13: + __osViSwapContext(); + viRetrace--; + if (!viRetrace) { + OSViContext* ctx = __osViGetCurrentContext(); + if (ctx->mq) { + osSendMesg(ctx->mq, ctx->msg, OS_MESG_NOBLOCK); + } + viRetrace = ctx->retraceCount; + } - __osViIntrCount++; + __osViIntrCount++; - // block optimized out since temp is always 0, - // but it changes register allocation and ordering for __osCurrentTime - if (temp != 0) - { - addTime = osGetCount(); - __osCurrentTime = addTime; - temp = 0; - } + // block optimized out since temp is always 0, + // but it changes register allocation and ordering for __osCurrentTime + if (temp != 0) { + addTime = osGetCount(); + __osCurrentTime = addTime; + temp = 0; + } - addTime = __osBaseCounter; - __osBaseCounter = osGetCount(); - addTime = __osBaseCounter - addTime; - __osCurrentTime = __osCurrentTime + addTime; + addTime = __osBaseCounter; + __osBaseCounter = osGetCount(); + addTime = __osBaseCounter - addTime; + __osCurrentTime = __osCurrentTime + addTime; - break; + break; - case 14: - __osTimerInterrupt(); - break; + case 14: + __osTimerInterrupt(); + break; } } } diff --git a/src/libultra_code/__osSiCreateAccessQueue.c b/src/libultra_code/__osSiCreateAccessQueue.c index e2d0c8e337..b1ed321afc 100644 --- a/src/libultra_code/__osSiCreateAccessQueue.c +++ b/src/libultra_code/__osSiCreateAccessQueue.c @@ -7,13 +7,13 @@ OSMesg osSiMesgBuff[SIAccessQueueSize]; OSMesgQueue gOsSiMessageQueue; u32 gOsSiAccessQueueCreated = 0; -void __osSiCreateAccessQueue() { //func_80100B50 +void __osSiCreateAccessQueue() { gOsSiAccessQueueCreated = 1; osCreateMesgQueue(&gOsSiMessageQueue, &osSiMesgBuff[0], SIAccessQueueSize - 1); osSendMesg(&gOsSiMessageQueue, NULL, OS_MESG_NOBLOCK); } -void __osSiGetAccess() { //func_80100BA0 +void __osSiGetAccess() { OSMesg sp1c; if (!gOsSiAccessQueueCreated) { __osSiCreateAccessQueue(); @@ -21,6 +21,6 @@ void __osSiGetAccess() { //func_80100BA0 osRecvMesg(&gOsSiMessageQueue, &sp1c, OS_MESG_BLOCK); } -void __osSiRelAccess() { //func_80100BE4 +void __osSiRelAccess() { osSendMesg(&gOsSiMessageQueue, NULL, OS_MESG_NOBLOCK); } diff --git a/src/libultra_code/__osSiRawStartDma.c b/src/libultra_code/__osSiRawStartDma.c index 537a0fba2f..d440366575 100644 --- a/src/libultra_code/__osSiRawStartDma.c +++ b/src/libultra_code/__osSiRawStartDma.c @@ -1,21 +1,20 @@ #include "libultra_internal.h" #include -s32 __osSiRawStartDma(s32 dir, void *addr) //func_801013F0 -{ - if (HW_REG(SI_STATUS_REG, u32) & (SI_STATUS_DMA_BUSY | SI_STATUS_IO_READ_BUSY)){ +s32 __osSiRawStartDma(s32 dir, void* addr) { + if (HW_REG(SI_STATUS_REG, u32) & (SI_STATUS_DMA_BUSY | SI_STATUS_IO_READ_BUSY)) { return -1; } - if (dir == OS_WRITE){ + if (dir == OS_WRITE) { osWritebackDCache(addr, 0x40); } HW_REG(SI_DRAM_ADDR_REG, void*) = (void*)osVirtualToPhysical(addr); - if (dir == OS_READ){ + if (dir == OS_READ) { HW_REG(SI_PIF_ADDR_RD64B_REG, void*) = (void*)PIF_RAM_START; - }else{ + } else { HW_REG(SI_PIF_ADDR_WR64B_REG, void*) = (void*)PIF_RAM_START; } - if (dir == OS_READ){ + if (dir == OS_READ) { osInvalDCache(addr, 0x40); } return 0; diff --git a/src/libultra_code/__osSpGetStatus.c b/src/libultra_code/__osSpGetStatus.c index 61b5053b24..cd68e408c7 100644 --- a/src/libultra_code/__osSpGetStatus.c +++ b/src/libultra_code/__osSpGetStatus.c @@ -2,7 +2,6 @@ #include #include -u32 __osSpGetStatus() -{ +u32 __osSpGetStatus() { return HW_REG(SP_STATUS_REG, u32); } diff --git a/src/libultra_code/__osSpSetStatus.c b/src/libultra_code/__osSpSetStatus.c index 3bd9c84d3c..01cf1adc1a 100644 --- a/src/libultra_code/__osSpSetStatus.c +++ b/src/libultra_code/__osSpSetStatus.c @@ -2,7 +2,6 @@ #include #include -void __osSpSetStatus(u32 a0) -{ +void __osSpSetStatus(u32 a0) { HW_REG(SP_STATUS_REG, u32) = a0; } diff --git a/src/libultra_code/code_80101B40.c.ignore b/src/libultra_code/code_80101B40.c.ignore index f0780cb743..908f84f9ef 100644 --- a/src/libultra_code/code_80101B40.c.ignore +++ b/src/libultra_code/code_80101B40.c.ignore @@ -1,8 +1,7 @@ #include #include -void func_80101B40(u32* a0) -{ +void func_80101B40(u32* a0) { a0[0] = 0x3F800000; // Float? a0[1] = 0; a0[2] = 0; diff --git a/src/libultra_code/code_80103B30.c b/src/libultra_code/code_80103B30.c index 2e17bf58d8..5137e4e26c 100644 --- a/src/libultra_code/code_80103B30.c +++ b/src/libultra_code/code_80103B30.c @@ -2,14 +2,14 @@ #include #include -u32 func_80103B30() -{ +u32 func_80103B30() { register u32 status; status = HW_REG(SP_STATUS_REG, u32); - if (status & 0x1C) + if (status & 0x1C) { return 1; + } return 0; } diff --git a/src/libultra_code/code_80104140.c b/src/libultra_code/code_80104140.c index c2ccd0c8d0..aa9fed857e 100644 --- a/src/libultra_code/code_80104140.c +++ b/src/libultra_code/code_80104140.c @@ -1,6 +1,5 @@ #include -OSThread* func_80104140() -{ +OSThread* func_80104140() { return __osActiveQueue; } diff --git a/src/libultra_code/code_801064C0.c b/src/libultra_code/code_801064C0.c index 04eafa5d8b..23b73d853e 100644 --- a/src/libultra_code/code_801064C0.c +++ b/src/libultra_code/code_801064C0.c @@ -1,7 +1,6 @@ #include #include -OSThread* __osGetCurrFaultedThread() -{ +OSThread* __osGetCurrFaultedThread() { return __osFaultedThread; } diff --git a/src/libultra_code/code_80106760.c b/src/libultra_code/code_80106760.c index e6626dfb34..e9f44fd633 100644 --- a/src/libultra_code/code_80106760.c +++ b/src/libultra_code/code_80106760.c @@ -1,8 +1,7 @@ #include #include -u32* func_80106760() -{ +u32* func_80106760() { register u32 sMask = __osDisableInt(); u32* var1; diff --git a/src/libultra_code/code_801067A0.c b/src/libultra_code/code_801067A0.c index 2257881abb..0ea5f968cd 100644 --- a/src/libultra_code/code_801067A0.c +++ b/src/libultra_code/code_801067A0.c @@ -2,14 +2,14 @@ #include #include -s32 func_801067A0(u32 a0) -{ +s32 func_801067A0(u32 a0) { register u32 spStatus; spStatus = HW_REG(SP_STATUS_REG, u32); - if (!(spStatus & SP_STATUS_HALT)) + if (!(spStatus & SP_STATUS_HALT)) { return -1; + } HW_REG(SP_PC_REG, u32) = a0; diff --git a/src/libultra_code/guPerspectiveF.c b/src/libultra_code/guPerspectiveF.c index caef68560f..503bcc25a4 100644 --- a/src/libultra_code/guPerspectiveF.c +++ b/src/libultra_code/guPerspectiveF.c @@ -1,7 +1,6 @@ #include "libultra_internal.h" -void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, float near, float far, - float scale) { +void guPerspectiveF(float mf[4][4], u16* perspNorm, float fovy, float aspect, float near, float far, float scale) { float yscale; int row; int col; @@ -23,14 +22,14 @@ void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, fl if (near + far <= 2.0) { *perspNorm = 65535; } else { - *perspNorm = (double) (1 << 17) / (near + far); - if (*perspNorm <= 0) + *perspNorm = (double)(1 << 17) / (near + far); + if (*perspNorm <= 0) { *perspNorm = 1; + } } } } -void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, float far, - float scale) { +void guPerspective(Mtx* m, u16* perspNorm, float fovy, float aspect, float near, float far, float scale) { float mat[4][4]; guPerspectiveF(mat, perspNorm, fovy, aspect, near, far, scale); guMtxF2L(mat, m); diff --git a/src/libultra_code/osContInit.c b/src/libultra_code/osContInit.c index dcccfb765c..33cc136b8f 100644 --- a/src/libultra_code/osContInit.c +++ b/src/libultra_code/osContInit.c @@ -5,19 +5,19 @@ pif_data_buffer_t _osPifInternalBuff; u8 _osCont_lastPollType; -u8 _osCont_numControllers; //always 4 +u8 _osCont_numControllers; // always 4 -//Not sure if the following is a struct together with the last two variables +// Not sure if the following is a struct together with the last two variables u16 unk_80175812; u32 unk_80175814; -u8 unk_80175818[0x20]; +u8 unk_80175818[0x20]; u32 gOsContInitialized = 0; OSMesgQueue _osContMesgQueue; OSMesg _osContMesgBuff[4]; #define HALF_SECOND OS_USEC_TO_CYCLES(500000) -s32 osContInit(OSMesgQueue *mq, u8 *ctl_present_bitfield, OSContStatus *status) { //func_80100C10 +s32 osContInit(OSMesgQueue* mq, u8* ctl_present_bitfield, OSContStatus* status) { OSMesg mesg; s32 ret = 0; OSTime currentTime; @@ -47,8 +47,8 @@ s32 osContInit(OSMesgQueue *mq, u8 *ctl_present_bitfield, OSContStatus *status) return ret; } -void __osContGetInitData(u8 *ctl_present_bitfield, OSContStatus *status) { //func_80100D6C - PIF_IO_slot_t *slot_ptr; +void __osContGetInitData(u8* ctl_present_bitfield, OSContStatus* status) { + PIF_IO_slot_t* slot_ptr; PIF_IO_slot_t slot; s32 i; u8 bitfield_temp; @@ -66,11 +66,11 @@ void __osContGetInitData(u8 *ctl_present_bitfield, OSContStatus *status) { //fun *ctl_present_bitfield = bitfield_temp; } -void __osPackRequestData(u8 command) { //func_80100E18 - PIF_IO_slot_t *slot_ptr; +void __osPackRequestData(u8 command) { + PIF_IO_slot_t* slot_ptr; PIF_IO_slot_t slot; s32 i; - for(i = 0; i < 0xF; i++) { + for (i = 0; i < 0xF; i++) { _osPifInternalBuff.words[i] = 0; } _osPifInternalBuff.status_control = 1; diff --git a/src/libultra_code/osContStartReadData.c b/src/libultra_code/osContStartReadData.c index a96bc6f288..9bd0bfbd23 100644 --- a/src/libultra_code/osContStartReadData.c +++ b/src/libultra_code/osContStartReadData.c @@ -3,12 +3,10 @@ #include -s32 osContStartReadData(OSMesgQueue *mq) //func_80100EF0 -{ +s32 osContStartReadData(OSMesgQueue* mq) { s32 ret; - __osSiGetAccess(); //__osSiGetAccess - if (_osCont_lastPollType != 1) - { + __osSiGetAccess(); // __osSiGetAccess + if (_osCont_lastPollType != 1) { __osPackReadData(); __osSiRawStartDma(OS_WRITE, &_osPifInternalBuff); osRecvMesg(mq, NULL, OS_MESG_BLOCK); @@ -19,8 +17,8 @@ s32 osContStartReadData(OSMesgQueue *mq) //func_80100EF0 return ret; } -void osContGetReadData(OSContPad *pad) { //func_80100F74 - PIF_IO_slot_t *slot_ptr; +void osContGetReadData(OSContPad* pad) { + PIF_IO_slot_t* slot_ptr; PIF_IO_slot_t slot; s32 i; slot_ptr = _osPifInternalBuff.slots; @@ -35,12 +33,12 @@ void osContGetReadData(OSContPad *pad) { //func_80100F74 }; } -void __osPackReadData() { //func_80101000 - PIF_IO_slot_t *slot_ptr; +void __osPackReadData() { + PIF_IO_slot_t* slot_ptr; PIF_IO_slot_t slot; s32 i; slot_ptr = _osPifInternalBuff.slots; - for(i = 0; i < 0xF; i++) { + for (i = 0; i < 0xF; i++) { _osPifInternalBuff.words[i] = 0; } _osPifInternalBuff.status_control = 1; @@ -51,7 +49,7 @@ void __osPackReadData() { //func_80101000 slot.button = 0xFFFF; slot.rawStickX = 0xFF; slot.rawStickY = 0xFF; - for(i = 0; i < _osCont_numControllers; i++) { + for (i = 0; i < _osCont_numControllers; i++) { *slot_ptr++ = slot; } slot_ptr->hdr.slot_type = 0xFE; diff --git a/src/libultra_code/osDpGetStatus.c b/src/libultra_code/osDpGetStatus.c index 636bdd2f96..f9c87f1fb2 100644 --- a/src/libultra_code/osDpGetStatus.c +++ b/src/libultra_code/osDpGetStatus.c @@ -1,6 +1,5 @@ #include -u32 osDpGetStatus(void) -{ +u32 osDpGetStatus(void) { return DPC_STATUS_REG; } diff --git a/src/libultra_code/osDpSetStatus.c b/src/libultra_code/osDpSetStatus.c index 9a5f189a55..d57ca509e3 100644 --- a/src/libultra_code/osDpSetStatus.c +++ b/src/libultra_code/osDpSetStatus.c @@ -1,6 +1,5 @@ #include -void osDpSetStatus(u32 status) -{ +void osDpSetStatus(u32 status) { DPC_STATUS_REG = status; } diff --git a/src/libultra_code/osVibrationPack.c b/src/libultra_code/osVibrationPack.c index b00f25de80..033f04500e 100644 --- a/src/libultra_code/osVibrationPack.c +++ b/src/libultra_code/osVibrationPack.c @@ -5,25 +5,24 @@ pif_data_buffer_t osPifBuffers[4]; -//func_800CF990 in 1.0 -s32 osSetVibration(unk_controller_t *arg0, u32 vibrate) //func_80100780 -{ +// func_800CF990 in 1.0 +s32 osSetVibration(unk_controller_t* arg0, u32 vibrate) { s32 i; s32 ret; - u8 *buf; - + u8* buf; + buf = (u8*)&osPifBuffers[arg0->ctrlridx]; - if (!(arg0->unk0 & 8)){ + if (!(arg0->unk0 & 8)) { return 5; } __osSiGetAccess(); osPifBuffers[arg0->ctrlridx].status_control = 1; buf += arg0->ctrlridx; - for(i=0; i<0x20; i++){ - ((PIF_mempak_wr_t*)buf)->data[i+2] = vibrate; + for (i = 0; i < 0x20; i++) { + ((PIF_mempak_wr_t*)buf)->data[i + 2] = vibrate; } - - _osCont_lastPollType = (u8)0xfe; //last controller poll type? + + _osCont_lastPollType = (u8)0xfe; // last controller poll type? __osSiRawStartDma(OS_WRITE, &osPifBuffers[arg0->ctrlridx]); osRecvMesg(arg0->ctrlrqueue, NULL, OS_MESG_BLOCK); __osSiRawStartDma(OS_READ, &osPifBuffers[arg0->ctrlridx]); @@ -31,11 +30,11 @@ s32 osSetVibration(unk_controller_t *arg0, u32 vibrate) //func_80100780 ret = ((PIF_mempak_wr_t*)buf)->hdr.status_hi_bytes_rec_lo & 0xc0; if (!ret) { if (!vibrate) { - if (((PIF_mempak_wr_t*)buf)->data[0x22] != 0){ + if (((PIF_mempak_wr_t*)buf)->data[0x22] != 0) { ret = 4; } - }else{ - if (((PIF_mempak_wr_t*)buf)->data[0x22] != 0xeb){ + } else { + if (((PIF_mempak_wr_t*)buf)->data[0x22] != 0xeb) { ret = 4; } } @@ -44,19 +43,18 @@ s32 osSetVibration(unk_controller_t *arg0, u32 vibrate) //func_80100780 return ret; } -void osSetUpMempakWrite(s32 ctrlridx, pif_data_buffer_t* buf) //func_801009F4 -{ +void osSetUpMempakWrite(s32 ctrlridx, pif_data_buffer_t* buf) { u8* buf_ptr = (u8*)buf; PIF_mempak_wr_t mempakwr; s32 i; mempakwr.hdr.slot_type = 0xFF; mempakwr.hdr.bytes_send = 0x23; mempakwr.hdr.status_hi_bytes_rec_lo = 1; - mempakwr.hdr.command = 3; //write mempak + mempakwr.hdr.command = 3; // write mempak mempakwr.data[0] = 0xC0; - mempakwr.data[1] = (u8)(func_80106170(0x600) | 0xC000); //yes, this is correct - if(ctrlridx != 0){ - for(i=0; ictrlrqueue = ctrlrqueue; unk_controller->ctrlridx = ctrlridx; unk_controller->bytes[0x65] = (u8)0xff; unk_controller->unk0 = 0; - + ret = func_80104C80(unk_controller, 0xfe); - if (ret == 2){ + if (ret == 2) { ret = func_80104C80(unk_controller, 0x80); } - if (ret != 0){ + if (ret != 0) { return ret; } ret = func_80105F40(ctrlrqueue, ctrlridx, 0x400, &sp24); ret = ret; - if (ret == 2){ + if (ret == 2) { ret = 4; //"Controller pack communication error" } - if (ret != 0){ + if (ret != 0) { return ret; } - if (sp24.unk[0x1F] == 0xfe){ - return 0xb; //possibly controller pack? (Some other valid return value other than vibration pack) + if (sp24.unk[0x1F] == 0xfe) { + return 0xb; // possibly controller pack? (Some other valid return value other than vibration pack) } ret = func_80104C80(unk_controller, 0x80); - if (ret == 2){ + if (ret == 2) { ret = 4; //"Controller pack communication error" } - if (ret != 0){ + if (ret != 0) { return ret; } ret = func_80105F40(ctrlrqueue, ctrlridx, 0x400, &sp24); - if (ret == 2){ + if (ret == 2) { ret = 4; //"Controller pack communication error" } - if (ret != 0){ + if (ret != 0) { return ret; } - if (sp24.unk[0x1F] != 0x80){ - return 0xb; //possibly controller pack? (Some other valid return value other than vibration pack) + if (sp24.unk[0x1F] != 0x80) { + return 0xb; // possibly controller pack? (Some other valid return value other than vibration pack) } - if ((unk_controller->unk0 & 8) == 0){ + if ((unk_controller->unk0 & 8) == 0) { osSetUpMempakWrite(ctrlridx, &osPifBuffers[ctrlridx]); } unk_controller->unk0 = 8; return 0; //"Recognized vibration pack" } - diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index d81d0c84f7..bf24cb9702 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -1,6 +1,6 @@ #include "z_arms_hook.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void ArmsHook_Init(ArmsHook* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 5bf11cac9f..436e0fd78d 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -1,6 +1,6 @@ #include "z_arrow_fire.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void ArrowFire_Init(ArrowFire* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 466249a739..dcd9b8aca8 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -1,6 +1,6 @@ #include "z_arrow_ice.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void ArrowIce_Init(ArrowIce* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index cd1734d25c..255088a17c 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -1,6 +1,6 @@ #include "z_arrow_light.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void ArrowLight_Init(ArrowLight* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index f1b5366cb8..f288e6ae7e 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -1,6 +1,6 @@ #include "z_bg_bdan_objects.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgBdanObjects_Init(BgBdanObjects* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index 4a9005cac6..bd6bcb48b7 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -2,29 +2,26 @@ * File: z_bg_bdan_switch.c * Overlay: Bg_Bdan_Switch * Description: Switches (Inside Lord Jabu-Jabu) -*/ + */ #include #include // BgBdanSwitch.actor.params & 0xFF -typedef enum -{ - BLUE, - YELLOW_HEAVY, - YELLOW, - YELLOW_TALL_1, - YELLOW_TALL_2 +typedef enum { + /* 0x00 */ BLUE, + /* 0x01 */ YELLOW_HEAVY, + /* 0x02 */ YELLOW, + /* 0x03 */ YELLOW_TALL_1, + /* 0x04 */ YELLOW_TALL_2 } BgBdanSwitchType; -typedef struct -{ +typedef struct { /* 0x00 */ char unk_00[0x2E]; /* 0x2E */ s16 unk_2E; } ColliderCustomHelper; -typedef struct -{ +typedef struct { /* 0x00 */ Collider base; /* 0x18 */ char unk_18[0x4]; /* 0x1C */ ColliderCustomHelper* unk_1C; @@ -37,8 +34,7 @@ typedef struct /* 0x46 */ Vec3s position; } ColliderCustomMain; // size = 0x4C -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ u32 dynaPolyId; /* 0x0150 */ f32 unk_150; @@ -60,7 +56,7 @@ typedef struct /* 0x01DD */ char unk_1DD[0x3]; } BgBdanSwitch; // size = 0x01E0 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void BgBdanSwitch_Init(BgBdanSwitch* this, GlobalContext* globalCtx); @@ -96,8 +92,7 @@ static void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx); static void func_8086DDA8(BgBdanSwitch* this); static void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx); -const ActorInit Bg_Bdan_Switch_InitVars = -{ +const ActorInit Bg_Bdan_Switch_InitVars = { ACTOR_BG_BDAN_SWITCH, ACTORTYPE_SWITCH, ROOM, @@ -114,30 +109,20 @@ extern UNK_PTR D_06005CF8; extern UNK_PTR D_060061A0; extern UNK_PTR D_06005A20; -static u32 D_8086E0A0[] = -{ - 0x00000000, 0x00000000, 0x00000000, 0xEFC1FFFE, 0x00000000, 0x00010100, 0x00000000, 0x00780000, 0x01720064 -}; +static u32 D_8086E0A0[] = { 0x00000000, 0x00000000, 0x00000000, 0xEFC1FFFE, 0x00000000, + 0x00010100, 0x00000000, 0x00780000, 0x01720064 }; -static u32 D_8086E0C4[] = -{ - 0x0A000939, 0x20000000, 0x00000001, &D_8086E0A0 -}; +static u32 D_8086E0C4[] = { 0x0A000939, 0x20000000, 0x00000001, &D_8086E0A0 }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_F32(unk_F4, 1400, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), - ICHAIN_F32(unk_FC, 1200, ICHAIN_STOP) + ICHAIN_F32(unk_FC, 1200, ICHAIN_STOP), }; -static u32 D_8086E0E0[] = -{ - 0x00000000, 0x430C0000, 0x00000000, 0x00000000 -}; +static u32 D_8086E0E0[] = { 0x00000000, 0x430C0000, 0x00000000, 0x00000000 }; -static void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) -{ +static void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) { s16 pad1; u32 local_c = 0; s16 pad2; @@ -145,32 +130,26 @@ static void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, u32 coll DynaPolyInfo_SetActorMove(&this->actor, flag); DynaPolyInfo_Alloc(collision, &local_c); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); - if (this->dynaPolyId == 0x32) - { - osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_bdan_switch.c", 325, this->actor.id, this->actor.params); + if (this->dynaPolyId == 0x32) { + osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_bdan_switch.c", 325, + this->actor.id, this->actor.params); } } -static void func_8086D098(BgBdanSwitch* this, GlobalContext* globalCtx) -{ +static void func_8086D098(BgBdanSwitch* this, GlobalContext* globalCtx) { Actor* actor = &this->actor; func_8005BBF8(globalCtx, &this->collider, actor); func_8005C050(globalCtx, &this->collider, actor, &D_8086E0C4, &this->collider.unk_20); } -static void func_8086D0EC(BgBdanSwitch* this) -{ - if (this->unk_1CC > 0) - { +static void func_8086D0EC(BgBdanSwitch* this) { + if (this->unk_1CC > 0) { this->unk_1CC += 0x5DC; - } - else - { + } else { this->unk_1CC += 0xFA0; } - switch (this->actor.params & 0xFF) - { + switch (this->actor.params & 0xFF) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -187,29 +166,24 @@ static void func_8086D0EC(BgBdanSwitch* this) this->actor.shape.unk_08 = 1.2f / this->unk_1D0; } -static void BgBdanSwitch_Init(BgBdanSwitch* this, GlobalContext* globalCtx) -{ +static void BgBdanSwitch_Init(BgBdanSwitch* this, GlobalContext* globalCtx) { s32 pad[2]; s16 type; s32 flag; - + type = this->actor.params & 0xFF; Actor_ProcessInitChain(&this->actor, initChain); - if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) - { + if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) { this->actor.scale.z = 0.05f; this->actor.scale.x = 0.05f; - } - else - { + } else { this->actor.scale.z = 0.1f; this->actor.scale.x = 0.1f; } this->actor.scale.y = 0.0f; Actor_SetHeight(&this->actor, 10.0f); - switch (type) - { + switch (type) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -224,37 +198,27 @@ static void BgBdanSwitch_Init(BgBdanSwitch* this, GlobalContext* globalCtx) flag = Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F); - switch (type) - { + switch (type) { case BLUE: case YELLOW: - if (flag) - { + if (flag) { func_8086D730(this); - } - else - { + } else { func_8086D5C4(this); } break; case YELLOW_HEAVY: - if (flag) - { + if (flag) { func_8086DB24(this); - } - else - { + } else { func_8086D86C(this); } break; case YELLOW_TALL_1: case YELLOW_TALL_2: - if (flag) - { + if (flag) { func_8086DCCC(this); - } - else - { + } else { func_8086DB4C(this); } break; @@ -266,10 +230,8 @@ static void BgBdanSwitch_Init(BgBdanSwitch* this, GlobalContext* globalCtx) osSyncPrintf("(巨大魚ダンジョン 専用スイッチ)(arg_data 0x%04x)\n", this->actor.params); } -static void BgBdanSwitch_Destroy(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - switch(this->actor.params & 0xFF) - { +static void BgBdanSwitch_Destroy(BgBdanSwitch* this, GlobalContext* globalCtx) { + switch (this->actor.params & 0xFF) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -281,76 +243,59 @@ static void BgBdanSwitch_Destroy(BgBdanSwitch* this, GlobalContext* globalCtx) } } -static void func_8086D4B4(BgBdanSwitch* this, GlobalContext* globalCtx) -{ +static void func_8086D4B4(BgBdanSwitch* this, GlobalContext* globalCtx) { s32 pad; s32 type; - if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) - { + if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) { type = this->actor.params & 0xFF; Flags_SetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F); - if (type == BLUE || type == YELLOW_TALL_2) - { + if (type == BLUE || type == YELLOW_TALL_2) { func_800806BC(globalCtx, &this->actor, 0x4807); - } - else - { + } else { func_800806BC(globalCtx, &this->actor, 0x4802); } } } -static void func_8086D548(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - if (Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) - { +static void func_8086D548(BgBdanSwitch* this, GlobalContext* globalCtx) { + if (Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) { Flags_UnsetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F); - if ((this->actor.params & 0xFF) == YELLOW_TALL_2) - { + if ((this->actor.params & 0xFF) == YELLOW_TALL_2) { func_800806BC(globalCtx, &this->actor, 0x4807); } } } -static void func_8086D5C4(BgBdanSwitch* this) -{ +static void func_8086D5C4(BgBdanSwitch* this) { this->updateFunc = &func_8086D5E0; this->unk_1C8 = 1.0f; } -static void func_8086D5E0(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - switch (this->actor.params & 0xFF) - { +static void func_8086D5E0(BgBdanSwitch* this, GlobalContext* globalCtx) { + switch (this->actor.params & 0xFF) { case BLUE: - if (func_800435B4(&this->actor)) - { + if (func_800435B4(&this->actor)) { func_8086D67C(this); func_8086D4B4(this, globalCtx); } break; case YELLOW: - if (func_8004356C(&this->actor)) - { + if (func_8004356C(&this->actor)) { func_8086D67C(this); func_8086D4B4(this, globalCtx); } } } -static void func_8086D67C(BgBdanSwitch* this) -{ +static void func_8086D67C(BgBdanSwitch* this) { this->updateFunc = &func_8086D694; this->unk_1DA = 0x64; } -static void func_8086D694(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - if ((func_8005B198() == this->actor.type) || (this->unk_1DA <= 0)) - { +static void func_8086D694(BgBdanSwitch* this, GlobalContext* globalCtx) { + if ((func_8005B198() == this->actor.type) || (this->unk_1DA <= 0)) { this->unk_1C8 -= 0.2f; - if (this->unk_1C8 <= 0.1f) - { + if (this->unk_1C8 <= 0.1f) { func_8086D730(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH); func_800AA000(this->actor.waterSurfaceDist, 0x78, 0x14, 0xA); @@ -358,97 +303,76 @@ static void func_8086D694(BgBdanSwitch* this, GlobalContext* globalCtx) } } -static void func_8086D730(BgBdanSwitch* this) -{ +static void func_8086D730(BgBdanSwitch* this) { this->unk_1C8 = 0.1f; this->updateFunc = &func_8086D754; this->unk_1D8 = 6; } -static void func_8086D754(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - switch (this->actor.params & 0xFF) - { +static void func_8086D754(BgBdanSwitch* this, GlobalContext* globalCtx) { + switch (this->actor.params & 0xFF) { case BLUE: - if (!func_800435B4(&this->actor)) - { - if (this->unk_1D8 <= 0) - { + if (!func_800435B4(&this->actor)) { + if (this->unk_1D8 <= 0) { func_8086D7FC(this); func_8086D548(this, globalCtx); } - } - else - { + } else { this->unk_1D8 = 6; } break; case YELLOW: - if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) - { + if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) { func_8086D7FC(this); } } } -static void func_8086D7FC(BgBdanSwitch* this) -{ +static void func_8086D7FC(BgBdanSwitch* this) { this->updateFunc = &func_8086D80C; } -static void func_8086D80C(BgBdanSwitch* this, GlobalContext* globalCtx) -{ +static void func_8086D80C(BgBdanSwitch* this, GlobalContext* globalCtx) { this->unk_1C8 += 0.2f; - if (this->unk_1C8 >= 1.0f) - { + if (this->unk_1C8 >= 1.0f) { func_8086D5C4(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH); } } -static void func_8086D86C(BgBdanSwitch* this) -{ +static void func_8086D86C(BgBdanSwitch* this) { this->updateFunc = &func_8086D888; this->unk_1C8 = 1.0f; } -static void func_8086D888(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - if (func_8004356C(&this->actor)) - { +static void func_8086D888(BgBdanSwitch* this, GlobalContext* globalCtx) { + if (func_8004356C(&this->actor)) { func_8086D8BC(this); } } -static void func_8086D8BC(BgBdanSwitch* this) -{ +static void func_8086D8BC(BgBdanSwitch* this) { this->updateFunc = &func_8086D8CC; } -static void func_8086D8CC(BgBdanSwitch* this, GlobalContext* globalCtx) -{ +static void func_8086D8CC(BgBdanSwitch* this, GlobalContext* globalCtx) { this->unk_1C8 -= 0.2f; - if (this->unk_1C8 <= 0.6f) - { + if (this->unk_1C8 <= 0.6f) { func_8086D9F8(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH); func_800AA000(this->actor.waterSurfaceDist, 0x78, 0x14, 0xA); } } -static void func_8086D944(BgBdanSwitch* this) -{ +static void func_8086D944(BgBdanSwitch* this) { this->updateFunc = &func_8086D95C; this->unk_1DA = 0x64; } -static void func_8086D95C(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - if ((func_8005B198() == this->actor.type) || (this->unk_1DA <= 0)) - { +static void func_8086D95C(BgBdanSwitch* this, GlobalContext* globalCtx) { + if ((func_8005B198() == this->actor.type) || (this->unk_1DA <= 0)) { this->unk_1C8 -= 0.2f; - if (this->unk_1C8 <= 0.1f) - { + if (this->unk_1C8 <= 0.1f) { func_8086DB24(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH); func_800AA000(this->actor.waterSurfaceDist, 0x78, 0x14, 0xA); @@ -456,90 +380,69 @@ static void func_8086D95C(BgBdanSwitch* this, GlobalContext* globalCtx) } } -static void func_8086D9F8(BgBdanSwitch* this) -{ +static void func_8086D9F8(BgBdanSwitch* this) { this->unk_1C8 = 0.6f; this->updateFunc = &func_8086DA1C; this->unk_1D8 = 6; } -static void func_8086DA1C(BgBdanSwitch* this, GlobalContext* globalCtx) -{ +static void func_8086DA1C(BgBdanSwitch* this, GlobalContext* globalCtx) { Actor* heldActor = PLAYER->heldActor; - if (func_8004356C(&this->actor)) - { - if (heldActor != NULL && heldActor->id == ACTOR_EN_RU1) - { - if (this->unk_1D8 <= 0) - { + if (func_8004356C(&this->actor)) { + if (heldActor != NULL && heldActor->id == ACTOR_EN_RU1) { + if (this->unk_1D8 <= 0) { func_8086D944(this); func_8086D4B4(this, globalCtx); } - } - else - { + } else { this->unk_1D8 = 6; } - } - else - { - if (this->unk_1D8 <= 0) - { + } else { + if (this->unk_1D8 <= 0) { func_8086DAB4(this); } } } -static void func_8086DAB4(BgBdanSwitch* this) -{ +static void func_8086DAB4(BgBdanSwitch* this) { this->updateFunc = &func_8086DAC4; } -static void func_8086DAC4(BgBdanSwitch* this, GlobalContext* globalCtx) -{ +static void func_8086DAC4(BgBdanSwitch* this, GlobalContext* globalCtx) { this->unk_1C8 += 0.2f; - if (this->unk_1C8 >= 1.0f) - { + if (this->unk_1C8 >= 1.0f) { func_8086D86C(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH); } } -static void func_8086DB24(BgBdanSwitch* this) -{ +static void func_8086DB24(BgBdanSwitch* this) { this->unk_1C8 = 0.1f; this->updateFunc = &func_8086DB40; } -static void func_8086DB40(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - +static void func_8086DB40(BgBdanSwitch* this, GlobalContext* globalCtx) { } -static void func_8086DB4C(BgBdanSwitch* this) -{ +static void func_8086DB4C(BgBdanSwitch* this) { this->updateFunc = &func_8086DB68; this->unk_1C8 = 2.0f; } -static void func_8086DB68(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - switch (this->actor.params & 0xFF) - { +static void func_8086DB68(BgBdanSwitch* this, GlobalContext* globalCtx) { + switch (this->actor.params & 0xFF) { default: return; case YELLOW_TALL_1: - if (((this->collider.base.collideFlags & 2) != 0) && this->unk_1D8 <= 0) - { + if (((this->collider.base.collideFlags & 2) != 0) && this->unk_1D8 <= 0) { this->unk_1D8 = 0xA; func_8086DC30(this); func_8086D4B4(this, globalCtx); } break; case YELLOW_TALL_2: - if (((this->collider.base.collideFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) - { + if (((this->collider.base.collideFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) { this->unk_1D8 = 0xA; func_8086DC30(this); func_8086D4B4(this, globalCtx); @@ -547,44 +450,35 @@ static void func_8086DB68(BgBdanSwitch* this, GlobalContext* globalCtx) } } -static void func_8086DC30(BgBdanSwitch* this) -{ +static void func_8086DC30(BgBdanSwitch* this) { this->updateFunc = &func_8086DC48; this->unk_1DA = 0x64; } -static void func_8086DC48(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - if ((func_8005B198() == this->actor.type) || (this->unk_1DA <= 0)) - { +static void func_8086DC48(BgBdanSwitch* this, GlobalContext* globalCtx) { + if ((func_8005B198() == this->actor.type) || (this->unk_1DA <= 0)) { this->unk_1C8 -= 0.3f; - if (this->unk_1C8 <= 1.0f) - { + if (this->unk_1C8 <= 1.0f) { func_8086DCCC(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH); } } } -static void func_8086DCCC(BgBdanSwitch* this) -{ +static void func_8086DCCC(BgBdanSwitch* this) { this->updateFunc = &func_8086DCE8; this->unk_1C8 = 1.0f; } -static void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - switch (this->actor.params & 0xFF) - { +static void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx) { + switch (this->actor.params & 0xFF) { case YELLOW_TALL_1: - if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) - { + if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) { func_8086DDA8(this); } break; case YELLOW_TALL_2: - if (((this->collider.base.collideFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) - { + if (((this->collider.base.collideFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) { this->unk_1D8 = 0xA; func_8086DDA8(this); func_8086D548(this, globalCtx); @@ -592,45 +486,38 @@ static void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx) } } -static void func_8086DDA8(BgBdanSwitch* this) -{ +static void func_8086DDA8(BgBdanSwitch* this) { this->updateFunc = &func_8086DDC0; this->unk_1DA = 0x64; } -static void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - if ((((this->actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->actor.type)) || (this->unk_1DA <= 0)) - { +static void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) { + if ((((this->actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->actor.type)) || + (this->unk_1DA <= 0)) { this->unk_1C8 += 0.3f; - if (this->unk_1C8 >= 2.0f) - { + if (this->unk_1C8 >= 2.0f) { func_8086DB4C(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH); } } } -static void BgBdanSwitch_Update(BgBdanSwitch* this, GlobalContext* globalCtx) -{ +static void BgBdanSwitch_Update(BgBdanSwitch* this, GlobalContext* globalCtx) { s32 pad; s32 type; s32 pad2; - if (this->unk_1DA > 0) - { + if (this->unk_1DA > 0) { this->unk_1DA -= 1; } this->updateFunc(this, globalCtx); func_8086D0EC(this); type = this->actor.params & 0xFF; - if (type != 3 && type != 4) - { + if (type != 3 && type != 4) { this->unk_1D8 -= 1; return; } - if (!func_8008E988(globalCtx) && this->unk_1D8 > 0) - { + if (!func_8008E988(globalCtx) && this->unk_1D8 > 0) { this->unk_1D8 -= 1; } pad = this->collider.base.collideFlags; @@ -641,17 +528,15 @@ static void BgBdanSwitch_Update(BgBdanSwitch* this, GlobalContext* globalCtx) Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); } -static void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, UNK_TYPE arg2) -{ - func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->unk_1D0), this->actor.posRot.pos.z, &this->actor.shape.rot); +static void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, UNK_TYPE arg2) { + func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->unk_1D0), + this->actor.posRot.pos.z, &this->actor.shape.rot); Matrix_Scale(this->unk_1D4, this->unk_1D0, this->unk_1D4, MTXMODE_APPLY); Draw_DListOpa(globalCtx, arg2); } -static void BgBdanSwitch_Draw(BgBdanSwitch* this, GlobalContext* globalCtx) -{ - switch (this->actor.params & 0xFF) - { +static void BgBdanSwitch_Draw(BgBdanSwitch* this, GlobalContext* globalCtx) { + switch (this->actor.params & 0xFF) { case YELLOW_HEAVY: case YELLOW: func_8086DF58(this, globalCtx, &D_060061A0); diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c index ecd44ee0a8..6c6a8db38e 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c @@ -2,13 +2,13 @@ * File: z_bg_bom_guard.c * Overlay: Bg_Bom_Guard * Description: -*/ + */ #include "z_bg_bom_guard.h" #include -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void BgBomGuard_Init(BgBomGuard* this, GlobalContext* globalCtx); @@ -17,8 +17,7 @@ static void BgBomGuard_Update(BgBomGuard* this, GlobalContext* globalCtx); static void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx); -const ActorInit Bg_Bom_Guard_InitVars = -{ +const ActorInit Bg_Bom_Guard_InitVars = { ACTOR_BG_BOM_GUARD, ACTORTYPE_PROP, ROOM, @@ -33,13 +32,11 @@ const ActorInit Bg_Bom_Guard_InitVars = extern u32 D_06001C40; -static void BgBomGuard_SetupAction(BgBomGuard* this, ActorFunc actionFunc) -{ +static void BgBomGuard_SetupAction(BgBomGuard* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -static void BgBomGuard_Init(BgBomGuard* this, GlobalContext* globalCtx) -{ +static void BgBomGuard_Init(BgBomGuard* this, GlobalContext* globalCtx) { s32 pad[2]; Actor* thisx = &this->dyna.actor; s32 local_c = 0; @@ -58,26 +55,20 @@ static void BgBomGuard_Init(BgBomGuard* this, GlobalContext* globalCtx) BgBomGuard_SetupAction(this, func_8086E638); } -static void BgBomGuard_Destroy(BgBomGuard* this, GlobalContext* globalCtx) -{ +static void BgBomGuard_Destroy(BgBomGuard* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) -{ +static void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) { Actor* it = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first; Actor* thisx = &this->dyna.actor; this->unk_168 = 0; - while (it != 0) - { - if (it->id == ACTOR_EN_BOM_BOWL_MAN) - { - if ((((EnBomBowlMan*)it)->unk_258 != 0) && - (fabsf(globalCtx->view.eye.x) > -20.0f) && - (fabsf(globalCtx->view.eye.y) > 110.0f)) - { + while (it != 0) { + if (it->id == ACTOR_EN_BOM_BOWL_MAN) { + if ((((EnBomBowlMan*)it)->unk_258 != 0) && (fabsf(globalCtx->view.eye.x) > -20.0f) && + (fabsf(globalCtx->view.eye.y) > 110.0f)) { this->unk_168 = 1; } break; @@ -85,17 +76,13 @@ static void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) it = it->next; } - if (this->unk_168 == 0) - { + if (this->unk_168 == 0) { thisx->posRot.pos.y = sREG(64) + -200.0f; - } - else - { + } else { thisx->posRot.pos.y = 0.0f; } } -static void BgBomGuard_Update(BgBomGuard* this, GlobalContext* globalCtx) -{ +static void BgBomGuard_Update(BgBomGuard* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index 038390492b..a9bad98576 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -1,6 +1,6 @@ #include "z_bg_bombwall.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00400000 void BgBombwall_Init(BgBombwall* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c index d4f9fadce6..9a6e73a486 100644 --- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c +++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c @@ -1,6 +1,6 @@ #include "z_bg_bowl_wall.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgBowlWall_Init(BgBowlWall* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index ef3776bec6..dedd2a7afb 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -1,6 +1,6 @@ #include "z_bg_breakwall.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgBreakwall_Init(BgBreakwall* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c index aa60cee7bd..b3ac8a472a 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c @@ -1,6 +1,6 @@ #include "z_bg_ddan_jd.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgDdanJd_Init(BgDdanJd* this, GlobalContext* globalCtx); @@ -36,6 +36,3 @@ const ActorInit Bg_Ddan_Jd_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ddan_Jd/BgDdanJd_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ddan_Jd/BgDdanJd_Draw.s") - - - diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index 2ce9ca13e4..1f88d27833 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -1,6 +1,6 @@ #include "z_bg_ddan_kd.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgDdanKd_Init(BgDdanKd* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index 7d70a8e366..967be13888 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -1,6 +1,6 @@ #include "z_bg_dodoago.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgDodoago_Init(BgDodoago* this, GlobalContext* globalCtx); @@ -42,4 +42,3 @@ const ActorInit Bg_Dodoago_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Dodoago/BgDodoago_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Dodoago/BgDodoago_Draw.s") - diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 0f30328291..2df2523ee3 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -1,6 +1,6 @@ #include "z_bg_dy_yoseizo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000030 void BgDyYoseizo_Init(BgDyYoseizo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index 4fce310049..e9a53f1d78 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -1,6 +1,6 @@ #include "z_bg_ganon_otyuka.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgGanonOtyuka_Init(BgGanonOtyuka* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index baa83eb800..1cbe24a292 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -1,6 +1,6 @@ #include "z_bg_gate_shutter.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgGateShutter_Init(BgGateShutter* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index cce0fe8e99..79ee9d72f1 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -1,6 +1,6 @@ #include "z_bg_gjyo_bridge.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgGjyoBridge_Init(BgGjyoBridge* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index 8bbd6da107..82514de7e3 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -1,6 +1,6 @@ #include "z_bg_gnd_darkmeiro.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgGndDarkmeiro_Init(BgGndDarkmeiro* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c index 037e3af4e7..8db58c43d1 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c @@ -1,6 +1,6 @@ #include "z_bg_gnd_firemeiro.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgGndFiremeiro_Init(BgGndFiremeiro* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c index b728ab7ba6..2075d3960e 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c @@ -1,6 +1,6 @@ #include "z_bg_gnd_iceblock.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgGndIceblock_Init(BgGndIceblock* this, GlobalContext* globalCtx); @@ -48,4 +48,3 @@ const ActorInit Bg_Gnd_Iceblock_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gnd_Iceblock/BgGndIceblock_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gnd_Iceblock/BgGndIceblock_Draw.s") - diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c index 34820a1c9a..2db03c4685 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c @@ -2,18 +2,17 @@ * File: z_bg_gnd_nisekabe.c * Overlay: ovl_Bg_Gnd_Nisekabe * Description: 2D Stone Wall -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; } ActorGndNisekabe; // size = 0x014C -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void Init(ActorGndNisekabe* this, GlobalContext* globalCtx); @@ -21,8 +20,7 @@ static void Destroy(ActorGndNisekabe* this, GlobalContext* globalCtx); static void Update(ActorGndNisekabe* this, GlobalContext* globalCtx); static void Draw(ActorGndNisekabe* this, GlobalContext* globalCtx); -const ActorInit Bg_Gnd_Nisekabe_InitVars = -{ +const ActorInit Bg_Gnd_Nisekabe_InitVars = { ACTOR_BG_GND_NISEKABE, ACTORTYPE_PROP, ROOM, @@ -35,45 +33,30 @@ const ActorInit Bg_Gnd_Nisekabe_InitVars = (ActorFunc)Draw, }; -static u32 segmentAddr[] = -{ - 0x06009230, - 0x0600A390, - 0x0600B4A0 -}; +static u32 segmentAddr[] = { 0x06009230, 0x0600A390, 0x0600B4A0 }; -static void Init(ActorGndNisekabe* this, GlobalContext* globalCtx) -{ +static void Init(ActorGndNisekabe* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.1); this->actor.unk_F4 = 3000.0; } -static void Destroy(ActorGndNisekabe* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorGndNisekabe* this, GlobalContext* globalCtx) { } -static void Update(ActorGndNisekabe* this, GlobalContext* globalCtx) -{ - if (globalCtx->actorCtx.unk_03 != 0) - { +static void Update(ActorGndNisekabe* this, GlobalContext* globalCtx) { + if (globalCtx->actorCtx.unk_03 != 0) { this->actor.flags |= 0x80; - } - else - { + } else { this->actor.flags &= 0xFFFFFF7F; } } -static void Draw(ActorGndNisekabe* this, GlobalContext* globalCtx) -{ +static void Draw(ActorGndNisekabe* this, GlobalContext* globalCtx) { u32 index = this->actor.params & 0xFF; - if ((this->actor.flags & 0x80) == 0x80) - { + if ((this->actor.flags & 0x80) == 0x80) { Draw_DListXlu(globalCtx, segmentAddr[index]); - } - else - { + } else { Draw_DListOpa(globalCtx, segmentAddr[index]); } } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index 559dd9a6f8..40238ba7d0 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -1,6 +1,6 @@ #include "z_bg_gnd_soulmeiro.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgGndSoulmeiro_Init(BgGndSoulmeiro* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index 4e2eeffc71..6941e4288a 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -1,6 +1,6 @@ #include "z_bg_haka.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHaka_Init(BgHaka* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index e4022a278d..02264be14c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -1,6 +1,6 @@ #include "z_bg_haka_gate.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHakaGate_Init(BgHakaGate* this, GlobalContext* globalCtx); @@ -52,4 +52,3 @@ const ActorInit Bg_Haka_Gate_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Gate/func_8087C85C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Gate/BgHakaGate_Draw.s") - diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 16df9b3596..1dc6221a21 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -1,6 +1,6 @@ #include "z_bg_haka_huta.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgHakaHuta_Init(BgHakaHuta* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index ed1e39a4ea..2454dc22ea 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -1,6 +1,6 @@ #include "z_bg_haka_megane.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x000000B0 void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx); @@ -35,6 +35,3 @@ const ActorInit Bg_Haka_Megane_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Megane/BgHakaMegane_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Megane/func_8087DC94.s") - - - diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c index acdf9ac6d2..53cd70fa9b 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c @@ -1,6 +1,6 @@ #include "z_bg_haka_meganebg.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHakaMeganeBG_Init(BgHakaMeganeBG* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index da3dfbe035..7fd5c9492f 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -1,6 +1,6 @@ #include "z_bg_haka_sgami.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000011 void BgHakaSgami_Init(BgHakaSgami* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index f7e7dee7a6..2201dcb925 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -1,6 +1,6 @@ #include "z_bg_haka_ship.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgHakaShip_Init(BgHakaShip* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 7b6a2c48a1..94684d9f8f 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -1,6 +1,6 @@ #include "z_bg_haka_trap.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHakaTrap_Init(BgHakaTrap* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index a95976c7b7..c6e50f9ce2 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -1,6 +1,6 @@ #include "z_bg_haka_tubo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgHakaTubo_Init(BgHakaTubo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c index ba8bea230b..e059e992e3 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c @@ -1,6 +1,6 @@ #include "z_bg_haka_water.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgHakaWater_Init(BgHakaWater* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 1365a45516..0b426a1c02 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -1,6 +1,6 @@ #include "z_bg_haka_zou.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgHakaZou_Init(BgHakaZou* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index a68e5de7aa..7d17f584b0 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -1,6 +1,6 @@ #include "z_bg_heavy_block.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHeavyBlock_Init(BgHeavyBlock* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index 1f173679b0..351fe7ebf7 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_curtain.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgHidanCurtain_Init(BgHidanCurtain* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 9dc30828ba..3dc9b1725b 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_dalm.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHidanDalm_Init(BgHidanDalm* this, GlobalContext* globalCtx); @@ -36,6 +36,3 @@ const ActorInit Bg_Hidan_Dalm_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Dalm/func_808862D8.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Dalm/BgHidanDalm_Draw.s") - - - diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index e2c232da8d..0b17a2d991 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_firewall.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c index 1f4b36c70c..d12f16076a 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c @@ -2,11 +2,11 @@ * File: z_bg_hidan_fslift.c * Overlay: Bg_Hidan_Fslift * Description: -*/ + */ #include "z_bg_hidan_fslift.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void BgHidanFslift_Init(BgHidanFslift* this, GlobalContext* globalCtx); @@ -21,8 +21,7 @@ static void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx); extern u32 D_0600B630; extern u32 D_0600E1E8; -const ActorInit Bg_Hidan_Fslift_InitVars = -{ +const ActorInit Bg_Hidan_Fslift_InitVars = { ACTOR_BG_HIDAN_FSLIFT, ACTORTYPE_BG, ROOM, @@ -35,37 +34,33 @@ const ActorInit Bg_Hidan_Fslift_InitVars = (ActorFunc)BgHidanFslift_Draw, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 300, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 350, ICHAIN_CONTINUE), - ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP) + ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP), }; -static void BgHidanFslift_Init(BgHidanFslift* this, GlobalContext* globalCtx) -{ +static void BgHidanFslift_Init(BgHidanFslift* this, GlobalContext* globalCtx) { s32 pad[2]; s32 local_c = 0; Actor* thisx = &this->dyna.actor; - + Actor_ProcessInitChain(thisx, initChain); DynaPolyInfo_SetActorMove(thisx, 1); DynaPolyInfo_Alloc(&D_0600E1E8, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); - if (Actor_SpawnAttached(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->posRot.pos.x, thisx->posRot.pos.y + 40.0f, thisx->posRot.pos.z + -28.0f, 0, 0, 0, 2) == NULL) - { + if (Actor_SpawnAttached(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->posRot.pos.x, + thisx->posRot.pos.y + 40.0f, thisx->posRot.pos.z + -28.0f, 0, 0, 0, 2) == NULL) { Actor_Kill(thisx); return; } this->actionFunc = func_80886FCC; } -static void func_80886F24(BgHidanFslift* this) -{ +static void func_80886F24(BgHidanFslift* this) { Actor* thisx = &this->dyna.actor; - if (thisx->attachedB != NULL && thisx->attachedB->update != NULL) - { + if (thisx->attachedB != NULL && thisx->attachedB->update != NULL) { thisx->attachedB->posRot.pos.x = thisx->posRot.pos.x; thisx->attachedB->posRot.pos.y = thisx->posRot.pos.y + 40.0f; thisx->attachedB->posRot.pos.z = thisx->posRot.pos.z + -28.0f; @@ -74,107 +69,82 @@ static void func_80886F24(BgHidanFslift* this) thisx->attachedB = NULL; } -static void BgHidanFslift_Destroy(BgHidanFslift* this, GlobalContext* globalCtx) -{ +static void BgHidanFslift_Destroy(BgHidanFslift* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void func_80886FB4(BgHidanFslift* this) -{ +static void func_80886FB4(BgHidanFslift* this) { this->unk_168 = 0x28; this->actionFunc = func_80886FCC; } -static void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) -{ +static void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) { UNK_TYPE somebool; Actor* thisx = &this->dyna.actor; DECR(this->unk_168); - if (this->unk_168 == 0) - { + if (this->unk_168 == 0) { somebool = 0; - if ((thisx->posRot.pos.y - thisx->initPosRot.pos.y) < 0.5f) - { + if ((thisx->posRot.pos.y - thisx->initPosRot.pos.y) < 0.5f) { somebool = 1; } - if (func_80043590(thisx)) - { - if (somebool) - { + if (func_80043590(thisx)) { + if (somebool) { this->actionFunc = func_808870D8; return; } } - if (!somebool) - { + if (!somebool) { this->actionFunc = func_8088706C; } } } -static void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx) -{ +static void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (Math_ApproxF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 4.0f)) - { + if (Math_ApproxF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 4.0f)) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); func_80886FB4(this); - } - else - { + } else { func_8002F974(thisx, 0x20b9); } func_80886F24(this); } -static void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx) -{ +static void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (func_80043590(thisx)) - { - if (Math_ApproxF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y + 790.0f, 4.0f)) - { + if (func_80043590(thisx)) { + if (Math_ApproxF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y + 790.0f, 4.0f)) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); func_80886FB4(this); - } - else - { + } else { func_8002F974(thisx, 0x20b9); } - } - else - { + } else { func_80886FB4(this); } func_80886F24(this); } -static void BgHidanFslift_Update(BgHidanFslift* this, GlobalContext* globalCtx) -{ +static void BgHidanFslift_Update(BgHidanFslift* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; this->actionFunc(this, globalCtx); - if (func_8004356C(thisx)) - { - if (this->unk_16A == 0) - { + if (func_8004356C(thisx)) { + if (this->unk_16A == 0) { this->unk_16A = 3; } func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 0x30); return; } - if (func_8004356C(thisx) == 0) - { - if (this->unk_16A != 0) - { + if (func_8004356C(thisx) == 0) { + if (this->unk_16A != 0) { func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 3); } this->unk_16A = 0; } } -static void BgHidanFslift_Draw(BgHidanFslift* this, GlobalContext* globalCtx) -{ +static void BgHidanFslift_Draw(BgHidanFslift* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_0600B630); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index 49e0df5462..9cd91b63d0 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_fwbig.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgHidanFwbig_Init(BgHidanFwbig* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 3abcef7ce2..97aba0e1ea 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_hamstep.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHidanHamstep_Init(BgHidanHamstep* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index 246db3a95c..cb4d60140d 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_hrock.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHidanHrock_Init(BgHidanHrock* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index cc80e92acb..48e065a68e 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_kousi.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgHidanKousi_Init(BgHidanKousi* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 6c7a96a123..64980bbda2 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_kowarerukabe.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHidanKowarerukabe_Init(BgHidanKowarerukabe* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index 351cd0f107..06ad32f3c5 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_rock.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHidanRock_Init(BgHidanRock* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c index fdec662734..7922456426 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_rsekizou.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHidanRsekizou_Init(BgHidanRsekizou* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c index ee750dba95..c2ec2c2cb8 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_sekizou.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHidanSekizou_Init(BgHidanSekizou* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c index 7af7ccaa12..e81f25b7f0 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c @@ -1,6 +1,6 @@ #include "z_bg_hidan_sima.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgHidanSima_Init(BgHidanSima* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c index 95c8d4937d..fa1fda2c1e 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c @@ -2,13 +2,12 @@ * File: z_bg_hidan_syoku.c * Overlay: Bg_Hidan_Syoku * Description: Stone Elevator in the Fire Temple -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ u32 dynaPolyId; /* 0x0150 */ f32 unk_150; @@ -16,12 +15,12 @@ typedef struct /* 0x0158 */ u32 unk_158; /* 0x015C */ u32 unk_15C; /* 0x0160 */ u8 unk_160; - /* 0x0164 */ ActorFunc updateFunc; - /* 0x0168 */ s16 unk_168; - /* 0x016A */ s16 unk_16A; + /* 0x0164 */ ActorFunc updateFunc; + /* 0x0168 */ s16 unk_168; + /* 0x016A */ s16 unk_16A; } ActorHidanSyoku; // size = 0x016C -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void Init(ActorHidanSyoku* this, GlobalContext* globalCtx); @@ -32,8 +31,7 @@ static void func_8088F62C(ActorHidanSyoku* this, GlobalContext* globalCtx); static void Update(ActorHidanSyoku* this, GlobalContext* globalCtx); static void Draw(ActorHidanSyoku* this, GlobalContext* globalCtx); -const ActorInit Bg_Hidan_Syoku_InitVars = -{ +const ActorInit Bg_Hidan_Syoku_InitVars = { ACTOR_BG_HIDAN_SYOKU, ACTORTYPE_BG, ROOM, @@ -46,16 +44,14 @@ const ActorInit Bg_Hidan_Syoku_InitVars = (ActorFunc)Draw, }; -static InitChainEntry initChain[] = -{ - ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP) +static InitChainEntry initChain[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; extern UNK_PTR D_0600A7E0; extern UNK_PTR D_0600E568; -static void Init(ActorHidanSyoku* this, GlobalContext* globalCtx) -{ +static void Init(ActorHidanSyoku* this, GlobalContext* globalCtx) { s32 pad[2]; u32 local_c = 0; @@ -67,104 +63,78 @@ static void Init(ActorHidanSyoku* this, GlobalContext* globalCtx) this->actor.initPosRot.pos.y += 540.0f; } -static void Destroy(ActorHidanSyoku* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorHidanSyoku* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -static void func_8088F47C(ActorHidanSyoku* this) -{ +static void func_8088F47C(ActorHidanSyoku* this) { this->unk_16A = 0x3c; Audio_PlayActorSound2(&this->actor, NA_SE_EV_BLOCK_BOUND); this->updateFunc = &func_8088F62C; } -static void func_8088F4B8(ActorHidanSyoku* this, GlobalContext* globalCtx) -{ - if (Flags_GetClear(globalCtx, this->actor.room) && func_8004356C(&this->actor)) - { +static void func_8088F4B8(ActorHidanSyoku* this, GlobalContext* globalCtx) { + if (Flags_GetClear(globalCtx, this->actor.room) && func_8004356C(&this->actor)) { this->unk_16A = 0x8c; this->updateFunc = &func_8088F514; } } -static void func_8088F514(ActorHidanSyoku* this, GlobalContext* globalCtx) -{ - if (this->unk_16A != 0) - { +static void func_8088F514(ActorHidanSyoku* this, GlobalContext* globalCtx) { + if (this->unk_16A != 0) { this->unk_16A -= 1; } this->actor.posRot.pos.y = (cosf(this->unk_16A * (M_PI / 140)) * 540.0f) + this->actor.initPosRot.pos.y; - if (this->unk_16A == 0) - { + if (this->unk_16A == 0) { func_8088F47C(this); - } - else - { + } else { func_8002F974(&this->actor, 0x20b9); } } -static void func_8088F5A0(ActorHidanSyoku* this, GlobalContext* globalCtx) -{ - if (this->unk_16A != 0) - { +static void func_8088F5A0(ActorHidanSyoku* this, GlobalContext* globalCtx) { + if (this->unk_16A != 0) { this->unk_16A -= 1; } this->actor.posRot.pos.y = this->actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 140)) * 540.0f); - if (this->unk_16A == 0) - { + if (this->unk_16A == 0) { func_8088F47C(this); - } - else - { + } else { func_8002F974(&this->actor, 0x20b9); } } -static void func_8088F62C(ActorHidanSyoku* this, GlobalContext* globalCtx) -{ - if (this->unk_16A != 0) - { +static void func_8088F62C(ActorHidanSyoku* this, GlobalContext* globalCtx) { + if (this->unk_16A != 0) { this->unk_16A -= 1; } - if (this->unk_16A == 0) - { + if (this->unk_16A == 0) { this->unk_16A = 0x8c; - if (this->actor.posRot.pos.y < this->actor.initPosRot.pos.y) - { + if (this->actor.posRot.pos.y < this->actor.initPosRot.pos.y) { this->updateFunc = &func_8088F514; - } - else - { + } else { this->updateFunc = &func_8088F5A0; } } } -static void Update(ActorHidanSyoku* this, GlobalContext* globalCtx) -{ +static void Update(ActorHidanSyoku* this, GlobalContext* globalCtx) { this->updateFunc(this, globalCtx); - if (func_8004356C(&this->actor)) - { - if (this->unk_168 == 0) - { + if (func_8004356C(&this->actor)) { + if (this->unk_168 == 0) { this->unk_168 = 3; } func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 0x30); return; } - if (!func_8004356C(&this->actor)) - { - if (this->unk_168 != 0) - { + if (!func_8004356C(&this->actor)) { + if (this->unk_168 != 0) { func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 3); } this->unk_168 = 0; } } -static void Draw(ActorHidanSyoku* this, GlobalContext* globalCtx) -{ +static void Draw(ActorHidanSyoku* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_0600A7E0); } diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c index 3ccd7a4fa7..6be01a595d 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c +++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c @@ -1,6 +1,6 @@ #include "z_bg_ice_objects.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgIceObjects_Init(BgIceObjects* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 3ebc6346da..811445fa31 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -1,6 +1,6 @@ #include "z_bg_ice_shelter.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgIceShelter_Init(BgIceShelter* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 81ca533027..cd411fac64 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -1,6 +1,6 @@ #include "z_bg_ice_shutter.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgIceShutter_Init(BgIceShutter* this, GlobalContext* globalCtx); @@ -38,6 +38,3 @@ const ActorInit Bg_Ice_Shutter_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/BgIceShutter_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/BgIceShutter_Draw.s") - - - diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c index 99a5b9fb55..14e159c07a 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c @@ -1,6 +1,6 @@ #include "z_bg_ice_turara.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgIceTurara_Init(BgIceTurara* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 1187a276bf..d7302e07ba 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -1,6 +1,6 @@ #include "z_bg_ingate.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgIngate_Init(BgIngate* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index 303ee5fd70..ad957055a8 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -1,6 +1,6 @@ #include "z_bg_jya_1flift.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgJya1flift_Init(BgJya1flift* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c index 1178ce90ea..8e5e1323d8 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c @@ -2,20 +2,19 @@ * File: z_bg_jya_amishutter.c * Overlay: Bg_Jya_Amishutter * Description: Circular Metal Grate (Spirit Temple) -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ u32 dynaPolyId; /* 0x0150 */ char unk_150[0x14]; /* 0x0164 */ void (*updateFunc)(Actor*); } BgJyaAmishutter; // size = 0x0168 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void BgJyaAmishutter_Init(BgJyaAmishutter* this, GlobalContext* globalCtx); @@ -32,8 +31,7 @@ static void func_808934C0(BgJyaAmishutter* this); static void func_808934FC(BgJyaAmishutter* this); static void func_8089350C(BgJyaAmishutter* this); -const ActorInit Bg_Jya_Amishutter_InitVars = -{ +const ActorInit Bg_Jya_Amishutter_InitVars = { ACTOR_BG_JYA_AMISHUTTER, ACTORTYPE_BG, ROOM, @@ -46,19 +44,17 @@ const ActorInit Bg_Jya_Amishutter_InitVars = (ActorFunc)BgJyaAmishutter_Draw, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 200, ICHAIN_CONTINUE), - ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP) + ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP), }; extern UNK_TYPE D_0600C4C8; extern UNK_TYPE D_0600C0A0; -static void func_808932C0(BgJyaAmishutter* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) -{ +static void func_808932C0(BgJyaAmishutter* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) { s16 pad1; u32 local_c = 0; s16 pad2; @@ -66,95 +62,74 @@ static void func_808932C0(BgJyaAmishutter* this, GlobalContext* globalCtx, u32 c DynaPolyInfo_SetActorMove(&this->actor, flag); DynaPolyInfo_Alloc(collision, &local_c); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); - if (this->dynaPolyId == 0x32) - { - osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_amishutter.c", 129, this->actor.id, this->actor.params); + if (this->dynaPolyId == 0x32) { + osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_amishutter.c", 129, + this->actor.id, this->actor.params); } } -static void BgJyaAmishutter_Init(BgJyaAmishutter* this, GlobalContext* globalCtx) -{ +static void BgJyaAmishutter_Init(BgJyaAmishutter* this, GlobalContext* globalCtx) { func_808932C0(this, globalCtx, &D_0600C4C8, 0); Actor_ProcessInitChain(&this->actor, initChain); func_808933BC(this); } -static void BgJyaAmishutter_Destroy(BgJyaAmishutter* this, GlobalContext* globalCtx) -{ +static void BgJyaAmishutter_Destroy(BgJyaAmishutter* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -static void func_808933BC(BgJyaAmishutter* this) -{ +static void func_808933BC(BgJyaAmishutter* this) { this->updateFunc = func_808933CC; } -static void func_808933CC(BgJyaAmishutter* this) -{ - if (this->actor.xzDistanceFromLink < 60.0f) - { - if (fabsf(this->actor.yDistanceFromLink) < 30.0f) - { +static void func_808933CC(BgJyaAmishutter* this) { + if (this->actor.xzDistanceFromLink < 60.0f) { + if (fabsf(this->actor.yDistanceFromLink) < 30.0f) { func_80893428(this); } } } -static void func_80893428(BgJyaAmishutter* this) -{ +static void func_80893428(BgJyaAmishutter* this) { this->updateFunc = func_80893438; } -static void func_80893438(BgJyaAmishutter* this) -{ - if (Math_ApproxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 100.0f, 3.0f)) - { +static void func_80893438(BgJyaAmishutter* this) { + if (Math_ApproxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 100.0f, 3.0f)) { func_808934B0(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_METALDOOR_STOP); - } - else - { + } else { func_8002F974(&this->actor, 0x2036); } } -static void func_808934B0(BgJyaAmishutter* this) -{ +static void func_808934B0(BgJyaAmishutter* this) { this->updateFunc = func_808934C0; } -static void func_808934C0(BgJyaAmishutter* this) -{ - if (this->actor.xzDistanceFromLink > 300.0f) - { +static void func_808934C0(BgJyaAmishutter* this) { + if (this->actor.xzDistanceFromLink > 300.0f) { func_808934FC(this); } } -static void func_808934FC(BgJyaAmishutter* this) -{ +static void func_808934FC(BgJyaAmishutter* this) { this->updateFunc = func_8089350C; } -static void func_8089350C(BgJyaAmishutter* this) -{ - if (Math_ApproxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 3.0f)) - { - func_808933BC(this); +static void func_8089350C(BgJyaAmishutter* this) { + if (Math_ApproxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 3.0f)) { + func_808933BC(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_METALDOOR_STOP); - } - else - { + } else { func_8002F974(&this->actor, 0x2036); } } -static void BgJyaAmishutter_Update(BgJyaAmishutter* this, GlobalContext* globalCtx) -{ +static void BgJyaAmishutter_Update(BgJyaAmishutter* this, GlobalContext* globalCtx) { this->updateFunc(this); } -static void BgJyaAmishutter_Draw(BgJyaAmishutter* this, GlobalContext* globalCtx) -{ +static void BgJyaAmishutter_Draw(BgJyaAmishutter* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_0600C0A0); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index abfd9bb9b9..bef3b84a78 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -1,6 +1,6 @@ #include "z_bg_jya_bigmirror.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgJyaBigmirror_Init(BgJyaBigmirror* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index 4498ddeffe..6fa60832b1 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -1,6 +1,6 @@ #include "z_bg_jya_block.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgJyaBlock_Init(BgJyaBlock* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index 8e7fbd7cc8..6e6f9c829d 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -1,6 +1,6 @@ #include "z_bg_jya_bombchuiwa.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000001 void BgJyaBombchuiwa_Init(BgJyaBombchuiwa* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index bd6ecca8f8..d9b23ebbe4 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -1,6 +1,6 @@ #include "z_bg_jya_bombiwa.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgJyaBombiwa_Init(BgJyaBombiwa* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 406d352a90..66e5b1278a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -1,6 +1,6 @@ #include "z_bg_jya_cobra.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgJyaCobra_Init(BgJyaCobra* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c index 306886f0a8..c8ac65e238 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c @@ -1,6 +1,6 @@ #include "z_bg_jya_goroiwa.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgJyaGoroiwa_Init(BgJyaGoroiwa* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index 98d5d4ff00..49b78c9694 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -1,6 +1,6 @@ #include "z_bg_jya_haheniron.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgJyaHaheniron_Init(BgJyaHaheniron* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index 416a171f19..0fb2cebc0f 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -1,6 +1,6 @@ #include "z_bg_jya_ironobj.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgJyaIronobj_Init(BgJyaIronobj* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index 509c27cc71..a9894f43d2 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -2,13 +2,12 @@ * File: z_bg_jya_kanaami.c * Overlay: Bg_Jya_Kanaami * Description: Climbable Metal Grating (Fire Temple) -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ u32 dynaPolyId; /* 0x014C */ char unk_150[0x14]; @@ -17,7 +16,7 @@ typedef struct /* 0x016A */ s16 unk_16A; } BgJyaKanaami; // size = 0x016C -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void BgJyaKanaami_Init(BgJyaKanaami* this, GlobalContext* globalCtx); @@ -31,8 +30,7 @@ static void func_8089993C(BgJyaKanaami* this); static void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx); static void func_80899A08(BgJyaKanaami* this); -const ActorInit Bg_Jya_Kanaami_InitVars = -{ +const ActorInit Bg_Jya_Kanaami_InitVars = { ACTOR_BG_JYA_KANAAMI, ACTORTYPE_BG, ROOM, @@ -45,19 +43,17 @@ const ActorInit Bg_Jya_Kanaami_InitVars = (ActorFunc)BgJyaKanaami_Draw, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 700, ICHAIN_CONTINUE), - ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP) + ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP), }; extern u32 D_0600F000; extern u32 D_0600F208; -static void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) -{ +static void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) { s32 pad; s32 local_c = 0; s32 pad2; @@ -65,67 +61,54 @@ static void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, u32 coll DynaPolyInfo_SetActorMove(&this->actor, flag); DynaPolyInfo_Alloc(collision, &local_c); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); - if (this->dynaPolyId == 0x32) - { - osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_kanaami.c", 145, this->actor.id, this->actor.params); + if (this->dynaPolyId == 0x32) { + osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_kanaami.c", 145, + this->actor.id, this->actor.params); } } -static void BgJyaKanaami_Init(BgJyaKanaami* this, GlobalContext* globalCtx) -{ +static void BgJyaKanaami_Init(BgJyaKanaami* this, GlobalContext* globalCtx) { func_80899740(this, globalCtx, &D_0600F208, 0); Actor_ProcessInitChain(&this->actor, initChain); - if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) - { + if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) { func_80899A08(this); - } - else - { + } else { func_80899880(this); } osSyncPrintf("(jya 金網)(arg_data 0x%04x)\n", this->actor.params); } -static void BgJyaKanaami_Destroy(BgJyaKanaami* this, GlobalContext* globalCtx) -{ +static void BgJyaKanaami_Destroy(BgJyaKanaami* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -static void func_80899880(BgJyaKanaami* this) -{ +static void func_80899880(BgJyaKanaami* this) { this->updateFunc = func_80899894; this->unk_16A = 0; } -static void func_80899894(BgJyaKanaami* this, GlobalContext* globalCtx) -{ - if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) || this->unk_16A > 0) - { - if (this->actor.posRot.pos.x > -1000.0f && this->unk_16A == 0) - { +static void func_80899894(BgJyaKanaami* this, GlobalContext* globalCtx) { + if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) || this->unk_16A > 0) { + if (this->actor.posRot.pos.x > -1000.0f && this->unk_16A == 0) { func_800800F8(globalCtx, 0xD7A, -0x63, &this->actor, 0); } this->unk_16A += 1; - if (this->unk_16A >= 0xA) - { + if (this->unk_16A >= 0xA) { func_8089993C(this); } } } -static void func_8089993C(BgJyaKanaami* this) -{ +static void func_8089993C(BgJyaKanaami* this) { this->updateFunc = func_80899950; this->unk_168 = 0; } -static void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) -{ +static void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) { s32 pad[2]; s32 var; this->unk_168 += 0x20; - if (Math_ApproxUpdateScaledS(&this->actor.posRot.rot.x, 0x4000, this->unk_168)) - { + if (Math_ApproxUpdateScaledS(&this->actor.posRot.rot.x, 0x4000, this->unk_168)) { func_80899A08(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_TRAP_BOUND); var = func_80092F88(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 3); @@ -135,22 +118,18 @@ static void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) } } -static void func_80899A08(BgJyaKanaami* this) -{ +static void func_80899A08(BgJyaKanaami* this) { this->updateFunc = 0; this->actor.posRot.rot.x = 0x4000; } -static void BgJyaKanaami_Update(BgJyaKanaami* this, GlobalContext* globalCtx) -{ - if (this->updateFunc) - { +static void BgJyaKanaami_Update(BgJyaKanaami* this, GlobalContext* globalCtx) { + if (this->updateFunc) { this->updateFunc(this, globalCtx); } this->actor.shape.rot.x = this->actor.posRot.rot.x; } -static void BgJyaKanaami_Draw(BgJyaKanaami* this, GlobalContext* globalCtx) -{ +static void BgJyaKanaami_Draw(BgJyaKanaami* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_0600F000); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 665ea107b3..2bfb33a526 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -1,6 +1,6 @@ #include "z_bg_jya_lift.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgJyaLift_Init(BgJyaLift* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 1aa895c33a..e2285e2e8c 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -1,6 +1,6 @@ #include "z_bg_jya_megami.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgJyaMegami_Init(BgJyaMegami* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index f4077d719f..7f47776247 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -1,6 +1,6 @@ #include "z_bg_jya_zurerukabe.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgJyaZurerukabe_Init(BgJyaZurerukabe* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index 5d94b4ff3e..b8a09316d5 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -1,6 +1,6 @@ #include "z_bg_menkuri_eye.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000020 void BgMenkuriEye_Init(BgMenkuriEye* this, GlobalContext* globalCtx); @@ -30,4 +30,3 @@ const ActorInit Bg_Menkuri_Eye_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Menkuri_Eye/BgMenkuriEye_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Menkuri_Eye/BgMenkuriEye_Draw.s") - diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c index 028d0046ba..42bb7979c3 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c @@ -2,7 +2,7 @@ * File: z_bg_menkuri_kaiten.c * Overlay: Bg_Menkuri_Kaiten * Description: Large rotating stone ring used in Gerudo Training Grounds and Forest Temple. -*/ + */ #include #include @@ -10,14 +10,13 @@ extern u32 D_060038D0; extern u32 D_060042D8; -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ u32 dynaPolyId; - /* 0x0150 */ char unk_150[0x14]; + /* 0x014C */ u32 dynaPolyId; + /* 0x0150 */ char unk_150[0x14]; } ActorMenkuriKaiten; // size = 0x0164 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 static void Init(ActorMenkuriKaiten* this, GlobalContext* globalCtx); @@ -25,8 +24,7 @@ static void Destroy(ActorMenkuriKaiten* this, GlobalContext* globalCtx); static void Update(ActorMenkuriKaiten* this, GlobalContext* globalCtx); static void Draw(ActorMenkuriKaiten* this, GlobalContext* globalCtx); -const ActorInit Bg_Menkuri_Kaiten_InitVars = -{ +const ActorInit Bg_Menkuri_Kaiten_InitVars = { ACTOR_BG_MENKURI_KAITEN, ACTORTYPE_BG, ROOM, @@ -39,13 +37,11 @@ const ActorInit Bg_Menkuri_Kaiten_InitVars = (ActorFunc)Draw, }; -static InitChainEntry initChain[] = -{ - ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP) +static InitChainEntry initChain[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -static void Init(ActorMenkuriKaiten* this, GlobalContext* globalCtx) -{ +static void Init(ActorMenkuriKaiten* this, GlobalContext* globalCtx) { s32 pad[2]; u32 local_c = 0; @@ -55,21 +51,17 @@ static void Init(ActorMenkuriKaiten* this, GlobalContext* globalCtx) this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); } -static void Destroy(ActorMenkuriKaiten* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorMenkuriKaiten* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -static void Update(ActorMenkuriKaiten* this, GlobalContext* globalCtx) -{ - if (!Flags_GetSwitch(globalCtx, this->actor.params) && func_80043590(&this->actor)) - { +static void Update(ActorMenkuriKaiten* this, GlobalContext* globalCtx) { + if (!Flags_GetSwitch(globalCtx, this->actor.params) && func_80043590(&this->actor)) { func_8002F974(&this->actor, 0x2024); this->actor.shape.rot.y += 0x80; } } -static void Draw(ActorMenkuriKaiten* this, GlobalContext* globalCtx) -{ +static void Draw(ActorMenkuriKaiten* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_060038D0); } diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c index e58040fc22..475dbe9ff4 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c @@ -2,17 +2,16 @@ * File: z_bg_menkuri_nisekabe.c * Overlay: ovl_Bg_Menkuri_Nisekabe * Description: False Stone Walls (Gerudo Training Grounds) -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; } BgMenkuriNisekabe; // size = 0x014C -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void Init(BgMenkuriNisekabe* this, GlobalContext* globalCtx); @@ -20,8 +19,7 @@ static void Destroy(BgMenkuriNisekabe* this, GlobalContext* globalCtx); static void Update(BgMenkuriNisekabe* this, GlobalContext* globalCtx); static void Draw(BgMenkuriNisekabe* this, GlobalContext* globalCtx); -const ActorInit Bg_Menkuri_Nisekabe_InitVars = -{ +const ActorInit Bg_Menkuri_Nisekabe_InitVars = { ACTOR_BG_MENKURI_NISEKABE, ACTORTYPE_PROP, ROOM, @@ -34,44 +32,29 @@ const ActorInit Bg_Menkuri_Nisekabe_InitVars = (ActorFunc)Draw, }; -static u32 segmentAddr[] = -{ - 0x06002280, - 0x06002BC0 -}; +static u32 segmentAddr[] = { 0x06002280, 0x06002BC0 }; -static void Init(BgMenkuriNisekabe* this, GlobalContext* globalCtx) -{ +static void Init(BgMenkuriNisekabe* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.1f); } -static void Destroy(BgMenkuriNisekabe* this,GlobalContext* globalCtx) -{ - +static void Destroy(BgMenkuriNisekabe* this, GlobalContext* globalCtx) { } -static void Update(BgMenkuriNisekabe* this, GlobalContext* globalCtx) -{ - if (globalCtx->actorCtx.unk_03 != 0) - { +static void Update(BgMenkuriNisekabe* this, GlobalContext* globalCtx) { + if (globalCtx->actorCtx.unk_03 != 0) { this->actor.flags |= 0x80; - } - else - { + } else { this->actor.flags &= ~0x80; } } -static void Draw(BgMenkuriNisekabe* this, GlobalContext* globalCtx) -{ +static void Draw(BgMenkuriNisekabe* this, GlobalContext* globalCtx) { u32 index = this->actor.params & 0xFF; - if ((this->actor.flags & 0x80) == 0x80) - { + if ((this->actor.flags & 0x80) == 0x80) { Draw_DListXlu(globalCtx, segmentAddr[index]); - } - else - { + } else { Draw_DListOpa(globalCtx, segmentAddr[index]); } } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 89fbc967b9..93ec2b84f4 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -1,6 +1,6 @@ #include "z_bg_mizu_bwall.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgMizuBwall_Init(BgMizuBwall* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index 999a3891cc..de1a472a00 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -1,6 +1,6 @@ #include "z_bg_mizu_movebg.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgMizuMovebg_Init(BgMizuMovebg* this, GlobalContext* globalCtx); @@ -40,4 +40,3 @@ const ActorInit Bg_Mizu_Movebg_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Draw.s") - diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c index f79aa0ab32..0b9bfbef41 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c @@ -1,6 +1,6 @@ #include "z_bg_mizu_shutter.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgMizuShutter_Init(BgMizuShutter* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c index b56662c90c..d4a4bebc28 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c @@ -2,18 +2,17 @@ * File: z_bg_mizu_uzu.c * Overlay: ovl_Bg_Mizu_Uzu * Description: Water Noise -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; } BgMizuUzu; // size = 0x0168 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void BgMizuUzu_Init(BgMizuUzu* this, GlobalContext* globalCtx); @@ -21,8 +20,7 @@ static void BgMizuUzu_Destroy(BgMizuUzu* this, GlobalContext* globalCtx); static void BgMizuUzu_Update(BgMizuUzu* this, GlobalContext* globalCtx); static void BgMizuUzu_Draw(BgMizuUzu* this, GlobalContext* globalCtx); -const ActorInit Bg_Mizu_Uzu_InitVars = -{ +const ActorInit Bg_Mizu_Uzu_InitVars = { ACTOR_BG_MIZU_UZU, ACTORTYPE_PROP, ROOM, @@ -35,19 +33,17 @@ const ActorInit Bg_Mizu_Uzu_InitVars = (ActorFunc)BgMizuUzu_Draw, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_F32(unk_F8, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1000, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP) + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; extern u32 D_060074EC; static void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx); -static void BgMizuUzu_Init(BgMizuUzu* this, GlobalContext* globalCtx) -{ +static void BgMizuUzu_Init(BgMizuUzu* this, GlobalContext* globalCtx) { s32 pad[2]; s32 local_c = 0; Actor* thisx = &this->dyna.actor; @@ -58,32 +54,24 @@ static void BgMizuUzu_Init(BgMizuUzu* this, GlobalContext* globalCtx) this->actionFunc = func_8089F788; } -static void BgMizuUzu_Destroy(BgMizuUzu* this, GlobalContext* globalCtx) -{ +static void BgMizuUzu_Destroy(BgMizuUzu* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx) -{ +static void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (PLAYER->currentBoots == 1) - { + if (PLAYER->currentBoots == 1) { func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); - } - else - { + } else { func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } Audio_PlayActorSound2(thisx, 0x20CD); thisx->shape.rot.y += 0x1C0; } -static void BgMizuUzu_Update(BgMizuUzu* this, GlobalContext* globalCtx) -{ +static void BgMizuUzu_Update(BgMizuUzu* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } -static void BgMizuUzu_Draw(BgMizuUzu* this, GlobalContext* globalCtx) -{ - +static void BgMizuUzu_Draw(BgMizuUzu* this, GlobalContext* globalCtx) { } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index f7caeab759..d5a2ff8b99 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -1,6 +1,6 @@ #include "z_bg_mizu_water.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgMizuWater_Init(BgMizuWater* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c index 0143568bf4..02693ebae5 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c @@ -2,11 +2,11 @@ * File: z_bg_mjin.c * Overlay: ovl_Bg_Mjin * Description: Warp Pad -*/ + */ #include "z_bg_mjin.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void BgMjin_SetupAction(BgMjin* this, ActorFunc actionFunc); @@ -17,8 +17,7 @@ static void func_808A0920(BgMjin* this, GlobalContext* globalCtx); static void BgMjin_Update(BgMjin* this, GlobalContext* globalCtx); static void BgMjin_Draw(BgMjin* this, GlobalContext* globalCtx); -const ActorInit Bg_Mjin_InitVars = -{ +const ActorInit Bg_Mjin_InitVars = { ACTOR_BG_MJIN, ACTORTYPE_BG, ROOM, @@ -36,51 +35,43 @@ extern u32 D_06000140; extern u32 D_06000330; extern u32 D_06000658; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 4000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 400, ICHAIN_CONTINUE), - ICHAIN_F32(unk_FC, 400, ICHAIN_STOP) + ICHAIN_F32(unk_FC, 400, ICHAIN_STOP), }; -static s16 objectTbl[] = { OBJECT_MJIN_FLASH, OBJECT_MJIN_DARK, OBJECT_MJIN_FLAME, OBJECT_MJIN_ICE, OBJECT_MJIN_SOUL, OBJECT_MJIN_WIND }; +static s16 objectTbl[] = { OBJECT_MJIN_FLASH, OBJECT_MJIN_DARK, OBJECT_MJIN_FLAME, + OBJECT_MJIN_ICE, OBJECT_MJIN_SOUL, OBJECT_MJIN_WIND }; -static void BgMjin_SetupAction(BgMjin* this, ActorFunc actionFunc) -{ +static void BgMjin_SetupAction(BgMjin* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -static void BgMjin_Init(BgMjin* this, GlobalContext* globalCtx) -{ +static void BgMjin_Init(BgMjin* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; s8 objBankIndex; Actor_ProcessInitChain(thisx, initChain); objBankIndex = Object_GetIndex(&globalCtx->objectCtx, (thisx->params != 0 ? OBJECT_MJIN : OBJECT_MJIN_OKA)); this->objBankIndex = objBankIndex; - if (objBankIndex < 0) - { + if (objBankIndex < 0) { Actor_Kill(thisx); - } - else - { + } else { BgMjin_SetupAction(this, &func_808A0850); } } -static void BgMjin_Destroy(BgMjin* this, GlobalContext* globalCtx) -{ +static void BgMjin_Destroy(BgMjin* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void func_808A0850(BgMjin* this, GlobalContext* globalCtx) -{ +static void func_808A0850(BgMjin* this, GlobalContext* globalCtx) { u32 local_c; u32 collision; - if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) - { + if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { local_c = 0; this->dyna.actor.flags &= ~0x10; this->dyna.actor.objBankIndex = this->objBankIndex; @@ -88,24 +79,21 @@ static void func_808A0850(BgMjin* this, GlobalContext* globalCtx) DynaPolyInfo_SetActorMove(&this->dyna.actor, 0); collision = this->dyna.actor.params != 0 ? &D_06000658 : &D_06000330; DynaPolyInfo_Alloc(collision, &local_c); - this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c); + this->dyna.dynaPolyId = + DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c); BgMjin_SetupAction(this, &func_808A0920); this->dyna.actor.draw = &BgMjin_Draw; } } -static void func_808A0920(BgMjin* this, GlobalContext* globalCtx) -{ - +static void func_808A0920(BgMjin* this, GlobalContext* globalCtx) { } -static void BgMjin_Update(BgMjin* this, GlobalContext* globalCtx) -{ +static void BgMjin_Update(BgMjin* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } -static void BgMjin_Draw(BgMjin* this, GlobalContext* globalCtx) -{ +static void BgMjin_Draw(BgMjin* this, GlobalContext* globalCtx) { s32 objBankIndex; u32 dlist; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; @@ -113,22 +101,19 @@ static void BgMjin_Draw(BgMjin* this, GlobalContext* globalCtx) s32 pad; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_bg_mjin.c", 250); - if (this->dyna.actor.params != 0) - { + if (this->dyna.actor.params != 0) { objBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectTbl[this->dyna.actor.params - 1]); - if (objBankIndex >= 0) - { + if (objBankIndex >= 0) { gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[objBankIndex].segment); } gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(&D_06000000)); dlist = &D_06000330; - } - else - { + } else { dlist = &D_06000140; } func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mjin.c", 285), G_MTX_NOPUSH | G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mjin.c", 285), + G_MTX_NOPUSH | G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, dlist); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_bg_mjin.c", 288); } diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 2aa818897f..52afee4d6d 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -1,6 +1,6 @@ #include "z_bg_mori_bigst.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgMoriBigst_Init(BgMoriBigst* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 5bfcd4a728..0bd8b68314 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -1,6 +1,6 @@ #include "z_bg_mori_elevator.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgMoriElevator_Init(BgMoriElevator* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index f3df1a1d31..4798138b3e 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -1,6 +1,6 @@ #include "z_bg_mori_hashigo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgMoriHashigo_Init(BgMoriHashigo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index c5e37ef0ab..d96560db67 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -1,6 +1,6 @@ #include "z_bg_mori_hashira4.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgMoriHashira4_Init(BgMoriHashira4* this, GlobalContext* globalCtx); @@ -45,4 +45,3 @@ const ActorInit Bg_Mori_Hashira4_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mori_Hashira4/BgMoriHashira4_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mori_Hashira4/func_808A3484.s") - diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 58b7f4c2f0..660c0b92a7 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -1,6 +1,6 @@ #include "z_bg_mori_hineri.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgMoriHineri_Init(BgMoriHineri* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index cf4c4cb668..c5fb920e52 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -1,6 +1,6 @@ #include "z_bg_mori_idomizu.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgMoriIdomizu_Init(BgMoriIdomizu* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index 5bcd3a9df1..785455ce93 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -1,6 +1,6 @@ #include "z_bg_mori_kaitenkabe.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgMoriKaitenkabe_Init(BgMoriKaitenkabe* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index 34fe919384..7be6743c65 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -1,6 +1,6 @@ #include "z_bg_mori_rakkatenjo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgMoriRakkatenjo_Init(BgMoriRakkatenjo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index 3271de6882..729034661c 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -1,6 +1,6 @@ #include "z_bg_po_event.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgPoEvent_Init(BgPoEvent* this, GlobalContext* globalCtx); @@ -66,4 +66,3 @@ const ActorInit Bg_Po_Event_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Po_Event/BgPoEvent_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Po_Event/BgPoEvent_Draw.s") - diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c index 0384263531..f9fe4197ae 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c @@ -1,6 +1,6 @@ #include "z_bg_po_syokudai.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgPoSyokudai_Init(BgPoSyokudai* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c index e870466ddf..a2fc2c41d5 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -2,11 +2,11 @@ * File: z_bg_pushbox.c * Overlay: ovl_Bg_Pushbox * Description: -*/ + */ #include "z_bg_pushbox.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void func_808A8AE0(BgPushbox* this, ActorFunc actionFunc); @@ -16,8 +16,7 @@ static void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx); static void BgPushbox_Update(BgPushbox* this, GlobalContext* globalCtx); static void BgPushbox_Draw(BgPushbox* this, GlobalContext* globalCtx); -const ActorInit Bg_Pushbox_InitVars = -{ +const ActorInit Bg_Pushbox_InitVars = { ACTOR_BG_PUSHBOX, ACTORTYPE_BG, ROOM, @@ -33,18 +32,15 @@ const ActorInit Bg_Pushbox_InitVars = extern u32 D_06000000; extern u32 D_06000350; -static InitChainEntry initChain[] = -{ - ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP) +static InitChainEntry initChain[] = { + ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP), }; -static void func_808A8AE0(BgPushbox* this, ActorFunc actionFunc) -{ +static void func_808A8AE0(BgPushbox* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -static void BgPushbox_Init(BgPushbox* this, GlobalContext* globalCtx) -{ +static void BgPushbox_Init(BgPushbox* this, GlobalContext* globalCtx) { s32 pad[2]; u32 local_c = 0; Actor* thisx = &this->dyna.actor; @@ -57,38 +53,34 @@ static void BgPushbox_Init(BgPushbox* this, GlobalContext* globalCtx) func_808A8AE0(this, &func_808A8BAC); } -static void BgPushbox_Destroy(BgPushbox* this, GlobalContext* globalCtx) -{ +static void BgPushbox_Destroy(BgPushbox* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx) -{ +static void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; thisx->speedXZ += this->dyna.unk_150 * 0.2f; - thisx->speedXZ = (thisx->speedXZ < -1.0f) ? -1.0f : - ((thisx->speedXZ > 1.0f) ? 1.0f : - thisx->speedXZ); + thisx->speedXZ = (thisx->speedXZ < -1.0f) ? -1.0f : ((thisx->speedXZ > 1.0f) ? 1.0f : thisx->speedXZ); Math_ApproxF(&thisx->speedXZ, 0.0f, 0.2f); thisx->posRot.rot.y = this->dyna.unk_158; Actor_MoveForward(thisx); func_8002E4B4(globalCtx, thisx, 20.0f, 40.0f, 40.0f, 0x1D); } -static void BgPushbox_Update(BgPushbox* this, GlobalContext* globalCtx){ +static void BgPushbox_Update(BgPushbox* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); func_8002DF90(this); } -static void BgPushbox_Draw(BgPushbox* this, GlobalContext* globalCtx) -{ +static void BgPushbox_Draw(BgPushbox* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_bg_pushbox.c", 263); func_80093D18(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_pushbox.c", 269), G_MTX_NOPUSH | G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_pushbox.c", 269), + G_MTX_NOPUSH | G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, &D_06000000); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_bg_pushbox.c", 272); } diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 5a8da07ce2..5a362160f0 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -1,6 +1,6 @@ #include "z_bg_relay_objects.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgRelayObjects_Init(BgRelayObjects* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c index 80ca6b1111..ccb41bd0ce 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c @@ -2,20 +2,19 @@ * File: z_bg_spot00_break.c * Overlay: ovl_Bg_Spot00_Break * Description: Broken drawbridge in Hyrule Field. -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ u32 dynaPolyId; - /* 0x0150 */ char unk_150[0x14]; + /* 0x014C */ u32 dynaPolyId; + /* 0x0150 */ char unk_150[0x14]; } ActorSpot00Break; // size = 0x0164 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void Init(ActorSpot00Break* this, GlobalContext* globalCtx); @@ -23,8 +22,7 @@ static void Destroy(ActorSpot00Break* this, GlobalContext* globalCtx); static void Update(ActorSpot00Break* this, GlobalContext* globalCtx); static void Draw(ActorSpot00Break* this, GlobalContext* globalCtx); -const ActorInit Bg_Spot00_Break_InitVars = -{ +const ActorInit Bg_Spot00_Break_InitVars = { ACTOR_BG_SPOT00_BREAK, ACTORTYPE_PROP, ROOM, @@ -37,62 +35,49 @@ const ActorInit Bg_Spot00_Break_InitVars = (ActorFunc)Draw, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_F32(unk_F8, 1200, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 2000, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP) + ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; -extern D_06000AF0; //segmented address: 0x06000AF0 -extern D_06000908; //segmented address: 0x06000908 -extern D_06000980; //segmented address: 0x06000980 -extern D_06000440; //segmented address: 0x06000440 +extern D_06000AF0; // segmented address: 0x06000AF0 +extern D_06000908; // segmented address: 0x06000908 +extern D_06000980; // segmented address: 0x06000980 +extern D_06000440; // segmented address: 0x06000440 -static void Init(ActorSpot00Break* this, GlobalContext* globalCtx) -{ +static void Init(ActorSpot00Break* this, GlobalContext* globalCtx) { s32 pad[2]; u32 local_c = 0; Actor_ProcessInitChain(&this->actor, initChain); DynaPolyInfo_SetActorMove(&this->actor, 0); - if (this->actor.params == 1) - { + if (this->actor.params == 1) { DynaPolyInfo_Alloc(&D_06000AF0, &local_c); - } - else - { + } else { DynaPolyInfo_Alloc(&D_06000908, &local_c); } this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); - if (LINK_IS_CHILD) - { + if (LINK_IS_CHILD) { Actor_Kill(&this->actor); } } -static void Destroy(ActorSpot00Break* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorSpot00Break* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -static void Update(ActorSpot00Break* this, GlobalContext* globalCtx) -{ - +static void Update(ActorSpot00Break* this, GlobalContext* globalCtx) { } -static void Draw(ActorSpot00Break* this, GlobalContext* globalCtx) -{ - if (this->actor.params == 1) - { +static void Draw(ActorSpot00Break* this, GlobalContext* globalCtx) { + if (this->actor.params == 1) { Draw_DListOpa(globalCtx, &D_06000980); - } - else - { + } else { Draw_DListOpa(globalCtx, &D_06000440); } } diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index ff9f65d0dd..1d32da9c50 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -1,6 +1,6 @@ #include "z_bg_spot00_hanebasi.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgSpot00Hanebasi_Init(BgSpot00Hanebasi* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c index a9cd342a23..682e091ae6 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c @@ -2,13 +2,12 @@ * File: z_bg_spot01_fusya.c * Overlay: Bg_Spot01_Fusya * Description: Windmill Sails -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc actionFunc; /* 0x0150 */ char unk_150[0x4]; @@ -17,7 +16,7 @@ typedef struct /* 0x015C */ f32 unk_15C; } BgSpot01Fusya; // size = 0x0160 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void BgSpot01Fusya_Init(BgSpot01Fusya* this, GlobalContext* globalCtx); @@ -27,8 +26,7 @@ static void BgSpot01Fusya_Draw(BgSpot01Fusya* this, GlobalContext* globalCtx); static void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx); -const ActorInit Bg_Spot01_Fusya_InitVars = -{ +const ActorInit Bg_Spot01_Fusya_InitVars = { ACTOR_BG_SPOT01_FUSYA, ACTORTYPE_BG, ROOM, @@ -41,45 +39,37 @@ const ActorInit Bg_Spot01_Fusya_InitVars = (ActorFunc)BgSpot01Fusya_Draw, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 12800, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 1300, ICHAIN_CONTINUE), - ICHAIN_F32(unk_FC, 1300, ICHAIN_STOP) + ICHAIN_F32(unk_FC, 1300, ICHAIN_STOP), }; extern u32 D_06000100; -static void BgSpot01Fusya_SetupAction(BgSpot01Fusya* this, ActorFunc actionFunc) -{ +static void BgSpot01Fusya_SetupAction(BgSpot01Fusya* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -static void BgSpot01Fusya_Init(BgSpot01Fusya* this, GlobalContext* globalCtx) -{ +static void BgSpot01Fusya_Init(BgSpot01Fusya* this, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, initChain); this->unk_154 = 100.0f; this->unk_158 = 100.0f; this->unk_15C = 0.5f; - if (gSaveContext.scene_setup_index < 4) - { + if (gSaveContext.scene_setup_index < 4) { gSaveContext.event_chk_inf[6] &= 0xFFDF; } BgSpot01Fusya_SetupAction(this, func_808AAA50); } -static void BgSpot01Fusya_Destroy(BgSpot01Fusya* this, GlobalContext* globalCtx) -{ - +static void BgSpot01Fusya_Destroy(BgSpot01Fusya* this, GlobalContext* globalCtx) { } -static void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx) -{ +static void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx) { f32 temp; Actor* thisx = &this->actor; - if (gSaveContext.event_chk_inf[6] & 0x20) - { + if (gSaveContext.event_chk_inf[6] & 0x20) { this->unk_158 = 1800.0f; } thisx->shape.rot.z += this->unk_154; @@ -88,13 +78,11 @@ static void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx) Math_SmoothScaleMaxF(&this->unk_154, this->unk_158, this->unk_15C, 100.0f); } -static void BgSpot01Fusya_Update(BgSpot01Fusya* this, GlobalContext* globalCtx) -{ +static void BgSpot01Fusya_Update(BgSpot01Fusya* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } -static void BgSpot01Fusya_Draw(BgSpot01Fusya* this, GlobalContext* globalCtx) -{ +static void BgSpot01Fusya_Draw(BgSpot01Fusya* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index 9e80e4d085..016173178f 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -1,6 +1,6 @@ #include "z_bg_spot01_idohashira.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgSpot01Idohashira_Init(BgSpot01Idohashira* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c index 4a7357fae8..ff77d423af 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c @@ -1,6 +1,6 @@ #include "z_bg_spot01_idomizu.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000020 void BgSpot01Idomizu_Init(BgSpot01Idomizu* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index 7c6ef6c872..6520fe9764 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -2,18 +2,17 @@ * File: z_bg_spot01_idosoko.c * Overlay: Bg_Spot01_Idosoko * Description: Stone blocking entrance to Bottom of the Well -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; } BgSpot01Idosoko; // size = 0x0168 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void BgSpot01Idosoko_Init(BgSpot01Idosoko* this, GlobalContext* globalCtx); @@ -23,8 +22,7 @@ static void BgSpot01Idosoko_Draw(BgSpot01Idosoko* this, GlobalContext* globalCtx static void func_808ABF54(BgSpot01Idosoko* this, GlobalContext* globalCtx); -const ActorInit Bg_Spot01_Idosoko_InitVars = -{ +const ActorInit Bg_Spot01_Idosoko_InitVars = { ACTOR_BG_SPOT01_IDOSOKO, ACTORTYPE_BG, ROOM, @@ -37,20 +35,17 @@ const ActorInit Bg_Spot01_Idosoko_InitVars = (ActorFunc)BgSpot01Idosoko_Draw, }; -static InitChainEntry initChain[] = -{ - ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP) +static InitChainEntry initChain[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; extern u32 D_06003C64; -static void BgSpot01Idosoko_SetupAction(BgSpot01Idosoko* this, ActorFunc actionFunc) -{ +static void BgSpot01Idosoko_SetupAction(BgSpot01Idosoko* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -static void BgSpot01Idosoko_Init(BgSpot01Idosoko* this, GlobalContext* globalCtx) -{ +static void BgSpot01Idosoko_Init(BgSpot01Idosoko* this, GlobalContext* globalCtx) { s32 pad[2]; s32 local_c = 0; Actor* thisx = &this->dyna.actor; @@ -58,35 +53,27 @@ static void BgSpot01Idosoko_Init(BgSpot01Idosoko* this, GlobalContext* globalCtx Actor_ProcessInitChain(thisx, initChain); DynaPolyInfo_Alloc(&D_06003C64, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); - if (LINK_IS_CHILD) - { + if (LINK_IS_CHILD) { Actor_Kill(thisx); - } - else - { + } else { BgSpot01Idosoko_SetupAction(this, func_808ABF54); } } -static void BgSpot01Idosoko_Destroy(BgSpot01Idosoko* this, GlobalContext* globalCtx) -{ +static void BgSpot01Idosoko_Destroy(BgSpot01Idosoko* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void func_808ABF54(BgSpot01Idosoko* this, GlobalContext* globalCtx) -{ - +static void func_808ABF54(BgSpot01Idosoko* this, GlobalContext* globalCtx) { } -static void BgSpot01Idosoko_Update(BgSpot01Idosoko* this, GlobalContext* globalCtx) -{ +static void BgSpot01Idosoko_Update(BgSpot01Idosoko* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } extern u32 D_06003B20; -static void BgSpot01Idosoko_Draw(BgSpot01Idosoko* this, GlobalContext* globalCtx) -{ +static void BgSpot01Idosoko_Draw(BgSpot01Idosoko* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index db61823bc2..e59a1179ee 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -1,6 +1,6 @@ #include "z_bg_spot01_objects2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgSpot01Objects2_Init(BgSpot01Objects2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index 42eab0a1ef..c39d81d061 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -1,6 +1,6 @@ #include "z_bg_spot02_objects.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgSpot02Objects_Init(BgSpot02Objects* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index a0bcdaff19..5504379eb8 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -1,6 +1,6 @@ #include "z_bg_spot03_taki.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgSpot03Taki_Init(BgSpot03Taki* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index b54b188258..62e45d39e2 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -1,6 +1,6 @@ #include "z_bg_spot05_soko.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot05Soko_Init(BgSpot05Soko* this, GlobalContext* globalCtx); @@ -36,6 +36,3 @@ const ActorInit Bg_Spot05_Soko_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot05_Soko/BgSpot05Soko_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot05_Soko/BgSpot05Soko_Draw.s") - - - diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 0e7d3df219..a57f4b8d2d 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -1,6 +1,6 @@ #include "z_bg_spot06_objects.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000200 void BgSpot06Objects_Init(BgSpot06Objects* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c index 04d6b4fe8d..9ac3a245b3 100644 --- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c @@ -1,6 +1,6 @@ #include "z_bg_spot07_taki.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgSpot07Taki_Init(BgSpot07Taki* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index 6b2ec19a86..915a39ba67 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -1,6 +1,6 @@ #include "z_bg_spot08_bakudankabe.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00400000 void BgSpot08Bakudankabe_Init(BgSpot08Bakudankabe* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index f09dff924a..5f1848ddfe 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -1,6 +1,6 @@ #include "z_bg_spot08_iceblock.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot08Iceblock_Init(BgSpot08Iceblock* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 199c382bbb..7518d97c4e 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -1,6 +1,6 @@ #include "z_bg_spot09_obj.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot09Obj_Init(BgSpot09Obj* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index ab85ada086..e15d4658f2 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -1,6 +1,6 @@ #include "z_bg_spot11_bakudankabe.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgSpot11Bakudankabe_Init(BgSpot11Bakudankabe* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c index cd556b53f6..4848c81181 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c @@ -1,6 +1,6 @@ #include "z_bg_spot11_oasis.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgSpot11Oasis_Init(BgSpot11Oasis* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index 479fc12d2e..87aac0132e 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -1,6 +1,6 @@ #include "z_bg_spot12_gate.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot12Gate_Init(BgSpot12Gate* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 3297978f4f..df1dfd43d2 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -1,6 +1,6 @@ #include "z_bg_spot12_saku.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot12Saku_Init(BgSpot12Saku* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 1091061b4f..5ef865590b 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -1,6 +1,6 @@ #include "z_bg_spot15_rrbox.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot15Rrbox_Init(BgSpot15Rrbox* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index aa3208cfe6..52a6f59441 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -2,11 +2,11 @@ * File: z_bg_spot15_saku.c * Overlay: ovl_Bg_Spot15_Saku * Description: -*/ + */ #include "z_bg_spot15_saku.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot15Saku_Init(BgSpot15Saku* this, GlobalContext* globalCtx); @@ -18,8 +18,7 @@ void func_808B4930(BgSpot15Saku* this, GlobalContext* globalCtx); void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx); void func_808B4A04(BgSpot15Saku* this, GlobalContext* globalCtx); -const ActorInit Bg_Spot15_Saku_InitVars = -{ +const ActorInit Bg_Spot15_Saku_InitVars = { ACTOR_BG_SPOT15_SAKU, ACTORTYPE_ITEMACTION, ROOM, @@ -35,8 +34,7 @@ const ActorInit Bg_Spot15_Saku_InitVars = extern u32 D_060003C0; extern u32 D_060004D0; -void BgSpot15Saku_Init(BgSpot15Saku* this, GlobalContext* globalCtx) -{ +void BgSpot15Saku_Init(BgSpot15Saku* this, GlobalContext* globalCtx) { s32 pad[2]; Actor* thisx = &this->dyna.actor; s32 local_c = 0; @@ -50,27 +48,23 @@ void BgSpot15Saku_Init(BgSpot15Saku* this, GlobalContext* globalCtx) this->unk_170 = thisx->posRot.pos.x; this->unk_174 = thisx->posRot.pos.y; this->unk_178 = thisx->posRot.pos.z; - if ((gSaveContext.inf_table[7] & 2) != 0) - { + if ((gSaveContext.inf_table[7] & 2) != 0) { thisx->posRot.pos.z = 2659.0f; } this->actionFunc = func_808B4930; } -void BgSpot15Saku_Destroy(BgSpot15Saku* this, GlobalContext* globalCtx) -{ +void BgSpot15Saku_Destroy(BgSpot15Saku* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } #ifdef NON_MATCHING // regalloc differences -void func_808B4930(BgSpot15Saku* this, GlobalContext* globalCtx) -{ +void func_808B4930(BgSpot15Saku* this, GlobalContext* globalCtx) { void* temp = this->unk_168; void* temp2 = this->unk_16C; - if ((temp != NULL || temp2 != NULL) && !(gSaveContext.inf_table[7] & 2)) - { + if ((temp != NULL || temp2 != NULL) && !(gSaveContext.inf_table[7] & 2)) { this->unk_17C = 2; this->actionFunc = func_808B4978; } @@ -79,15 +73,12 @@ void func_808B4930(BgSpot15Saku* this, GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot15_Saku/func_808B4930.s") #endif -void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx) -{ +void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (!this->unk_17C) - { + if (!this->unk_17C) { Audio_PlayActorSound2(thisx, 0x2067); thisx->posRot.pos.z -= 2.0f; - if (thisx->posRot.pos.z < 2660.0f) - { + if (thisx->posRot.pos.z < 2660.0f) { Audio_PlayActorSound2(thisx, 0x280E); this->unk_17C = 0x1E; this->actionFunc = func_808B4A04; @@ -97,10 +88,8 @@ void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx) #ifdef NON_MATCHING // single regalloc difference -void func_808B4A04(BgSpot15Saku* this, GlobalContext* globalCtx) -{ - if (this->unk_17C == 0) - { +void func_808B4A04(BgSpot15Saku* this, GlobalContext* globalCtx) { + if (this->unk_17C == 0) { this->unk_168 = 0 & 0xFFFFFFFFFFFFFFFF; this->unk_16C = 0 & 0xFFFFFFFFFFFFFFFF; this->actionFunc = func_808B4930; @@ -110,14 +99,12 @@ void func_808B4A04(BgSpot15Saku* this, GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot15_Saku/func_808B4A04.s") #endif -void BgSpot15Saku_Update(BgSpot15Saku* this, GlobalContext* globalCtx) -{ +void BgSpot15Saku_Update(BgSpot15Saku* this, GlobalContext* globalCtx) { DECR(this->unk_17C); this->actionFunc(this, globalCtx); } -void BgSpot15Saku_Draw(BgSpot15Saku* this, GlobalContext* globalCtx) -{ +void BgSpot15Saku_Draw(BgSpot15Saku* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[4]; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index d400221d14..fbf7847aaf 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -1,6 +1,6 @@ #include "z_bg_spot16_bombstone.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgSpot16Bombstone_Init(BgSpot16Bombstone* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c index 6b1159eaa0..5ec81828d5 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c @@ -1,6 +1,6 @@ #include "z_bg_spot16_doughnut.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot16Doughnut_Init(BgSpot16Doughnut* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index 233f372510..5ec76c9240 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -1,6 +1,6 @@ #include "z_bg_spot17_bakudankabe.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot17Bakudankabe_Init(BgSpot17Bakudankabe* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c index a105f6359c..bc70d2436b 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c @@ -1,6 +1,6 @@ #include "z_bg_spot17_funen.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgSpot17Funen_Init(BgSpot17Funen* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index acc207c4ab..774c115b13 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -1,6 +1,6 @@ #include "z_bg_spot18_basket.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgSpot18Basket_Init(BgSpot18Basket* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c index 2146b2b190..05cb5e107e 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c @@ -2,17 +2,16 @@ * File: z_bg_spot18_futa.c * Overlay: ovl_Bg_Spot18_Futa * Description: The lid to a goron jar. -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ u32 dynaPolyId; - /* 0x0150 */ u32 unk_150[0x5]; + /* 0x014C */ u32 dynaPolyId; + /* 0x0150 */ u32 unk_150[0x5]; } ActorSpot18Futa; // size = 0x0154 #define ROOM 0x00 @@ -23,8 +22,7 @@ static void Destroy(ActorSpot18Futa* this, GlobalContext* globalCtx); static void Update(ActorSpot18Futa* this, GlobalContext* globalCtx); static void Draw(ActorSpot18Futa* this, GlobalContext* globalCtx); -const ActorInit Bg_Spot18_Futa_InitVars = -{ +const ActorInit Bg_Spot18_Futa_InitVars = { ACTOR_BG_SPOT18_FUTA, ACTORTYPE_PROP, ROOM, @@ -37,19 +35,17 @@ const ActorInit Bg_Spot18_Futa_InitVars = (ActorFunc)Draw, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), - ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP) + ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP), }; -extern u32 DL_SPOT18_FUTA; // 0x6000368 +extern u32 DL_SPOT18_FUTA; // 0x6000368 extern u32 DL_SPOT18_FUTA2; // 0x6000150 -static void Init(ActorSpot18Futa* this, GlobalContext* globalCtx) -{ +static void Init(ActorSpot18Futa* this, GlobalContext* globalCtx) { s32 pad[2]; u32 sp1C = 0; @@ -59,32 +55,25 @@ static void Init(ActorSpot18Futa* this, GlobalContext* globalCtx) Actor_ProcessInitChain(&this->actor, initChain); } -static void Destroy(ActorSpot18Futa* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorSpot18Futa* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -static void Update(ActorSpot18Futa* this, GlobalContext* globalCtx) -{ +static void Update(ActorSpot18Futa* this, GlobalContext* globalCtx) { s32 iVar1; - if (this->actor.attachedA == NULL) - { + if (this->actor.attachedA == NULL) { iVar1 = Math_ApproxF(&this->actor.scale.x, 0, 0.005); - if (iVar1 != 0) - { + if (iVar1 != 0) { Actor_Kill(&this->actor); - } - else - { + } else { this->actor.scale.z = this->actor.scale.x; this->actor.scale.y = this->actor.scale.x; } } } -static void Draw(ActorSpot18Futa* this, GlobalContext* globalCtx) -{ +static void Draw(ActorSpot18Futa* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &DL_SPOT18_FUTA2); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index 4020fc96d2..4f65b2e911 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -1,6 +1,6 @@ #include "z_bg_spot18_obj.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgSpot18Obj_Init(BgSpot18Obj* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c index c551a419a8..58d9ab2792 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c @@ -1,6 +1,6 @@ #include "z_bg_spot18_shutter.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgSpot18Shutter_Init(BgSpot18Shutter* this, GlobalContext* globalCtx); @@ -40,6 +40,3 @@ const ActorInit Bg_Spot18_Shutter_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot18_Shutter/BgSpot18Shutter_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot18_Shutter/BgSpot18Shutter_Draw.s") - - - diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c index 02050e74eb..0283b0a006 100644 --- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c +++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c @@ -1,6 +1,6 @@ #include "z_bg_sst_floor.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgSstFloor_Init(BgSstFloor* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c index f1a3b465d3..e00e526425 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c +++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c @@ -1,6 +1,6 @@ #include "z_bg_toki_hikari.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000020 void BgTokiHikari_Init(BgTokiHikari* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 459d1d3360..d87c2f1362 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -2,11 +2,11 @@ * File: z_bg_toki_swd.c * Overlay: ovl_Bg_Toki_Swd * Description: Master Sword (Contains Cutscenes) -*/ + */ #include "z_bg_toki_swd.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx); @@ -20,289 +20,137 @@ static void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx); extern u32 D_06001BD0; -static u32 D_808BB2F0[] = -{ - 0x00000009, 0x000001A9, 0x0000000A, 0x00000001, - 0x000C0000, 0x01000000, 0x00000000, 0x00000000, - 0x00000036, 0x00000034, 0x00000000, 0x00000036, - 0x00000034, 0x00000000, 0x00000000, 0x00000000, - 0x00000004, 0x00000001, 0x0002006E, 0x006F0000, - 0x00000000, 0x00000000, 0xFFFFFFE3, 0xFFFFFFC5, - 0x00000000, 0xFFFFFFE3, 0xFFFFFFC5, 0x00000000, - 0x00000000, 0x00000000, 0x00000003, 0x00000001, - 0x000A006E, 0x006F0000, 0x00000000, 0x00000000, - 0x0000002E, 0xFFFFFFE6, 0x00000000, 0x0000002E, - 0xFFFFFFE6, 0x00000000, 0x00000000, 0x00000000, - 0x000003E8, 0x00000001, 0x000800E6, 0x00E700E7, - 0x0000002D, 0x00000001, 0x000100D2, 0x00E600E6, - 0x00000001, 0x00010000, 0x00F10000, 0x00000000, - 0x42700000, 0xFFD60048, 0xFFD9018C, 0x00000000, - 0x42700000, 0xFFD60048, 0xFFD9019D, 0x00000000, - 0x42700000, 0xFFD60048, 0xFFD901AE, 0x00000000, - 0x42700000, 0xFFD60048, 0xFFD902A8, 0x00000000, - 0x42700000, 0xFFD60048, 0xFFD90000, 0x00000000, - 0x42700000, 0xFFD60048, 0xFFD9007A, 0x00000000, - 0x42700000, 0xFFD60048, 0xFFD90064, 0x00000000, - 0x42700000, 0xFFD60048, 0xFFD90074, 0xFF000000, - 0x42700000, 0xFFD60048, 0xFFD9005F, 0x00000001, - 0x00010050, 0x01960000, 0x00000000, 0x42700000, - 0xFFFF005F, 0xFFED2F73, 0x00000000, 0x42700000, - 0xFFFF005F, 0xFFED6B2F, 0x00000000, 0x42700000, - 0xFFFF005F, 0xFFED6169, 0x00000000, 0x42700000, - 0xFFFF005F, 0xFFED0000, 0x00000000, 0x42700000, - 0xFFFF005F, 0xFFED0005, 0x00000000, 0x42700000, - 0xFFFF0081, 0xFFDE7961, 0x00000000, 0x42700000, - 0xFFFF00AD, 0xFFED742F, 0x00000000, 0x42700000, - 0xFFEF00D9, 0xFFEC2E64, 0x00000000, 0x42700000, - 0xFFE80148, 0xFFF40000, 0x00000000, 0x42700000, - 0xFFE501FD, 0xFFFE2F73, 0x00000000, 0x42700000, - 0xFFD7032D, 0x000A6B2F, 0x00000000, 0x42700000, - 0xFFC40505, 0x00266D61, 0x00000000, 0x42700000, - 0xFFC60776, 0x005B0000, 0x00000000, 0x42700000, - 0xFFCB09DE, 0x00850005, 0x00000000, 0x42700000, - 0xFFDF0D75, 0x00C17961, 0x00000000, 0x42700000, - 0x00000F78, 0x00E1742F, 0x00000000, 0x42700000, - 0x000710DD, 0x00F56565, 0x00000000, 0x42700000, - 0x000710DC, 0x00F50000, 0x00000000, 0x42700000, - 0x000710DC, 0x00F52F73, 0xFF000000, 0x42700000, - 0x000710DC, 0x00F56B2F, 0x00000002, 0x00010000, - 0x010E0000, 0x0000001E, 0x42700000, 0xFFEC0055, - 0xFFF72F73, 0x0000001E, 0x42700000, 0xFFEC0055, - 0xFFF76B2F, 0x0000001E, 0x42700000, 0xFFEC0055, - 0xFFF76169, 0x0000001E, 0x42700000, 0xFFEC0055, - 0xFFF70000, 0x0000001E, 0x42700000, 0xFFEC0055, - 0xFFF70005, 0x0000001E, 0x42700000, 0xFFEC0055, - 0xFFF77961, 0x0000001E, 0x42700000, 0xFFEC0055, - 0xFFF7742F, 0x0000001E, 0x42700000, 0xFFEC0055, - 0xFFF72E64, 0xFF00001E, 0x42700000, 0xFFEC0055, - 0xFFF70000, 0x00000002, 0x00010050, 0x01A90000, - 0x00000005, 0x42700000, 0xFFFF0070, 0x00072F73, - 0x00000005, 0x42700000, 0xFFFF0070, 0x00076B2F, - 0x00000005, 0x42700000, 0xFFFF0070, 0x00076169, - 0x00000005, 0x42700000, 0xFFFF0070, 0x00070000, - 0x0000000F, 0x42700000, 0xFFFF0070, 0x00070005, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00077961, - 0x00000019, 0x42700000, 0xFFFF0075, 0x0007742F, - 0x00000019, 0x42700000, 0xFFFF0075, 0x00072E64, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00072F73, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00076B2F, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00076D61, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00070005, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00077961, - 0x00000014, 0x42700000, 0xFFFF0075, 0x0007742F, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00076565, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, - 0x00000014, 0x42700000, 0xFFFF0075, 0x00072F73, - 0xFF000014, 0x42700000, 0xFFFF0075, 0x00076B2F, - 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, +static u32 D_808BB2F0[] = { + 0x00000009, 0x000001A9, 0x0000000A, 0x00000001, 0x000C0000, 0x01000000, 0x00000000, 0x00000000, 0x00000036, + 0x00000034, 0x00000000, 0x00000036, 0x00000034, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, + 0x0002006E, 0x006F0000, 0x00000000, 0x00000000, 0xFFFFFFE3, 0xFFFFFFC5, 0x00000000, 0xFFFFFFE3, 0xFFFFFFC5, + 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x000A006E, 0x006F0000, 0x00000000, 0x00000000, + 0x0000002E, 0xFFFFFFE6, 0x00000000, 0x0000002E, 0xFFFFFFE6, 0x00000000, 0x00000000, 0x00000000, 0x000003E8, + 0x00000001, 0x000800E6, 0x00E700E7, 0x0000002D, 0x00000001, 0x000100D2, 0x00E600E6, 0x00000001, 0x00010000, + 0x00F10000, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD9018C, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD9019D, + 0x00000000, 0x42700000, 0xFFD60048, 0xFFD901AE, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD902A8, 0x00000000, + 0x42700000, 0xFFD60048, 0xFFD90000, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD9007A, 0x00000000, 0x42700000, + 0xFFD60048, 0xFFD90064, 0x00000000, 0x42700000, 0xFFD60048, 0xFFD90074, 0xFF000000, 0x42700000, 0xFFD60048, + 0xFFD9005F, 0x00000001, 0x00010050, 0x01960000, 0x00000000, 0x42700000, 0xFFFF005F, 0xFFED2F73, 0x00000000, + 0x42700000, 0xFFFF005F, 0xFFED6B2F, 0x00000000, 0x42700000, 0xFFFF005F, 0xFFED6169, 0x00000000, 0x42700000, + 0xFFFF005F, 0xFFED0000, 0x00000000, 0x42700000, 0xFFFF005F, 0xFFED0005, 0x00000000, 0x42700000, 0xFFFF0081, + 0xFFDE7961, 0x00000000, 0x42700000, 0xFFFF00AD, 0xFFED742F, 0x00000000, 0x42700000, 0xFFEF00D9, 0xFFEC2E64, + 0x00000000, 0x42700000, 0xFFE80148, 0xFFF40000, 0x00000000, 0x42700000, 0xFFE501FD, 0xFFFE2F73, 0x00000000, + 0x42700000, 0xFFD7032D, 0x000A6B2F, 0x00000000, 0x42700000, 0xFFC40505, 0x00266D61, 0x00000000, 0x42700000, + 0xFFC60776, 0x005B0000, 0x00000000, 0x42700000, 0xFFCB09DE, 0x00850005, 0x00000000, 0x42700000, 0xFFDF0D75, + 0x00C17961, 0x00000000, 0x42700000, 0x00000F78, 0x00E1742F, 0x00000000, 0x42700000, 0x000710DD, 0x00F56565, + 0x00000000, 0x42700000, 0x000710DC, 0x00F50000, 0x00000000, 0x42700000, 0x000710DC, 0x00F52F73, 0xFF000000, + 0x42700000, 0x000710DC, 0x00F56B2F, 0x00000002, 0x00010000, 0x010E0000, 0x0000001E, 0x42700000, 0xFFEC0055, + 0xFFF72F73, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF76B2F, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF76169, + 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF70000, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF70005, 0x0000001E, + 0x42700000, 0xFFEC0055, 0xFFF77961, 0x0000001E, 0x42700000, 0xFFEC0055, 0xFFF7742F, 0x0000001E, 0x42700000, + 0xFFEC0055, 0xFFF72E64, 0xFF00001E, 0x42700000, 0xFFEC0055, 0xFFF70000, 0x00000002, 0x00010050, 0x01A90000, + 0x00000005, 0x42700000, 0xFFFF0070, 0x00072F73, 0x00000005, 0x42700000, 0xFFFF0070, 0x00076B2F, 0x00000005, + 0x42700000, 0xFFFF0070, 0x00076169, 0x00000005, 0x42700000, 0xFFFF0070, 0x00070000, 0x0000000F, 0x42700000, + 0xFFFF0070, 0x00070005, 0x00000014, 0x42700000, 0xFFFF0075, 0x00077961, 0x00000019, 0x42700000, 0xFFFF0075, + 0x0007742F, 0x00000019, 0x42700000, 0xFFFF0075, 0x00072E64, 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00072F73, 0x00000014, 0x42700000, 0xFFFF0075, 0x00076B2F, 0x00000014, + 0x42700000, 0xFFFF0075, 0x00076D61, 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, 0x00000014, 0x42700000, + 0xFFFF0075, 0x00070005, 0x00000014, 0x42700000, 0xFFFF0075, 0x00077961, 0x00000014, 0x42700000, 0xFFFF0075, + 0x0007742F, 0x00000014, 0x42700000, 0xFFFF0075, 0x00076565, 0x00000014, 0x42700000, 0xFFFF0075, 0x00070000, + 0x00000014, 0x42700000, 0xFFFF0075, 0x00072F73, 0xFF000014, 0x42700000, 0xFFFF0075, 0x00076B2F, 0xFFFFFFFF, + 0x00000000, 0x00000000, 0x00000000, }; -static u32 D_808BB7A0[] = -{ - 0x00000009, 0x00000170, 0x00000001, 0x00010000, - 0x007E0000, 0x00000000, 0x42700000, 0xFFFF0065, - 0xFF92616D, 0x00000000, 0x42200000, 0xFFFF0065, - 0xFF926964, 0x00000000, 0x42200000, 0xFFFF0065, - 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0065, - 0xFF920111, 0x00000000, 0x42200000, 0xFFFF0065, - 0xFF93012D, 0x00000000, 0x42200000, 0xFFFF0047, - 0xFF920033, 0x00000000, 0x42200000, 0xFFFF0048, - 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0048, - 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0048, - 0xFF922F68, 0xFF000000, 0x42200000, 0xFFFF0048, - 0xFF92612F, 0x00000001, 0x0001003A, 0x01530000, - 0x00000000, 0x42700001, 0xFFF7006A, 0xFFFDA1BC, - 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5F3, - 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5EB, - 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5A2, - 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBBAEE, - 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBC9B8, - 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCB0020, - 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBA5A4, - 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCB0020, - 0x00000000, 0x42700000, 0xFFAD0066, 0xFFD6A5E1, - 0x00000000, 0x42700000, 0xFF8C0051, 0xFFEDA5D0, - 0x00000000, 0x42700000, 0xFF8A0051, 0x00360020, - 0x00000000, 0x42700000, 0xFF96004E, 0x0074A5A6, - 0x00000000, 0x42700000, 0xFFE5004B, 0x00E2A5E5, - 0x00000000, 0x42700000, 0x00790052, 0x0138C0AE, - 0x00000000, 0x42700000, 0x0128004C, 0x0176A5E5, - 0x00000000, 0x42700000, 0x02350050, 0x01010020, - 0x00000000, 0x42700000, 0x02660050, 0xFFFFA5EB, - 0x00000000, 0x42700000, 0x02520050, 0xFF6FA5E1, - 0x00000000, 0x42700000, 0x01DB0050, 0xFE840020, - 0x00000000, 0x42700000, 0x01430050, 0xFDFFA5E1, - 0x00000000, 0x42700000, 0x00C00050, 0xFDC2A5D0, - 0x00000000, 0x42700000, 0xFFD30050, 0xFDA40020, - 0x00000000, 0x42700000, 0xFF720050, 0xFDB3A5A6, - 0x00000000, 0x42700000, 0xFF1C0050, 0xFDCEA5E5, - 0x00000000, 0x42700000, 0xFE88005D, 0xFE23C0AE, - 0x00000000, 0x42700000, 0xFDB8005F, 0xFF49A5E5, - 0x00000000, 0x42700000, 0xFD9B005F, 0xFFDE0020, - 0xFF000000, 0x42700000, 0xFDAD005F, 0x00A1A5EB, - 0x00000002, 0x00010000, 0x009B0000, 0x00000005, - 0x4221999A, 0xFFFF006F, 0x0005A1BC, 0x00000005, - 0x42200000, 0xFFFF006F, 0x0005A5F3, 0x00000005, - 0x42200000, 0xFFFF006F, 0x0005A5EB, 0x0000000F, - 0x42200000, 0xFFFF006F, 0x0005A5A2, 0x0000000F, - 0x42200000, 0xFFFF006F, 0x0005BAEE, 0x0000000F, - 0x42200000, 0xFFFF0068, 0x0008C9B8, 0x00000005, - 0x42200000, 0xFFFF0068, 0x00080020, 0x0000001E, - 0x42200000, 0xFFFF0068, 0x0008A5A4, 0x0000001E, - 0x42200000, 0xFFFF0068, 0x00080020, 0xFF00001E, - 0x42200000, 0xFFFF0068, 0x0008A5E1, 0x00000002, - 0x0001003A, 0x01700000, 0x00000005, 0x42700001, - 0x00000078, 0x000CA1BC, 0x00000005, 0x42700000, - 0x00000078, 0x000CA5F3, 0x00000005, 0x42700000, - 0x00000078, 0x000CA5EB, 0x0000000A, 0x42700000, - 0x00000078, 0x000CA5A2, 0x00000005, 0x42700000, - 0xFFFF005F, 0x000BBAEE, 0x00000005, 0x42700000, - 0xFFFF005F, 0x000BC9B8, 0x00000005, 0x42700000, - 0xFFFF005F, 0x000B0020, 0x00000005, 0x42700000, - 0xFFFF005F, 0x000BA5A4, 0x00000005, 0x42700000, - 0xFFFF005F, 0x000B0020, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x0008A5E1, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x0008A5D0, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x00080020, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x0008A5A6, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x0008A5E5, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x0008C0AE, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x0008A5E5, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x00080020, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x0008A5EB, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x0008A5E1, 0x0000000A, 0x42700000, - 0xFFFD005F, 0x00080020, 0x0000000F, 0x42700000, - 0xFFFD005F, 0x0008A5E1, 0x0000000F, 0x42700000, - 0xFFFD005F, 0x0008A5D0, 0x0000000F, 0x42700000, - 0xFFFD005F, 0x00080020, 0x0000000F, 0x42700000, - 0xFFFD005F, 0x0008A5A6, 0x0000000F, 0x42700000, - 0xFFFD005F, 0x0008A5E5, 0x0000000F, 0x42700000, - 0xFFFD005F, 0x0008C0AE, 0x0000000F, 0x42700000, - 0xFFFD005F, 0x0008A5E5, 0x0000000F, 0x42700000, - 0xFFFD005F, 0x00080020, 0xFF00001E, 0x42700000, - 0xFFFD005F, 0x0008A5EB, 0x0000000A, 0x00000001, - 0x000C0000, 0x00B40000, 0x00000000, 0x00000000, - 0x0000001C, 0xFFFFFFF6, 0x00000000, 0xFFFFFFF2, - 0x00000009, 0x00000000, 0xBE6EEEEF, 0x00000000, - 0x00000004, 0x00000001, 0x0002005A, 0x005B0000, - 0x00000000, 0x00000000, 0xFFFFFFF2, 0x00000024, - 0x00000000, 0xFFFFFFF2, 0x00000024, 0x00000000, - 0x00000000, 0x00000000, 0x00000003, 0x00000001, - 0x000A005A, 0x005B0000, 0x00000000, 0x00000000, - 0xFFFFFFF8, 0xFFFFFFDD, 0x00000000, 0xFFFFFFF8, - 0xFFFFFFDD, 0x00000000, 0x00000000, 0x00000000, - 0x0000002D, 0x00000001, 0x000100BE, 0x00D200D2, - 0x000003E8, 0x00000001, 0x000800D2, 0x00D300D3, - 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, +static u32 D_808BB7A0[] = { + 0x00000009, 0x00000170, 0x00000001, 0x00010000, 0x007E0000, 0x00000000, 0x42700000, 0xFFFF0065, 0xFF92616D, + 0x00000000, 0x42200000, 0xFFFF0065, 0xFF926964, 0x00000000, 0x42200000, 0xFFFF0065, 0xFF9200FB, 0x00000000, + 0x42200000, 0xFFFF0065, 0xFF920111, 0x00000000, 0x42200000, 0xFFFF0065, 0xFF93012D, 0x00000000, 0x42200000, + 0xFFFF0047, 0xFF920033, 0x00000000, 0x42200000, 0xFFFF0048, 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0048, + 0xFF9200FB, 0x00000000, 0x42200000, 0xFFFF0048, 0xFF922F68, 0xFF000000, 0x42200000, 0xFFFF0048, 0xFF92612F, + 0x00000001, 0x0001003A, 0x01530000, 0x00000000, 0x42700001, 0xFFF7006A, 0xFFFDA1BC, 0x00000000, 0x42700000, + 0xFFF7006A, 0xFFFDA5F3, 0x00000000, 0x42700000, 0xFFF7006A, 0xFFFDA5EB, 0x00000000, 0x42700000, 0xFFF7006A, + 0xFFFDA5A2, 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBBAEE, 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBC9B8, + 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCB0020, 0x00000000, 0x42700000, 0xFFBD006C, 0xFFCBA5A4, 0x00000000, + 0x42700000, 0xFFBD006C, 0xFFCB0020, 0x00000000, 0x42700000, 0xFFAD0066, 0xFFD6A5E1, 0x00000000, 0x42700000, + 0xFF8C0051, 0xFFEDA5D0, 0x00000000, 0x42700000, 0xFF8A0051, 0x00360020, 0x00000000, 0x42700000, 0xFF96004E, + 0x0074A5A6, 0x00000000, 0x42700000, 0xFFE5004B, 0x00E2A5E5, 0x00000000, 0x42700000, 0x00790052, 0x0138C0AE, + 0x00000000, 0x42700000, 0x0128004C, 0x0176A5E5, 0x00000000, 0x42700000, 0x02350050, 0x01010020, 0x00000000, + 0x42700000, 0x02660050, 0xFFFFA5EB, 0x00000000, 0x42700000, 0x02520050, 0xFF6FA5E1, 0x00000000, 0x42700000, + 0x01DB0050, 0xFE840020, 0x00000000, 0x42700000, 0x01430050, 0xFDFFA5E1, 0x00000000, 0x42700000, 0x00C00050, + 0xFDC2A5D0, 0x00000000, 0x42700000, 0xFFD30050, 0xFDA40020, 0x00000000, 0x42700000, 0xFF720050, 0xFDB3A5A6, + 0x00000000, 0x42700000, 0xFF1C0050, 0xFDCEA5E5, 0x00000000, 0x42700000, 0xFE88005D, 0xFE23C0AE, 0x00000000, + 0x42700000, 0xFDB8005F, 0xFF49A5E5, 0x00000000, 0x42700000, 0xFD9B005F, 0xFFDE0020, 0xFF000000, 0x42700000, + 0xFDAD005F, 0x00A1A5EB, 0x00000002, 0x00010000, 0x009B0000, 0x00000005, 0x4221999A, 0xFFFF006F, 0x0005A1BC, + 0x00000005, 0x42200000, 0xFFFF006F, 0x0005A5F3, 0x00000005, 0x42200000, 0xFFFF006F, 0x0005A5EB, 0x0000000F, + 0x42200000, 0xFFFF006F, 0x0005A5A2, 0x0000000F, 0x42200000, 0xFFFF006F, 0x0005BAEE, 0x0000000F, 0x42200000, + 0xFFFF0068, 0x0008C9B8, 0x00000005, 0x42200000, 0xFFFF0068, 0x00080020, 0x0000001E, 0x42200000, 0xFFFF0068, + 0x0008A5A4, 0x0000001E, 0x42200000, 0xFFFF0068, 0x00080020, 0xFF00001E, 0x42200000, 0xFFFF0068, 0x0008A5E1, + 0x00000002, 0x0001003A, 0x01700000, 0x00000005, 0x42700001, 0x00000078, 0x000CA1BC, 0x00000005, 0x42700000, + 0x00000078, 0x000CA5F3, 0x00000005, 0x42700000, 0x00000078, 0x000CA5EB, 0x0000000A, 0x42700000, 0x00000078, + 0x000CA5A2, 0x00000005, 0x42700000, 0xFFFF005F, 0x000BBAEE, 0x00000005, 0x42700000, 0xFFFF005F, 0x000BC9B8, + 0x00000005, 0x42700000, 0xFFFF005F, 0x000B0020, 0x00000005, 0x42700000, 0xFFFF005F, 0x000BA5A4, 0x00000005, + 0x42700000, 0xFFFF005F, 0x000B0020, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5E1, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x0008A5D0, 0x0000000A, 0x42700000, 0xFFFD005F, 0x00080020, 0x0000000A, 0x42700000, 0xFFFD005F, + 0x0008A5A6, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5E5, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008C0AE, + 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5E5, 0x0000000A, 0x42700000, 0xFFFD005F, 0x00080020, 0x0000000A, + 0x42700000, 0xFFFD005F, 0x0008A5EB, 0x0000000A, 0x42700000, 0xFFFD005F, 0x0008A5E1, 0x0000000A, 0x42700000, + 0xFFFD005F, 0x00080020, 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008A5E1, 0x0000000F, 0x42700000, 0xFFFD005F, + 0x0008A5D0, 0x0000000F, 0x42700000, 0xFFFD005F, 0x00080020, 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008A5A6, + 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008A5E5, 0x0000000F, 0x42700000, 0xFFFD005F, 0x0008C0AE, 0x0000000F, + 0x42700000, 0xFFFD005F, 0x0008A5E5, 0x0000000F, 0x42700000, 0xFFFD005F, 0x00080020, 0xFF00001E, 0x42700000, + 0xFFFD005F, 0x0008A5EB, 0x0000000A, 0x00000001, 0x000C0000, 0x00B40000, 0x00000000, 0x00000000, 0x0000001C, + 0xFFFFFFF6, 0x00000000, 0xFFFFFFF2, 0x00000009, 0x00000000, 0xBE6EEEEF, 0x00000000, 0x00000004, 0x00000001, + 0x0002005A, 0x005B0000, 0x00000000, 0x00000000, 0xFFFFFFF2, 0x00000024, 0x00000000, 0xFFFFFFF2, 0x00000024, + 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x000A005A, 0x005B0000, 0x00000000, 0x00000000, + 0xFFFFFFF8, 0xFFFFFFDD, 0x00000000, 0xFFFFFFF8, 0xFFFFFFDD, 0x00000000, 0x00000000, 0x00000000, 0x0000002D, + 0x00000001, 0x000100BE, 0x00D200D2, 0x000003E8, 0x00000001, 0x000800D2, 0x00D300D3, 0xFFFFFFFF, 0x00000000, + 0x00000000, 0x00000000, }; -static u32 D_808BBD90[] = -{ - 0x0000000B, 0x00000BB8, 0x00000021, 0x00000001, - 0x00010000, 0x0BB80000, 0x00000000, 0x00000000, - 0xFFFFFFF8, 0xFFFFFFFF, 0x00000000, 0xFFFFFFF8, - 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, - 0x0000000A, 0x00000003, 0x00050000, 0x00010000, - 0x80000000, 0x00000000, 0x00000000, 0x00000334, - 0x00000000, 0x00000000, 0x00000334, 0x00000000, - 0x00000000, 0x00000001, 0x00020001, 0x00100000, - 0x80000000, 0x00000000, 0x00000000, 0x00000334, - 0x00000000, 0x00000000, 0x000002D0, 0x00000000, - 0x00000000, 0x00000001, 0x00050010, 0x00B00000, - 0x80000000, 0x00000000, 0x00000000, 0x000002D0, - 0x00000000, 0x00000000, 0x000002D0, 0x00000000, - 0x00000000, 0x00000001, 0x0000003E, 0x00000003, - 0x00040028, 0x00467D74, 0x00000000, 0xFFFFFFFF, - 0x00000031, 0x000002CF, 0x00000001, 0x0000002F, - 0x000002AF, 0x3D888889, 0xBD888889, 0xBD888889, - 0x00040046, 0x00DC8010, 0x00000000, 0x00000001, - 0x0000002F, 0x000002AF, 0x00000000, 0x00000086, - 0x00000015, 0xBBDA740E, 0x3F147AE1, 0x3BDA740E, - 0x000200DC, 0x01108000, 0x00000000, 0x00000000, - 0x00000086, 0x00000015, 0x00000000, 0x00000065, - 0x00000002, 0x00000000, 0xBF227627, 0x00000000, - 0x00000003, 0x00000001, 0x000C0154, 0x01550000, - 0x00000000, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFD, - 0xFFFFFFFF, 0x00000000, 0xFFFFFFFD, 0x00000000, - 0x00000000, 0x00000000, 0x00000013, 0x00000006, - 0xFFFF0000, 0x0032FFFF, 0xFFFFFFFF, 0x70E60032, - 0x003C0000, 0x00000000, 0xFFFF003C, 0x00FAFFFF, - 0xFFFFFFFF, 0x70E700FA, 0x01040000, 0x00000000, - 0xFFFF0104, 0x0122FFFF, 0xFFFFFFFF, 0x70E80122, - 0x01400000, 0x00000000, 0x00000001, 0x00010000, - 0x00FB0000, 0x00000000, 0x42700000, 0xFFC5000C, - 0x02B20222, 0x00000000, 0x42700000, 0xFFC5000C, - 0x02B200FA, 0x00000000, 0x42700000, 0xFFC5000C, - 0x02B20000, 0x00000000, 0x42700000, 0xFFC5000C, - 0x02B20000, 0x00000000, 0x42700000, 0xFFC5000C, - 0x02B20000, 0x00000000, 0x42700000, 0xFFE10018, - 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, - 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, - 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, - 0x02BD2D70, 0x00000000, 0x42700000, 0xFFE10018, - 0x02BD0085, 0x00000000, 0x42700000, 0xFFE10018, - 0x02BD01E6, 0xFF000000, 0x42700000, 0xFFE10018, - 0x02BD0000, 0x00000001, 0x0001005A, 0x014B0000, - 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0222, - 0x00000000, 0x42700000, 0xFF66005C, 0x00EC00FA, - 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, - 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, - 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, - 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, - 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, - 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, - 0xFF000000, 0x42700000, 0xFF66005C, 0x00EC2D70, - 0x00000001, 0x000100DC, 0x01EB0000, 0x00000000, - 0x42700001, 0xFFFE007A, 0x00270222, 0x00000000, - 0x42700001, 0xFFFE007A, 0x002700FA, 0x00000000, - 0x42700001, 0xFFFE0066, 0x00270000, 0x00000000, - 0x42700001, 0xFFFE005A, 0x00270000, 0x00000000, - 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, - 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, - 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, - 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, - 0x42700001, 0xFFFE0051, 0x003E2D70, 0xFF000000, - 0x42700001, 0xFFFE0051, 0x003E0085, 0x00000002, - 0x00010000, 0x01180000, 0x0000001E, 0x42700000, - 0x002B0034, 0x02CC0222, 0x0000001E, 0x42700000, - 0x002B0034, 0x02CC00FA, 0x0000000A, 0x42700000, - 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, - 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, - 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, - 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, - 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, - 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, - 0x003F0056, 0x02D22D70, 0x0000001E, 0x42700000, - 0x003F0055, 0x02D10085, 0x0000001E, 0x42700000, - 0x003F0055, 0x02D101E6, 0xFF00001E, 0x42700000, - 0x003E0055, 0x02D10000, 0x00000002, 0x0001005A, - 0x01680000, 0x0000001E, 0x42700000, 0xFF970053, - 0x016E0222, 0x0000001E, 0x42700000, 0xFF980053, - 0x016C00FA, 0x0000001E, 0x42700000, 0xFFC10053, - 0x01530000, 0x0000001E, 0x42700000, 0xFFF00063, - 0x00FF0000, 0x0000001E, 0x42700000, 0xFFE2006F, - 0x00B10000, 0x0000001E, 0x42700000, 0xFFB00070, - 0x00790000, 0x0000001E, 0x42700000, 0xFFB00070, - 0x00790000, 0x0000001E, 0x42700000, 0xFFB00070, - 0x00790000, 0xFF00001E, 0x42700000, 0xFFB00070, - 0x00792D70, 0x00000002, 0x000100DC, 0x02080000, - 0x0000001E, 0x42700001, 0x00000089, 0xFFC90222, - 0x0000001E, 0x42700001, 0x00000089, 0xFFC900FA, - 0x0000001E, 0x42700001, 0x00000075, 0xFFC90000, - 0x0000001E, 0x42700001, 0x00000069, 0xFFC90000, - 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, - 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, - 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, - 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, - 0x0000001E, 0x42700001, 0x00000062, 0xFFE12D70, - 0xFF00001E, 0x42700001, 0x00000062, 0xFFE10085, - 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, +static u32 D_808BBD90[] = { + 0x0000000B, 0x00000BB8, 0x00000021, 0x00000001, 0x00010000, 0x0BB80000, 0x00000000, 0x00000000, 0xFFFFFFF8, + 0xFFFFFFFF, 0x00000000, 0xFFFFFFF8, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x0000000A, 0x00000003, + 0x00050000, 0x00010000, 0x80000000, 0x00000000, 0x00000000, 0x00000334, 0x00000000, 0x00000000, 0x00000334, + 0x00000000, 0x00000000, 0x00000001, 0x00020001, 0x00100000, 0x80000000, 0x00000000, 0x00000000, 0x00000334, + 0x00000000, 0x00000000, 0x000002D0, 0x00000000, 0x00000000, 0x00000001, 0x00050010, 0x00B00000, 0x80000000, + 0x00000000, 0x00000000, 0x000002D0, 0x00000000, 0x00000000, 0x000002D0, 0x00000000, 0x00000000, 0x00000001, + 0x0000003E, 0x00000003, 0x00040028, 0x00467D74, 0x00000000, 0xFFFFFFFF, 0x00000031, 0x000002CF, 0x00000001, + 0x0000002F, 0x000002AF, 0x3D888889, 0xBD888889, 0xBD888889, 0x00040046, 0x00DC8010, 0x00000000, 0x00000001, + 0x0000002F, 0x000002AF, 0x00000000, 0x00000086, 0x00000015, 0xBBDA740E, 0x3F147AE1, 0x3BDA740E, 0x000200DC, + 0x01108000, 0x00000000, 0x00000000, 0x00000086, 0x00000015, 0x00000000, 0x00000065, 0x00000002, 0x00000000, + 0xBF227627, 0x00000000, 0x00000003, 0x00000001, 0x000C0154, 0x01550000, 0x00000000, 0xFFFFFFFF, 0x00000000, + 0xFFFFFFFD, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFD, 0x00000000, 0x00000000, 0x00000000, 0x00000013, 0x00000006, + 0xFFFF0000, 0x0032FFFF, 0xFFFFFFFF, 0x70E60032, 0x003C0000, 0x00000000, 0xFFFF003C, 0x00FAFFFF, 0xFFFFFFFF, + 0x70E700FA, 0x01040000, 0x00000000, 0xFFFF0104, 0x0122FFFF, 0xFFFFFFFF, 0x70E80122, 0x01400000, 0x00000000, + 0x00000001, 0x00010000, 0x00FB0000, 0x00000000, 0x42700000, 0xFFC5000C, 0x02B20222, 0x00000000, 0x42700000, + 0xFFC5000C, 0x02B200FA, 0x00000000, 0x42700000, 0xFFC5000C, 0x02B20000, 0x00000000, 0x42700000, 0xFFC5000C, + 0x02B20000, 0x00000000, 0x42700000, 0xFFC5000C, 0x02B20000, 0x00000000, 0x42700000, 0xFFE10018, 0x02BD0000, + 0x00000000, 0x42700000, 0xFFE10018, 0x02BD0000, 0x00000000, 0x42700000, 0xFFE10018, 0x02BD0000, 0x00000000, + 0x42700000, 0xFFE10018, 0x02BD2D70, 0x00000000, 0x42700000, 0xFFE10018, 0x02BD0085, 0x00000000, 0x42700000, + 0xFFE10018, 0x02BD01E6, 0xFF000000, 0x42700000, 0xFFE10018, 0x02BD0000, 0x00000001, 0x0001005A, 0x014B0000, + 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0222, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC00FA, 0x00000000, + 0x42700000, 0xFF66005C, 0x00EC0000, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, 0x00000000, 0x42700000, + 0xFF66005C, 0x00EC0000, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, 0x00000000, 0x42700000, 0xFF66005C, + 0x00EC0000, 0x00000000, 0x42700000, 0xFF66005C, 0x00EC0000, 0xFF000000, 0x42700000, 0xFF66005C, 0x00EC2D70, + 0x00000001, 0x000100DC, 0x01EB0000, 0x00000000, 0x42700001, 0xFFFE007A, 0x00270222, 0x00000000, 0x42700001, + 0xFFFE007A, 0x002700FA, 0x00000000, 0x42700001, 0xFFFE0066, 0x00270000, 0x00000000, 0x42700001, 0xFFFE005A, + 0x00270000, 0x00000000, 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, 0x42700001, 0xFFFE0051, 0x003E0000, + 0x00000000, 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, 0x42700001, 0xFFFE0051, 0x003E0000, 0x00000000, + 0x42700001, 0xFFFE0051, 0x003E2D70, 0xFF000000, 0x42700001, 0xFFFE0051, 0x003E0085, 0x00000002, 0x00010000, + 0x01180000, 0x0000001E, 0x42700000, 0x002B0034, 0x02CC0222, 0x0000001E, 0x42700000, 0x002B0034, 0x02CC00FA, + 0x0000000A, 0x42700000, 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, 0x002B0034, 0x02CC0000, 0x0000000A, + 0x42700000, 0x002B0034, 0x02CC0000, 0x0000000A, 0x42700000, 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, + 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, 0x003F0056, 0x02D20000, 0x0000001E, 0x42700000, 0x003F0056, + 0x02D22D70, 0x0000001E, 0x42700000, 0x003F0055, 0x02D10085, 0x0000001E, 0x42700000, 0x003F0055, 0x02D101E6, + 0xFF00001E, 0x42700000, 0x003E0055, 0x02D10000, 0x00000002, 0x0001005A, 0x01680000, 0x0000001E, 0x42700000, + 0xFF970053, 0x016E0222, 0x0000001E, 0x42700000, 0xFF980053, 0x016C00FA, 0x0000001E, 0x42700000, 0xFFC10053, + 0x01530000, 0x0000001E, 0x42700000, 0xFFF00063, 0x00FF0000, 0x0000001E, 0x42700000, 0xFFE2006F, 0x00B10000, + 0x0000001E, 0x42700000, 0xFFB00070, 0x00790000, 0x0000001E, 0x42700000, 0xFFB00070, 0x00790000, 0x0000001E, + 0x42700000, 0xFFB00070, 0x00790000, 0xFF00001E, 0x42700000, 0xFFB00070, 0x00792D70, 0x00000002, 0x000100DC, + 0x02080000, 0x0000001E, 0x42700001, 0x00000089, 0xFFC90222, 0x0000001E, 0x42700001, 0x00000089, 0xFFC900FA, + 0x0000001E, 0x42700001, 0x00000075, 0xFFC90000, 0x0000001E, 0x42700001, 0x00000069, 0xFFC90000, 0x0000001E, + 0x42700001, 0x00000062, 0xFFE10000, 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, 0x0000001E, 0x42700001, + 0x00000062, 0xFFE10000, 0x0000001E, 0x42700001, 0x00000062, 0xFFE10000, 0x0000001E, 0x42700001, 0x00000062, + 0xFFE12D70, 0xFF00001E, 0x42700001, 0x00000062, 0xFFE10085, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, }; -const ActorInit Bg_Toki_Swd_InitVars = -{ +const ActorInit Bg_Toki_Swd_InitVars = { ACTOR_BG_TOKI_SWD, ACTORTYPE_PROP, ROOM, @@ -315,160 +163,118 @@ const ActorInit Bg_Toki_Swd_InitVars = (ActorFunc)BgTokiSwd_Draw, }; -static ColliderCylinderInit colliderInit = -{ - 0x0A, 0x00, 0x00, 0x39, - 0x12, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0xFFCFFFFF, - 0x00, 0x00, 0x00, 0x00, - 0xFFCFFFFF, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, - 0x000A, - 0x0046, - 0x0000000000000000, +static ColliderCylinderInit colliderInit = { + 0x0A, 0x00, 0x00, 0x39, 0x12, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, + 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000, 0x0001, 0x0000, 0x000A, 0x0046, 0x0000, }; -static SubActor98Init subActor98Init = -{ +static SubActor98Init subActor98Init = { 0x0A, 0x0023, 0x0064, 0xFF, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0x19, ICHAIN_STOP), }; -static void BgTokiSwd_SetupAction(BgTokiSwd* this, ActorFunc actionFunc) -{ - this->actionFunc = actionFunc; +static void BgTokiSwd_SetupAction(BgTokiSwd* this, ActorFunc actionFunc) { + this->actionFunc = actionFunc; } -static void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) -{ - ColliderCylinderMain* collision; - Actor* thisx = &this->actor; +static void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) { + ColliderCylinderMain* collision; + Actor* thisx = &this->actor; - Actor_ProcessInitChain(thisx, initChain); - this->actor.shape.unk_08 = 800.0f; - BgTokiSwd_SetupAction(thisx, func_808BAF40); - collision = &this->collider; - if (LINK_IS_ADULT) - { - thisx->draw = NULL; - } + Actor_ProcessInitChain(thisx, initChain); + this->actor.shape.unk_08 = 800.0f; + BgTokiSwd_SetupAction(thisx, func_808BAF40); + collision = &this->collider; + if (LINK_IS_ADULT) { + thisx->draw = NULL; + } - if (gSaveContext.scene_setup_index == 5) - { - globalCtx->unk_11D30[0] = 0xFF; - } + if (gSaveContext.scene_setup_index == 5) { + globalCtx->unk_11D30[0] = 0xFF; + } - ActorCollider_AllocCylinder(globalCtx, collision); - ActorCollider_InitCylinder(globalCtx, collision, thisx, &colliderInit); - ActorCollider_Cylinder_Update(thisx, collision); - func_80061ED4(&thisx->sub_98, 0, &subActor98Init); + ActorCollider_AllocCylinder(globalCtx, collision); + ActorCollider_InitCylinder(globalCtx, collision, thisx, &colliderInit); + ActorCollider_Cylinder_Update(thisx, collision); + func_80061ED4(&thisx->sub_98, 0, &subActor98Init); } -static void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx) -{ - ColliderCylinderMain* collider = &this->collider; - ActorCollider_FreeCylinder(globalCtx, collider); +static void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx) { + ColliderCylinderMain* collider = &this->collider; + ActorCollider_FreeCylinder(globalCtx, collider); } -static void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) -{ - if (((gSaveContext.event_chk_inf[4] & 0x8000) == 0) && (gSaveContext.scene_setup_index < 4) && - (func_8002E12C(&this->actor, 800.0f, 0x7530) != 0) && (func_800BFC84(globalCtx) == 0)) - { - gSaveContext.event_chk_inf[4] |= 0x8000; - globalCtx->csCtx.segment = D_808BBD90; - gSaveContext.cutscene_trigger = 1; - } - if (LINK_IS_CHILD || ((gSaveContext.event_chk_inf[5] & 0x20) != 0)) - { - if (func_8002F410(&this->actor, globalCtx) != 0) - { - if (LINK_IS_CHILD) - { - Item_Give(globalCtx, ITEM_SWORD_MASTER); - globalCtx->csCtx.segment = D_808BB2F0; - } - else - { - globalCtx->csCtx.segment = D_808BB7A0; - } - Audio_SetBGM(NA_BGM_STOP); - Audio_SetBGM(NA_SE_PL_BOUND_DIRT); - gSaveContext.cutscene_trigger = 1; - this->actor.attachedA = 0; - BgTokiSwd_SetupAction(this, func_808BB0AC); - } - else - { - if (func_8002E084(&this->actor, 0x2000) != 0) - { - func_8002F580(&this->actor, globalCtx); - } - } - } - if (gSaveContext.scene_setup_index == 5) - { - if (globalCtx->unk_11D30[0] > 0) - { - globalCtx->unk_11D30[0]--; - } - else - { - globalCtx->unk_11D30[0] = 0; - } - } +static void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) { + if (((gSaveContext.event_chk_inf[4] & 0x8000) == 0) && (gSaveContext.scene_setup_index < 4) && + (func_8002E12C(&this->actor, 800.0f, 0x7530) != 0) && (func_800BFC84(globalCtx) == 0)) { + gSaveContext.event_chk_inf[4] |= 0x8000; + globalCtx->csCtx.segment = D_808BBD90; + gSaveContext.cutscene_trigger = 1; + } + if (LINK_IS_CHILD || ((gSaveContext.event_chk_inf[5] & 0x20) != 0)) { + if (func_8002F410(&this->actor, globalCtx) != 0) { + if (LINK_IS_CHILD) { + Item_Give(globalCtx, ITEM_SWORD_MASTER); + globalCtx->csCtx.segment = D_808BB2F0; + } else { + globalCtx->csCtx.segment = D_808BB7A0; + } + Audio_SetBGM(NA_BGM_STOP); + Audio_SetBGM(NA_SE_PL_BOUND_DIRT); + gSaveContext.cutscene_trigger = 1; + this->actor.attachedA = 0; + BgTokiSwd_SetupAction(this, func_808BB0AC); + } else { + if (func_8002E084(&this->actor, 0x2000) != 0) { + func_8002F580(&this->actor, globalCtx); + } + } + } + if (gSaveContext.scene_setup_index == 5) { + if (globalCtx->unk_11D30[0] > 0) { + globalCtx->unk_11D30[0]--; + } else { + globalCtx->unk_11D30[0] = 0; + } + } } -static void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx) -{ +static void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx) { Player* player; - //if attached is set, sword has been pulled/placed from the pedestal - if (func_8002F410(&this->actor, globalCtx) != 0) - { - if (LINK_IS_CHILD) - { - Audio_PlayActorSound2(&this->actor, NA_SE_IT_SWORD_PUTAWAY_STN); - this->actor.draw = NULL; //sword has been pulled, dont draw sword - } - else - { - this->actor.draw = BgTokiSwd_Draw; //sword has been placed, draw the master sword + // if attached is set, sword has been pulled/placed from the pedestal + if (func_8002F410(&this->actor, globalCtx) != 0) { + if (LINK_IS_CHILD) { + Audio_PlayActorSound2(&this->actor, NA_SE_IT_SWORD_PUTAWAY_STN); + this->actor.draw = NULL; // sword has been pulled, dont draw sword + } else { + this->actor.draw = BgTokiSwd_Draw; // sword has been placed, draw the master sword } BgTokiSwd_SetupAction(this, func_808BB128); - } - else - { + } else { player = PLAYER; player->interactRangeActor = &this->actor; } } -static void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) -{ - if ((func_8006C4A4(globalCtx, 1) != 0) && (globalCtx->unk_11D30[0] < 0xFF)) - { +static void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) { + if ((func_8006C4A4(globalCtx, 1) != 0) && (globalCtx->unk_11D30[0] < 0xFF)) { globalCtx->unk_11D30[0] += 5; } } -static void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx) -{ +static void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx) { this->actionFunc(&this->actor, globalCtx); Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); } -static void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx) -{ +static void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx) { s32 pad[4]; GameState* state; GraphicsContext* gfxCtx; @@ -480,12 +286,12 @@ static void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx) func_80093D18(globalCtx->state.gfxCtx); func_8002EBCC(&this->actor, globalCtx, 0); - - gSPSegment(gfxCtx->polyOpa.p++, 0x08, Draw_TexScroll(globalCtx->state.gfxCtx, 0, - -(globalCtx->gameplayFrames % 0x80), 32, 32)); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 742), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPSegment(gfxCtx->polyOpa.p++, 0x08, + Draw_TexScroll(globalCtx->state.gfxCtx, 0, -(globalCtx->gameplayFrames % 0x80), 32, 32)); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 742), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001BD0); - + func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 776); } diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index 1234536404..29a536898b 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -1,6 +1,6 @@ #include "z_bg_treemouth.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgTreemouth_Init(BgTreemouth* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index dfeff5acb8..1a6a7350a4 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -2,20 +2,19 @@ * File: z_bg_umajump.c * Overlay: ovl_Bg_Umajump * Description: Hoppable horse fence -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ u32 dynaPolyId; - /* 0x0150 */ char unk_150[0x14]; + /* 0x014C */ u32 dynaPolyId; + /* 0x0150 */ char unk_150[0x14]; } ActorBgUmajump; // size = 0x0164 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void Init(ActorBgUmajump* this, GlobalContext* globalCtx); @@ -23,8 +22,7 @@ static void Destroy(ActorBgUmajump* this, GlobalContext* globalCtx); static void Update(ActorBgUmajump* this, GlobalContext* globalCtx); static void Draw(ActorBgUmajump* this, GlobalContext* globalCtx); -const ActorInit Bg_Umajump_InitVars = -{ +const ActorInit Bg_Umajump_InitVars = { ACTOR_BG_UMAJUMP, ACTORTYPE_PROP, ROOM, @@ -34,19 +32,17 @@ const ActorInit Bg_Umajump_InitVars = (ActorFunc)Init, (ActorFunc)Destroy, (ActorFunc)Update, - (ActorFunc)Draw + (ActorFunc)Draw, }; -extern D_06001438; //segmented address: 0x06001438 -extern D_06001220; //segmented address: 0x06001220 +extern D_06001438; // segmented address: 0x06001438 +extern D_06001220; // segmented address: 0x06001220 -static InitChainEntry initChain[] = -{ - ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP) +static InitChainEntry initChain[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -static void Init(ActorBgUmajump* this, GlobalContext* globalCtx) -{ +static void Init(ActorBgUmajump* this, GlobalContext* globalCtx) { s32 pad[2]; u32 sp24 = 0; @@ -55,10 +51,8 @@ static void Init(ActorBgUmajump* this, GlobalContext* globalCtx) DynaPolyInfo_Alloc(&D_06001438, &sp24); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp24); - if (this->actor.params == 1) - { - if ((!Flags_GetEventChkInf(0x18)) && (DREG(1) == 0)) - { + if (this->actor.params == 1) { + if ((!Flags_GetEventChkInf(0x18)) && (DREG(1) == 0)) { Actor_Kill(&this->actor); return; } @@ -66,17 +60,13 @@ static void Init(ActorBgUmajump* this, GlobalContext* globalCtx) } } -static void Destroy(ActorBgUmajump* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorBgUmajump* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -static void Update(ActorBgUmajump* this, GlobalContext* globalCtx) -{ - +static void Update(ActorBgUmajump* this, GlobalContext* globalCtx) { } -static void Draw(ActorBgUmajump* this, GlobalContext* globalCtx) -{ +static void Draw(ActorBgUmajump* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_06001220); } diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c index 81d3a61e2b..83882c24f9 100644 --- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c +++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c @@ -1,6 +1,6 @@ #include "z_bg_vb_sima.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgVbSima_Init(BgVbSima* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index b5b2c87ce5..940a4f77dc 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -1,6 +1,6 @@ #include "z_bg_ydan_hasi.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void BgYdanHasi_Init(BgYdanHasi* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index 069100d59e..ead7bdff7f 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -1,6 +1,6 @@ #include "z_bg_ydan_maruta.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgYdanMaruta_Init(BgYdanMaruta* this, GlobalContext* globalCtx); @@ -40,6 +40,3 @@ const ActorInit Bg_Ydan_Maruta_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Maruta/BgYdanMaruta_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Maruta/BgYdanMaruta_Draw.s") - - - diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index 79b7234961..82beaa9285 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -1,6 +1,6 @@ #include "z_bg_ydan_sp.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void BgYdanSp_Init(BgYdanSp* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index 5bc3369bb2..a4547686ca 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -1,6 +1,6 @@ #include "z_bg_zg.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void BgZg_Init(BgZg* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 68cff5fa7e..842acad26e 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -1,6 +1,6 @@ #include "z_boss_dodongo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossDodongo_Init(BossDodongo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 40e2274ca8..0aeb958584 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -1,6 +1,6 @@ #include "z_boss_fd.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossFd_Init(BossFd* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index e51697fc73..8bee518ab3 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -1,6 +1,6 @@ #include "z_boss_fd2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossFd2_Init(BossFd2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index cd14e40388..ca942353d1 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -1,6 +1,6 @@ #include "z_boss_ganon.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossGanon_Init(BossGanon* this, GlobalContext* globalCtx); @@ -158,4 +158,3 @@ const ActorInit Boss_Ganon_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E3564.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E3D84.s") - diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 2b45483587..049d4d5b4a 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -1,6 +1,6 @@ #include "z_boss_ganon2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossGanon2_Init(BossGanon2* this, GlobalContext* globalCtx); @@ -132,4 +132,3 @@ const ActorInit Boss_Ganon2_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_809069F8.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_80906AB0.s") - diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 91f88442b4..606e3c5718 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -1,6 +1,6 @@ #include "z_boss_ganondrof.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossGanondrof_Init(BossGanondrof* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index c69737c805..dcdadea6b5 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -1,6 +1,6 @@ #include "z_boss_goma.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossGoma_Init(BossGoma* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 64465f48d0..be09d229a1 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -1,6 +1,6 @@ #include "z_boss_mo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossMo_Init(BossMo* this, GlobalContext* globalCtx); @@ -74,4 +74,3 @@ const ActorInit Boss_Mo_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80925480.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80925C18.s") - diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 82eaf37e83..8ee2afd5a8 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -1,6 +1,6 @@ #include "z_boss_sst.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000435 void BossSst_Init(BossSst* this, GlobalContext* globalCtx); @@ -306,4 +306,3 @@ const ActorInit Boss_Sst_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_809360FC.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8093639C.s") - diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 29925e7110..bf07fc0759 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -1,6 +1,6 @@ #include "z_boss_tw.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossTw_Init(BossTw* this, GlobalContext* globalCtx); @@ -202,4 +202,3 @@ const ActorInit Boss_Tw_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8094A6D8.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8094A740.s") - diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 1b706f0568..5f5505cea6 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1,6 +1,6 @@ #include "z_boss_va.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void BossVa_Init(BossVa* this, GlobalContext* globalCtx); @@ -176,4 +176,3 @@ const ActorInit Boss_Va_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095BBD0.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095BD24.s") - diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index a85be15722..50e875ccff 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -1,6 +1,6 @@ #include "z_demo_6k.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void Demo6K_Init(Demo6K* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index e5b0a70786..447963c889 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -1,6 +1,6 @@ #include "z_demo_du.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void DemoDu_Init(DemoDu* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index 755fe69418..905ce14db8 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -1,6 +1,6 @@ #include "z_demo_ec.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void DemoEc_Init(DemoEc* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 656e660eef..31285eab99 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -1,6 +1,6 @@ #include "z_demo_effect.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void DemoEffect_Init(DemoEffect* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c index 9d5aa45d67..0faec9fb85 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -1,6 +1,6 @@ #include "z_demo_ext.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void DemoExt_Init(DemoExt* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index e39a5fbcf0..9bb0c4b88a 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -2,13 +2,13 @@ * File: z_demo_geff.c * Overlay: Demo_Geff * Description: -*/ + */ #include "z_demo_geff.h" #include -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 static void DemoGeff_Init(DemoGeff* this, GlobalContext* globalCtx); @@ -24,17 +24,25 @@ static void func_80978308(DemoGeff* this, GlobalContext* globalCtx); static void func_809784D4(DemoGeff* this, GlobalContext* globalCtx); static void func_80978344(DemoGeff* this, GlobalContext* globalCtx); -s16 objectIds[] = { OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, - OBJECT_GEFF, OBJECT_GEFF, }; +s16 objectIds[] = { + OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, +}; -ActorFunc scaleFuncs[] = { (ActorFunc)func_80978030, (ActorFunc)func_80978030, (ActorFunc)func_80978030, - (ActorFunc)func_80978030, (ActorFunc)func_80978030, (ActorFunc)func_80978030, - (ActorFunc)func_80978030, (ActorFunc)func_80978030, (ActorFunc)func_80978030, }; -ActorFunc actionFuncs[] = { (ActorFunc)func_809783D4, (ActorFunc)func_80978308, }; -ActorFunc drawFuncs[] = { (ActorFunc)func_809784D4, (ActorFunc)func_80978344, }; +ActorFunc scaleFuncs[] = { + (ActorFunc)func_80978030, (ActorFunc)func_80978030, (ActorFunc)func_80978030, + (ActorFunc)func_80978030, (ActorFunc)func_80978030, (ActorFunc)func_80978030, + (ActorFunc)func_80978030, (ActorFunc)func_80978030, (ActorFunc)func_80978030, +}; +ActorFunc actionFuncs[] = { + (ActorFunc)func_809783D4, + (ActorFunc)func_80978308, +}; +ActorFunc drawFuncs[] = { + (ActorFunc)func_809784D4, + (ActorFunc)func_80978344, +}; -const ActorInit Demo_Geff_InitVars = -{ +const ActorInit Demo_Geff_InitVars = { ACTOR_DEMO_GEFF, ACTORTYPE_BOSS, ROOM, @@ -50,7 +58,6 @@ const ActorInit Demo_Geff_InitVars = extern UNK_TYPE D_06000EA0; static void DemoGeff_Destroy(DemoGeff* this, GlobalContext* globalCtx) { - } static void DemoGeff_Init(DemoGeff* this, GlobalContext* globalCtx) { @@ -85,7 +92,7 @@ static void func_80977F80(DemoGeff* this, GlobalContext* globalCtx) { Gfx* gfxArr[5]; func_800C6AC4(gfxArr, gfxCtx, "../z_demo_geff.c", 204); - + gSPSegment(gfxCtx->polyOpa.p++, 0x06, globalCtx->objectCtx.status[objBankIndex].segment); gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[objBankIndex].segment); @@ -205,7 +212,6 @@ static void DemoGeff_Update(DemoGeff* this, GlobalContext* globalCtx) { } static void func_809784D4(DemoGeff* this, GlobalContext* globalCtx) { - } static void DemoGeff_Draw(DemoGeff* this, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 6b317aae0e..7b9dff5d63 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -1,6 +1,6 @@ #include "z_demo_gj.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void DemoGj_Init(DemoGj* this, GlobalContext* globalCtx); 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 3006969e61..8ff5464e9e 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -2,13 +2,13 @@ * File: z_demo_go.c * Overlay: Demo_Go * Description: -*/ + */ #include "z_demo_go.h" #include -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void DemoGo_Init(DemoGo* this, GlobalContext* globalCtx); @@ -27,27 +27,18 @@ void func_8097D130(DemoGo* this, GlobalContext* globalCtx); void func_8097D290(DemoGo* this, GlobalContext* globalCtx); void func_8097D29C(DemoGo* this, GlobalContext* globalCtx); -UNK_PTR D_8097D440[] = {0x0600CE80, 0x0600D280, 0x0600D680}; +UNK_PTR D_8097D440[] = { 0x0600CE80, 0x0600D280, 0x0600D680 }; -ActorFunc D_8097D44C[] = -{ - func_8097CFDC, - func_8097CFFC, - func_8097D01C, - func_8097D058, - func_8097D088, - func_8097D0D0, - func_8097D130 +ActorFunc D_8097D44C[] = { + func_8097CFDC, func_8097CFFC, func_8097D01C, func_8097D058, func_8097D088, func_8097D0D0, func_8097D130, }; -ActorFunc D_8097D468[] = -{ +ActorFunc D_8097D468[] = { func_8097D290, - func_8097D29C + func_8097D29C, }; -const ActorInit Demo_Go_InitVars = -{ +const ActorInit Demo_Go_InitVars = { ACTOR_DEMO_GO, ACTORTYPE_NPC, ROOM, @@ -65,11 +56,9 @@ extern UNK_TYPE D_06004930; extern UNK_TYPE D_0600E680; extern UNK_TYPE D_0600FEF0; -UNK_TYPE func_8097C870(DemoGo *this) -{ +UNK_TYPE func_8097C870(DemoGo* this) { s32 ret; - switch (this->actor.params) - { + switch (this->actor.params) { case 0: ret = 3; break; @@ -77,8 +66,7 @@ UNK_TYPE func_8097C870(DemoGo *this) ret = 4; break; default: - if (1) - { + if (1) { ret = 5; } break; @@ -86,71 +74,59 @@ UNK_TYPE func_8097C870(DemoGo *this) return ret; } -void func_8097C8A8(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097C8A8(DemoGo* this, GlobalContext* globalCtx) { s32 pad[2]; Actor* thisx = &this->actor; Vec3f* sp20; Vec3f* sp1C; - if ((thisx->params == 0) || (thisx->params == 1)) - { + if ((thisx->params == 0) || (thisx->params == 1)) { func_800A6E10(&globalCtx->mf_11D60, &thisx->posRot.pos, &sp20, &sp1C); Audio_PlaySoundAtPosition(globalCtx, &sp20, 0x14, 0x28A0); } } -void DemoGo_Destroy(DemoGo* this, GlobalContext* globalCtx) -{ +void DemoGo_Destroy(DemoGo* this, GlobalContext* globalCtx) { func_800A56F0(&this->skelAnime, globalCtx); } -void func_8097C930(DemoGo* this) -{ +void func_8097C930(DemoGo* this) { s16* something = &this->unk_192; s16* other = &this->unk_190; s32 pad[3]; - if (DECR(*something) == 0) - { + if (DECR(*something) == 0) { *something = Math_Rand_S16Offset(0x3C, 0x3C); } *other = *something; - if (*other >= 3) - { + if (*other >= 3) { *other = 0; } } -void func_8097C9B8(DemoGo* this) -{ +void func_8097C9B8(DemoGo* this) { func_80078914(&this->actor.unk_E4, NA_SE_EN_DODO_M_GND); } -void func_8097C9DC(DemoGo* this) -{ +void func_8097C9DC(DemoGo* this) { s32 pad[2]; - if (func_800A56C8(&this->skelAnime, 12.0f) || func_800A56C8(&this->skelAnime, 25.0f)) - { + if (func_800A56C8(&this->skelAnime, 12.0f) || func_800A56C8(&this->skelAnime, 25.0f)) { func_80078914(&this->actor.unk_E4, NA_SE_EN_MORIBLIN_WALK); } } -void func_8097CA30(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097CA30(DemoGo* this, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } -void func_8097CA78(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097CA78(DemoGo* this, GlobalContext* globalCtx) { s16 pad; Vec3f vec = this->actor.posRot.pos; func_80033480(globalCtx, &vec, kREG(11) + 100.0f, kREG(12) + 0xA, kREG(13) + 0x12C, kREG(14), 0); func_8097C9B8(this); } -void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; PosRot* posRot = &thisx->posRot; CutsceneContext* csCtx = &globalCtx->csCtx; @@ -160,11 +136,9 @@ void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) Vec3f startPos; Vec3f endPos; - if (globalCtx->csCtx.state != 0) - { + if (globalCtx->csCtx.state != 0) { actorAction = csCtx->actorActions[func_8097C870(this)]; - if (actorAction != NULL) - { + if (actorAction != NULL) { temp_ret = func_8006F93C(actorAction->endFrame, actorAction->startFrame, csCtx->frames); startPos.x = actorAction->startPos.x; startPos.y = actorAction->startPos.y; @@ -180,51 +154,38 @@ void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) } } -void func_8097CC08(DemoGo* this) -{ +void func_8097CC08(DemoGo* this) { f32 something = this->unk_19C; - if (something < 8.0f) - { + if (something < 8.0f) { this->actor.speedXZ = (((kREG(15) * 0.01f) + 1.2f) * 0.125f) * something; - } - else - { + } else { this->actor.speedXZ = (kREG(15) * 0.01f) + 1.2f; } Actor_MoveForward(&this->actor); } -void func_8097CCC0(DemoGo* this) -{ +void func_8097CCC0(DemoGo* this) { Actor_MoveForward(&this->actor); } -void func_8097CCE0(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097CCE0(DemoGo* this, GlobalContext* globalCtx) { CsCmdActorAction* actorAction; Actor* thisx = &this->actor; s32 rotYDelta; s32 newRotY; s32 thisRotY; - if (globalCtx->csCtx.state != 0) - { + if (globalCtx->csCtx.state != 0) { actorAction = globalCtx->csCtx.actorActions[func_8097C870(this)]; - if (actorAction != NULL) - { + if (actorAction != NULL) { thisRotY = thisx->posRot.rot.y; rotYDelta = actorAction->rot.y - thisRotY; - if ((rotYDelta > -(kREG(16) + 0x96)) && (rotYDelta < kREG(16) + 0x96)) - { + if ((rotYDelta > -(kREG(16) + 0x96)) && (rotYDelta < kREG(16) + 0x96)) { newRotY = actorAction->rot.y; - } - else if (rotYDelta > 0) - { + } else if (rotYDelta > 0) { newRotY = (thisRotY + kREG(16)) + 0x96; - } - else - { - newRotY = (thisRotY - kREG(16)) - 0x96; + } else { + newRotY = (thisRotY - kREG(16)) - 0x96; } thisx->shape.rot.y = newRotY; thisx->posRot.rot.y = newRotY; @@ -232,21 +193,17 @@ void func_8097CCE0(DemoGo* this, GlobalContext* globalCtx) } } -UNK_TYPE DemoGo_FrameUpdateMatrix(DemoGo* this) -{ +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 csCmdActorAction) -{ +s32 func_8097CDB0(DemoGo* this, GlobalContext* globalCtx, u16 csCmdActorAction) { CutsceneContext* csCtx = &globalCtx->csCtx; CsCmdActorAction* actorAction = csCtx->actorActions[func_8097C870(this)]; - if (csCtx->state != 0) - { - if (actorAction != NULL && actorAction->action == csCmdActorAction) - { + if (csCtx->state != 0) { + if (actorAction != NULL && actorAction->action == csCmdActorAction) { return 1; } } @@ -256,15 +213,12 @@ s32 func_8097CDB0(DemoGo* this, GlobalContext* globalCtx, u16 csCmdActorAction) #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Go/func_8097CDB0.s") #endif -void func_8097CE10(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097CE10(DemoGo* this, GlobalContext* globalCtx) { this->action = 1; } -void func_8097CE20(DemoGo* this, GlobalContext* globalCtx) -{ - if (func_8097CDB0(this, globalCtx, 2)) - { +void func_8097CE20(DemoGo* this, GlobalContext* globalCtx) { + if (func_8097CDB0(this, globalCtx, 2)) { this->action = 2; this->drawConfig = 1; func_8097CB0C(this, globalCtx); @@ -272,75 +226,62 @@ void func_8097CE20(DemoGo* this, GlobalContext* globalCtx) } } -void func_8097CE78(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097CE78(DemoGo* this, GlobalContext* globalCtx) { CutsceneContext* csCtx = &globalCtx->csCtx; CsCmdActorAction* actorAction; - if (globalCtx->csCtx.state != 0) - { + if (globalCtx->csCtx.state != 0) { actorAction = csCtx->actorActions[func_8097C870(this)]; - if (actorAction != NULL && csCtx->frames >= actorAction->endFrame) - { + if (actorAction != NULL && csCtx->frames >= actorAction->endFrame) { func_8097CA78(this, globalCtx); this->action = 3; } } } -void func_8097CEEC(DemoGo* this, GlobalContext* globalCtx) -{ - if (func_8097CDB0(this, globalCtx, 3)) - { +void func_8097CEEC(DemoGo* this, GlobalContext* globalCtx) { + if (func_8097CDB0(this, globalCtx, 3)) { this->action = 4; } } -void func_8097CF20(DemoGo* this, GlobalContext* globalCtx, UNK_TYPE arg2) -{ +void func_8097CF20(DemoGo* this, GlobalContext* globalCtx, UNK_TYPE arg2) { UNK_PTR animation = &D_060029A8; - if (arg2 != 0) - { - SkelAnime_ChangeAnimation(&this->skelAnime, animation, 1.0f, 0.0f, SkelAnime_GetFrameCount(animation), 0, -8.0f); + if (arg2 != 0) { + SkelAnime_ChangeAnimation(&this->skelAnime, animation, 1.0f, 0.0f, SkelAnime_GetFrameCount(animation), 0, + -8.0f); this->action = 5; this->unk_19C = 0.0f; } } -void func_8097CF9C(DemoGo* this) -{ +void func_8097CF9C(DemoGo* this) { this->unk_19C += 1.0f; - if (this->unk_19C >= 8.0f) - { + if (this->unk_19C >= 8.0f) { this->action = 6; } } -void func_8097CFDC(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097CFDC(DemoGo* this, GlobalContext* globalCtx) { func_8097CE10(this, globalCtx); } -void func_8097CFFC(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097CFFC(DemoGo* this, GlobalContext* globalCtx) { func_8097CE20(this, globalCtx); } -void func_8097D01C(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097D01C(DemoGo* this, GlobalContext* globalCtx) { func_8097CB0C(this, globalCtx); func_8097CA30(this, globalCtx); func_8097CE78(this, globalCtx); } -void func_8097D058(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097D058(DemoGo* this, GlobalContext* globalCtx) { func_8097CA30(this, globalCtx); func_8097CEEC(this, globalCtx); } -void func_8097D088(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097D088(DemoGo* this, GlobalContext* globalCtx) { UNK_TYPE something; func_8097CA30(this, globalCtx); something = DemoGo_FrameUpdateMatrix(this); @@ -348,8 +289,7 @@ void func_8097D088(DemoGo* this, GlobalContext* globalCtx) func_8097CF20(this, globalCtx, something); } -void func_8097D0D0(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097D0D0(DemoGo* this, GlobalContext* globalCtx) { func_8097CCE0(this, globalCtx); func_8097CCC0(this); func_8097CA30(this, globalCtx); @@ -358,8 +298,7 @@ void func_8097D0D0(DemoGo* this, GlobalContext* globalCtx) func_8097C9DC(this); func_8097CF9C(this); } -void func_8097D130(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097D130(DemoGo* this, GlobalContext* globalCtx) { func_8097CCE0(this, globalCtx); func_8097CC08(this); func_8097CA30(this, globalCtx); @@ -368,34 +307,28 @@ void func_8097D130(DemoGo* this, GlobalContext* globalCtx) func_8097C9DC(this); } -void DemoGo_Update(DemoGo* this, GlobalContext* globalCtx) -{ - if (this->action < 0 || this->action >= 7 || D_8097D44C[this->action] == 0) - { +void DemoGo_Update(DemoGo* this, GlobalContext* globalCtx) { + if (this->action < 0 || this->action >= 7 || D_8097D44C[this->action] == 0) { osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; } D_8097D44C[this->action](this, globalCtx); } -void DemoGo_Init(DemoGo* this, GlobalContext* globalCtx) -{ +void DemoGo_Init(DemoGo* this, GlobalContext* globalCtx) { UNK_PTR animation = &D_06004930; s16 pad; - + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); func_800A46F8(globalCtx, &this->skelAnime, &D_0600FEF0, 0, 0, 0, 0); SkelAnime_ChangeAnimation(&this->skelAnime, animation, 1.0f, 0.0f, SkelAnime_GetFrameCount(animation), 2, 0.0f); this->action = 0; } -void func_8097D290(DemoGo* this, GlobalContext* globalCtx) -{ - +void func_8097D290(DemoGo* this, GlobalContext* globalCtx) { } -void func_8097D29C(DemoGo* this, GlobalContext* globalCtx) -{ +void func_8097D29C(DemoGo* this, GlobalContext* globalCtx) { s32 pad; s16 temp = this->unk_190; SkelAnime* skelAnime = &this->skelAnime; @@ -410,14 +343,14 @@ void func_8097D29C(DemoGo* this, GlobalContext* globalCtx) gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(srcSegment8)); gSPSegment(gfxCtx->polyOpa.p++, 0x09, SEGMENTED_TO_VIRTUAL(srcSegment9)); - func_800A1AC8(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl, skelAnime->dListCount, NULL, NULL, &this->actor); + func_800A1AC8(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl, skelAnime->dListCount, NULL, NULL, + &this->actor); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_demo_go.c", 746); } void DemoGo_Draw(DemoGo* this, GlobalContext* globalCtx) { - if (this->drawConfig < 0 || this->drawConfig >= 2 || D_8097D468[this->drawConfig] == 0) - { + if (this->drawConfig < 0 || this->drawConfig >= 2 || D_8097D468[this->drawConfig] == 0) { osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; } diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index 20cfaea446..5dd655772d 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -1,6 +1,6 @@ #include "z_demo_gt.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void DemoGt_Init(DemoGt* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index 62db83bd26..568707a99d 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -1,6 +1,6 @@ #include "z_demo_ik.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void DemoIk_Init(DemoIk* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 4846b47a1b..bd79b57225 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -1,6 +1,6 @@ #include "z_demo_im.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000011 void DemoIm_Init(DemoIm* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index f8cc3054a3..ae22ebdc02 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -1,6 +1,6 @@ #include "z_demo_kankyo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void DemoKankyo_Init(DemoKankyo* this, GlobalContext* globalCtx); @@ -70,4 +70,3 @@ const ActorInit Demo_Kankyo_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098B354.s") - diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 6b1398901e..2f4b639148 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -1,6 +1,6 @@ #include "z_demo_kekkai.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void DemoKekkai_Init(DemoKekkai* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 211a6ecc51..4217d217fa 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -1,6 +1,6 @@ #include "z_demo_sa.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void DemoSa_Init(DemoSa* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c index 02f60bd706..ceccbb5be0 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c @@ -1,6 +1,6 @@ #include "z_demo_shd.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void DemoShd_Init(DemoShd* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index acbb4a7e07..f0718f3181 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -1,6 +1,6 @@ #include "z_demo_tre_lgt.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void DemoTreLgt_Init(DemoTreLgt* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 406a70a689..1baa96137f 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -2,11 +2,11 @@ * File: z_door_ana.c * Overlay: ovl_Door_Ana * Description: Grottos Entrances/Exits -*/ + */ #include "z_door_ana.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000000 static void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx); @@ -20,8 +20,7 @@ static void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx); static void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx); static void DoorAna_Update_Entering(DoorAna* this, GlobalContext* globalCtx); -const ActorInit Door_Ana_InitVars = -{ +const ActorInit Door_Ana_InitVars = { ACTOR_DOOR_ANA, ACTORTYPE_ITEMACTION, ROOM, @@ -35,106 +34,77 @@ const ActorInit Door_Ana_InitVars = }; // initial collision data -static ColliderCylinderInit colliderInit = -{ - 0x0A, 0x00, 0x09, 0x00, - 0x00, 0x01, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, - 0x00000000, 0x00, 0x00, - 0x00, 0x00, 0x00000048, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, - 0x0032, 0x000A, 0x0000, - 0x0000, 0x0000, 0x0000, +static ColliderCylinderInit colliderInit = { + 0x0A, 0x00, 0x09, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x00000048, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x0032, 0x000A, 0x0000, 0x0000, 0x0000, 0x0000, }; // array of entrance table entries to grotto destinations static s16 entrances[] = { - 0x036D, 0x003F, 0x0598, 0x059C, - 0x05A0, 0x05A4, 0x05A8, 0x05AC, - 0x05B0, 0x05B4, 0x05B8, 0x05BC, - 0x05C0, 0x05C4, 0x05FC, + 0x036D, 0x003F, 0x0598, 0x059C, 0x05A0, 0x05A4, 0x05A8, 0x05AC, + 0x05B0, 0x05B4, 0x05B8, 0x05BC, 0x05C0, 0x05C4, 0x05FC, }; // display list extern Gfx* D_05001390; // sets current actionFunc to be ran on next update call -static void DoorAna_SetupAction(DoorAna* this, ActorFunc func) -{ +static void DoorAna_SetupAction(DoorAna* this, ActorFunc func) { this->actionFunc = func; } -static void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx) -{ +static void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx) { ColliderCylinderMain* collider; this->actor.shape.rot.z = 0; this->actor.shape.rot.y = this->actor.shape.rot.z; // init block for grottos that are initially "hidden" (require explosives/hammer/song of storms to open) - if ((this->actor.params & 0x300) != 0) - { + if ((this->actor.params & 0x300) != 0) { // only allocate collider for grottos that need bombing/hammering open - if ((this->actor.params & 0x200) != 0) - { + if ((this->actor.params & 0x200) != 0) { collider = &this->collider; ActorCollider_AllocCylinder(globalCtx, collider); ActorCollider_InitCylinder(globalCtx, collider, &this->actor, &colliderInit); - } - else - { + } else { this->actor.flags |= 0x10; } Actor_SetScale(&this->actor, 0); DoorAna_SetupAction(this, (ActorFunc)&DoorAna_Update_Hidden); - } - else - { + } else { DoorAna_SetupAction(this, (ActorFunc)&DoorAna_Update_Open); } this->actor.unk_1F = 0; - } -static void DoorAna_Destroy(DoorAna* this, GlobalContext* globalCtx) -{ +static void DoorAna_Destroy(DoorAna* this, GlobalContext* globalCtx) { // free collider if it has one - if ((this->actor.params & 0x200) != 0) - { + if ((this->actor.params & 0x200) != 0) { ActorCollider_FreeCylinder(globalCtx, &this->collider); } } // update routine for grottos that are currently "hidden"/unopened -static void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) -{ +static void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) { bool openGrotto = false; - if ((this->actor.params & 0x200) == 0) - { + if ((this->actor.params & 0x200) == 0) { // opening with song of storms - if (this->actor.waterSurfaceDist < 40000.0f && func_8006C4A4(globalCtx, 5) != 0) - { + if (this->actor.waterSurfaceDist < 40000.0f && func_8006C4A4(globalCtx, 5) != 0) { openGrotto = true; this->actor.flags &= ~0x10; } - } - else - { + } else { // bombing/hammering open a grotto - if ((this->collider.base.collideFlags & 2) != 0) - { + if ((this->collider.base.collideFlags & 2) != 0) { openGrotto = true; ActorCollider_FreeCylinder(globalCtx, &this->collider); - } - else - { + } else { ActorCollider_Cylinder_Update(&this->actor, &this->collider); Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this->collider); } } // open the grotto - if (openGrotto) - { + if (openGrotto) { this->actor.params &= ~0x0300; DoorAna_SetupAction(this, (ActorFunc)&DoorAna_Update_Open); Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -143,40 +113,31 @@ static void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) } // update routine for grottos that are open -static void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) -{ +static void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) { Player* player; s32 destinationIdx; player = PLAYER; - if (Math_ApproxF(&this->actor.scale.x, 0.01f, 0.001f) != 0) - { - if ((this->actor.unk_1F != 0) && (globalCtx->sceneLoadFlag == 0) && - (player->stateFlags1 & 0x80000000) && (player->unk_84F == 0)) - { + if (Math_ApproxF(&this->actor.scale.x, 0.01f, 0.001f) != 0) { + if ((this->actor.unk_1F != 0) && (globalCtx->sceneLoadFlag == 0) && (player->stateFlags1 & 0x80000000) && + (player->unk_84F == 0)) { destinationIdx = ((this->actor.params >> 0xC) & 7) - 1; func_800C0AF4(globalCtx, 1, 0x4FF); gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.posRot.pos.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.initPosRot.rot.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].data = this->actor.params & 0xFFFF; - if (destinationIdx < 0) - { + if (destinationIdx < 0) { destinationIdx = this->actor.initPosRot.rot.z + 1; } globalCtx->nextEntranceIndex = entrances[destinationIdx]; DoorAna_SetupAction(this, (ActorFunc)&DoorAna_Update_Entering); - } - else - { - if (func_8008E988(globalCtx) == 0 && !(player->stateFlags1 & 0x8800000) && - this->actor.xzDistanceFromLink <= 15.0f && -50.0f <= this->actor.yDistanceFromLink && - this->actor.yDistanceFromLink <= 15.0f) - { + } else { + if (func_8008E988(globalCtx) == 0 && !(player->stateFlags1 & 0x8800000) && + this->actor.xzDistanceFromLink <= 15.0f && -50.0f <= this->actor.yDistanceFromLink && + this->actor.yDistanceFromLink <= 15.0f) { player->stateFlags1 |= 0x80000000; this->actor.unk_1F = 1; - } - else - { + } else { this->actor.unk_1F = 0; } } @@ -185,34 +146,32 @@ static void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) } // update function for after the player has triggered the grotto -static void DoorAna_Update_Entering(DoorAna* this, GlobalContext* globalCtx) -{ +static void DoorAna_Update_Entering(DoorAna* this, GlobalContext* globalCtx) { Player* player; - if (this->actor.yDistanceFromLink <= 0.0f && 15.0f < this->actor.xzDistanceFromLink) - { + if (this->actor.yDistanceFromLink <= 0.0f && 15.0f < this->actor.xzDistanceFromLink) { player = PLAYER; player->actor.posRot.pos.x = Math_Sins(this->actor.rotTowardsLinkY) * 15.0f + this->actor.posRot.pos.x; player->actor.posRot.pos.z = Math_Coss(this->actor.rotTowardsLinkY) * 15.0f + this->actor.posRot.pos.z; } } -static void DoorAna_Update(DoorAna* this, GlobalContext* globalCtx) -{ +static void DoorAna_Update(DoorAna* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); // changes the grottos facing angle based on camera angle - this->actor.shape.rot.y = func_8005A9F4(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]) + 0x8000; + this->actor.shape.rot.y = + func_8005A9F4(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]) + 0x8000; } -static void DoorAna_Draw(DoorAna* this, GlobalContext* globalCtx) -{ +static void DoorAna_Draw(DoorAna* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx** dList = &D_05001390; // required for stack placement? Gfx* gfxArr[3]; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_door_ana.c", 440); func_80093D84(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_door_ana.c", 446), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_door_ana.c", 446), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyXlu.p++, dList); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_door_ana.c", 449); -} \ No newline at end of file +} diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index 2b5616a38e..4cd20660d4 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -1,6 +1,6 @@ #include "z_door_gerudo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void DoorGerudo_Init(DoorGerudo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 469cbf509a..4c2e90d9f9 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -1,6 +1,6 @@ #include "z_door_killer.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void DoorKiller_Init(DoorKiller* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 0b0b0cbba4..ee6a9e1204 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -1,6 +1,6 @@ #include "z_door_shutter.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void DoorShutter_Init(DoorShutter* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c index ca210be91d..7ad3af1293 100644 --- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c +++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c @@ -2,50 +2,38 @@ * File: z_door_toki.c * Overlay: ovl_Door_Toki * Description: Manages collision for the Door of Time. -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ u32 dynaPolyId; - /* 0x0150 */ u8 unk_150[0x18]; + /* 0x014C */ u32 dynaPolyId; + /* 0x0150 */ u8 unk_150[0x18]; } ActorDoorToki; // size = 0x0168 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void Init(ActorDoorToki* this, GlobalContext* globalCtx); static void Destroy(ActorDoorToki* this, GlobalContext* globalCtx); static void Update(ActorDoorToki* this, GlobalContext* globalCtx); -const ActorInit Door_Toki_InitVars = -{ - ACTOR_DOOR_TOKI, - ACTORTYPE_BG, - ROOM, - FLAGS, - OBJECT_TOKI_OBJECTS, - sizeof(ActorDoorToki), - (ActorFunc)Init, - (ActorFunc)Destroy, - (ActorFunc)Update, - NULL +const ActorInit Door_Toki_InitVars = { + ACTOR_DOOR_TOKI, ACTORTYPE_BG, ROOM, FLAGS, OBJECT_TOKI_OBJECTS, sizeof(ActorDoorToki), (ActorFunc)Init, + (ActorFunc)Destroy, (ActorFunc)Update, NULL, }; // This has to be defined in the linker to produce a proper lui addiu pair extern u32 DOOR_TOKI_COLLISION_DATA; -static InitChainEntry initChain[] = -{ - ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP) +static InitChainEntry initChain[] = { + ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; -static void Init(ActorDoorToki* this, GlobalContext* globalCtx) -{ +static void Init(ActorDoorToki* this, GlobalContext* globalCtx) { s32 pad[2]; u32 sp1C = 0; @@ -55,15 +43,14 @@ static void Init(ActorDoorToki* this, GlobalContext* globalCtx) this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp1C); } -static void Destroy(ActorDoorToki* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorDoorToki* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -static void Update(ActorDoorToki* this, GlobalContext* globalCtx) -{ - if (gSaveContext.event_chk_inf[4] & 0x800) +static void Update(ActorDoorToki* this, GlobalContext* globalCtx) { + if (gSaveContext.event_chk_inf[4] & 0x800) { func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); - else + } else { func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); + } } diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 0a2bfdaed4..c7e7db92bc 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -1,6 +1,6 @@ #include "z_door_warp1.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void DoorWarp1_Init(DoorWarp1* this, GlobalContext* globalCtx); @@ -96,4 +96,3 @@ const ActorInit Door_Warp1_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Warp1/func_8099B5EC.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Warp1/DoorWarp1_Draw.s") - diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c index 02a1f6f89f..6df8f4173d 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -1,6 +1,6 @@ #include "z_efc_erupc.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EfcErupc_Init(EfcErupc* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index 871b3d6975..6e2ebddd03 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -1,6 +1,6 @@ #include "z_eff_dust.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EffDust_Init(EffDust* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 2304bc97f7..b16bafbb47 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -1,6 +1,6 @@ #include "z_elf_msg.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ElfMsg_Init(ElfMsg* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 93e7ec11cb..3ba001027b 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -1,6 +1,6 @@ #include "z_elf_msg2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ElfMsg2_Init(ElfMsg2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 7c0677b5f6..ab5d63eb3a 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -1,6 +1,6 @@ #include "z_en_am.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x04000015 void EnAm_Init(EnAm* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index bf0cc6b585..6d9d1bbfb3 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -1,6 +1,6 @@ #include "z_en_ani.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnAni_Init(EnAni* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index d116d2b745..d55d4d36ea 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -1,6 +1,6 @@ #include "z_en_anubice.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnAnubice_Init(EnAnubice* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index c4ed61f64d..98aeae20ee 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -1,6 +1,6 @@ #include "z_en_anubice_fire.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnAnubiceFire_Init(EnAnubiceFire* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c index 9fb9bed6b6..9717d199e1 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c @@ -2,16 +2,15 @@ * File: z_en_anubice_tag.c * Overlay: ovl_En_Anubice_Tag * Description: Spawns and manages the Anubis enemy -*/ + */ #include #include #include -//temp struct until we can reference other actors outside of their file -typedef struct -{ +// temp struct until we can reference other actors outside of their file +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x10E]; /* 0x025A */ s16 unk_25A; @@ -22,15 +21,14 @@ typedef struct /* 0x0264 */ char unk_264[0xB0]; } EnAnubice; // size = 0x0314 -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc actionFunc; /* 0x0150 */ EnAnubice* anubis; /* 0x0154 */ f32 triggerRange; } EnAnubiceTag; // size = 0x0158 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void EnAnubiceTag_Init(EnAnubiceTag* this, GlobalContext* globalCtx); @@ -40,8 +38,7 @@ static void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalC static void EnAnubiceTag_Update(EnAnubiceTag* this, GlobalContext* globalCtx); static void EnAnubiceTag_Draw(EnAnubiceTag* this, GlobalContext* globalCtx); -const ActorInit En_Anubice_Tag_InitVars = -{ +const ActorInit En_Anubice_Tag_InitVars = { ACTOR_EN_ANUBICE_TAG, ACTORTYPE_SWITCH, ROOM, @@ -54,103 +51,79 @@ const ActorInit En_Anubice_Tag_InitVars = (ActorFunc)EnAnubiceTag_Draw, }; -static void EnAnubiceTag_Init(EnAnubiceTag* this, GlobalContext* globalCtx) -{ +static void EnAnubiceTag_Init(EnAnubiceTag* this, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); //"Anubis control tag generated" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ アヌビス制御タグ発生 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - if (this->actor.params < (s16)0xFFFF) - { + if (this->actor.params < (s16)0xFFFF) { this->actor.params = 0; } - if (this->actor.params != 0) - { + if (this->actor.params != 0) { this->triggerRange = this->actor.params * 40.0f; } this->actionFunc = &EnAnubiceTag_SpawnAnubis; } -static void EnAnubiceTag_Destroy(EnAnubiceTag* this, GlobalContext* globalCtx) -{ - +static void EnAnubiceTag_Destroy(EnAnubiceTag* this, GlobalContext* globalCtx) { } -static void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) -{ - this->anubis = Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - 0, this->actor.rotTowardsLinkY, 0, 0); +static void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { + this->anubis = + Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, this->actor.posRot.pos.x, + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.rotTowardsLinkY, 0, 0); - if (this->anubis != NULL) - { + if (this->anubis != NULL) { this->actionFunc = &EnAnubiceTag_ManageAnubis; } } -static void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) -{ +static void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { EnAnubice* anubis; Vec3f offset; - - if (this->anubis != NULL) - { + + if (this->anubis != NULL) { anubis = this->anubis; - if (anubis->actor.update == NULL) - { + if (anubis->actor.update == NULL) { return; } - } - else - { + } else { Actor_Kill(this); return; } - if (anubis->unk_25A != 0) - { + if (anubis->unk_25A != 0) { Actor_Kill(this); return; } - if (this->actor.xzDistanceFromLink < (200.0f + this->triggerRange)) - { - if (anubis->unk_260 == 0) - { - if (anubis->unk_262 == 0) - { + if (this->actor.xzDistanceFromLink < (200.0f + this->triggerRange)) { + if (anubis->unk_260 == 0) { + if (anubis->unk_262 == 0) { anubis->unk_25E = 1; offset.x = -Math_Sins(this->actor.rotTowardsLinkY) * this->actor.xzDistanceFromLink; offset.z = -Math_Coss(this->actor.rotTowardsLinkY) * this->actor.xzDistanceFromLink; - Math_SmoothScaleMaxF(&anubis->actor.posRot.pos.x, - (this->actor.posRot.pos.x + offset.x), 0.3f, 10.0f); - Math_SmoothScaleMaxF(&anubis->actor.posRot.pos.z, - (this->actor.posRot.pos.z + offset.z), 0.3f, 10.0f); + Math_SmoothScaleMaxF(&anubis->actor.posRot.pos.x, (this->actor.posRot.pos.x + offset.x), 0.3f, 10.0f); + Math_SmoothScaleMaxF(&anubis->actor.posRot.pos.z, (this->actor.posRot.pos.z + offset.z), 0.3f, 10.0f); return; } } - } - else - { - if (anubis->unk_25E != 0) - { + } else { + if (anubis->unk_25E != 0) { anubis->unk_260 = 1; } } } -static void EnAnubiceTag_Update(EnAnubiceTag* this, GlobalContext* globalCtx) -{ +static void EnAnubiceTag_Update(EnAnubiceTag* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } -static void EnAnubiceTag_Draw(EnAnubiceTag* this, GlobalContext* globalCtx) -{ - if (BREG(0) != 0) - { +static void EnAnubiceTag_Draw(EnAnubiceTag* this, GlobalContext* globalCtx) { + if (BREG(0) != 0) { DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 0xFF, 0, 0, 0xFF, 4, globalCtx->state.gfxCtx); + this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + 1.0f, 0xFF, 0, 0, 0xFF, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c index 4f39cbb0be..cc1e84bb5a 100644 --- a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c +++ b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c @@ -2,64 +2,48 @@ * File: z_en_arow_trap.c * Overlay: ovl_En_Arow_Trap * Description: An unused trap that reflects arrows. -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ u32 unk_14C; - /* 0x0150 */ u32 attackTimer; + /* 0x014C */ u32 unk_14C; + /* 0x0150 */ u32 attackTimer; } ActorEnArowTrap; // size = 0x0154 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void Init(ActorEnArowTrap* this, GlobalContext* globalCtx); static void Destroy(ActorEnArowTrap* this, GlobalContext* globalCtx); static void Update(ActorEnArowTrap* this, GlobalContext* globalCtx); -const ActorInit En_Arow_Trap_InitVars = -{ - ACTOR_EN_AROW_TRAP, - ACTORTYPE_PROP, - ROOM, - FLAGS, - OBJECT_GAMEPLAY_KEEP, - sizeof(ActorEnArowTrap), - (ActorFunc)Init, - (ActorFunc)Destroy, - (ActorFunc)Update, - NULL +const ActorInit En_Arow_Trap_InitVars = { + ACTOR_EN_AROW_TRAP, ACTORTYPE_PROP, ROOM, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ActorEnArowTrap), (ActorFunc)Init, + (ActorFunc)Destroy, (ActorFunc)Update, NULL, }; -static void Init(ActorEnArowTrap* this, GlobalContext* globalCtx) -{ +static void Init(ActorEnArowTrap* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01); this->unk_14C = 0; this->attackTimer = 80; this->actor.posRot2.pos = this->actor.posRot.pos; } -static void Destroy(ActorEnArowTrap* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorEnArowTrap* this, GlobalContext* globalCtx) { } -static void Update(ActorEnArowTrap* this, GlobalContext* globalCtx) -{ - if (this->actor.xzDistanceFromLink <= 400) - { +static void Update(ActorEnArowTrap* this, GlobalContext* globalCtx) { + if (this->actor.xzDistanceFromLink <= 400) { this->attackTimer--; - if (this->attackTimer == 0) - { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ARROW, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, - 0xFFFFFFFF); + if (this->attackTimer == 0) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ARROW, this->actor.posRot.pos.x, + this->actor.posRot.pos.y, this->actor.posRot.pos.z, this->actor.shape.rot.x, + this->actor.shape.rot.y, this->actor.shape.rot.z, 0xFFFFFFFF); this->attackTimer = 80; } } diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 5eccf70449..858c204baf 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -1,6 +1,6 @@ #include "z_en_arrow.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnArrow_Init(EnArrow* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index d44e38cd5d..a09614155f 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -1,6 +1,6 @@ #include "z_en_attack_niw.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnAttackNiw_Init(EnAttackNiw* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 709fd4d72b..2b0d599c73 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -1,6 +1,6 @@ #include "z_en_ba.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnBa_Init(EnBa* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 1cf09e8a98..c00f0c431e 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -1,6 +1,6 @@ #include "z_en_bb.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x01000015 void EnBb_Init(EnBb* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index 6e8296d232..b201d8b109 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -1,6 +1,6 @@ #include "z_en_bdfire.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnBdfire_Init(EnBdfire* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 0f50335e42..d7fe07fc9f 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -1,6 +1,6 @@ #include "z_en_bigokuta.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void EnBigokuta_Init(EnBigokuta* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 89358438dd..d279338ef2 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -1,6 +1,6 @@ #include "z_en_bili.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00005005 void EnBili_Init(EnBili* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bird/z_en_bird.c b/src/overlays/actors/ovl_En_Bird/z_en_bird.c index 4b355e81f2..93c0645966 100644 --- a/src/overlays/actors/ovl_En_Bird/z_en_bird.c +++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.c @@ -2,33 +2,32 @@ * File: z_en_bird.c * Overlay: ovl_En_Bird * Description: The projectile fired by deku scrubs and octaroks. -*/ + */ #include #include -typedef struct -{ - /* 0x0000 */ Actor actor; +typedef struct { + /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ ActorFunc updateFunc; - /* 0x0194 */ u32 unk_194; - /* 0x0198 */ s32 unk_198; - /* 0x019C */ s16 unk_19C; - /* 0x019E */ char unk_19E[0x2]; - /* 0x01A0 */ f32 unk_1A0; - /* 0x01A4 */ f32 unk_1A4; - /* 0x01A8 */ f32 unk_1A8; - /* 0x01AC */ f32 unk_1AC; - /* 0x01B0 */ f32 unk_1B0; - /* 0x01B4 */ f32 unk_1B4; - /* 0x01B8 */ f32 unk_1B8; - /* 0x01BC */ f32 unk_1BC; - /* 0x01C0 */ s16 unk_1C0; - /* 0x01C2 */ char unk_1C2[0x1A]; + /* 0x0194 */ u32 unk_194; + /* 0x0198 */ s32 unk_198; + /* 0x019C */ s16 unk_19C; + /* 0x019E */ char unk_19E[0x2]; + /* 0x01A0 */ f32 unk_1A0; + /* 0x01A4 */ f32 unk_1A4; + /* 0x01A8 */ f32 unk_1A8; + /* 0x01AC */ f32 unk_1AC; + /* 0x01B0 */ f32 unk_1B0; + /* 0x01B4 */ f32 unk_1B4; + /* 0x01B8 */ f32 unk_1B8; + /* 0x01BC */ f32 unk_1BC; + /* 0x01C0 */ s16 unk_1C0; + /* 0x01C2 */ char unk_1C2[0x1A]; } EnBird; // size = 0x01C4 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnBird_Init(EnBird* this, GlobalContext* globalCtx); @@ -41,8 +40,7 @@ void EnBird_SetNewUpdate(EnBird* this, ActorFunc updateFunc); void func_809C1D60(EnBird* this, GlobalContext* globalCtx); void func_809C1CAC(EnBird* this, s16 params); -const ActorInit En_Bird_InitVars = -{ +const ActorInit En_Bird_InitVars = { ACTOR_EN_BIRD, ACTORTYPE_PROP, ROOM, @@ -55,21 +53,18 @@ const ActorInit En_Bird_InitVars = (ActorFunc)EnBird_Draw, }; -static InitChainEntry initChain[] = -{ - ICHAIN_F32(unk_4C, 5600, ICHAIN_STOP) +static InitChainEntry initChain[] = { + ICHAIN_F32(unk_4C, 5600, ICHAIN_STOP), }; extern u32 D_0600006C; extern u32 D_06002190; -void EnBird_SetNewUpdate(EnBird* this, ActorFunc newUpdateFunc) -{ +void EnBird_SetNewUpdate(EnBird* this, ActorFunc newUpdateFunc) { this->updateFunc = newUpdateFunc; } -void EnBird_Init(EnBird* this, GlobalContext* globalCtx) -{ +void EnBird_Init(EnBird* this, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, initChain); Actor_SetScale(&this->actor, 0.01); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002190, &D_0600006C, 0, 0, 0); @@ -88,16 +83,13 @@ void EnBird_Init(EnBird* this, GlobalContext* globalCtx) func_809C1CAC(this, this->actor.params); } -void EnBird_Destroy(EnBird* this, GlobalContext* globalCtx) -{ - +void EnBird_Destroy(EnBird* this, GlobalContext* globalCtx) { } #ifdef NON_MATCHING // D_0600006C address is reused when it shouldn't be // also minor ordering differences -void func_809C1CAC(EnBird* this, s16 params) -{ +void func_809C1CAC(EnBird* this, s16 params) { f32 frameCount = SkelAnime_GetFrameCount(&D_0600006C); f32 playbackSpeed = this->unk_19C ? 0.0f : 1.0f; this->unk_198 = Math_Rand_S16Offset(5, 0x23); @@ -108,46 +100,38 @@ void func_809C1CAC(EnBird* this, s16 params) #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Bird/func_809C1CAC.s") #endif -void func_809C1D60(EnBird* this, GlobalContext* globalCtx) -{ +void func_809C1D60(EnBird* this, GlobalContext* globalCtx) { f32 fVar2 = sinf(this->unk_1B4); this->actor.shape.unk_08 = this->actor.shape.unk_08 + fVar2 * this->unk_1A0; Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); - if (this->unk_19C != 0) - { + if (this->unk_19C != 0) { this->skelAnime.animPlaybackSpeed = this->actor.speedXZ + this->actor.speedXZ; } SkelAnime_FrameUpdateMatrix(&this->skelAnime); this->unk_198 -= 1; - if (this->unk_198 <= 0) - { + if (this->unk_198 <= 0) { func_809C1E00(this, this->actor.params); } } -void func_809C1E00(EnBird* this, s16 params) -{ +void func_809C1E00(EnBird* this, s16 params) { this->unk_198 = Math_Rand_S16Offset(0x14, 0x2D); EnBird_SetNewUpdate(this, (ActorFunc)func_809C1E40); } - -void func_809C1E40(EnBird* this, GlobalContext* globalCtx) -{ +void func_809C1E40(EnBird* this, GlobalContext* globalCtx) { f32 fVar4 = sinf(this->unk_1B4); this->actor.shape.unk_08 += fVar4 * this->unk_1A0; Math_SmoothScaleMaxMinF(&this->actor.speedXZ, this->unk_1A8, 0.1f, this->unk_1AC, 0.0f); - if (this->unk_1B0 < Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) || this->unk_198 < 4) - { - func_80077B58(&this->actor.posRot.rot.y, Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos), this->unk_1C0); - } - else - { + if (this->unk_1B0 < Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) || this->unk_198 < 4) { + func_80077B58(&this->actor.posRot.rot.y, Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos), + this->unk_1C0); + } else { fVar4 = sinf(this->unk_1B4); this->actor.posRot.rot.y += (s16)(fVar4 * this->unk_1A4); } @@ -155,19 +139,16 @@ void func_809C1E40(EnBird* this, GlobalContext* globalCtx) this->actor.shape.rot.y = this->actor.posRot.rot.y; SkelAnime_FrameUpdateMatrix(&this->skelAnime); this->unk_198 -= 1; - if (this->unk_198 < 0) - { + if (this->unk_198 < 0) { func_809C1CAC(this, this->actor.params); } } -void EnBird_Update(EnBird* this, GlobalContext* globalCtx) -{ +void EnBird_Update(EnBird* this, GlobalContext* globalCtx) { this->unk_1B4 += this->unk_1B8; this->updateFunc(this, globalCtx); } -void EnBird_Draw(EnBird* this, GlobalContext* globalCtx) -{ +void EnBird_Draw(EnBird* this, GlobalContext* globalCtx) { SkelAnime_Draw(globalCtx, this->skelAnime.limbIndex, this->skelAnime.actorDrawTbl, 0, NULL, NULL); } diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c index 85d6c5d851..3d49c0686c 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -1,6 +1,6 @@ #include "z_en_blkobj.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnBlkobj_Init(EnBlkobj* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 1313f7d37c..9e5e8f1470 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -1,6 +1,6 @@ #include "z_en_bom.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnBom_Init(EnBom* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index e3136d3907..a1c172338a 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -1,6 +1,6 @@ #include "z_en_bom_bowl_man.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x08000039 void EnBomBowlMan_Init(EnBomBowlMan* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index f5c80248be..c10655c120 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -1,6 +1,6 @@ #include "z_en_bom_bowl_pit.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnBomBowlPit_Init(EnBomBowlPit* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index 6e45fa3082..7b59910d74 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -1,6 +1,6 @@ #include "z_en_bom_chu.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnBomChu_Init(EnBomChu* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index c9b1bc035e..7171ed868e 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -1,6 +1,6 @@ #include "z_en_bombf.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000011 void EnBombf_Init(EnBombf* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index da3921c246..6bc88ee3a8 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -2,11 +2,11 @@ * File: z_en_boom.c * Overlay: ovl_En_Boom * Description: Thrown Boomerang. Actor spawns when thrown and is killed when caught. -*/ + */ #include "z_en_boom.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 static void EnBoom_SetupAction(EnBoom* this, ActorFunc* actionFunc); @@ -16,8 +16,7 @@ static void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx); static void EnBoom_Update(EnBoom* this, GlobalContext* globalCtx); static void EnBoom_Draw(EnBoom* this, GlobalContext* globalCtx); -const ActorInit En_Boom_InitVars = -{ +const ActorInit En_Boom_InitVars = { ACTOR_EN_BOOM, ACTORTYPE_MISC, ROOM, @@ -27,37 +26,36 @@ const ActorInit En_Boom_InitVars = (ActorFunc)EnBoom_Init, (ActorFunc)EnBoom_Destroy, (ActorFunc)EnBoom_Update, - (ActorFunc)EnBoom_Draw + (ActorFunc)EnBoom_Draw, }; // Related to collision, should be moved somewhere else when collision_check is decompiled. // Seems to be made up of a bunch of substructs, but I didnt do too much digging. // This is probably not accurate. -typedef struct -{ - u8 unk_00; - u8 unk_01; - u8 unk_02; - u8 unk_03; - u8 unk_04; - u8 unk_05; +typedef struct { + u8 unk_00; + u8 unk_01; + u8 unk_02; + u8 unk_03; + u8 unk_04; + u8 unk_05; u16 pad_06; - u8 unk_08; - u8 pad_09; - u8 pad_0A; - u8 pad_0B; + u8 unk_08; + u8 pad_09; + u8 pad_0A; + u8 pad_0B; u32 unk_0C; - u8 unk_10; - u8 unk_11; + u8 unk_10; + u8 unk_11; u16 pad_12; u32 unk_14; - u8 unk_18; - u8 unk_19; + u8 unk_18; + u8 unk_19; u16 pad_1A; - u8 unk_1C; - u8 unk_1D; - u8 unk_1E; - u8 pad_1F; + u8 unk_1C; + u8 unk_1D; + u8 unk_1E; + u8 pad_1F; u32 unk_20; u32 unk_24; u32 unk_28; @@ -70,35 +68,30 @@ typedef struct u32 unk_44; u32 unk_48; u32 unk_4C; -} unkCollision; //size = 0x50 +} unkCollision; // size = 0x50 -static unkCollision col = -{ - 0x0A, 0x09, 0x00, 0x00, 0x08, 0x03, 0x0000, 0x02, 0x00, 0x00, 0x00, 0x00000010, - 0x00, 0x01, 0x0000, 0xFFCFFFFF, 0x00, 0x00, 0x0000, 0x05, 0x00, 0x00, 0x00, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, +static unkCollision col = { + 0x0A, 0x09, 0x00, 0x00, 0x08, 0x03, 0x0000, 0x02, 0x00, + 0x00, 0x00, 0x00000010, 0x00, 0x01, 0x0000, 0xFFCFFFFF, 0x00, 0x00, + 0x0000, 0x05, 0x00, 0x00, 0x00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_S8(unk_1F, 5, ICHAIN_CONTINUE), ICHAIN_VEC3S(shape.rot, 0, ICHAIN_STOP), }; static Vec3f mtxSrc1 = { -960.0f, 0.0f, 0.0f }; -static Vec3f mtxSrc2 = { 960.0f, 0.0f, 0.0f }; +static Vec3f mtxSrc2 = { 960.0f, 0.0f, 0.0f }; extern D_0400C808; -static void EnBoom_SetupAction(EnBoom* this, ActorFunc* actionFunc) -{ +static void EnBoom_SetupAction(EnBoom* this, ActorFunc* actionFunc) { this->actionFunc = actionFunc; } -static void EnBoom_Init(EnBoom* this, GlobalContext* globalCtx) -{ +static void EnBoom_Init(EnBoom* this, GlobalContext* globalCtx) { u32 pad; TrailEffect trail; @@ -138,14 +131,12 @@ static void EnBoom_Init(EnBoom* this, GlobalContext* globalCtx) EnBoom_SetupAction(this, &EnBoom_Fly); } -static void EnBoom_Destroy(EnBoom* this, GlobalContext* globalCtx) -{ +static void EnBoom_Destroy(EnBoom* this, GlobalContext* globalCtx) { func_8002709C(globalCtx, this->effect); func_8005D060(globalCtx, &this->collider); } -static void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) -{ +static void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { Actor* target; Player* player; s32 collided; @@ -165,8 +156,7 @@ static void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) target = this->moveTo; // If the boomerang is moving toward a targeted actor, handle setting the proper x and y angle to fly toward it. - if (target != NULL) - { + if (target != NULL) { yawTarget = func_8002DAC0(&this->actor, &target->posRot2.pos); yawDiff = this->actor.posRot.rot.y - yawTarget; @@ -174,23 +164,21 @@ static void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) pitchDiff = this->actor.posRot.rot.x - pitchTarget; distXYZScale = ((200.0f - Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &target->posRot2.pos)) * 0.005f); - if (distXYZScale < 0.12f) + if (distXYZScale < 0.12f) { distXYZScale = 0.12f; - - if ((target != (Actor*)player) && ((target->update == NULL) || (ABS(yawDiff) > 0x4000))) - { + } + + if ((target != (Actor*)player) && ((target->update == NULL) || (ABS(yawDiff) > 0x4000))) { // BUG: This condition is why the boomerang will randomly fly off in a the down left direction sometimes. // If the actor targetted is not Link and the difference between the 2 y angles is greater than 0x4000, // the moveTo pointer is nulled and it flies off in a seemingly random direction. this->moveTo = NULL; - } - else - { + } else { Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, yawTarget, (s16)(ABS(yawDiff) * distXYZScale)); Math_ApproxUpdateScaledS(&this->actor.posRot.rot.x, pitchTarget, (s16)(ABS(pitchDiff) * distXYZScale)); } } - + // Set xyz speed, move forward, and play the boomerang sound func_8002D9A4(&this->actor, 12.0f); Actor_MoveForward(&this->actor); @@ -199,42 +187,33 @@ static void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) // If the boomerang collides with EnItem00 or a Skulltula token, set grabbed pointer to pick it up collided = (this->collider.colliderFlags & 0x2); collided = (!!(collided)); - if (collided) - { - if (((this->collider.at->id == ACTOR_EN_ITEM00) || (this->collider.at->id == ACTOR_EN_SI))) - { + if (collided) { + if (((this->collider.at->id == ACTOR_EN_ITEM00) || (this->collider.at->id == ACTOR_EN_SI))) { this->grabbed = this->collider.at; - if (this->collider.at->id == ACTOR_EN_SI) - { + if (this->collider.at->id == ACTOR_EN_SI) { this->collider.at->flags |= 0x2000; } } } - - // Decrement the return timer and check if its 0. If it is, check if Link can catch it and handle accordingly. + + // Decrement the return timer and check if its 0. If it is, check if Link can catch it and handle accordingly. // Otherwise handle grabbing and colliding. - if (DECR(this->returnTimer) == 0) - { + if (DECR(this->returnTimer) == 0) { distFromLink = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &player->actor.posRot2.pos); this->moveTo = player; - //If the boomerang is less than 40 units away from Link, he can catch it. - if (distFromLink < 40.0f) - { + // If the boomerang is less than 40 units away from Link, he can catch it. + if (distFromLink < 40.0f) { target = this->grabbed; - if (target != NULL) - { + if (target != NULL) { Math_Vec3f_Copy(&target->posRot.pos, &player->actor.posRot.pos); // If the grabbed actor is EnItem00 (HP/Key etc) set gravity and flags so it falls in front of Link. // Otherwise if its a Skulltula Token, just set flags so he collides with it to collect it. - if (target->id == ACTOR_EN_ITEM00) - { + if (target->id == ACTOR_EN_ITEM00) { target->gravity = -0.9f; target->bgCheckFlags &= ~0x03; - } - else - { + } else { target->flags &= ~0x2000; } } @@ -242,42 +221,34 @@ static void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) player->stateFlags1 &= ~0x02000000; Actor_Kill(&this->actor); } - } - else - { + } else { collided = (this->collider.colliderFlags & 0x2); collided = (!!(collided)); - if (collided) - { + if (collided) { // Copy the position from the prevous frame to the boomerang to start the bounce back. Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.pos4); - } - else - { + } else { collided = func_8003DE84(&globalCtx->colCtx, &this->actor.pos4, &this->actor.posRot.pos, &hitPoint, - &this->actor.wallPoly, 1, 1, 1, 1, &hitDynaID); + &this->actor.wallPoly, 1, 1, 1, 1, &hitDynaID); - if (collided != 0) - { + if (collided != 0) { // If the boomerang coolides with something and its is a Jabu Object actor with params equal to 0, then - // set collided to 0 so that the boomerang will go through the wall. + // set collided to 0 so that the boomerang will go through the wall. // Otherwise play a clank sound and keep collided set to bounce back. if ((func_8002F9EC(globalCtx, &this->actor, this->actor.wallPoly, hitDynaID, &hitPoint) != 0) || - ((hitDynaID != 0x32) && ((hitActor = DynaPolyInfo_GetActor(&globalCtx->colCtx, hitDynaID)) != NULL) && (hitActor->actor.id == ACTOR_BG_BDAN_OBJECTS) && (hitActor->actor.params == 0))) - { + ((hitDynaID != 0x32) && + ((hitActor = DynaPolyInfo_GetActor(&globalCtx->colCtx, hitDynaID)) != NULL) && + (hitActor->actor.id == ACTOR_BG_BDAN_OBJECTS) && (hitActor->actor.params == 0))) { collided = 0; - } - else - { + } else { func_80062D60(globalCtx, &hitPoint); - } + } } } - + // If the boomerang needs to bounce back, set x and y angle accordingly. // Set timer to 0 and set return actor to player so it goes back to Link. - if (collided != 0) - { + if (collided != 0) { this->actor.posRot.rot.x = -this->actor.posRot.rot.x; this->actor.posRot.rot.y += 0x8000; this->moveTo = player; @@ -288,32 +259,25 @@ static void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) // If the actor the boomerang is holding has a null update function, set grabbed to null. // Otherwise, copy the position from the boomerang to the actor to move it. target = this->grabbed; - if (target != NULL) - { - if (target->update == NULL) - { + if (target != NULL) { + if (target->update == NULL) { this->grabbed = NULL; - } - else - { + } else { Math_Vec3f_Copy(&target->posRot.pos, &this->actor.posRot.pos); } } } -static void EnBoom_Update(EnBoom* this, GlobalContext* globalCtx) -{ +static void EnBoom_Update(EnBoom* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (!(player->stateFlags1 & 0x20000000)) - { + if (!(player->stateFlags1 & 0x20000000)) { this->actionFunc(this, globalCtx); Actor_SetHeight(&this->actor, 0.0f); this->activeTimer = this->activeTimer + 1; } } -static void EnBoom_Draw(EnBoom* this, GlobalContext* globalCtx) -{ +static void EnBoom_Draw(EnBoom* this, GlobalContext* globalCtx) { s32 pad; Vec3f mtxDest1; Vec3f mtxDest2; @@ -328,8 +292,7 @@ static void EnBoom_Draw(EnBoom* this, GlobalContext* globalCtx) Matrix_MultVec3f(&mtxSrc1, &mtxDest1); Matrix_MultVec3f(&mtxSrc2, &mtxDest2); - if (func_80090480(globalCtx, &this->collider, &this->unk_1DC, &mtxDest1, &mtxDest2) != 0) - { + if (func_80090480(globalCtx, &this->collider, &this->unk_1DC, &mtxDest1, &mtxDest2) != 0) { func_8001FDF0(func_80026B0C(this->effect), &mtxDest1, &mtxDest2); } diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index 2cd3cc8ece..a841cf8bd5 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -1,6 +1,6 @@ #include "z_en_box.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnBox_Init(EnBox* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index fe49fa8767..42afcfa753 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -1,6 +1,6 @@ #include "z_en_brob.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnBrob_Init(EnBrob* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 6587f45927..a925f6a46e 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -1,6 +1,6 @@ #include "z_en_bubble.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000001 void EnBubble_Init(EnBubble* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index 647cb10de7..c34f06f0fb 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -1,6 +1,6 @@ #include "z_en_butte.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnButte_Init(EnButte* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 66d2c3626e..1a700781a8 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -1,6 +1,6 @@ #include "z_en_bw.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnBw_Init(EnBw* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index 70f6261c5f..a65c91b2ab 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -1,6 +1,6 @@ #include "z_en_bx.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnBx_Init(EnBx* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/src/overlays/actors/ovl_En_Changer/z_en_changer.c index bc89faafa3..65e73fd513 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -1,6 +1,6 @@ #include "z_en_changer.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnChanger_Init(EnChanger* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index b3a31c0fd2..cf78c10fed 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -1,6 +1,6 @@ #include "z_en_clear_tag.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void EnClearTag_Init(EnClearTag* this, GlobalContext* globalCtx); @@ -44,4 +44,3 @@ const ActorInit En_Clear_Tag_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/func_809D5004.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/func_809D53CC.s") - diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index bd9ae92128..c9a55ffebd 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -1,6 +1,6 @@ #include "z_en_cow.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnCow_Init(EnCow* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index d00d419264..195c6a88a5 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -1,6 +1,6 @@ #include "z_en_crow.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00005005 void EnCrow_Init(EnCrow* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 003bc39406..0adb43c976 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -1,6 +1,6 @@ #include "z_en_cs.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnCs_Init(EnCs* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index eb3a8a2c57..ef886765c1 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -1,6 +1,6 @@ #include "z_en_daiku.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnDaiku_Init(EnDaiku* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index 7f6effe716..a5d5cde51a 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -1,6 +1,6 @@ #include "z_en_daiku_kakariko.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnDaikuKakariko_Init(EnDaikuKakariko* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 43dd06da1f..2e46a02fe3 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -1,6 +1,6 @@ #include "z_en_dekubaba.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnDekubaba_Init(EnDekubaba* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 034d881812..d547fc737c 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -1,6 +1,6 @@ #include "z_en_dekunuts.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnDekunuts_Init(EnDekunuts* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 94ed51fec5..173f96e41c 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -1,6 +1,6 @@ #include "z_en_dh.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000415 void EnDh_Init(EnDh* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 24a9e9d8e3..e3e36c0e33 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -1,6 +1,6 @@ #include "z_en_dha.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnDha_Init(EnDha* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index 1162d8f9fe..cb1c8d77ac 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -1,6 +1,6 @@ #include "z_en_diving_game.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnDivingGame_Init(EnDivingGame* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 7edfcc1c93..4a6b6e71e0 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -1,6 +1,6 @@ #include "z_en_dns.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnDns_Init(EnDns* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index bcb0ea1df2..b8f150034f 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -1,6 +1,6 @@ #include "z_en_dnt_demo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnDntDemo_Init(EnDntDemo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index 52151a95c7..659df06f6b 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -1,6 +1,6 @@ #include "z_en_dnt_jiji.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnDntJiji_Init(EnDntJiji* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index c0e938e600..c784d2b49a 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -1,6 +1,6 @@ #include "z_en_dnt_nomal.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnDntNomal_Init(EnDntNomal* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index f48eed4dcb..96f2578d50 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -1,6 +1,6 @@ #include "z_en_dodojr.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnDodojr_Init(EnDodojr* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 3d90f3eda5..1bf9689dc7 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -1,6 +1,6 @@ #include "z_en_dodongo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnDodongo_Init(EnDodongo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 67393b61e4..c9e1d06c25 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -1,6 +1,6 @@ #include "z_en_dog.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void EnDog_Init(EnDog* this, GlobalContext* globalCtx); @@ -15,8 +15,7 @@ static void EnDog_RunAway(EnDog* this, GlobalContext* globalCtx); static void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx); static void EnDog_Wait(EnDog* this, GlobalContext* globalCtx); -const ActorInit En_Dog_InitVars = -{ +const ActorInit En_Dog_InitVars = { ACTOR_EN_DOG, ACTORTYPE_NPC, ROOM, @@ -29,68 +28,48 @@ const ActorInit En_Dog_InitVars = (ActorFunc)EnDog_Draw, }; -static ColliderCylinderInit cylinderInit = -{ - 0x06, 0x00, 0x09, 0x39, - 0x10, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00000000, - 0x00, 0x00, 0x00, 0x00, - 0xFFCFFFFF, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x00, +static ColliderCylinderInit cylinderInit = { + 0x06, 0x00, 0x09, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00000000, + 0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - 0x0010, - 0x0014, - 0x0000, - 0x0000, 0x0000, 0x0000, + 0x0010, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000, }; // There are multiple versions of sub98 init structs // Keeping these local until z_collision_check is decompiled -typedef struct -{ +typedef struct { /* 0x00 */ u8 health; /* 0x02 */ s16 unk_10; /* 0x04 */ s16 unk_12; /* 0x06 */ u16 unk_14; /* 0x08 */ u8 mass; -}sub98Init; +} sub98Init; -static sub98Init sub98Data = -{ - 0x00, //health - 0x0000, //unk_10 - 0x0000, //unk_12 - 0x0000, //unk_14 - 0x32, //mass +static sub98Init sub98Data = { + 0x00, // health + 0x0000, // unk_10 + 0x0000, // unk_12 + 0x0000, // unk_14 + 0x32, // mass }; -static struct_80034EC0_Entry animations[]= -{ - {0x06001368, 1.0f, 0.0f, -1.0f, 0x00, 0.0f}, - {0x06001368, 1.0f, 0.0f, -1.0f, 0x00, -6.0f}, - {0x06000D78, 1.0f, 0.0f, -1.0f, 0x00, -6.0f}, - {0x06000278, 1.0f, 0.0f, -1.0f, 0x00, -6.0f}, - {0x06001150, 1.0f, 0.0f, 4.0f, 0x02, -6.0f}, - {0x06001150, 1.0f, 5.0f, 25.0f,0x04, -6.0f}, - {0x06000928, 1.0f, 0.0f, 6.0f, 0x02, -6.0f}, - {0x06000C28, 1.0f, 0.0f, -1.0f, 0x00, -6.0f}, +static struct_80034EC0_Entry animations[] = { + { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, + { 0x06000D78, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, { 0x06000278, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, + { 0x06001150, 1.0f, 0.0f, 4.0f, 0x02, -6.0f }, { 0x06001150, 1.0f, 5.0f, 25.0f, 0x04, -6.0f }, + { 0x06000928, 1.0f, 0.0f, 6.0f, 0x02, -6.0f }, { 0x06000C28, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, }; // Bandaid fix for a lw vs lh issue in EnDog_FollowPath. Roman will look at it later. -typedef union -{ +typedef union { /* 0x00 */ s32 entry; - struct - { + struct { s16 unk_0; s16 unk_2; }; -}s16ArrEntry; +} s16ArrEntry; -typedef enum -{ +typedef enum { /* 0x00 */ DOG_WALK, /* 0x01 */ DOG_RUN, /* 0x02 */ DOG_BARK, @@ -105,127 +84,105 @@ extern UNK_PTR D_06001368; extern UNK_PTR D_06000D78; extern UNK_PTR D_06000278; -static void EnDog_PlayWalkSFX(EnDog* this) -{ +static void EnDog_PlayWalkSFX(EnDog* this) { u32* walk = &D_06001368; - if (this->skelAnime.animCurrent == walk) - { - if ((this->skelAnime.animCurrentFrame == 1.0f) || (this->skelAnime.animCurrentFrame == 7.0f)) - { + if (this->skelAnime.animCurrent == walk) { + if ((this->skelAnime.animCurrentFrame == 1.0f) || (this->skelAnime.animCurrentFrame == 7.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHIBI_WALK); } } } -static void EnDog_PlayRunSFX(EnDog* this) -{ +static void EnDog_PlayRunSFX(EnDog* this) { u32* run = &D_06000D78; - if (this->skelAnime.animCurrent == run) - { - if ((this->skelAnime.animCurrentFrame == 2.0f) || (this->skelAnime.animCurrentFrame == 4.0f)) - { + if (this->skelAnime.animCurrent == run) { + if ((this->skelAnime.animCurrentFrame == 2.0f) || (this->skelAnime.animCurrentFrame == 4.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHIBI_WALK); } } } -static void EnDog_PlayBarkSFX(EnDog* this) -{ +static void EnDog_PlayBarkSFX(EnDog* this) { u32* bark = &D_06000278; - if (this->skelAnime.animCurrent == bark) - { - if ((this->skelAnime.animCurrentFrame == 13.0f) || (this->skelAnime.animCurrentFrame == 19.0f)) - { + if (this->skelAnime.animCurrent == bark) { + if ((this->skelAnime.animCurrentFrame == 13.0f) || (this->skelAnime.animCurrentFrame == 19.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_BARK); } } } -static s32 EnDog_PlayAnimAndSFX(EnDog* this) -{ +static s32 EnDog_PlayAnimAndSFX(EnDog* this) { s32 animation; - if (this->behavior != this->nextBehavior) - { - if (this->nextBehavior == DOG_SIT_2) - { + if (this->behavior != this->nextBehavior) { + if (this->nextBehavior == DOG_SIT_2) { this->nextBehavior = DOG_SIT; } - if (this->nextBehavior == DOG_BOW_2) - { + if (this->nextBehavior == DOG_BOW_2) { this->nextBehavior = DOG_BOW; } this->behavior = this->nextBehavior; - switch(this->behavior) - { - case DOG_WALK: - animation = 1; + switch (this->behavior) { + case DOG_WALK: + animation = 1; break; - case DOG_RUN: - animation = 2; + case DOG_RUN: + animation = 2; break; - case DOG_BARK: - animation = 3; + case DOG_BARK: + animation = 3; break; case DOG_SIT: - animation = 4; + animation = 4; break; - case DOG_BOW: - animation = 6; + case DOG_BOW: + animation = 6; break; } func_80034EC0(&this->skelAnime, &animations, animation); } - - switch(this->behavior) - { - case DOG_SIT: - if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) - { + + switch (this->behavior) { + case DOG_SIT: + if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) { func_80034EC0(&this->skelAnime, &animations, 5); this->behavior = this->nextBehavior = DOG_SIT_2; } break; - case DOG_BOW: - if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) - { + case DOG_BOW: + if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) { func_80034EC0(&this->skelAnime, &animations, 7); this->behavior = this->nextBehavior = DOG_BOW_2; } break; - case DOG_WALK: - EnDog_PlayWalkSFX(this); + case DOG_WALK: + EnDog_PlayWalkSFX(this); break; - case DOG_RUN: + case DOG_RUN: EnDog_PlayRunSFX(this); break; - case DOG_BARK: + case DOG_BARK: EnDog_PlayBarkSFX(this); - if (this){} // needed for regalloc + if (this) {} // needed for regalloc break; } return 0; } -static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) -{ - if ((this->collider.base.collideFlags & 2)) - { +static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) { + if ((this->collider.base.collideFlags & 2)) { this->collider.base.collideFlags &= ~2; return 2; } - if (globalCtx->sceneNum == SCENE_MARKET_DAY) - { + if (globalCtx->sceneNum == SCENE_MARKET_DAY) { return 0; } - if ((this->collider.base.maskB & 1)) - { + if ((this->collider.base.maskB & 1)) { this->collider.base.maskB &= ~1; - if (gSaveContext.dogParams != 0) - { + if (gSaveContext.dogParams != 0) { return 0; } gSaveContext.dogParams = (this->actor.params & 0x7FFF); @@ -235,37 +192,27 @@ static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) return 0; } -static EnDog_UpdateWaypoint(EnDog* this, GlobalContext* globalCtx) -{ +static EnDog_UpdateWaypoint(EnDog* this, GlobalContext* globalCtx) { s32 change; - if (this->path == NULL) - { + if (this->path == NULL) { return 0; } - if (this->reverse) - { + if (this->reverse) { change = -1; - } - else - { + } else { change = 1; } - + this->waypoint += change; - if (this->reverse) - { - if (this->waypoint < 0) - { + if (this->reverse) { + if (this->waypoint < 0) { this->waypoint = this->path->count - 1; } - } - else - { - if ((this->path->count - 1) < this->waypoint) - { + } else { + if ((this->path->count - 1) < this->waypoint) { this->waypoint = 0; } } @@ -273,26 +220,21 @@ static EnDog_UpdateWaypoint(EnDog* this, GlobalContext* globalCtx) return 1; } -static s32 EnDog_Orient(EnDog* this, GlobalContext* globalCtx) -{ +static s32 EnDog_Orient(EnDog* this, GlobalContext* globalCtx) { s16 targetYaw; f32 waypointDistSq; - + waypointDistSq = func_8008E520(&this->actor, this->path, this->waypoint, &targetYaw); Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, targetYaw, 10, 1000, 1); - if ((waypointDistSq > 0.0f) && (waypointDistSq < 1000.0f)) - { + if ((waypointDistSq > 0.0f) && (waypointDistSq < 1000.0f)) { return EnDog_UpdateWaypoint(this, globalCtx); - } - else - { + } else { return 0; } } -static void EnDog_Init(EnDog* this, GlobalContext* globalCtx) -{ +static void EnDog_Init(EnDog* this, GlobalContext* globalCtx) { SkelAnime* skelAnime; s16 followingDog; ColliderCylinderMain* collider; @@ -302,15 +244,13 @@ static void EnDog_Init(EnDog* this, GlobalContext* globalCtx) skelAnime = &this->skelAnime; func_800A46F8(globalCtx, skelAnime, &D_06007290, 0, &this->unk_1F4, &this->unk_242, 13); func_80034EC0(skelAnime, animations, 0); - - if ((this->actor.params & 0x8000) == 0) - { + + if ((this->actor.params & 0x8000) == 0) { this->actor.params = (this->actor.params & 0xF0FF) | ((((this->actor.params & 0x0F00) >> 8) + 1) << 8); } followingDog = ((gSaveContext.dogParams & 0x0F00) >> 8); - if (followingDog == ((this->actor.params & 0x0F00) >> 8) && ((this->actor.params & 0x8000) == 0)) - { + if (followingDog == ((this->actor.params & 0x0F00) >> 8) && ((this->actor.params & 0x8000) == 0)) { Actor_Kill(&this->actor); return; } @@ -323,26 +263,20 @@ static void EnDog_Init(EnDog* this, GlobalContext* globalCtx) this->actor.gravity = -1.0f; this->path = func_8008E4E0(globalCtx, (s16)((this->actor.params & 0x00F0) >> 4), 0xF); - switch (globalCtx->sceneNum) - { + switch (globalCtx->sceneNum) { case SCENE_MARKET_NIGHT: - if ((!gSaveContext.dogIsLost) && (((this->actor.params & 0x0F00) >> 8) == 1)) - { + if ((!gSaveContext.dogIsLost) && (((this->actor.params & 0x0F00) >> 8) == 1)) { Actor_Kill(&this->actor); } break; case SCENE_IMPA: // Richard's Home - if ((u32)(this->actor.params & 0x8000) == 0) - { - if (!gSaveContext.dogIsLost) - { + if ((u32)(this->actor.params & 0x8000) == 0) { + if (!gSaveContext.dogIsLost) { this->nextBehavior = DOG_SIT; this->actionFunc = EnDog_Wait; this->actor.speedXZ = 0.0f; return; - } - else - { + } else { Actor_Kill(&this->actor); return; } @@ -350,44 +284,34 @@ static void EnDog_Init(EnDog* this, GlobalContext* globalCtx) break; } - if ((u32)(this->actor.params & 0x8000) != 0) - { + if ((u32)(this->actor.params & 0x8000) != 0) { this->nextBehavior = DOG_WALK; this->actionFunc = EnDog_FollowLink; - } - else - { + } else { this->nextBehavior = DOG_SIT; this->actionFunc = EnDog_ChooseMovement; } } -static void EnDog_Destroy(EnDog* this, GlobalContext* globalCtx) -{ - ColliderCylinderMain* collider = &this->collider; +static void EnDog_Destroy(EnDog* this, GlobalContext* globalCtx) { + ColliderCylinderMain* collider = &this->collider; ActorCollider_FreeCylinder(globalCtx, collider); } -static void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) -{ +static void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) { s16ArrEntry behaviors[] = { DOG_SIT, DOG_BOW, DOG_BARK }; s16ArrEntry unused[] = { 40, 80, 20 }; f32 speed; s32 frame; - if (EnDog_CanFollow(this, globalCtx) == 1) - { + if (EnDog_CanFollow(this, globalCtx) == 1) { this->actionFunc = EnDog_FollowLink; } - if (DECR(this->behaviorTimer) != 0) - { - if (this->nextBehavior == DOG_WALK) - { + if (DECR(this->behaviorTimer) != 0) { + if (this->nextBehavior == DOG_WALK) { speed = 1.0f; - } - else - { + } else { speed = 4.0f; } Math_SmoothScaleMaxMinF(&this->actor.speedXZ, speed, 0.4f, 1.0f, 0.0f); @@ -396,19 +320,14 @@ static void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) // Used to change between two text boxes for Richard's owner in the Market Day scene // depending on where he is on his path. En_Hy checks these event flags. - if (this->waypoint < 9) - { + if (this->waypoint < 9) { // Richard is close to her, text says something about his coat gSaveContext.event_inf[3] |= 1; - } - else - { + } else { // Richard is far, text says something about running fast gSaveContext.event_inf[3] &= ~1; } - } - else - { + } else { frame = globalCtx->state.frames % 3; this->nextBehavior = behaviors[frame].entry; // no clue why they're using the action id to calculate timer. possibly meant to use the unused array? @@ -417,27 +336,20 @@ static void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) } } -static void EnDog_ChooseMovement(EnDog* this, GlobalContext* globalCtx) -{ - if (EnDog_CanFollow(this, globalCtx) == 1) - { +static void EnDog_ChooseMovement(EnDog* this, GlobalContext* globalCtx) { + if (EnDog_CanFollow(this, globalCtx) == 1) { this->actionFunc = EnDog_FollowLink; } - if (DECR(this->behaviorTimer) == 0) - { + if (DECR(this->behaviorTimer) == 0) { this->behaviorTimer = Math_Rand_S16Offset(200, 100); - if (globalCtx->state.frames % 2) - { + if (globalCtx->state.frames % 2) { this->nextBehavior = DOG_WALK; - } - else - { + } else { this->nextBehavior = DOG_RUN; } - if (this->nextBehavior == DOG_RUN) - { + if (this->nextBehavior == DOG_RUN) { this->behaviorTimer /= 2; } this->actionFunc = EnDog_FollowPath; @@ -445,81 +357,63 @@ static void EnDog_ChooseMovement(EnDog* this, GlobalContext* globalCtx) Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 0.4f, 1.0f, 0.0f); } -static void EnDog_FollowLink(EnDog* this, GlobalContext* globalCtx) -{ +static void EnDog_FollowLink(EnDog* this, GlobalContext* globalCtx) { f32 speed; - if (gSaveContext.dogParams == 0) - { + if (gSaveContext.dogParams == 0) { this->nextBehavior = DOG_SIT; this->actionFunc = EnDog_Wait; this->actor.speedXZ = 0.0f; - return; + return; } - - if (this->actor.xzDistanceFromLink > 400.0f) - { - if (this->nextBehavior != DOG_SIT && this->nextBehavior != DOG_SIT_2) - { + + if (this->actor.xzDistanceFromLink > 400.0f) { + if (this->nextBehavior != DOG_SIT && this->nextBehavior != DOG_SIT_2) { this->nextBehavior = DOG_BOW; } gSaveContext.dogParams = 0; speed = 0.0f; - } - else if (this->actor.xzDistanceFromLink > 100.0f) - { + } else if (this->actor.xzDistanceFromLink > 100.0f) { this->nextBehavior = DOG_RUN; speed = 4.0f; - } - else if (this->actor.xzDistanceFromLink < 40.0f) - { - if (this->nextBehavior != DOG_BOW && this->nextBehavior != DOG_BOW_2) - { + } else if (this->actor.xzDistanceFromLink < 40.0f) { + if (this->nextBehavior != DOG_BOW && this->nextBehavior != DOG_BOW_2) { this->nextBehavior = DOG_BOW; } speed = 0.0f; - } - else - { + } else { this->nextBehavior = DOG_WALK; speed = 1.0f; } - + Math_SmoothScaleMaxF(&this->actor.speedXZ, speed, 0.6f, 1.0f); - if (!(this->actor.xzDistanceFromLink > 400.0f)) - { + if (!(this->actor.xzDistanceFromLink > 400.0f)) { Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, this->actor.rotTowardsLinkY, 10, 1000, 1); this->actor.shape.rot = this->actor.posRot.rot; } } -static void EnDog_RunAway(EnDog* this, GlobalContext* globalCtx) -{ - if (this->actor.xzDistanceFromLink < 200.0f) - { +static void EnDog_RunAway(EnDog* this, GlobalContext* globalCtx) { + if (this->actor.xzDistanceFromLink < 200.0f) { Math_SmoothScaleMaxF(&this->actor.speedXZ, 4.0f, 0.6f, 1.0f); Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, (this->actor.rotTowardsLinkY ^ 0x8000), 10, 1000, 1); - } - else - { + } else { this->actionFunc = EnDog_FaceLink; } this->actor.shape.rot = this->actor.posRot.rot; } -static void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) -{ +static void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) { s16 rotTowardLink; s16 prevRotY; f32 absAngleDiff; - + // if the dog is more than 200 units away from Link, turn to face him then wait - if (200.0f <= this->actor.xzDistanceFromLink) - { + if (200.0f <= this->actor.xzDistanceFromLink) { this->nextBehavior = DOG_WALK; - Math_SmoothScaleMaxF(&this->actor.speedXZ, 1.0f, 0.6f, 1.0f); + Math_SmoothScaleMaxF(&this->actor.speedXZ, 1.0f, 0.6f, 1.0f); rotTowardLink = this->actor.rotTowardsLinkY; prevRotY = this->actor.posRot.rot.y; @@ -528,62 +422,51 @@ static void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) absAngleDiff = this->actor.posRot.rot.y; absAngleDiff -= prevRotY; absAngleDiff = fabsf(absAngleDiff); - if (absAngleDiff < 200.0f) - { + if (absAngleDiff < 200.0f) { this->nextBehavior = DOG_SIT; this->actionFunc = EnDog_Wait; this->actor.speedXZ = 0.0f; } - } - else - { + } else { this->nextBehavior = DOG_RUN; this->actionFunc = EnDog_RunAway; } this->actor.shape.rot = this->actor.posRot.rot; } -static void EnDog_Wait(EnDog* this, GlobalContext* globalCtx) -{ +static void EnDog_Wait(EnDog* this, GlobalContext* globalCtx) { this->unusedAngle = (this->actor.rotTowardsLinkY - this->actor.shape.rot.y); // If another dog is following Link and he gets within 200 units of waiting dog, run away - if ((gSaveContext.dogParams != 0) && (this->actor.xzDistanceFromLink < 200.0f)) - { + if ((gSaveContext.dogParams != 0) && (this->actor.xzDistanceFromLink < 200.0f)) { this->nextBehavior = DOG_RUN; this->actionFunc = EnDog_RunAway; } } -static void EnDog_Update(EnDog* this, GlobalContext* globalCtx) -{ +static void EnDog_Update(EnDog* this, GlobalContext* globalCtx) { s32 pad1; s32 pad2; EnDog_PlayAnimAndSFX(this); SkelAnime_FrameUpdateMatrix(&this->skelAnime); - func_8002E4B4(globalCtx, &this->actor, this->collider.dim.radius, - this->collider.dim.height * 0.5f, 0.0f, 5); + func_8002E4B4(globalCtx, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f, 5); Actor_MoveForward(&this->actor); this->actionFunc(this, globalCtx); ActorCollider_Cylinder_Update(&this->actor, &this->collider); Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); } -static UNK_TYPE EnDog_Callback1(UNK_TYPE unused1, UNK_TYPE unused2, UNK_TYPE unused3, UNK_TYPE unused4) -{ +static UNK_TYPE EnDog_Callback1(UNK_TYPE unused1, UNK_TYPE unused2, UNK_TYPE unused3, UNK_TYPE unused4) { return 0; } -static void EnDog_Callback2(UNK_TYPE unused1, UNK_TYPE unused2, UNK_TYPE unused3, UNK_TYPE unused4) -{ - +static void EnDog_Callback2(UNK_TYPE unused1, UNK_TYPE unused2, UNK_TYPE unused3, UNK_TYPE unused4) { } -static void EnDog_Draw(EnDog* this, GlobalContext* globalCtx) -{ +static void EnDog_Draw(EnDog* this, GlobalContext* globalCtx) { s32 pad; - Color_RGBA8 colors[] = { {0xFF, 0xFF, 0xC8, 0x00}, {0x96, 0x64, 0x32, 0x00} }; + Color_RGBA8 colors[] = { { 0xFF, 0xFF, 0xC8, 0x00 }, { 0x96, 0x64, 0x32, 0x00 } }; GraphicsContext* gfxCtx; s32 pad2[2]; Gfx* gfxArr[2]; @@ -593,11 +476,10 @@ static void EnDog_Draw(EnDog* this, GlobalContext* globalCtx) func_80093D18(globalCtx->state.gfxCtx); gDPPipeSync(gfxCtx->polyOpa.p++); - gDPSetEnvColor(gfxCtx->polyOpa.p++, - colors[this->actor.params & 0xF].r, colors[this->actor.params & 0xF].g, + gDPSetEnvColor(gfxCtx->polyOpa.p++, colors[this->actor.params & 0xF].r, colors[this->actor.params & 0xF].g, colors[this->actor.params & 0xF].b, colors[this->actor.params & 0xF].a); - func_800A1AC8(globalCtx, this->skelAnime.limbIndex, this->skelAnime.actorDrawTbl, - this->skelAnime.dListCount, EnDog_Callback1, EnDog_Callback2, &this->actor); + func_800A1AC8(globalCtx, this->skelAnime.limbIndex, this->skelAnime.actorDrawTbl, this->skelAnime.dListCount, + EnDog_Callback1, EnDog_Callback2, &this->actor); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_dog.c", 994); } diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 4773451998..1dcf925929 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -1,6 +1,6 @@ #include "z_en_door.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnDoor_Init(EnDoor* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 9c3506c55b..5141702415 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -1,6 +1,6 @@ #include "z_en_ds.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnDs_Init(EnDs* this, GlobalContext* globalCtx); @@ -62,6 +62,3 @@ const ActorInit En_Ds_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ds/func_809FDA7C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ds/EnDs_Draw.s") - - - diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index 880e2688a4..dfe8c4fe00 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -1,6 +1,6 @@ #include "z_en_du.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000009 void EnDu_Init(EnDu* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 2e7292896b..3319b32e46 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -1,6 +1,6 @@ #include "z_en_dy_extra.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnDyExtra_Init(EnDyExtra* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c index 249ee02aed..b6ef202b44 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -2,17 +2,16 @@ * File: z_en_eg.c * Overlay: ovl_En_Eg * Description: Zelda's Path in Ganon Castle Escape? -*/ + */ #include #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ s32 funcIndex; + /* 0x014C */ s32 funcIndex; } ActorEg; // size = 0x0154 #define ROOM 0x00 @@ -26,41 +25,30 @@ static void Update(ActorEg* this, GlobalContext* globalCtx); static void Draw(ActorEg* this, GlobalContext* globalCtx); static bool hasVoidedOut = false; -static const ActorFunc funcTbl[] = { (ActorFunc)func_809FFDC8 }; +static const ActorFunc funcTbl[] = { + (ActorFunc)func_809FFDC8, +}; -const ActorInit En_Eg_InitVars = -{ - ACTOR_EN_EG, - ACTORTYPE_ITEMACTION, - ROOM, - FLAGS, - OBJECT_ZL2, - sizeof(ActorEg), - (ActorFunc)Init, - (ActorFunc)Destroy, - (ActorFunc)Update, +const ActorInit En_Eg_InitVars = { + ACTOR_EN_EG, ACTORTYPE_ITEMACTION, ROOM, + FLAGS, OBJECT_ZL2, sizeof(ActorEg), + (ActorFunc)Init, (ActorFunc)Destroy, (ActorFunc)Update, (ActorFunc)Draw, }; -static void PlayVoidOutSFX() -{ +static void PlayVoidOutSFX() { func_800788CC(NA_SE_OC_ABYSS); } -static void Destroy(ActorEg* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorEg* this, GlobalContext* globalCtx) { } -static void Init(ActorEg* this, GlobalContext* globalCtx) -{ +static void Init(ActorEg* this, GlobalContext* globalCtx) { this->funcIndex = 0; } -static void func_809FFDC8(ActorEg* this, GlobalContext* globalCtx) -{ - if (!hasVoidedOut && (gSaveContext.timer_2_value < 1) && - Flags_GetSwitch(globalCtx, 0x36) && (kREG(0) == 0)) - { +static void func_809FFDC8(ActorEg* this, GlobalContext* globalCtx) { + if (!hasVoidedOut && (gSaveContext.timer_2_value < 1) && Flags_GetSwitch(globalCtx, 0x36) && (kREG(0) == 0)) { // Void the player out func_800C0C88(globalCtx); gSaveContext.respawn_flag = -2; @@ -71,21 +59,16 @@ static void func_809FFDC8(ActorEg* this, GlobalContext* globalCtx) } } -static void Update(ActorEg* this, GlobalContext* globalCtx) -{ +static void Update(ActorEg* this, GlobalContext* globalCtx) { s32 funcIndex = this->funcIndex; - if (((funcIndex < 0) || (0 < funcIndex)) || (funcTbl[funcIndex] == NULL)) - { + if (((funcIndex < 0) || (0 < funcIndex)) || (funcTbl[funcIndex] == NULL)) { // Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!" osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); - } - else - { + } else { funcTbl[funcIndex](this, globalCtx); } } -static void Draw(ActorEg* this, GlobalContext* globalCtx) -{ +static void Draw(ActorEg* this, GlobalContext* globalCtx) { } diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 1ec6fbca82..f6a52d1add 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -1,6 +1,6 @@ #include "z_en_eiyer.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnEiyer_Init(EnEiyer* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 8d34c6458b..e4fa180b6f 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -1,6 +1,6 @@ #include "z_en_elf.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000030 void EnElf_Init(EnElf* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 3a7f1e7222..c0532da414 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -1,6 +1,6 @@ #include "z_en_encount1.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x08000010 void EnEncount1_Init(EnEncount1* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index 854720464b..47a101ec5f 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -1,6 +1,6 @@ #include "z_en_encount2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnEncount2_Init(EnEncount2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 86428d40be..00bce1411e 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -1,6 +1,6 @@ #include "z_en_ex_item.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnExItem_Init(EnExItem* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index 03c2d7a21f..87c1502e53 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -1,6 +1,6 @@ #include "z_en_ex_ruppy.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnExRuppy_Init(EnExRuppy* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 328e1965af..2941915953 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -1,6 +1,6 @@ #include "z_en_fd.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000215 void EnFd_Init(EnFd* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index 7db6b42193..5c022a685c 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -1,6 +1,6 @@ #include "z_en_fd_fire.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnFdFire_Init(EnFdFire* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index dfc7aacdb9..550c91a21c 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -1,6 +1,6 @@ #include "z_en_fhg_fire.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnFhgFire_Init(EnFhgFire* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index e0756f70b9..8e7b5e145d 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -1,6 +1,6 @@ #include "z_en_fire_rock.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnFireRock_Init(EnFireRock* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 3b3f25c8e1..f5b4f92d5a 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -1,6 +1,6 @@ #include "z_en_firefly.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00005005 void EnFirefly_Init(EnFirefly* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 50a95ed186..481805a07f 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -1,6 +1,6 @@ #include "z_en_fish.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnFish_Init(EnFish* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 347ee0b999..ab119b44ab 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -1,6 +1,6 @@ #include "z_en_floormas.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000405 void EnFloormas_Init(EnFloormas* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 39e707d548..17049a7d48 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -1,6 +1,6 @@ #include "z_en_fr.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000019 void EnFr_Init(EnFr* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 458f42e9ff..32bc8091c3 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -1,6 +1,6 @@ #include "z_en_fu.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000019 void EnFu_Init(EnFu* this, GlobalContext* globalCtx); @@ -52,4 +52,3 @@ const ActorInit En_Fu_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Fu/func_80A1E26C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Fu/EnFu_Draw.s") - diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index 66b4b79a2a..2049ba88c9 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -1,6 +1,6 @@ #include "z_en_fw.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000215 void EnFw_Init(EnFw* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 763f67783f..6f04d0c957 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -1,6 +1,6 @@ #include "z_en_fz.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000415 void EnFz_Init(EnFz* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index e7034f656e..275c5d16c7 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -1,6 +1,6 @@ #include "z_en_g_switch.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnGSwitch_Init(EnGSwitch* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index 1f63663588..043109e436 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -1,6 +1,6 @@ #include "z_en_ganon_mant.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnGanonMant_Init(EnGanonMant* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c index c24f656ae1..e1705ecd52 100644 --- a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c +++ b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c @@ -2,18 +2,17 @@ * File: z_en_ganon_organ.c * Overlay: ovl_En_Ganon_Organ * Description: The organ that Ganondorf plays in the cutscene before the fight. Includes carpet and scenery as well. -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4]; } EnGanonOrgan; // size = 0x0150 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnGanonOrgan_Init(EnGanonOrgan* this, GlobalContext* globalCtx); @@ -21,8 +20,7 @@ void EnGanonOrgan_Destroy(EnGanonOrgan* this, GlobalContext* globalCtx); void EnGanonOrgan_Update(EnGanonOrgan* this, GlobalContext* globalCtx); void EnGanonOrgan_Draw(EnGanonOrgan* this, GlobalContext* globalCtx); -const ActorInit En_Ganon_Organ_InitVars = -{ +const ActorInit En_Ganon_Organ_InitVars = { ACTOR_EN_GANON_ORGAN, ACTORTYPE_BOSS, ROOM, @@ -35,46 +33,38 @@ const ActorInit En_Ganon_Organ_InitVars = (ActorFunc)EnGanonOrgan_Draw, }; -//temp local struct to represent ganondorf, remove when we can reference other overlays -typedef struct -{ +// temp local struct to represent ganondorf, remove when we can reference other overlays +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x5CC]; /* 0x0718 */ s16 organFadeTimer; /* 0x071A */ char unk_71A[0x2]; } BossGanon; // size = 0x071C -extern D_80A2CCA8; //remove when data is decompiled -extern D_80A2EAB0; //remove when data is decompiled +extern D_80A2CCA8; // remove when data is decompiled +extern D_80A2EAB0; // remove when data is decompiled -void EnGanonOrgan_Init(EnGanonOrgan* this, GlobalContext* globalCtx) -{ +void EnGanonOrgan_Init(EnGanonOrgan* this, GlobalContext* globalCtx) { this->actor.flags &= ~1; } -void EnGanonOrgan_Destroy(EnGanonOrgan* this, GlobalContext* globalCtx) -{ - +void EnGanonOrgan_Destroy(EnGanonOrgan* this, GlobalContext* globalCtx) { } -void EnGanonOrgan_Update(EnGanonOrgan* this, GlobalContext* globalCtx) -{ +void EnGanonOrgan_Update(EnGanonOrgan* this, GlobalContext* globalCtx) { BossGanon* dorf; osSyncPrintf("ORGAN MOVE 1\n"); - if (this->actor.params == 1) - { + if (this->actor.params == 1) { dorf = (BossGanon*)this->actor.attachedA; - if (dorf->organFadeTimer == 0) - { + if (dorf->organFadeTimer == 0) { Actor_Kill(&this->actor); } } osSyncPrintf("ORGAN MOVE 2\n"); } -Gfx* EnGanonOrgan_EmptyDList(GraphicsContext* gfxCtx) -{ +Gfx* EnGanonOrgan_EmptyDList(GraphicsContext* gfxCtx) { Gfx* displayList; displayList = Graph_Alloc(gfxCtx, sizeof(Gfx)); @@ -82,24 +72,25 @@ Gfx* EnGanonOrgan_EmptyDList(GraphicsContext* gfxCtx) return displayList; } -Gfx* func_80A280BC(GraphicsContext* gfxCtx, BossGanon* dorf) -{ +Gfx* func_80A280BC(GraphicsContext* gfxCtx, BossGanon* dorf) { Gfx* displayList; Gfx* displayListHead; displayList = Graph_Alloc(gfxCtx, 4 * sizeof(Gfx)); displayListHead = displayList; gDPPipeSync(displayListHead++); - do { if (1) { } } while(0); + do { + if (1) {} + } while (0); gDPSetEnvColor(displayListHead++, 0x19, 0x14, 0x00, dorf->organFadeTimer); - gDPSetRenderMode(displayListHead++, AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | - CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2); + gDPSetRenderMode(displayListHead++, + AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | G_RM_FOG_SHADE_A, + G_RM_AA_ZB_XLU_SURF2); gSPEndDisplayList(displayListHead); return displayList; } -Gfx* func_80A28148(GraphicsContext* gfxCtx, BossGanon* dorf) -{ +Gfx* func_80A28148(GraphicsContext* gfxCtx, BossGanon* dorf) { Gfx* displayList; Gfx* displayListHead; @@ -107,16 +98,18 @@ Gfx* func_80A28148(GraphicsContext* gfxCtx, BossGanon* dorf) displayListHead = displayList; gDPPipeSync(displayListHead++); - do { if (1) { } } while(0); + do { + if (1) {} + } while (0); gDPSetEnvColor(displayListHead++, 0x00, 0x00, 0x00, dorf->organFadeTimer); - gDPSetRenderMode(displayListHead++, AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | - CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2); + gDPSetRenderMode(displayListHead++, + AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | G_RM_FOG_SHADE_A, + G_RM_AA_ZB_XLU_SURF2); gSPEndDisplayList(displayListHead); return displayList; } -void EnGanonOrgan_Draw(EnGanonOrgan* this, GlobalContext* globalCtx) -{ +void EnGanonOrgan_Draw(EnGanonOrgan* this, GlobalContext* globalCtx) { BossGanon* dorf; u32 pad; GraphicsContext* gfxCtx; @@ -127,19 +120,16 @@ void EnGanonOrgan_Draw(EnGanonOrgan* this, GlobalContext* globalCtx) func_800C6AC4(&gfxArr, globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 205); osSyncPrintf("ORGAN DRAW 1\n"); func_80093D18(globalCtx->state.gfxCtx); - if ((this->actor.params == 1) && (dorf->organFadeTimer != 0xff)) - { + if ((this->actor.params == 1) && (dorf->organFadeTimer != 0xff)) { gSPSegment(gfxCtx->polyOpa.p++, 0x08, func_80A280BC(globalCtx->state.gfxCtx, dorf)); gSPSegment(gfxCtx->polyOpa.p++, 0x09, func_80A28148(globalCtx->state.gfxCtx, dorf)); - } - else - { + } else { gSPSegment(gfxCtx->polyOpa.p++, 0x08, EnGanonOrgan_EmptyDList(globalCtx->state.gfxCtx)); gSPSegment(gfxCtx->polyOpa.p++, 0x09, EnGanonOrgan_EmptyDList(globalCtx->state.gfxCtx)); } Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_NEW); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 221), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyOpa.p++, &D_80A2CCA8); gSPDisplayList(gfxCtx->polyOpa.p++, &D_80A2EAB0); diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 72cda6cf94..49acb4af07 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -1,6 +1,6 @@ #include "z_en_gb.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnGb_Init(EnGb* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 15c97f5e49..be15155017 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -1,6 +1,6 @@ #include "z_en_ge1.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnGe1_Init(EnGe1* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 86950c46b2..ff14a9143e 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -1,6 +1,6 @@ #include "z_en_ge2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnGe2_Init(EnGe2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 740a9f535c..40b8f59baf 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -1,6 +1,6 @@ #include "z_en_ge3.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnGe3_Init(EnGe3* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 97de2d617d..b2defe4f67 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -1,6 +1,6 @@ #include "z_en_geldb.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnGeldB_Init(EnGeldB* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index cde8f017b0..9f7cdc9c3f 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -1,6 +1,6 @@ #include "z_en_girla.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnGirlA_Init(EnGirlA* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 424c8c81ec..dd3350d398 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -1,6 +1,6 @@ #include "z_en_gm.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnGm_Init(EnGm* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 4ef81ccb8d..5f95e74065 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -1,6 +1,6 @@ #include "z_en_go.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000039 void EnGo_Init(EnGo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index e7273e162f..1e7806536b 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -1,6 +1,6 @@ #include "z_en_go2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000039 void EnGo2_Init(EnGo2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index a7195a2257..9da1accf45 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -1,6 +1,6 @@ #include "z_en_goma.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void EnGoma_Init(EnGoma* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 5134ac716f..acf9dfaa94 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -1,6 +1,6 @@ #include "z_en_goroiwa.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnGoroiwa_Init(EnGoroiwa* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 44f0b60af8..fd8eb03de3 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -1,6 +1,6 @@ #include "z_en_gs.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000009 void EnGs_Init(EnGs* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 59588610bf..8319cc856d 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -1,6 +1,6 @@ #include "z_en_guest.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnGuest_Init(EnGuest* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/src/overlays/actors/ovl_En_Hata/z_en_hata.c index 8191104e12..28db90caf4 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -1,6 +1,6 @@ #include "z_en_hata.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnHata_Init(EnHata* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 5799f22868..c91f89d340 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -1,6 +1,6 @@ #include "z_en_heishi1.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnHeishi1_Init(EnHeishi1* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index a5c256692a..27320ec955 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -1,6 +1,6 @@ #include "z_en_heishi2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnHeishi2_Init(EnHeishi2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index f095edde2c..d421db8d46 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -1,6 +1,6 @@ #include "z_en_heishi3.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnHeishi3_Init(EnHeishi3* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 3a9825bc8a..732c90cee3 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -1,6 +1,6 @@ #include "z_en_heishi4.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnHeishi4_Init(EnHeishi4* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 2531f4c74a..c168d295e0 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -1,6 +1,6 @@ #include "z_en_hintnuts.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnHintnuts_Init(EnHintnuts* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index 867f4f8ec4..f1082366cb 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -1,6 +1,6 @@ #include "z_en_holl.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnHoll_Init(EnHoll* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index 0e3230dc45..718c55f4a0 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -1,6 +1,6 @@ #include "z_en_honotrap.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnHonotrap_Init(EnHonotrap* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 9ff037fe2f..de015bcf25 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -1,6 +1,6 @@ #include "z_en_horse.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnHorse_Init(EnHorse* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 5516523617..6426ac04ae 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -1,6 +1,6 @@ #include "z_en_horse_game_check.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnHorseGameCheck_Init(EnHorseGameCheck* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index a6ebaa483d..e4b7f9425e 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -1,6 +1,6 @@ #include "z_en_horse_ganon.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnHorseGanon_Init(EnHorseGanon* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 1daafb990a..21ee375020 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -1,6 +1,6 @@ #include "z_en_horse_link_child.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void EnHorseLinkChild_Init(EnHorseLinkChild* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index cc9a5a4a2d..f329bb0f5c 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -1,6 +1,6 @@ #include "z_en_horse_normal.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnHorseNormal_Init(EnHorseNormal* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index 03ac2db446..8c077de883 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -1,6 +1,6 @@ #include "z_en_horse_zelda.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnHorseZelda_Init(EnHorseZelda* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index bfecaf8fd5..87f337d384 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -1,6 +1,6 @@ #include "z_en_hs.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnHs_Init(EnHs* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index 374c3fb178..199528d6a3 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -1,6 +1,6 @@ #include "z_en_hs2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnHs2_Init(EnHs2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 5ee36de620..4ea8001385 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -1,6 +1,6 @@ #include "z_en_hy.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnHy_Init(EnHy* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index 496feb0150..adc0fc065e 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -1,6 +1,6 @@ #include "z_en_ice_hono.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnIceHono_Init(EnIceHono* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index a06da30ed8..b1096c3b6b 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -1,6 +1,6 @@ #include "z_en_ik.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnIk_Init(EnIk* this, GlobalContext* globalCtx); @@ -164,4 +164,3 @@ const ActorInit En_Ik_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ik/func_80A781CC.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ik/EnIk_Init.s") - diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index bacfc6ea32..f4b2c102bb 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -1,6 +1,6 @@ #include "z_en_in.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnIn_Init(EnIn* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index e351674a17..4b2d4252f6 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -1,6 +1,6 @@ #include "z_en_insect.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnInsect_Init(EnInsect* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 0d5ce67505..a322390463 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -1,6 +1,6 @@ #include "z_en_ishi.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00800000 void EnIshi_Init(EnIshi* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_It/z_en_it.c b/src/overlays/actors/ovl_En_It/z_en_it.c index 60b2614512..e96f5b1f50 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -2,16 +2,15 @@ * File: z_en_it.c * Overlay: ovl_En_It * Description: Dampe's Minigame digging spot hitboxes -*/ + */ #include #include #include -typedef struct -{ - /* 0x0000 */ Actor actor; - /* 0x014C */ u32 unk_14C; +typedef struct { + /* 0x0000 */ Actor actor; + /* 0x014C */ u32 unk_14C; /* 0x0150 */ ColliderCylinderMain cylinderCollider; } ActorIt; // size = 0x019C @@ -22,53 +21,23 @@ static void Init(ActorIt* this, GlobalContext* globalCtx); static void Destroy(ActorIt* this, GlobalContext* globalCtx); static void Update(ActorIt* this, GlobalContext* globalCtx); -static ColliderCylinderInit cylinderInitData = -{ - 0x0A, 0x00, 0x00, 0x05, - 0x10, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00000000, - 0x00, 0x00, 0x00, 0x00, - 0x00000000, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, - 0x0028, - 0x000A, - 0x00000000000000000000, +static ColliderCylinderInit cylinderInitData = { + 0x0A, 0x00, 0x00, 0x05, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00000000, 0x00, 0x00, + 0x00, 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000, 0x0001, 0x0000, 0x0028, 0x000A, 0x0000, }; -static u8 damageTblInitData[] = -{ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x00, - 0x00, - 0x00 +static u8 damageTblInitData[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, }; -const ActorInit En_It_InitVars = -{ - ACTOR_EN_IT, - ACTORTYPE_PROP, - ROOM, - FLAGS, - OBJECT_GAMEPLAY_KEEP, - sizeof(ActorIt), - (ActorFunc)Init, - (ActorFunc)Destroy, - (ActorFunc)Update, +const ActorInit En_It_InitVars = { + ACTOR_EN_IT, ACTORTYPE_PROP, ROOM, + FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ActorIt), + (ActorFunc)Init, (ActorFunc)Destroy, (ActorFunc)Update, (ActorFunc)NULL, }; -static void Init(ActorIt* this, GlobalContext* globalCtx) -{ +static void Init(ActorIt* this, GlobalContext* globalCtx) { ActorIt* it = this; it->actor.params = 0x0D05; @@ -77,15 +46,13 @@ static void Init(ActorIt* this, GlobalContext* globalCtx) func_80061EFC(&it->actor.sub_98.damageChart, 0, &damageTblInitData); // Init Damage Chart } -static void Destroy(ActorIt* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorIt* this, GlobalContext* globalCtx) { ActorIt* it = this; ActorCollider_FreeCylinder(globalCtx, &it->cylinderCollider); } -static void Update(ActorIt* this, GlobalContext* globalCtx) -{ +static void Update(ActorIt* this, GlobalContext* globalCtx) { s32 pad; ActorIt* it = this; diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/src/overlays/actors/ovl_En_Jj/z_en_jj.c index c683a7138d..24ee963f22 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -1,6 +1,6 @@ #include "z_en_jj.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnJj_Init(EnJj* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index 024b18260d..469d56004e 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -1,6 +1,6 @@ #include "z_en_js.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnJs_Init(EnJs* this, GlobalContext* globalCtx); @@ -54,6 +54,3 @@ const ActorInit En_Js_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Js/func_80A895F4.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Js/EnJs_Draw.s") - - - diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index f84d6e45a9..6c2e9abf2c 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -1,6 +1,6 @@ #include "z_en_jsjutan.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnJsjutan_Init(EnJsjutan* this, GlobalContext* globalCtx); @@ -34,4 +34,3 @@ const ActorInit En_Jsjutan_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jsjutan/EnJsjutan_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jsjutan/EnJsjutan_Draw.s") - diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index e9f9f540ca..99d3201ba7 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -1,6 +1,6 @@ #include "z_en_kakasi.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000009 void EnKakasi_Init(EnKakasi* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 4305db7488..9096748d7c 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -1,6 +1,6 @@ #include "z_en_kakasi2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x0A000031 void EnKakasi2_Init(EnKakasi2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index 436e79806c..6c73d2aa8d 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -1,6 +1,6 @@ #include "z_en_kakasi3.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000009 void EnKakasi3_Init(EnKakasi3* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 315958ee33..1a7e805b5c 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -1,6 +1,6 @@ #include "z_en_kanban.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnKanban_Init(EnKanban* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 46057f2f48..5b6e5ebb27 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -1,6 +1,6 @@ #include "z_en_karebaba.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnKarebaba_Init(EnKarebaba* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index db1f932ba6..9c4c324212 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -1,6 +1,6 @@ #include "z_en_ko.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnKo_Init(EnKo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index c39532a647..0c142c954b 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -1,6 +1,6 @@ #include "z_en_kusa.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00800010 void EnKusa_Init(EnKusa* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 5e518d987f..1050aa7c32 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -1,6 +1,6 @@ #include "z_en_kz.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnKz_Init(EnKz* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c index 42558635ff..ac102d44a3 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -1,6 +1,6 @@ #include "z_en_light.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnLight_Init(EnLight* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index 9b472b44d7..237a145155 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -2,11 +2,11 @@ * File: z_en_lightbox.c * Overlay: ovl_En_Lightbox * Description: -*/ + */ #include "z_en_lightbox.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx); @@ -14,8 +14,7 @@ static void EnLightbox_Destroy(EnLightbox* this, GlobalContext* globalCtx); static void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx); static void EnLightbox_Draw(EnLightbox* this, GlobalContext* globalCtx); -const ActorInit En_Lightbox_InitVars = -{ +const ActorInit En_Lightbox_InitVars = { ACTOR_EN_LIGHTBOX, ACTORTYPE_PROP, ROOM, @@ -31,13 +30,12 @@ const ActorInit En_Lightbox_InitVars = extern u32 D_06000B70; extern u32 D_06001F10; -static void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx) -{ +static void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx) { u32 local_c = 0; Actor* thisx = &this->dyna.actor; s32 pad[4]; - switch(thisx->params){ + switch (thisx->params) { case 0: Actor_SetScale(thisx, 0.025f); break; @@ -65,56 +63,41 @@ static void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx) this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); } -static void EnLightbox_Destroy(EnLightbox* this, GlobalContext* globalCtx) -{ +static void EnLightbox_Destroy(EnLightbox* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx) -{ +static void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (this->dyna.unk_162 != 0) - { - if (func_8002F5A0(thisx, globalCtx)) - { + if (this->dyna.unk_162 != 0) { + if (func_8002F5A0(thisx, globalCtx)) { this->dyna.unk_162 = 0; } - } - else - { - if (func_8002F410(thisx, globalCtx)) - { + } else { + if (func_8002F410(thisx, globalCtx)) { this->dyna.unk_162++; - } - else - { - if (thisx->speedXZ) - { - if (thisx->bgCheckFlags & 8) - { + } else { + if (thisx->speedXZ) { + if (thisx->bgCheckFlags & 8) { thisx->posRot.rot.y = (thisx->posRot.rot.y + thisx->unk_7E) - thisx->posRot.rot.y; - Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->unk_E4, 4, &D_801333E0, &D_801333E0, + &D_801333E8); thisx->speedXZ *= 0.7f; thisx->bgCheckFlags &= ~0x8; } } - if ((thisx->bgCheckFlags & 1) == 0) - { + if ((thisx->bgCheckFlags & 1) == 0) { Math_ApproxF(&thisx->speedXZ, 0, IREG(57) / 100.0f); - } - else - { + } else { Math_ApproxF(&thisx->speedXZ, 0, IREG(58) / 100.0f); - if ((thisx->bgCheckFlags & 2) && (thisx->velocity.y < IREG(59) / 100.0f)) - { - Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + if ((thisx->bgCheckFlags & 2) && (thisx->velocity.y < IREG(59) / 100.0f)) { + Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->unk_E4, 4, &D_801333E0, &D_801333E0, + &D_801333E8); thisx->velocity.y *= IREG(60) / 100.0f; thisx->bgCheckFlags &= ~0x1; - } - else - { + } else { func_8002F580(thisx, globalCtx); } } @@ -125,7 +108,6 @@ static void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx) thisx->posRot2.pos = thisx->posRot.pos; } -static void EnLightbox_Draw(EnLightbox* this, GlobalContext* globalCtx) -{ +static void EnLightbox_Draw(EnLightbox* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_06000B70); } diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c index 55ecd36d85..5d4affcf75 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c @@ -2,86 +2,61 @@ * File: z_en_m_fire1.c * Overlay: ovl_En_M_Fire1 * Description: The attack from a Deku Nut. Spawned by ovl_En_Arrow. -*/ + */ #include #include #include -typedef struct -{ - /* 0x0000 */ Actor actor; +typedef struct { + /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinderMain capsule; - /* 0x0198 */ f32 unk_0198; + /* 0x0198 */ f32 unk_0198; } ActorMFire; // size = 0x019C -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void Init(ActorMFire* this, GlobalContext* globalCtx); static void Destroy(ActorMFire* this, GlobalContext* globalCtx); static void Update(ActorMFire* this, GlobalContext* globalCtx); -const ActorInit En_M_Fire1_InitVars = -{ - ACTOR_EN_M_FIRE1, - ACTORTYPE_MISC, - ROOM, - FLAGS, - OBJECT_GAMEPLAY_KEEP, - sizeof(ActorMFire), - (ActorFunc)Init, - (ActorFunc)Destroy, - (ActorFunc)Update, - NULL +const ActorInit En_M_Fire1_InitVars = { + ACTOR_EN_M_FIRE1, ACTORTYPE_MISC, ROOM, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ActorMFire), (ActorFunc)Init, + (ActorFunc)Destroy, (ActorFunc)Update, NULL, }; -static ColliderCylinderInit cylinderInitData = -{ - 0x0A, 0x09, 0x00, 0x00, - 0x08, 0x01, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, - 0x00000001, - 0x00, 0x00, 0x00, 0x00, - 0xFFCFFFFF, - 0x00, 0x00, 0x00, 0x00, - 0x19, 0x00, 0x00, 0x00, - 0x00C8, - 0x00C8, - 0x00000000000000000000, +static ColliderCylinderInit cylinderInitData = { + 0x0A, 0x09, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00000001, 0x00, 0x00, + 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x19, 0x0000, 0x0000, 0x0000, 0x00C8, 0x00C8, 0x0000, }; -static void Init(ActorMFire* this, GlobalContext* globalCtx) -{ +static void Init(ActorMFire* this, GlobalContext* globalCtx) { s32 pad; ActorMFire* thisLocal; thisLocal = this; - if (this->actor.params < 0) + if (this->actor.params < 0) { Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &thisLocal->actor, ACTORTYPE_ITEMACTION); + } ActorCollider_AllocCylinder(globalCtx, &thisLocal->capsule); ActorCollider_InitCylinder(globalCtx, &thisLocal->capsule, &thisLocal->actor, &cylinderInitData); } -static void Destroy(ActorMFire* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorMFire* this, GlobalContext* globalCtx) { ColliderCylinderMain* capsule = &this->capsule; ActorCollider_FreeCylinder(globalCtx, capsule); } -static void Update(ActorMFire* this, GlobalContext* globalCtx) -{ +static void Update(ActorMFire* this, GlobalContext* globalCtx) { s32 pad; ActorMFire* thisLocal = this; - if (Math_ApproxF(&thisLocal->unk_0198, 1.0, 0.2)) - { + if (Math_ApproxF(&thisLocal->unk_0198, 1.0, 0.2)) { Actor_Kill(&this->actor); - } - else - { + } else { ActorCollider_Cylinder_Update(&thisLocal->actor, &thisLocal->capsule); Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &thisLocal->capsule); } diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index c1f2603d52..6041bb2ba3 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -1,6 +1,6 @@ #include "z_en_m_thunder.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnMThunder_Init(EnMThunder* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index a29f5688ed..783150f3b7 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -1,6 +1,6 @@ #include "z_en_ma1.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000039 void EnMa1_Init(EnMa1* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index dd27fe06f1..bb821761a2 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -1,6 +1,6 @@ #include "z_en_ma2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000039 void EnMa2_Init(EnMa2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index 927a914fd0..362e11453a 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -1,6 +1,6 @@ #include "z_en_ma3.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000039 void EnMa3_Init(EnMa3* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 483dcef84f..8398388e08 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -1,6 +1,6 @@ #include "z_en_mag.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnMag_Init(EnMag* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 634f63f97e..b368d395a6 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -1,6 +1,6 @@ #include "z_en_mb.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnMb_Init(EnMb* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index b72b739fad..8ed5e98048 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -1,6 +1,6 @@ #include "z_en_md.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000019 void EnMd_Init(EnMd* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index da0c4c0b79..94225f36bb 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -1,6 +1,6 @@ #include "z_en_mk.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnMk_Init(EnMk* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 11dd6370a6..1491d4d2f5 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -1,6 +1,6 @@ #include "z_en_mm.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnMm_Init(EnMm* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index 50ad29a779..9404ef93c6 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -1,6 +1,6 @@ #include "z_en_mm2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnMm2_Init(EnMm2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ms/dlists.c b/src/overlays/actors/ovl_En_Ms/dlists.c index 356c05d216..d3229c2483 100644 --- a/src/overlays/actors/ovl_En_Ms/dlists.c +++ b/src/overlays/actors/ovl_En_Ms/dlists.c @@ -1,3 +1 @@ #include "dlists.h" - - diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 950bfea3d9..b8c98d0557 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -2,13 +2,12 @@ * File: z_en_ms.c * Overlay: ovl_En_Ms * Description: Magic Bean Salesman -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ UNK_PTR unkSkelAnimeStruct; @@ -20,7 +19,7 @@ typedef struct /* 0x024C */ s16 activeTimer; } EnMs; // size = 0x0250 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 static void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx); @@ -33,8 +32,7 @@ static void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx); static void EnMs_Update(EnMs* this, GlobalContext* globalCtx); static void EnMs_Draw(EnMs* this, GlobalContext* globalCtx); -const ActorInit En_Ms_InitVars = -{ +const ActorInit En_Ms_InitVars = { ACTOR_EN_MS, ACTORTYPE_NPC, ROOM, @@ -47,43 +45,31 @@ const ActorInit En_Ms_InitVars = (ActorFunc)EnMs_Draw, }; -static s32 unk_col_80AB0320[] = -{ -0x0A000939, 0x01000000, -0x00000000, 0x00000000, -0x00000000, 0xFFCFFFFF, -0x00000000, 0x00010100, -0x00160025, 0x00000000, -0x00000000 +static s32 unk_col_80AB0320[] = { + 0x0A000939, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0xFFCFFFFF, + 0x00000000, 0x00010100, 0x00160025, 0x00000000, 0x00000000, }; -static s16 prices[] = -{ - 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 +static s16 prices[] = { + 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, }; -static u16 offerTextIds[] = -{ - 0x405E, 0x405F, 0x4060, 0x4061, 0x4062, - 0x4063, 0x4064, 0x4065, 0x4066, 0x4067 +static u16 offerTextIds[] = { + 0x405E, 0x405F, 0x4060, 0x4061, 0x4062, 0x4063, 0x4064, 0x4065, 0x4066, 0x4067, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 500, ICHAIN_STOP) + ICHAIN_F32(unk_4C, 500, ICHAIN_STOP), }; extern D_060005EC; extern D_06003DC0; -static void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx) -{ +static void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx) { this->actor.textId = func_8006C360(globalCtx, 0x1B); - if (this->actor.textId == 0) - { - if (BEANS_BOUGHT >= 10) - { + if (this->actor.textId == 0) { + if (BEANS_BOUGHT >= 10) { this->actor.textId = 0x406B; return; } @@ -91,19 +77,17 @@ static void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx) } } -static void EnMs_Init(EnMs* this, GlobalContext* globalCtx) -{ +static void EnMs_Init(EnMs* this, GlobalContext* globalCtx) { s32 pad1; s32 pad2; - if (LINK_AGE_IN_YEARS != YEARS_CHILD) - { + if (LINK_AGE_IN_YEARS != YEARS_CHILD) { Actor_Kill(&this->actor); return; } Actor_ProcessInitChain(&this->actor, initChain); - func_800A46F8(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, - &this->unkSkelAnimeStruct, &this->unk_1C6, 9); //skelanime_mtx_init + func_800A46F8(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, &this->unkSkelAnimeStruct, &this->unk_1C6, + 9); // skelanime_mtx_init ActorCollider_AllocCylinder(globalCtx, &this->collider); func_8005C450(globalCtx, &this->collider, this, &unk_col_80AB0320); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); @@ -119,70 +103,57 @@ static void EnMs_Init(EnMs* this, GlobalContext* globalCtx) this->actionFunc = EnMs_Wait; } -static void EnMs_Destroy(EnMs* this, GlobalContext* globalCtx) -{ +static void EnMs_Destroy(EnMs* this, GlobalContext* globalCtx) { ColliderCylinderMain* collider = &this->collider; ActorCollider_FreeCylinder(globalCtx, collider); } -static void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) -{ +static void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) { s16 unkAngle; unkAngle = this->actor.rotTowardsLinkY - this->actor.shape.rot.y; EnMs_SetOfferText(&this->actor, globalCtx); - if (func_8002F194(&this->actor, globalCtx) != 0) //if talk is initiated - { + if (func_8002F194(&this->actor, globalCtx) != 0) { // if talk is initiated this->actionFunc = &EnMs_Talk; return; } - if ((this->actor.xzDistanceFromLink < 90.0f) && (ABS(unkAngle) < 0x2000)) //talk range - { + if ((this->actor.xzDistanceFromLink < 90.0f) && (ABS(unkAngle) < 0x2000)) { // talk range func_8002F2CC(&this->actor, globalCtx, 90.0f); } } -static void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) -{ +static void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) { u8 dialogState; dialogState = func_8010BDBC(&globalCtx->msgCtx); - if (dialogState != 4) - { - if ((dialogState == 6) && (func_80106BC8(globalCtx) != 0)) //advanced final textbox - { + if (dialogState != 4) { + if ((dialogState == 6) && (func_80106BC8(globalCtx) != 0)) { // advanced final textbox this->actionFunc = &EnMs_Wait; } - } - else - { - if(func_80106BC8(globalCtx) != 0) - { - switch (globalCtx->msgCtx.choiceIndex) - { - case 0: //yes - if (gSaveContext.rupees < prices[BEANS_BOUGHT]) - { - func_8010B720(globalCtx, 0x4069); //not enough rupees text + } else { + if (func_80106BC8(globalCtx) != 0) { + switch (globalCtx->msgCtx.choiceIndex) { + case 0: // yes + if (gSaveContext.rupees < prices[BEANS_BOUGHT]) { + func_8010B720(globalCtx, 0x4069); // not enough rupees text return; } func_8002F434(&this->actor, globalCtx, GI_BEAN, 90.0f, 10.0f); this->actionFunc = &EnMs_Sell; return; - case 1: //no + case 1: // no func_8010B720(globalCtx, 0x4068); - default: return; + default: + return; } } } } -static void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) -{ - if (func_8002F410(&this->actor, globalCtx) != 0) //if attached is set - { - Rupees_ChangeBy(-prices[BEANS_BOUGHT]); //decrease ruppees +static void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) { + if (func_8002F410(&this->actor, globalCtx) != 0) { // if attached is set + Rupees_ChangeBy(-prices[BEANS_BOUGHT]); // decrease ruppees this->actor.attachedA = NULL; this->actionFunc = &EnMs_TalkAfterBuy; return; @@ -190,18 +161,15 @@ static void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) func_8002F434(&this->actor, globalCtx, GI_BEAN, 90.0f, 10.0f); } -static void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx) -{ - //if dialog state is 6 and player responded to textbox - if ((func_8010BDBC(&globalCtx->msgCtx)) == 6 && (func_80106BC8(globalCtx) != 0)) - { +static void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx) { + // if dialog state is 6 and player responded to textbox + if ((func_8010BDBC(&globalCtx->msgCtx)) == 6 && (func_80106BC8(globalCtx) != 0)) { func_8010B720(globalCtx, 0x406C); this->actionFunc = &EnMs_Talk; } } -static void EnMs_Update(EnMs* this, GlobalContext* globalCtx) -{ +static void EnMs_Update(EnMs* this, GlobalContext* globalCtx) { s32 pad1; s32 pad2; @@ -212,8 +180,7 @@ static void EnMs_Update(EnMs* this, GlobalContext* globalCtx) SkelAnime_FrameUpdateMatrix(&this->skelAnime); this->actionFunc(this, globalCtx); - if (gSaveContext.entrance_index == 0x157 && gSaveContext.scene_setup_index == 8) //ride carpet if in credits - { + if (gSaveContext.entrance_index == 0x157 && gSaveContext.scene_setup_index == 8) { // ride carpet if in credits Actor_MoveForward(&this->actor); osSyncPrintf("OOOHHHHHH %f\n", this->actor.velocity.y); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); @@ -222,9 +189,8 @@ static void EnMs_Update(EnMs* this, GlobalContext* globalCtx) Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); } -void EnMs_Draw(EnMs* this, GlobalContext* globalCtx) -{ +void EnMs_Draw(EnMs* this, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); - func_800A1AC8(globalCtx, this->skelAnime.limbIndex, this->skelAnime.actorDrawTbl, - this->skelAnime.dListCount, 0, 0, &this->actor); + func_800A1AC8(globalCtx, this->skelAnime.limbIndex, this->skelAnime.actorDrawTbl, this->skelAnime.dListCount, 0, 0, + &this->actor); } diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c index 003f40e92b..570f85511d 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -1,6 +1,6 @@ #include "z_en_mu.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnMu_Init(EnMu* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 9fb939c914..49b85a5c6e 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -1,6 +1,6 @@ #include "z_en_nb.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnNb_Init(EnNb* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index bae1f92168..5b3ef46bbf 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -1,6 +1,6 @@ #include "z_en_niw.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00800010 void EnNiw_Init(EnNiw* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 6c591bf4a8..5ba7d1f2ab 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -1,6 +1,6 @@ #include "z_en_niw_girl.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnNiwGirl_Init(EnNiwGirl* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 0cf4c9951c..2a240d5f0e 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -1,6 +1,6 @@ #include "z_en_niw_lady.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnNiwLady_Init(EnNiwLady* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 8145e5e581..373ea40116 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -2,7 +2,7 @@ * File: z_en_nutsball.c * Overlay: ovl_En_Nutsball * Description: The projectile fired by deku scrubs and octoroks. -*/ + */ #include "z_en_nutsball.h" @@ -16,8 +16,7 @@ static void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx); static void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx); static void EnNutsball_Draw(EnNutsball* this, GlobalContext* globalCtx); -const ActorInit En_Nutsball_InitVars = -{ +const ActorInit En_Nutsball_InitVars = { ACTOR_EN_NUTSBALL, ACTORTYPE_PROP, ROOM, @@ -30,27 +29,16 @@ const ActorInit En_Nutsball_InitVars = (ActorFunc)NULL, }; -static ColliderCylinderInit cylinderInitData = -{ - 0xa, 0x11, 0x9, 0x39, - 0x20, 0x1, { 0x0, 0x0 }, - 0x0, { 0x0, 0x0, 0x0 }, - 0xffcfffff, - 0x0, 0x8, { 0x0, 0x0} , - 0xffcfffff, - { 0x0, 0x0, 0x0, 0x0 }, - 0x11, 0x1, 0x1, 0x0, - 0xd, - 0xd, - 0x0, - { 0x0, 0x0, 0x0 } +static ColliderCylinderInit cylinderInitData = { + 0x0A, 0x11, 0x09, 0x39, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFFCFFFFF, 0x00, 0x08, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x01, 0x01, 0x00, 0x000D, 0x000D, 0x0000, 0x0000, 0x0000, 0x0000, }; static s16 objectTbl[] = { OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK }; static u32 dListTbl[] = { 0x06002028, 0x060012F0, 0x06004008, 0x06002410, 0x06001890 }; -static void EnNutsball_Init(EnNutsball* this, GlobalContext* globalCtx) -{ +static void EnNutsball_Init(EnNutsball* this, GlobalContext* globalCtx) { s32 pad[2]; ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawFunc_Circle, 13.0f); @@ -58,22 +46,20 @@ static void EnNutsball_Init(EnNutsball* this, GlobalContext* globalCtx) ActorCollider_InitCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectTbl[this->actor.params]); - if (this->objBankIndex < 0) + if (this->objBankIndex < 0) { Actor_Kill(&this->actor); - else + } else { this->actionFunc = (ActorFunc)func_80ABBB34; + } } -static void EnNutsball_Destroy(EnNutsball* this, GlobalContext* globalCtx) -{ +static void EnNutsball_Destroy(EnNutsball* this, GlobalContext* globalCtx) { ColliderCylinderMain* collider = &this->collider; ActorCollider_FreeCylinder(globalCtx, collider); } -static void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx) -{ - if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) - { +static void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx) { + if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { this->actor.objBankIndex = this->objBankIndex; this->actor.draw = (ActorFunc)EnNutsball_Draw; this->actor.shape.rot.y = 0; @@ -83,31 +69,26 @@ static void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx) } } -static void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) -{ +static void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) { Player* player = PLAYER; Vec3s sp4C; Vec3f sp40; this->timer--; - if (this->timer == 0) + if (this->timer == 0) { this->actor.gravity = -1; + } this->actor.initPosRot.rot.z += 0x2AA8; - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || - (this->collider.base.colliderFlags & 2) || (this->collider.base.collideFlags & 2) || - (this->collider.base.maskA & 2)) - { + if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.colliderFlags & 2) || + (this->collider.base.collideFlags & 2) || (this->collider.base.maskA & 2)) { // Checking if the player is using a shield that reflects projectiles // And if so, reflects the projectile on impact - if ((player->currentShield == 1) || ((player->currentShield == 2) && LINK_IS_ADULT)) - { - if ((this->collider.base.colliderFlags & 2) && - (this->collider.base.colliderFlags & 0x10) && - (this->collider.base.colliderFlags & 4)) - { + if ((player->currentShield == 1) || ((player->currentShield == 2) && LINK_IS_ADULT)) { + if ((this->collider.base.colliderFlags & 2) && (this->collider.base.colliderFlags & 0x10) && + (this->collider.base.colliderFlags & 4)) { this->collider.base.colliderFlags &= ~0x16; this->collider.base.colliderFlags |= 0x08; @@ -126,22 +107,19 @@ static void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) func_800297A4(globalCtx, &sp40, 0x40C00000, 0, 7, 3, 15, -1, 10, 0); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EN_OCTAROCK_ROCK); Actor_Kill(&this->actor); - } - else - { - if (this->timer == -300) + } else { + if (this->timer == -300) { Actor_Kill(&this->actor); + } } } -static void EnNutsball_Update(EnNutsball* this, GlobalContext* globalCtx) -{ +static void EnNutsball_Update(EnNutsball* this, GlobalContext* globalCtx) { EnNutsball* nutsball = this; Player* player = PLAYER; s32 pad; - if (!(player->stateFlags1 & 0x300000C0) || (nutsball->actionFunc == (ActorFunc)func_80ABBB34)) - { + if (!(player->stateFlags1 & 0x300000C0) || (nutsball->actionFunc == (ActorFunc)func_80ABBB34)) { nutsball->actionFunc(nutsball, globalCtx); Actor_MoveForward(&nutsball->actor); @@ -156,8 +134,7 @@ static void EnNutsball_Update(EnNutsball* this, GlobalContext* globalCtx) } } -static void EnNutsball_Draw(EnNutsball* this, GlobalContext* globalCtx) -{ +static void EnNutsball_Draw(EnNutsball* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* gfxArr[5]; @@ -166,7 +143,8 @@ static void EnNutsball_Draw(EnNutsball* this, GlobalContext* globalCtx) func_80093D18(globalCtx->state.gfxCtx); Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY); Matrix_RotateZ(this->actor.initPosRot.rot.z * 9.58738e-05f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(gfxCtx->polyOpa.p++, dListTbl[this->actor.params]); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_nutsball.c", 337); diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index e6867b4f30..e2a0b80da0 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -1,6 +1,6 @@ #include "z_en_nwc.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnNwc_Init(EnNwc* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 62ff461199..a605022c37 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -1,6 +1,6 @@ #include "z_en_ny.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnNy_Init(EnNy* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c index 4d35e0a859..9d4b366928 100644 --- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c +++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c @@ -2,20 +2,19 @@ * File: z_en_oe2.c * Overlay: ovl_En_Oe2 * Description: Blue Navi Target. Probably unused since NPC's are blue and they do not use this actor. -*/ + */ #include #include #include -typedef struct -{ - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x44]; - /* 0x0190 */ ActorFunc updateFunc; +typedef struct { + /* 0x0000 */ Actor actor; + /* 0x014C */ char unk_14C[0x44]; + /* 0x0190 */ ActorFunc updateFunc; } ActorEnOE2; // size = 0x0194 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 static void func_80ABE6A0(ActorEnOE2* this, ActorFunc func); @@ -25,46 +24,29 @@ static void func_80ABE6DC(ActorEnOE2* this, GlobalContext* globalCtx); static void Update(ActorEnOE2* this, GlobalContext* globalCtx); static void Draw(ActorEnOE2* this, GlobalContext* globalCtx); -const ActorInit En_OE2_InitVars = -{ - ACTOR_EN_OE2, - ACTORTYPE_NPC, - ROOM, - FLAGS, - OBJECT_OE2, - sizeof(ActorEnOE2), - (ActorFunc)Init, - (ActorFunc)Destroy, - (ActorFunc)Update, - (ActorFunc)Draw +const ActorInit En_OE2_InitVars = { + ACTOR_EN_OE2, ACTORTYPE_NPC, ROOM, + FLAGS, OBJECT_OE2, sizeof(ActorEnOE2), + (ActorFunc)Init, (ActorFunc)Destroy, (ActorFunc)Update, + (ActorFunc)Draw, }; -static void func_80ABE6A0(ActorEnOE2* this, ActorFunc func) -{ +static void func_80ABE6A0(ActorEnOE2* this, ActorFunc func) { this->updateFunc = func; } -static void Init(ActorEnOE2* this, GlobalContext* globalCtx) -{ +static void Init(ActorEnOE2* this, GlobalContext* globalCtx) { func_80ABE6A0(this, (ActorFunc)func_80ABE6DC); } -static void Destroy(ActorEnOE2* this, GlobalContext* globalCtx) -{ - +static void Destroy(ActorEnOE2* this, GlobalContext* globalCtx) { } -static void func_80ABE6DC(ActorEnOE2* this, GlobalContext* globalCtx) -{ - +static void func_80ABE6DC(ActorEnOE2* this, GlobalContext* globalCtx) { } -static void Update(ActorEnOE2* this, GlobalContext* globalCtx) -{ - +static void Update(ActorEnOE2* this, GlobalContext* globalCtx) { } -static void Draw(ActorEnOE2* this, GlobalContext* globalCtx) -{ - +static void Draw(ActorEnOE2* this, GlobalContext* globalCtx) { } diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index 4f1a2e58d4..baf298eb1f 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -2,21 +2,20 @@ * File: z_en_okarina_effect.c * Overlay: ovl_En_Okarina_Effect * Description: Manages the storm created when playing Song of Storms -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ u16 timer; /* 0x0150 */ ActorFunc actionFunc; } EnOkarinaEffect; // size = 0x0154 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 static void EnOkarinaEffect_SetupAction(EnOkarinaEffect* this, ActorFunc* newActionFunc); @@ -26,8 +25,7 @@ static void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* g static void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx); static void EnOkarinaEffect_Update(EnOkarinaEffect* this, GlobalContext* globalCtx); -const ActorInit En_Okarina_Effect_InitVars = -{ +const ActorInit En_Okarina_Effect_InitVars = { ACTOR_EN_OKARINA_EFFECT, ACTORTYPE_ITEMACTION, ROOM, @@ -40,111 +38,88 @@ const ActorInit En_Okarina_Effect_InitVars = NULL, }; -static void EnOkarinaEffect_SetupAction(EnOkarinaEffect* this, ActorFunc* newActionFunc) -{ +static void EnOkarinaEffect_SetupAction(EnOkarinaEffect* this, ActorFunc* newActionFunc) { this->actionFunc = newActionFunc; } -static void EnOkarinaEffect_Destroy(EnOkarinaEffect* this, GlobalContext* globalCtx) -{ +static void EnOkarinaEffect_Destroy(EnOkarinaEffect* this, GlobalContext* globalCtx) { globalCtx->unk_10B16[0] = 0; - if ((D_8011FB30 != 4) && (D_8011FB30 != 5) && (globalCtx->gloomySkyEvent == 1)) - { - globalCtx->gloomySkyEvent = 2; //end gloomy sky + if ((D_8011FB30 != 4) && (D_8011FB30 != 5) && (globalCtx->gloomySkyEvent == 1)) { + globalCtx->gloomySkyEvent = 2; // end gloomy sky func_80077684(globalCtx); } - globalCtx->lightning = 2; //end lightning + globalCtx->lightning = 2; // end lightning } -static void EnOkarinaEffect_Init(EnOkarinaEffect* this, GlobalContext* globalCtx) -{ +static void EnOkarinaEffect_Init(EnOkarinaEffect* this, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); //"Ocarina Storm Effect" osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ オカリナあらし効果ビカビカビカ〜 ☆☆☆☆☆ \n" VT_RST); osSyncPrintf("\n\n"); - if (globalCtx->unk_10B12[1] != 0) - { - Actor_Kill(&this->actor); //kill if an instance is already spawned + if (globalCtx->unk_10B12[1] != 0) { + Actor_Kill(&this->actor); // kill if an instance is already spawned } EnOkarinaEffect_SetupAction(this, &EnOkarinaEffect_TriggerStorm); } -static void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) -{ - this->timer = 400; //20 seconds - globalCtx->unk_10B16[0] = 20; //rain intensity target - globalCtx->gloomySkyEvent = 1; //start gloomy sky - if ((D_8011FB30 != 0) || globalCtx->gloomySky != 0) - { +static void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) { + this->timer = 400; // 20 seconds + globalCtx->unk_10B16[0] = 20; // rain intensity target + globalCtx->gloomySkyEvent = 1; // start gloomy sky + if ((D_8011FB30 != 0) || globalCtx->gloomySky != 0) { globalCtx->unk_10B02 = 1; } - globalCtx->lightning = 1; //start lightning + globalCtx->lightning = 1; // start lightning func_80077624(globalCtx); EnOkarinaEffect_SetupAction(this, &EnOkarinaEffect_ManageStorm); } -static void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) -{ - func_8006C438(globalCtx, 5); //clear bean grow env flag - if (((globalCtx->pauseCtx.state == 0) && (globalCtx->unk_10A20 == 0) && - (globalCtx->msgCtx.unk_E300 == 0) && (func_800C0D28(globalCtx) == 0) - && ((globalCtx->unk_1241B == 0) || (gSaveContext.game_mode != 0))) - || (this->timer >= 250)) - { - if (globalCtx->unk_10A42 != 0 || globalCtx->unk_10A43 != 1) - { +static void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) { + func_8006C438(globalCtx, 5); // clear bean grow env flag + if (((globalCtx->pauseCtx.state == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->msgCtx.unk_E300 == 0) && + (func_800C0D28(globalCtx) == 0) && ((globalCtx->unk_1241B == 0) || (gSaveContext.game_mode != 0))) || + (this->timer >= 250)) { + if (globalCtx->unk_10A42 != 0 || globalCtx->unk_10A43 != 1) { this->timer--; } osSyncPrintf("\nthis->timer=[%d]", this->timer); - if (this->timer == 308) - { + if (this->timer == 308) { //"Let's grow some beans" osSyncPrintf("\n\n\n豆よ のびろ 指定\n\n\n"); - func_8006C3D0(globalCtx, 5); //set bean grow env flag + func_8006C3D0(globalCtx, 5); // set bean grow env flag } } - if (D_8011FB38 != 0) - { + if (D_8011FB38 != 0) { this->timer = 0; } - if (this->timer == 0) - { + if (this->timer == 0) { globalCtx->unk_10B16[0] = 0; - if (globalCtx->csCtx.state == 0) - { + if (globalCtx->csCtx.state == 0) { func_80077684(globalCtx); - } - else - if (func_800FA0B4(0) == 1) - { + } else if (func_800FA0B4(0) == 1) { func_800F6D58(0xF, 1, 0); func_800F6D58(0xE, 1, 0); } osSyncPrintf("\n\n\nE_wether_flg=[%d]", D_8011FB30); osSyncPrintf("\nrain_evt_trg=[%d]\n\n", globalCtx->gloomySkyEvent); - if (D_8011FB30 == 0 && (globalCtx->gloomySkyEvent == 1)) - { - globalCtx->gloomySkyEvent = 2; //end gloomy sky - } - else - { + if (D_8011FB30 == 0 && (globalCtx->gloomySkyEvent == 1)) { + globalCtx->gloomySkyEvent = 2; // end gloomy sky + } else { globalCtx->gloomySkyEvent = 0; globalCtx->unk_10B02 = 0; } - globalCtx->lightning = 2; //end lightning + globalCtx->lightning = 2; // end lightning Actor_Kill(&this->actor); } } -static void EnOkarinaEffect_Update(EnOkarinaEffect* this, GlobalContext* globalCtx) -{ +static void EnOkarinaEffect_Update(EnOkarinaEffect* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); - if (BREG(0) != 0) - { + if (BREG(0) != 0) { DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 0xFF, 0, 0xFF, 0xFF, 4, globalCtx->state.gfxCtx); + this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + 1.0f, 0xFF, 0, 0xFF, 0xFF, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index fbb6ea8bb5..74cafda79e 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -1,6 +1,6 @@ #include "z_en_okarina_tag.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void EnOkarinaTag_Init(EnOkarinaTag* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 9d6fb9d2b5..b7387e7b0b 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -1,6 +1,6 @@ #include "z_en_okuta.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnOkuta_Init(EnOkuta* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 0a3da67c7e..ed35c629db 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -1,6 +1,6 @@ #include "z_en_ossan.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnOssan_Init(EnOssan* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 71a387205c..50813c1b57 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -1,6 +1,6 @@ #include "z_en_owl.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnOwl_Init(EnOwl* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c index 3c7701a84b..36d9a0d4f3 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -1,6 +1,6 @@ #include "z_en_part.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnPart_Init(EnPart* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 0e72785315..ee711ad05b 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -1,6 +1,6 @@ #include "z_en_peehat.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x01000015 void EnPeehat_Init(EnPeehat* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index ea70957c7d..697e20b59d 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -1,6 +1,6 @@ #include "z_en_po_desert.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00001090 void EnPoDesert_Init(EnPoDesert* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index f5eb512b15..33e33057b3 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -1,6 +1,6 @@ #include "z_en_po_field.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00001035 void EnPoField_Init(EnPoField* this, GlobalContext* globalCtx); @@ -104,4 +104,3 @@ const ActorInit En_Po_Field_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Po_Field/func_80AD6BF4.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Po_Field/func_80AD6C4C.s") - diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index b394185037..828fbf17b5 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -1,6 +1,6 @@ #include "z_en_po_relay.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00011019 void EnPoRelay_Init(EnPoRelay* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 6926df62b4..9298414a70 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -1,6 +1,6 @@ #include "z_en_po_sisters.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00005215 void EnPoSisters_Init(EnPoSisters* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index e01235e574..f6e3162c02 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -1,6 +1,6 @@ #include "z_en_poh.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00001015 void EnPoh_Init(EnPoh* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c index d20bd1a651..ba72f83411 100644 --- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c +++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c @@ -2,11 +2,11 @@ * File: z_en_pu_box.c * Overlay: ovl_En_Pu_Box * Description: An unused stone cube. -*/ + */ #include "z_en_pu_box.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void EnPubox_Init(EnPubox* this, GlobalContext* globalCtx); @@ -14,8 +14,7 @@ static void EnPubox_Destroy(EnPubox* this, GlobalContext* globalCtx); static void EnPubox_Update(EnPubox* this, GlobalContext* globalCtx); static void EnPubox_Draw(EnPubox* this, GlobalContext* globalCtx); -const ActorInit En_Pu_box_InitVars = -{ +const ActorInit En_Pu_box_InitVars = { ACTOR_EN_PU_BOX, ACTORTYPE_BG, ROOM, @@ -31,13 +30,11 @@ const ActorInit En_Pu_box_InitVars = extern u32 D_06000380; extern u32 D_060006D0; -static void EnPubox_Init(EnPubox* this, GlobalContext* globalCtx) -{ +static void EnPubox_Init(EnPubox* this, GlobalContext* globalCtx) { u32 local_c = 0; Actor* thisx = &this->dyna.actor; - switch(thisx->params) - { + switch (thisx->params) { case 0: Actor_SetScale(thisx, 0.0025f); break; @@ -66,23 +63,18 @@ static void EnPubox_Init(EnPubox* this, GlobalContext* globalCtx) this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); } -static void EnPubox_Destroy(EnPubox* this, GlobalContext* globalCtx) -{ +static void EnPubox_Destroy(EnPubox* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void EnPubox_Update(EnPubox* this, GlobalContext* globalCtx) -{ +static void EnPubox_Update(EnPubox* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; thisx->speedXZ += this->dyna.unk_150; thisx->posRot.rot.y = this->dyna.unk_158; - thisx->speedXZ = (thisx->speedXZ < -2.5f) ? -2.5f : - ((thisx->speedXZ > 2.5f) ? 2.5f : - thisx->speedXZ); + thisx->speedXZ = (thisx->speedXZ < -2.5f) ? -2.5f : ((thisx->speedXZ > 2.5f) ? 2.5f : thisx->speedXZ); Math_SmoothScaleMaxMinF(&thisx->speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); - if (thisx->speedXZ != 0.0f) - { + if (thisx->speedXZ != 0.0f) { Audio_PlaySoundGeneral(0x200A, &thisx->unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } this->dyna.unk_154 = 0.0f; @@ -92,7 +84,6 @@ static void EnPubox_Update(EnPubox* this, GlobalContext* globalCtx) thisx->posRot2.pos = thisx->posRot.pos; } -static void EnPubox_Draw(EnPubox* this, GlobalContext* globalCtx) -{ +static void EnPubox_Draw(EnPubox* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_06000380); } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 9414f012e8..beb9c70c64 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -1,6 +1,6 @@ #include "z_en_rd.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000415 void EnRd_Init(EnRd* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index bbe37addaf..34183f3154 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -1,6 +1,6 @@ #include "z_en_reeba.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x08000015 void EnReeba_Init(EnReeba* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index 001f1f72d8..29d79a0eb5 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -1,6 +1,6 @@ #include "z_en_river_sound.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnRiverSound_Init(EnRiverSound* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/src/overlays/actors/ovl_En_Rl/z_en_rl.c index 4de9d7ab57..9e1e1d21d8 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -1,6 +1,6 @@ #include "z_en_rl.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnRl_Init(EnRl* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index cd9cf7ea69..41d7d555f2 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -1,6 +1,6 @@ #include "z_en_rr.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000435 void EnRr_Init(EnRr* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index f9a497e0bb..c38711e087 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -1,6 +1,6 @@ #include "z_en_ru1.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x04000011 void EnRu1_Init(EnRu1* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 238d25c5d3..968fd653bf 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -1,6 +1,6 @@ #include "z_en_ru2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnRu2_Init(EnRu2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 3ad852beab..deb14890aa 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -1,6 +1,6 @@ #include "z_en_sa.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000019 void EnSa_Init(EnSa* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 1bb726ee2a..a6ee3760f9 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -1,6 +1,6 @@ #include "z_en_sb.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnSb_Init(EnSb* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c index b23bf2d7bb..a765f6fb83 100644 --- a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c +++ b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c @@ -2,18 +2,17 @@ * File: z_en_scene_change.c * Overlay: ovl_En_Scene_Change * Description: Unknown (Broken Actor) -*/ + */ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc updateFunc; } EnSceneChange; // size = 0x0150 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void EnSceneChange_Init(EnSceneChange* this, GlobalContext* globalCtx); @@ -23,8 +22,7 @@ static void EnSceneChange_Draw(EnSceneChange* this, GlobalContext* globalCtx); static void func_80AF8C70(EnSceneChange* this, ActorFunc updateFunc); static void func_80AF8CAC(EnSceneChange* this, GlobalContext* globalCtx); -const ActorInit En_Scene_Change_InitVars = -{ +const ActorInit En_Scene_Change_InitVars = { ACTOR_EN_SCENE_CHANGE, ACTORTYPE_PROP, ROOM, @@ -37,45 +35,36 @@ const ActorInit En_Scene_Change_InitVars = (ActorFunc)EnSceneChange_Draw, }; - -static void func_80AF8C70(EnSceneChange* this, ActorFunc updateFunc) -{ +static void func_80AF8C70(EnSceneChange* this, ActorFunc updateFunc) { this->updateFunc = updateFunc; } -static void EnSceneChange_Init(EnSceneChange* this, GlobalContext* globalCtx) -{ +static void EnSceneChange_Init(EnSceneChange* this, GlobalContext* globalCtx) { func_80AF8C70(this, func_80AF8CAC); } -static void EnSceneChange_Destroy(EnSceneChange* this, GlobalContext* globalCtx) -{ - +static void EnSceneChange_Destroy(EnSceneChange* this, GlobalContext* globalCtx) { } -static void func_80AF8CAC(EnSceneChange* this, GlobalContext* globalCtx) -{ - +static void func_80AF8CAC(EnSceneChange* this, GlobalContext* globalCtx) { } -static void EnSceneChange_Update(EnSceneChange* this, GlobalContext* globalCtx) -{ +static void EnSceneChange_Update(EnSceneChange* this, GlobalContext* globalCtx) { this->updateFunc(&this->actor, globalCtx); } -static void EnSceneChange_Draw(EnSceneChange* this, GlobalContext* globalCtx) -{ +static void EnSceneChange_Draw(EnSceneChange* this, GlobalContext* globalCtx) { s32 pad[0x2]; Gfx* displayList; s32 pad1[0x2]; Gfx* displayListHead; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - + displayList = Graph_Alloc(globalCtx->state.gfxCtx, 0x3C0); - + gfxCtx = globalCtx->state.gfxCtx; - + func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_en_scene_change.c", 290); displayListHead = displayList; diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.c b/src/overlays/actors/ovl_En_Sda/z_en_sda.c index f7f94a2e17..a9ed3ec501 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c @@ -1,6 +1,6 @@ #include "z_en_sda.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnSda_Init(EnSda* this, GlobalContext* globalCtx); @@ -36,4 +36,3 @@ const ActorInit En_Sda_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Sda/func_80AF95C4.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Sda/func_80AF9C70.s") - diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index 4de770cbbd..8e6aaedb84 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -1,6 +1,6 @@ #include "z_en_shopnuts.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnShopnuts_Init(EnShopnuts* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index 8459c35682..5b146510e5 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -1,6 +1,6 @@ #include "z_en_si.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000201 void EnSi_Init(EnSi* this, GlobalContext* globalCtx); @@ -38,6 +38,3 @@ const ActorInit En_Si_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/EnSi_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/EnSi_Draw.s") - - - diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index c4eaae0b30..83a2a7d021 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -1,6 +1,6 @@ #include "z_en_siofuki.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnSiofuki_Init(EnSiofuki* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 09d9072040..b35a770124 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -1,6 +1,6 @@ #include "z_en_skb.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnSkb_Init(EnSkb* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index b1195e3f03..7934401163 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -1,6 +1,6 @@ #include "z_en_skj.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000015 void EnSkj_Init(EnSkj* this, GlobalContext* globalCtx); @@ -212,4 +212,3 @@ const ActorInit En_Skj_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skj/func_80B014E4.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Draw.s") - diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c index 46eb75c122..78ebde1573 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -1,6 +1,6 @@ #include "z_en_skjneedle.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000205 void EnSkjneedle_Init(EnSkjneedle* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 3c154511c1..789d6d9cde 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -1,6 +1,6 @@ #include "z_en_ssh.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void EnSsh_Init(EnSsh* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index b86d70c99a..56bfe637d8 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -1,6 +1,6 @@ #include "z_en_st.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void EnSt_Init(EnSt* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 06af7dc629..334d9231fd 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -1,6 +1,6 @@ #include "z_en_sth.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnSth_Init(EnSth* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index 39a14fc8c3..8e1f9b3534 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -1,6 +1,6 @@ #include "z_en_stream.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnStream_Init(EnStream* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 8b9423d1ad..9f4096f1bf 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -1,6 +1,6 @@ #include "z_en_sw.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnSw_Init(EnSw* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index e5ea597dbb..339586fe4c 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -1,6 +1,6 @@ #include "z_en_syateki_itm.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnSyatekiItm_Init(EnSyatekiItm* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 9cb98966dd..49ad897d8d 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -1,6 +1,6 @@ #include "z_en_syateki_man.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x08000019 void EnSyatekiMan_Init(EnSyatekiMan* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 178ca2939a..345068e9b5 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -1,6 +1,6 @@ #include "z_en_syateki_niw.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnSyatekiNiw_Init(EnSyatekiNiw* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index ff905b4f8a..1875628d10 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -1,6 +1,6 @@ #include "z_en_ta.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnTa_Init(EnTa* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index 94055a81e1..51273cde17 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -1,6 +1,6 @@ #include "z_en_takara_man.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x08000039 void EnTakaraMan_Init(EnTakaraMan* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.c b/src/overlays/actors/ovl_En_Tana/z_en_tana.c index 2be9a331d2..a03465c1bd 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -1,6 +1,6 @@ #include "z_en_tana.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnTana_Init(EnTana* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index c9bd3b20da..bc7d141e09 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -1,6 +1,6 @@ #include "z_en_test.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnTest_Init(EnTest* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.c b/src/overlays/actors/ovl_En_Tg/z_en_tg.c index 9869550a16..dce566fa8c 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c @@ -1,6 +1,6 @@ #include "z_en_tg.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnTg_Init(EnTg* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index afddf7c339..ba6f565b64 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -1,6 +1,6 @@ #include "z_en_tite.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnTite_Init(EnTite* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index f5ec3bc5d5..954447e626 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -2,27 +2,26 @@ #include #include "z_en_tk.h" -typedef struct -{ - /* 0x0000 */ u8 health; /* SubActorStruct98.health */ - /* 0x0002 */ s16 h_2; /* SubActorStruct98.unk_10 */ - /* 0x0004 */ s16 h_4; /* SubActorStruct98.unk_12 */ - /* 0x0006 */ s16 h_6; /* SubActorStruct98.unk_14 */ - /* 0x0008 */ u8 mass; /* SubActorStruct98.mass */ +typedef struct { + /* 0x0000 */ u8 health; /* SubActorStruct98.health */ + /* 0x0002 */ s16 h_2; /* SubActorStruct98.unk_10 */ + /* 0x0004 */ s16 h_4; /* SubActorStruct98.unk_12 */ + /* 0x0006 */ s16 h_6; /* SubActorStruct98.unk_14 */ + /* 0x0008 */ u8 mass; /* SubActorStruct98.mass */ /* 0x000A */ } EnTk_SubActorStruct98Init; #define ROOM 0x00 #define FLAGS 0x00000009 -s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *globalCtx); -void EnTk_Init(EnTk *this, GlobalContext *globalCtx); -void EnTk_Destroy(EnTk *this, GlobalContext *globalCtx); -void EnTk_Rest(EnTk *this, GlobalContext *globalCtx); -void EnTk_Walk(EnTk *this, GlobalContext *globalCtx); -void EnTk_Dig(EnTk *this, GlobalContext *globalCtx); -void EnTk_Update(EnTk *this, GlobalContext *globalCtx); -void EnTk_Draw(EnTk *this, GlobalContext *globalCtx); +s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx); +void EnTk_Init(EnTk* this, GlobalContext* globalCtx); +void EnTk_Destroy(EnTk* this, GlobalContext* globalCtx); +void EnTk_Rest(EnTk* this, GlobalContext* globalCtx); +void EnTk_Walk(EnTk* this, GlobalContext* globalCtx); +void EnTk_Dig(EnTk* this, GlobalContext* globalCtx); +void EnTk_Update(EnTk* this, GlobalContext* globalCtx); +void EnTk_Draw(EnTk* this, GlobalContext* globalCtx); extern UNK_TYPE D_04051DB0; extern UNK_TYPE D_040521B0; @@ -43,8 +42,7 @@ extern UNK_TYPE D_0600BC90; extern UNK_TYPE D_0600BCA0; extern UNK_TYPE D_0600BE40; -const ActorInit En_Tk_InitVars = -{ +const ActorInit En_Tk_InitVars = { ACTOR_EN_TK, ACTORTYPE_NPC, ROOM, @@ -57,16 +55,12 @@ const ActorInit En_Tk_InitVars = (ActorFunc)EnTk_Draw, }; -void EnTkEff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel, - u8 duration, f32 size, f32 growth) -{ +void EnTkEff_Create(EnTk* this, Vec3f* pos, Vec3f* speed, Vec3f* accel, u8 duration, f32 size, f32 growth) { s16 i; - EnTkEff *eff = this->eff; + EnTkEff* eff = this->eff; - for (i = 0; i < ARRAY_COUNT(this->eff); i++) - { - if (eff->active != 1) - { + for (i = 0; i < ARRAY_COUNT(this->eff); i++) { + if (eff->active != 1) { eff->size = size; eff->growth = growth; eff->timeTotal = eff->timeLeft = duration; @@ -80,19 +74,15 @@ void EnTkEff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel, } } -void EnTkEff_Update(EnTk *this) -{ +void EnTkEff_Update(EnTk* this) { s16 i; - EnTkEff *eff; + EnTkEff* eff; eff = this->eff; - for (i = 0; i < ARRAY_COUNT(this->eff); i++) - { - if (eff->active != 0) - { + for (i = 0; i < ARRAY_COUNT(this->eff); i++) { + if (eff->active != 0) { eff->timeLeft--; - if (eff->timeLeft == 0) - { + if (eff->timeLeft == 0) { eff->active = 0; } eff->accel.x = Math_Rand_ZeroOne() * 0.4f - 0.2f; @@ -109,27 +99,18 @@ void EnTkEff_Update(EnTk *this) } } -void EnTkEff_Draw(EnTk *this, GlobalContext *globalCtx) -{ - static UNK_PTR images[] = - { - &D_040539B0, - &D_040535B0, - &D_040531B0, - &D_04052DB0, - &D_040529B0, - &D_040525B0, - &D_040521B0, - &D_04051DB0, +void EnTkEff_Draw(EnTk* this, GlobalContext* globalCtx) { + static UNK_PTR images[] = { + &D_040539B0, &D_040535B0, &D_040531B0, &D_04052DB0, &D_040529B0, &D_040525B0, &D_040521B0, &D_04051DB0, }; - EnTkEff *eff = this->eff; - GraphicsContext *gfxCtx; + EnTkEff* eff = this->eff; + GraphicsContext* gfxCtx; s16 gfxSetup; s16 i; s16 alpha; s16 imageIdx; - Gfx *pgdl[4]; + Gfx* pgdl[4]; /* * This assignment always occurs before a call to func_800C6AC4 which @@ -145,14 +126,15 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *globalCtx) * Same code is generated without the if, * but that would make the do...while redundant so there's probably an if. */ - do { if (1) { func_80093D84(globalCtx->state.gfxCtx); } } while (0); + do { + if (1) { + func_80093D84(globalCtx->state.gfxCtx); + } + } while (0); - for (i = 0; i < ARRAY_COUNT(this->eff); i++) - { - if (eff->active != 0) - { - if (gfxSetup == 0) - { + for (i = 0; i < ARRAY_COUNT(this->eff); i++) { + if (eff->active != 0) { + if (gfxSetup == 0) { gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0); gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600BC90); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x64, 0x3C, 0x14, 0x00); @@ -166,15 +148,11 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *globalCtx) Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); func_800D1FD4(&globalCtx->mf_11DA0); Matrix_Scale(eff->size, eff->size, 1.f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyXlu.p++, - Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tk_eff.c", - 140), + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tk_eff.c", 140), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - imageIdx = eff->timeLeft * - ((f32)ARRAY_COUNT(images) / eff->timeTotal); - gSPSegment(gfxCtx->polyXlu.p++, 0x08, - SEGMENTED_TO_VIRTUAL(images[imageIdx])); + imageIdx = eff->timeLeft * ((f32)ARRAY_COUNT(images) / eff->timeTotal); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(images[imageIdx])); gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600BCA0); } @@ -184,11 +162,9 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *globalCtx) func_800C6B54(pgdl, globalCtx->state.gfxCtx, "../z_en_tk_eff.c", 154); } -s32 EnTkEff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size, - f32 growth, f32 yAccelMax) -{ - Vec3f speed = {0.f, 0.f, 0.f}; - Vec3f accel = {0.f, 0.3f, 0.f}; +s32 EnTkEff_CreateDflt(EnTk* this, Vec3f* pos, u8 duration, f32 size, f32 growth, f32 yAccelMax) { + Vec3f speed = { 0.f, 0.f, 0.f }; + Vec3f accel = { 0.f, 0.3f, 0.f }; accel.y += Math_Rand_ZeroOne() * yAccelMax; @@ -199,79 +175,55 @@ s32 EnTkEff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size, /** z_en_tk_eff.c ends here probably **/ -static ColliderCylinderInit D_80B1D508 = -{ - 0x0A, 0x00, 0x00, 0x39, - 0x20, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00000000, 0x00, 0x00, - 0x00, 0x00, 0x00000000, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, - 0x001E, 0x0034, 0x0000, - 0x0000, 0x0000, 0x0000, +static ColliderCylinderInit D_80B1D508 = { + 0x0A, 0x00, 0x00, 0x39, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x001E, 0x0034, 0x0000, 0x0000, 0x0000, 0x0000, }; -static EnTk_SubActorStruct98Init D_80B1D534 = -{ - 0x00, - 0x0000, - 0x0000, - 0x0000, - 0xFF, +static EnTk_SubActorStruct98Init D_80B1D534 = { + 0x00, 0x0000, 0x0000, 0x0000, 0xFF, }; -void EnTk_RestAnim(EnTk *this, GlobalContext *globalCtx) -{ +void EnTk_RestAnim(EnTk* this, GlobalContext* globalCtx) { UNK_PTR anim = &D_06002F84; - SkelAnime_ChangeAnimation(&this->skelAnim, (u32)anim, 1.f, 0.f, - SkelAnime_GetFrameCount((u32)&D_06002F84), 0, + SkelAnime_ChangeAnimation(&this->skelAnim, (u32)anim, 1.f, 0.f, SkelAnime_GetFrameCount((u32)&D_06002F84), 0, -10.f); this->actionCountdown = Math_Rand_S16Offset(60, 60); this->actor.speedXZ = 0.f; } -void EnTk_WalkAnim(EnTk *this, GlobalContext *globalCtx) -{ +void EnTk_WalkAnim(EnTk* this, GlobalContext* globalCtx) { UNK_PTR anim = &D_06001FA8; - SkelAnime_ChangeAnimation(&this->skelAnim, (u32)anim, 1.f, 0.f, - SkelAnime_GetFrameCount((u32)&D_06002F84), 0, + SkelAnime_ChangeAnimation(&this->skelAnim, (u32)anim, 1.f, 0.f, SkelAnime_GetFrameCount((u32)&D_06002F84), 0, -10.f); this->actionCountdown = Math_Rand_S16Offset(240, 240); } -void EnTk_DigAnim(EnTk *this, GlobalContext *globalCtx) -{ +void EnTk_DigAnim(EnTk* this, GlobalContext* globalCtx) { UNK_PTR anim = &D_06001144; - SkelAnime_ChangeAnimation(&this->skelAnim, (u32)anim, 1.f, 0.f, - SkelAnime_GetFrameCount((u32)&D_06001144), 0, + SkelAnime_ChangeAnimation(&this->skelAnim, (u32)anim, 1.f, 0.f, SkelAnime_GetFrameCount((u32)&D_06001144), 0, -10.f); - if (EnTk_CheckNextSpot(this, globalCtx) >= 0) - { + if (EnTk_CheckNextSpot(this, globalCtx) >= 0) { this->validDigHere = 1; } } -void EnTk_UpdateEyes(EnTk *this) -{ - if (DECR(this->blinkCountdown) == 0) - { +void EnTk_UpdateEyes(EnTk* this) { + if (DECR(this->blinkCountdown) == 0) { this->eyeImageIdx++; - if (this->eyeImageIdx > 2) - { + if (this->eyeImageIdx > 2) { this->blinkCycles--; - if (this->blinkCycles < 0) - { + if (this->blinkCycles < 0) { this->blinkCountdown = Math_Rand_S16Offset(30, 30); this->blinkCycles = 2; - if (Math_Rand_ZeroOne() > 0.5f) - { + if (Math_Rand_ZeroOne() > 0.5f) { this->blinkCycles++; } } @@ -280,13 +232,11 @@ void EnTk_UpdateEyes(EnTk *this) } } -s32 EnTk_CheckFacingPlayer(EnTk *this) -{ +s32 EnTk_CheckFacingPlayer(EnTk* this) { s16 v0; s16 v1; - if (this->actor.waterSurfaceDist > 10000.f) - { + if (this->actor.waterSurfaceDist > 10000.f) { return 0; } @@ -295,42 +245,34 @@ s32 EnTk_CheckFacingPlayer(EnTk *this) v0 -= this->headRot; v1 = this->actor.rotTowardsLinkY - v0; - if (ABS(v1) < 0x1554) - { + if (ABS(v1) < 0x1554) { return 1; - } - else - { + } else { return 0; } } -s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *globalCtx) -{ - Actor *prop; +s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx) { + Actor* prop; f32 dxz; f32 dy; prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; - while (prop != NULL) - { - if (prop->id != ACTOR_EN_IT) - { + while (prop != NULL) { + if (prop->id != ACTOR_EN_IT) { prop = prop->next; continue; } - if (prop == this->currentSpot) - { + if (prop == this->currentSpot) { prop = prop->next; continue; } dy = prop->posRot.pos.y - this->actor.unk_80; dxz = func_8002DB8C(&this->actor, prop); - if (dxz > 40.f || dy > 10.f) - { + if (dxz > 40.f || dy > 10.f) { prop = prop->next; continue; } @@ -342,67 +284,53 @@ s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *globalCtx) return -1; } -void EnTk_CheckCurrentSpot(EnTk *this) -{ +void EnTk_CheckCurrentSpot(EnTk* this) { f32 dxz; f32 dy; - if (this->currentSpot != NULL) - { + if (this->currentSpot != NULL) { dy = this->currentSpot->posRot.pos.y - this->actor.unk_80; dxz = func_8002DB8C(&this->actor, this->currentSpot); - if (dxz > 40.f || dy > 10.f) - { + if (dxz > 40.f || dy > 10.f) { this->currentSpot = NULL; } } } -f32 EnTk_Step(EnTk *this, GlobalContext *globalCtx) -{ - f32 stepFrames[] = {36.f, 10.f}; +f32 EnTk_Step(EnTk* this, GlobalContext* globalCtx) { + f32 stepFrames[] = { 36.f, 10.f }; f32 a1_; s32 i; - if (this->skelAnim.animCurrentFrame == 0.f || - this->skelAnim.animCurrentFrame == 25.f) - { + if (this->skelAnim.animCurrentFrame == 0.f || this->skelAnim.animCurrentFrame == 25.f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK); } - if (this->skelAnim.animCurrent != (u32 *)&D_06001FA8) - { + if (this->skelAnim.animCurrent != (u32*)&D_06001FA8) { return 0.f; } a1_ = this->skelAnim.animCurrentFrame; - for (i = 0; i < ARRAY_COUNT(stepFrames); i++) - { - if (a1_ < stepFrames[i] + 12.f && a1_ >= stepFrames[i]) - { + for (i = 0; i < ARRAY_COUNT(stepFrames); i++) { + if (a1_ < stepFrames[i] + 12.f && a1_ >= stepFrames[i]) { break; } } - if (i >= ARRAY_COUNT(stepFrames)) - { + if (i >= ARRAY_COUNT(stepFrames)) { return 0.f; - } - else - { + } else { a1_ = (0x8000 / 12.f) * (a1_ - stepFrames[i]); return Math_Sins(a1_) * 2.f; } } -s32 EnTk_Orient(EnTk *this, GlobalContext *globalCtx) -{ - Path *path; - Vec3s *point; +s32 EnTk_Orient(EnTk* this, GlobalContext* globalCtx) { + Path* path; + Vec3s* point; f32 dx; f32 dz; - if (this->actor.params < 0) - { + if (this->actor.params < 0) { return 1; } @@ -413,90 +341,63 @@ s32 EnTk_Orient(EnTk *this, GlobalContext *globalCtx) dx = point->x - this->actor.posRot.pos.x; dz = point->z - this->actor.posRot.pos.z; - Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, - Math_atan2f(dx, dz) * (0x8000 / M_PI), 10, 1000, 1); + Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, Math_atan2f(dx, dz) * (0x8000 / M_PI), 10, 1000, 1); this->actor.posRot.rot = this->actor.shape.rot; - if (SQ(dx) + SQ(dz) < 10.f) - { + if (SQ(dx) + SQ(dz) < 10.f) { this->currentWaypoint++; - if (this->currentWaypoint >= path->count) - { + if (this->currentWaypoint >= path->count) { this->currentWaypoint = 0; } return 0; - } - else - { + } else { return 1; } } -u16 func_80B1C54C(GlobalContext *globalCtx, Actor *a1) -{ +u16 func_80B1C54C(GlobalContext* globalCtx, Actor* a1) { u16 ret; ret = func_8006C360(globalCtx, 14); - if (ret != 0) - { + if (ret != 0) { return ret; } - if (gSaveContext.inf_table[13] & 0x0200) - { + if (gSaveContext.inf_table[13] & 0x0200) { /* "Do you want me to dig here? ..." */ return 0x5019; - } - else - { + } else { /* "Hey kid! ..." */ return 0x5018; } } -s16 func_80B1C5A0(GlobalContext *globalCtx, Actor *actor) -{ +s16 func_80B1C5A0(GlobalContext* globalCtx, Actor* actor) { s32 ret = 1; - switch (func_8010BDBC(&globalCtx->msgCtx)) - { + switch (func_8010BDBC(&globalCtx->msgCtx)) { case 0: case 1: - { break; - } case 2: - { /* "I am the boss of the carpenters ..." (wtf?) */ - if (actor->textId == 0x5028) - { + if (actor->textId == 0x5028) { gSaveContext.inf_table[13] |= 0x0100; } ret = 0; break; - } case 3: - { break; - } case 4: - { - if (func_80106BC8(globalCtx) != 0 && - (actor->textId == 0x5018 || actor->textId == 0x5019)) - { - if (globalCtx->msgCtx.choiceIndex == 1) - { + if (func_80106BC8(globalCtx) != 0 && (actor->textId == 0x5018 || actor->textId == 0x5019)) { + if (globalCtx->msgCtx.choiceIndex == 1) { /* "Thanks a lot!" */ actor->textId = 0x0084; - } - else if (gSaveContext.rupees < 10) - { + } else if (gSaveContext.rupees < 10) { /* "You don't have enough Rupees!" */ actor->textId = 0x0085; - } - else - { + } else { globalCtx->msgCtx.msgMode = 0x37; Rupees_ChangeBy(-10); gSaveContext.inf_table[13] |= 0x0200; @@ -506,115 +407,78 @@ s16 func_80B1C5A0(GlobalContext *globalCtx, Actor *actor) gSaveContext.inf_table[13] |= 0x0200; } break; - } case 5: - { - if (func_80106BC8(globalCtx) != 0 && - (actor->textId == 0x0084 || actor->textId == 0x0085)) - { + if (func_80106BC8(globalCtx) != 0 && (actor->textId == 0x0084 || actor->textId == 0x0085)) { func_80106CCC(globalCtx); ret = 0; } break; - } case 6: case 7: case 8: case 9: - { break; - } } return ret; } -s32 EnTk_ChooseReward(EnTk *this) -{ +s32 EnTk_ChooseReward(EnTk* this) { f32 luck; s32 reward; luck = Math_Rand_ZeroOne(); - if (luck < 0.4f) - { + if (luck < 0.4f) { reward = 0; - } - else if (luck < 0.7) - { + } else if (luck < 0.7) { reward = 1; - } - else if (luck < 0.9) - { + } else if (luck < 0.9) { reward = 2; - } - else - { + } else { reward = 3; } - switch (reward) - { + switch (reward) { case 0: - { - if (this->rewardCount[0] < 8) - { + if (this->rewardCount[0] < 8) { this->rewardCount[0] += 1; return reward; } break; - } case 1: - { - if (this->rewardCount[1] < 4) - { + if (this->rewardCount[1] < 4) { this->rewardCount[1] += 1; return reward; } break; - } case 2: - { - if (this->rewardCount[2] < 2) - { + if (this->rewardCount[2] < 2) { this->rewardCount[2] += 1; return reward; } break; - } case 3: - { - if (this->rewardCount[3] < 1) - { + if (this->rewardCount[3] < 1) { this->rewardCount[3] += 1; return reward; } break; - } } - if (this->rewardCount[0] < 8) - { + if (this->rewardCount[0] < 8) { this->rewardCount[0] += 1; reward = 0; - } - else if (this->rewardCount[1] < 4) - { + } else if (this->rewardCount[1] < 4) { this->rewardCount[1] += 1; reward = 1; - } - else if (this->rewardCount[2] < 2) - { + } else if (this->rewardCount[2] < 2) { this->rewardCount[2] += 1; reward = 2; - } - else if (this->rewardCount[3] < 1) - { + } else if (this->rewardCount[3] < 1) { this->rewardCount[3] += 1; reward = 3; - } - else - { + } else { reward = 0; this->rewardCount[0] = 1; this->rewardCount[1] = 0; @@ -625,15 +489,12 @@ s32 EnTk_ChooseReward(EnTk *this) return reward; } -void EnTk_DigEff(EnTk *this) -{ - Vec3f pos = {0.f, 0.f, 0.f}; - Vec3f speed = {0.f, 0.f, 0.f}; - Vec3f accel = {0.f, 0.3f, 0.f}; +void EnTk_DigEff(EnTk* this) { + Vec3f pos = { 0.f, 0.f, 0.f }; + Vec3f speed = { 0.f, 0.f, 0.f }; + Vec3f accel = { 0.f, 0.3f, 0.f }; - if (this->skelAnim.animCurrentFrame >= 32.f && - this->skelAnim.animCurrentFrame < 40.f) - { + if (this->skelAnim.animCurrentFrame >= 32.f && this->skelAnim.animCurrentFrame < 40.f) { pos.x = (Math_Rand_ZeroOne() - 0.5f) * 12.f + this->v3f_304.x; pos.y = (Math_Rand_ZeroOne() - 0.5f) * 8.f + this->v3f_304.y; pos.z = (Math_Rand_ZeroOne() - 0.5f) * 12.f + this->v3f_304.z; @@ -641,31 +502,23 @@ void EnTk_DigEff(EnTk *this) } } -void EnTk_Init(EnTk *this, GlobalContext *globalCtx) -{ - EnTk *thisAgain = this; +void EnTk_Init(EnTk* this, GlobalContext* globalCtx) { + EnTk* thisAgain = this; UNK_PTR anim = &D_06002F84; - ActorShape_Init(&thisAgain->actor.shape, 0, ActorShadow_DrawFunc_Circle, - 24.f); + ActorShape_Init(&thisAgain->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.f); - func_800A46F8(globalCtx, &thisAgain->skelAnim, (u32)&D_0600BE40, 0, - thisAgain->hz_22A, thisAgain->hz_296, 18); - SkelAnime_ChangeAnimation(&thisAgain->skelAnim, (u32)anim, 1.f, 0.f, - SkelAnime_GetFrameCount((u32)&D_06002F84), - 0, 0.f); + func_800A46F8(globalCtx, &thisAgain->skelAnim, (u32)&D_0600BE40, 0, thisAgain->hz_22A, thisAgain->hz_296, 18); + SkelAnime_ChangeAnimation(&thisAgain->skelAnim, (u32)anim, 1.f, 0.f, SkelAnime_GetFrameCount((u32)&D_06002F84), 0, + 0.f); ActorCollider_AllocCylinder(globalCtx, &thisAgain->collider); - ActorCollider_InitCylinder(globalCtx, &thisAgain->collider, - &thisAgain->actor, &D_80B1D508); + ActorCollider_InitCylinder(globalCtx, &thisAgain->collider, &thisAgain->actor, &D_80B1D508); func_80061EFC(&thisAgain->actor.sub_98, NULL, &D_80B1D534); - if (gSaveContext.day_time <= 0xC000 || - gSaveContext.day_time >= 0xE000 || - !LINK_IS_CHILD || - globalCtx->sceneNum != SCENE_SPOT02) - { + if (gSaveContext.day_time <= 0xC000 || gSaveContext.day_time >= 0xE000 || !LINK_IS_CHILD || + globalCtx->sceneNum != SCENE_SPOT02) { Actor_Kill(&thisAgain->actor); return; } @@ -679,64 +532,50 @@ void EnTk_Init(EnTk *this, GlobalContext *globalCtx) thisAgain->actionFunc = EnTk_Rest; } -void EnTk_Destroy(EnTk *this, GlobalContext *globalCtx) -{ - EnTk *thisAgain = this; +void EnTk_Destroy(EnTk* this, GlobalContext* globalCtx) { + EnTk* thisAgain = this; ActorCollider_FreeCylinder(globalCtx, &thisAgain->collider); } -void EnTk_Rest(EnTk *this, GlobalContext *globalCtx) -{ +void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) { s16 v1; s16 a1_; - if (this->h_1E0 != 0) - { + if (this->h_1E0 != 0) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; v1 = this->actor.rotTowardsLinkY - v1; - if (this->h_1E0 == 2) - { + if (this->h_1E0 == 2) { EnTk_DigAnim(this, globalCtx); this->h_1E0 = 0; this->actionFunc = EnTk_Dig; return; } - func_800343CC(globalCtx, &this->actor, &this->h_1E0, - this->collider.dim.radius + 30.f, - func_80B1C54C, func_80B1C5A0); - } - else if (EnTk_CheckFacingPlayer(this) != 0) - { + func_800343CC(globalCtx, &this->actor, &this->h_1E0, this->collider.dim.radius + 30.f, func_80B1C54C, + func_80B1C5A0); + } else if (EnTk_CheckFacingPlayer(this) != 0) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; v1 = this->actor.rotTowardsLinkY - v1; this->actionCountdown = 0; - func_800343CC(globalCtx, &this->actor, &this->h_1E0, - this->collider.dim.radius + 30.f, - func_80B1C54C, func_80B1C5A0); - } - else if (func_8002F194(&this->actor, globalCtx) != 0) - { + func_800343CC(globalCtx, &this->actor, &this->h_1E0, this->collider.dim.radius + 30.f, func_80B1C54C, + func_80B1C5A0); + } else if (func_8002F194(&this->actor, globalCtx) != 0) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; v1 = this->actor.rotTowardsLinkY - v1; this->actionCountdown = 0; this->h_1E0 = 1; - } - else if (DECR(this->actionCountdown) == 0) - { + } else if (DECR(this->actionCountdown) == 0) { EnTk_WalkAnim(this, globalCtx); this->actionFunc = EnTk_Walk; /*! @bug v1 is uninitialized past this branch */ - } - else - { + } else { v1 = 0; } @@ -744,36 +583,29 @@ void EnTk_Rest(EnTk *this, GlobalContext *globalCtx) Math_SmoothScaleMaxMinS(&this->headRot, a1_, 6, 1000, 1); } -void EnTk_Walk(EnTk *this, GlobalContext *globalCtx) -{ - if (this->h_1E0 == 2) - { +void EnTk_Walk(EnTk* this, GlobalContext* globalCtx) { + if (this->h_1E0 == 2) { EnTk_DigAnim(this, globalCtx); this->h_1E0 = 0; this->actionFunc = EnTk_Dig; - } - else - { + } else { this->actor.speedXZ = EnTk_Step(this, globalCtx); EnTk_Orient(this, globalCtx); Math_SmoothScaleMaxMinS(&this->headRot, 0, 6, 1000, 1); EnTk_CheckCurrentSpot(this); DECR(this->actionCountdown); - if (EnTk_CheckFacingPlayer(this) != 0 || this->actionCountdown == 0) - { + if (EnTk_CheckFacingPlayer(this) != 0 || this->actionCountdown == 0) { EnTk_RestAnim(this, globalCtx); this->actionFunc = EnTk_Rest; } } } -void EnTk_Dig(EnTk *this, GlobalContext *globalCtx) -{ +void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) { Vec3f rewardOrigin; Vec3f rewardPos; - s32 rewardParams[] = - { + s32 rewardParams[] = { 0x0000, /* Green rupee */ 0x0001, /* Blue rupee */ 0x0002, /* Red rupee */ @@ -783,15 +615,13 @@ void EnTk_Dig(EnTk *this, GlobalContext *globalCtx) EnTk_DigEff(this); - if (this->skelAnim.animCurrentFrame == 32.f) - { + if (this->skelAnim.animCurrentFrame == 32.f) { /* What's gonna come out? */ Audio_PlayActorSound2(&this->actor, NA_SE_EV_DIG_UP); this->rewardTimer = 0; - if (this->validDigHere == 1) - { + if (this->validDigHere == 1) { rewardOrigin.x = 0.f; rewardOrigin.y = 0.f; rewardOrigin.z = -40.f; @@ -804,55 +634,41 @@ void EnTk_Dig(EnTk *this, GlobalContext *globalCtx) rewardPos.z += this->actor.posRot.pos.z; this->currentReward = EnTk_ChooseReward(this); - if (this->currentReward == 3) - { + if (this->currentReward == 3) { /* * Upgrade the purple rupee reward to the heart piece if this * is the first grand prize dig. */ - if ((gSaveContext.item_get_inf[1] & 0x1000) == 0) - { + if ((gSaveContext.item_get_inf[1] & 0x1000) == 0) { gSaveContext.item_get_inf[1] |= 0x1000; this->currentReward = 4; } } - Item_DropCollectible(globalCtx, &rewardPos, - rewardParams[this->currentReward]); + Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]); } } - if (this->skelAnim.animCurrentFrame >= 32.f && this->rewardTimer == 10) - { + if (this->skelAnim.animCurrentFrame >= 32.f && this->rewardTimer == 10) { /* Play a reward sound shortly after digging */ - if (this->validDigHere == 0) - { + if (this->validDigHere == 0) { /* Bad dig spot */ Audio_PlayActorSound2(&this->actor, NA_SE_SY_ERROR); - } - else if (this->currentReward == 4) - { + } else if (this->currentReward == 4) { /* Heart piece */ - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); - } - else - { + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + } else { /* Rupee */ Audio_PlayActorSound2(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); } } this->rewardTimer++; - if (func_800A56C8(&this->skelAnim, this->skelAnim.animFrameCount) != 0) - { - if (this->currentReward < 0) - { + if (func_800A56C8(&this->skelAnim, this->skelAnim.animFrameCount) != 0) { + if (this->currentReward < 0) { /* "Nope, nothing here!" */ func_8010B680(globalCtx, 0x501A, 0); - } - else - { + } else { func_80106CCC(globalCtx); } @@ -864,10 +680,9 @@ void EnTk_Dig(EnTk *this, GlobalContext *globalCtx) } } -void EnTk_Update(EnTk *this, GlobalContext *globalCtx) -{ - EnTk *thisAgain = this; - ColliderCylinderMain *collider = &thisAgain->collider; +void EnTk_Update(EnTk* this, GlobalContext* globalCtx) { + EnTk* thisAgain = this; + ColliderCylinderMain* collider = &thisAgain->collider; ActorCollider_Cylinder_Update(&thisAgain->actor, collider); Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, collider); @@ -885,10 +700,9 @@ void EnTk_Update(EnTk *this, GlobalContext *globalCtx) EnTk_UpdateEyes(thisAgain); } -void func_80B1D200(GlobalContext *globalCtx) -{ - GraphicsContext *gfxCtx; - Gfx *pgdl[4]; +void func_80B1D200(GlobalContext* globalCtx) { + GraphicsContext* gfxCtx; + Gfx* pgdl[4]; gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1188); @@ -898,64 +712,51 @@ void func_80B1D200(GlobalContext *globalCtx) func_800C6B54(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1190); } -s32 func_80B1D278(s16 a0, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Vec3s *sp10, - Actor *actor) -{ - EnTk *tk = (EnTk *)actor; +s32 func_80B1D278(s16 a0, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Vec3s* sp10, Actor* actor) { + EnTk* tk = (EnTk*)actor; - switch (a1) - { + switch (a1) { /* Limb 15 - Head */ case 15: - { tk->h_21E = sp10->y; break; - } /* Limb 16 - Jaw */ case 16: - { tk->h_21E += sp10->y; sp10->y += tk->headRot; break; - } } return 0; } -void func_80B1D2E4(GlobalContext *globalCtx, UNK_TYPE a1, UNK_TYPE a2, - UNK_TYPE a3, Actor *actor) -{ - EnTk *this = (EnTk *)actor; - Vec3f sp28 = {0.f, 0.f, 4600.f}; - Vec3f sp1C = {0.f, 0.f, 0.f}; +void func_80B1D2E4(GlobalContext* globalCtx, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Actor* actor) { + EnTk* this = (EnTk*)actor; + Vec3f sp28 = { 0.f, 0.f, 4600.f }; + Vec3f sp1C = { 0.f, 0.f, 0.f }; /* Limb 16 - Jaw */ - if (a1 == 16) - { + if (a1 == 16) { Matrix_MultVec3f(&sp1C, &this->actor.posRot2.pos); } /* Limb 14 - Neck */ - if (a1 == 14) - { + if (a1 == 14) { Matrix_MultVec3f(&sp28, &this->v3f_304); func_80B1D200(globalCtx); } } -void EnTk_Draw(EnTk *this, GlobalContext *globalCtx) -{ - static UNK_PTR eyeImages[] = - { +void EnTk_Draw(EnTk* this, GlobalContext* globalCtx) { + static UNK_PTR eyeImages[] = { &D_06003B40, &D_06004340, &D_06004B40, }; - EnTk *thisAgain = this; - GraphicsContext *gfxCtx; - Gfx *pgdl[4]; + EnTk* thisAgain = this; + GraphicsContext* gfxCtx; + Gfx* pgdl[4]; Matrix_Push(); EnTkEff_Draw(thisAgain, globalCtx); @@ -966,13 +767,10 @@ void EnTk_Draw(EnTk *this, GlobalContext *globalCtx) func_80093D18(globalCtx->state.gfxCtx); - gSPSegment(gfxCtx->polyOpa.p++, 0x08, - SEGMENTED_TO_VIRTUAL(eyeImages[thisAgain->eyeImageIdx])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(eyeImages[thisAgain->eyeImageIdx])); - func_800A1AC8(globalCtx, thisAgain->skelAnim.limbIndex, - thisAgain->skelAnim.actorDrawTbl, - thisAgain->skelAnim.dListCount, func_80B1D278, func_80B1D2E4, - &thisAgain->actor); + func_800A1AC8(globalCtx, thisAgain->skelAnim.limbIndex, thisAgain->skelAnim.actorDrawTbl, + thisAgain->skelAnim.dListCount, func_80B1D278, func_80B1D2E4, &thisAgain->actor); func_800C6B54(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1312); } diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.c b/src/overlays/actors/ovl_En_Torch/z_en_torch.c index e3c3f73ae7..7c973a93cc 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.c +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.c @@ -2,56 +2,37 @@ * File: z_en_torch.c * Overlay: ovl_En_Torch * Description: Spawns a chest with the appropriate contents then unloads. Used in grottos. -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; } ActorEnTorch; // size = 0x014C -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void Init(ActorEnTorch* this, GlobalContext* globalCtx); -const ActorInit En_Torch_InitVars = -{ - ACTOR_EN_TORCH, - ACTORTYPE_ITEMACTION, - ROOM, - FLAGS, - OBJECT_GAMEPLAY_KEEP, - sizeof(ActorEnTorch), - (ActorFunc)Init, - NULL, - NULL, - NULL +const ActorInit En_Torch_InitVars = { + ACTOR_EN_TORCH, ACTORTYPE_ITEMACTION, ROOM, FLAGS, OBJECT_GAMEPLAY_KEEP, + sizeof(ActorEnTorch), (ActorFunc)Init, NULL, NULL, NULL, }; static u8 sChestContents[] = { - GI_RUPEE_BLUE, - GI_RUPEE_RED, - GI_RUPEE_GOLD, - GI_BOMBS_20, - GI_BOMBS_1, - GI_BOMBS_1, - GI_BOMBS_1, - GI_BOMBS_1 - }; + GI_RUPEE_BLUE, GI_RUPEE_RED, GI_RUPEE_GOLD, GI_BOMBS_20, GI_BOMBS_1, GI_BOMBS_1, GI_BOMBS_1, GI_BOMBS_1, +}; -static void Init(ActorEnTorch* this, GlobalContext* globalCtx) -{ +static void Init(ActorEnTorch* this, GlobalContext* globalCtx) { s8 returnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data; /* Spawn chest with desired contents. Contents are passed to en_torch from grotto params via Save Context. */ - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - 0, this->actor.shape.rot.y, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->actor.posRot.pos.x, this->actor.posRot.pos.y, + this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, (sChestContents[(returnData >> 0x5) & 0x7] << 0x5) | 0x5000 | (returnData & 0x1F)); Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index b7b44893b8..e5a3efb080 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -1,6 +1,6 @@ #include "z_en_torch2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000035 void EnTorch2_Init(EnTorch2* this, GlobalContext* globalCtx); @@ -40,4 +40,3 @@ const ActorInit En_Torch2_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Torch2/func_80B1F7D4.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Draw.s") - diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index b532e71422..73be3384a9 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -1,6 +1,6 @@ #include "z_en_toryo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnToryo_Init(EnToryo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 24f149bd33..ff00b33425 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -1,6 +1,6 @@ #include "z_en_tp.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnTp_Init(EnTp* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index 480ad6b869..4ebf99e331 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -1,6 +1,6 @@ #include "z_en_tr.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnTr_Init(EnTr* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index 09c45fd277..648e2e186a 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -1,6 +1,6 @@ #include "z_en_trap.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnTrap_Init(EnTrap* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 26431fc665..20fa54640f 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -2,7 +2,7 @@ * File: z_en_tubo_trap.c * Overlay: ovl_En_Tubo_Trap * Description: Flying pot enemy -*/ + */ #include "z_en_tubo_trap.h" @@ -16,28 +16,16 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx); -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 -static ColliderCylinderInit cylinderInitData = -{ - 0x0A, 0x11, 0x09, 0x00, 0x20, 0x01, - 0x00, 0x00, - 0x00, - 0x00, 0x00, 0x00, - 0xFFCFFFFF, - 0x00, 0x04, - 0x00, 0x00, - 0xFFCFFFFF, - 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x00, - 0x00, - 0x0009, 0x0017, 0x0000, - 0x0000, 0x0000, 0x0000 +static ColliderCylinderInit cylinderInitData = { + 0x0A, 0x11, 0x09, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFFCFFFFF, 0x00, 0x04, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x00, 0x00, 0x0009, 0x0017, 0x0000, 0x0000, 0x0000, 0x0000, }; -const ActorInit En_Tubo_Trap_InitVars = -{ +const ActorInit En_Tubo_Trap_InitVars = { ACTOR_EN_TUBO_TRAP, ACTORTYPE_PROP, ROOM, @@ -53,8 +41,7 @@ const ActorInit En_Tubo_Trap_InitVars = extern UNK_TYPE D_05017A60; extern Gfx D_05017870[]; -void EnTuboTrap_Init(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_Init(EnTuboTrap* this, GlobalContext* globalCtx) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 2.0f); osSyncPrintf("\n\n"); @@ -65,26 +52,22 @@ void EnTuboTrap_Init(EnTuboTrap* this, GlobalContext* globalCtx) this->actionFunc = (ActorFunc)EnTuboTrap_WaitForProximity; } -void EnTuboTrap_Destroy(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_Destroy(EnTuboTrap* this, GlobalContext* globalCtx) { ColliderCylinderMain* collider = &this->collider; ActorCollider_FreeCylinder(globalCtx, collider); } -void EnTuboTrap_DropCollectible(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_DropCollectible(EnTuboTrap* this, GlobalContext* globalCtx) { s16 params = this->actor.params; s16 param3FF = (params >> 6) & 0x3FF; - if (param3FF >= 0 && param3FF < 0x1A) - { + if (param3FF >= 0 && param3FF < 0x1A) { Item_DropCollectible(globalCtx, &this->actor.posRot, param3FF | ((params & 0x3F) << 8)); } } #ifdef NON_MATCHING // regalloc and stack usage differences, most likely the same differences as EnTuboTrap_SpawnWaterFragments -void EnTuboTrap_SpawnFragments(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_SpawnFragments(EnTuboTrap* this, GlobalContext* globalCtx) { Vec3f* actorPos; f32 rand; f32 cos; @@ -99,8 +82,7 @@ void EnTuboTrap_SpawnFragments(EnTuboTrap* this, GlobalContext* globalCtx) addr = &D_05017A60; actorPos = &this->actor.posRot.pos; - for (i = 0, var = 0; i < 15; i++, var += 20000) - { + for (i = 0, var = 0; i < 15; i++, var += 20000) { sin = Math_Sins(var); cos = Math_Coss(var); spC8.x = sin * 8.0f; @@ -135,8 +117,7 @@ void EnTuboTrap_SpawnFragments(EnTuboTrap* this, GlobalContext* globalCtx) #ifdef NON_MATCHING // regalloc and stack usage differences, most likely the same differences as EnTuboTrap_SpawnFragments -void EnTuboTrap_SpawnWaterFragments(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_SpawnWaterFragments(EnTuboTrap* this, GlobalContext* globalCtx) { Vec3f* actorPos; f32 rand; f32 cos; @@ -156,8 +137,7 @@ void EnTuboTrap_SpawnWaterFragments(EnTuboTrap* this, GlobalContext* globalCtx) func_8002949C(globalCtx, &spC8, 0, 0, 0, 400); - for (i = 0, var = 0; i < 15; i++, var += 20000) - { + for (i = 0, var = 0; i < 15; i++, var += 20000) { sin = Math_Sins(var); cos = Math_Coss(var); spC8.x = sin * 8.0f; @@ -187,13 +167,11 @@ void EnTuboTrap_SpawnWaterFragments(EnTuboTrap* this, GlobalContext* globalCtx) #endif #ifdef NON_MATCHING -void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { s32 pad; Player* player = PLAYER; - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.unk_84 > 15.0f)) - { + if ((this->actor.bgCheckFlags & 0x20) && (this->actor.unk_84 > 15.0f)) { EnTuboTrap_SpawnWaterFragments(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_BOMB_DROP_WATER); EnTuboTrap_DropCollectible(this, globalCtx); @@ -201,8 +179,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) return; } - if (this->collider.base.colliderFlags & 4) - { + if (this->collider.base.colliderFlags & 4) { this->collider.base.colliderFlags &= ~4; EnTuboTrap_SpawnFragments(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); @@ -212,8 +189,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) return; } - if (this->collider.base.collideFlags & 2) - { + if (this->collider.base.collideFlags & 2) { this->collider.base.collideFlags &= ~2; EnTuboTrap_SpawnFragments(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_EXPLOSION); @@ -223,11 +199,9 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) return; } - if (this->collider.base.colliderFlags & 2) - { + if (this->collider.base.colliderFlags & 2) { this->collider.base.colliderFlags &= ~2; - if (this->collider.base.at == &player->actor) - { + if (this->collider.base.at == &player->actor) { EnTuboTrap_SpawnFragments(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); Audio_PlaySoundAtPosition(globalCtx, &player->actor.posRot.pos, 40, 0x83E); @@ -237,8 +211,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) } } - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1)) - { + if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1)) { EnTuboTrap_SpawnFragments(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); @@ -250,27 +223,25 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tubo_Trap/EnTuboTrap_HandleImpact.s") #endif -void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) { Player* player = PLAYER; f32 targetHeight; - if (BREG(2) != 0) - { - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わて ☆☆☆☆☆ %f\n" VT_RST, this->actor.posRot.pos.y); // "You" + if (BREG(2) != 0) { + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わて ☆☆☆☆☆ %f\n" VT_RST, this->actor.posRot.pos.y); // "You" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ おいどん ☆☆☆☆☆ %f\n" VT_RST, player->actor.posRot.pos.y); // "Me" osSyncPrintf("\n\n"); } - if (this->actor.xzDistanceFromLink < 200.0f && this->actor.posRot.pos.y <= player->actor.posRot.pos.y) - { + if (this->actor.xzDistanceFromLink < 200.0f && this->actor.posRot.pos.y <= player->actor.posRot.pos.y) { Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this, ACTORTYPE_ENEMY); this->actor.flags |= 1; targetHeight = 40.0f + -10.0f * gSaveContext.link_age; this->targetY = player->actor.posRot.pos.y + targetHeight; - if (this->targetY < this->actor.posRot.pos.y) + if (this->targetY < this->actor.posRot.pos.y) { this->targetY = this->actor.posRot.pos.y + targetHeight; + } this->originPos = this->actor.posRot.pos; Audio_PlayActorSound2(this, NA_SE_EV_POT_MOVE_START); @@ -278,36 +249,33 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) } } -void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += 5000; Math_SmoothScaleMaxF(&this->actor.posRot.pos.y, this->targetY, 0.8f, 3.0f); - if (fabsf(this->actor.posRot.pos.y - this->targetY) < 10.0f) - { + if (fabsf(this->actor.posRot.pos.y - this->targetY) < 10.0f) { this->actor.speedXZ = 10.0f; this->actor.posRot.rot.y = this->actor.rotTowardsLinkY; this->actionFunc = (ActorFunc)EnTuboTrap_Fly; } } -void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx) { f32 dx = this->originPos.x - this->actor.posRot.pos.x; f32 dy = this->originPos.y - this->actor.posRot.pos.y; f32 dz = this->originPos.z - this->actor.posRot.pos.z; Audio_PlayActorSound2(&this->actor, 0x3037); - if (240.0f < sqrtf(SQ(dx) + SQ(dy) + SQ(dz))) + if (240.0f < sqrtf(SQ(dx) + SQ(dy) + SQ(dz))) { Math_SmoothScaleMaxF(&this->actor.gravity, -3.0f, 0.2f, 0.5f); + } this->actor.shape.rot.y += 5000; EnTuboTrap_HandleImpact(this, globalCtx); } -void EnTuboTrap_Update(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_Update(EnTuboTrap* this, GlobalContext* globalCtx) { EnTuboTrap* tuboTrap = this; SubGlobalContext11E60* sub_11E60 = &globalCtx->sub_11E60; @@ -320,7 +288,6 @@ void EnTuboTrap_Update(EnTuboTrap* this, GlobalContext* globalCtx) Actor_CollisionCheck_SetAT(globalCtx, sub_11E60, &tuboTrap->collider); } -void EnTuboTrap_Draw(EnTuboTrap* this, GlobalContext* globalCtx) -{ +void EnTuboTrap_Draw(EnTuboTrap* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, D_05017870); } diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 9a55707a3b..aabb4d5122 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -1,6 +1,6 @@ #include "z_en_vali.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00001015 void EnVali_Init(EnVali* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Vase/z_en_vase.c b/src/overlays/actors/ovl_En_Vase/z_en_vase.c index f5ccb7f14d..b59658505b 100644 --- a/src/overlays/actors/ovl_En_Vase/z_en_vase.c +++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.c @@ -2,52 +2,41 @@ * File: z_en_vase.c * Overlay: ovl_En_Vase * Description: An unused, orange pot based on ALTTP. Lacks collision. -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; } ActorEnVase; // size = 0x014C -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void Init(ActorEnVase* this, GlobalContext* globalCtx); static void Destroy(ActorEnVase* this, GlobalContext* globalCtx); static void Draw(ActorEnVase* this, GlobalContext* globalCtx); -const ActorInit En_Vase_InitVars = -{ - ACTOR_EN_VASE, - ACTORTYPE_PROP, - ROOM, - FLAGS, - OBJECT_VASE, - sizeof(ActorEnVase), - (ActorFunc)Init, - (ActorFunc)Destroy, - (ActorFunc)Actor_Noop, - (ActorFunc)Draw +const ActorInit En_Vase_InitVars = { + ACTOR_EN_VASE, ACTORTYPE_PROP, ROOM, + FLAGS, OBJECT_VASE, sizeof(ActorEnVase), + (ActorFunc)Init, (ActorFunc)Destroy, (ActorFunc)Actor_Noop, + (ActorFunc)Draw, }; extern u32 DL_VASE; -static void Init(ActorEnVase* this, GlobalContext* globalCtx) -{ +static void Init(ActorEnVase* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->actor.posRot2.pos = this->actor.posRot.pos; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f); } -static void Destroy(ActorEnVase* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorEnVase* this, GlobalContext* globalCtx) { } -static void Draw(ActorEnVase* this, GlobalContext* globalCtx) -{ +static void Draw(ActorEnVase* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &DL_VASE); } diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index c0f7c6a636..3dc05ae313 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -1,6 +1,6 @@ #include "z_en_vb_ball.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EnVbBall_Init(EnVbBall* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index 961cc513e6..7f5a95a227 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -1,6 +1,6 @@ #include "z_en_viewer.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnViewer_Init(EnViewer* this, GlobalContext* globalCtx); @@ -70,4 +70,3 @@ const ActorInit En_Viewer_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Viewer/func_80B2C8AC.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Viewer/func_80B2CC1C.s") - diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index 63dca9ee7d..158afe4cb2 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -1,6 +1,6 @@ #include "z_en_vm.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000011 void EnVm_Init(EnVm* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c index e7b284c307..c77b52a7b3 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c @@ -1,6 +1,6 @@ #include "z_en_wall_tubo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnWallTubo_Init(EnWallTubo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index f1e89098fd..ffcb83d1b8 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -2,46 +2,45 @@ * File: z_en_wallmas * Overlay: En_Wallmas * Description: Wallmaster (Ceiling monster) -*/ + */ #include "z_en_wallmas.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 #define TIMER_SCALE 0.0062500000931322574615478515625f #define DEGREE_60_RAD 1.0471975803375244140625f #define DEGREE_15_RAD 0.261799395084381103515625f -#define DAMAGE_EFFECT_BURN 2 -#define DAMAGE_EFFECT_STUN_WHITE 4 -#define DAMAGE_EFFECT_STUN_BLUE 1 +#define DAMAGE_EFFECT_BURN 2 +#define DAMAGE_EFFECT_STUN_WHITE 4 +#define DAMAGE_EFFECT_STUN_BLUE 1 static void EnWallmas_Init(EnWallmas* this, GlobalContext* globalCtx); static void EnWallmas_Destroy(EnWallmas* this, GlobalContext* globalCtx); -static void EnWallmas_TimerInit(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_ProximityOrSwitchInit(EnWallmas *this); -static void EnWallmas_WaitToDrop(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_Drop(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_Land(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_Stand(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_JumpToCeiling(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_ReturnToCeiling(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_TakeDamage(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_DamageCoolDown(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_Die(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_TakePlayer(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_WaitForProximity(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_WaitForSwitchFlag(EnWallmas *this, GlobalContext *globalCtx); -static void EnWallmas_Stun(EnWallmas *this, GlobalContext *globalCtx); +static void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_ProximityOrSwitchInit(EnWallmas* this); +static void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_Land(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_JumpToCeiling(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_DamageCoolDown(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_Die(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_WaitForProximity(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_WaitForSwitchFlag(EnWallmas* this, GlobalContext* globalCtx); +static void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx); static void EnWallmas_Update(EnWallmas* this, GlobalContext* globalCtx); -static void EnWallmas_Walk(EnWallmas *this, GlobalContext *globalCtx); -static s32 EnWallMas_UpdatePos(GlobalContext *globalCtx, s32 arg1, s32 arg2, Actor *arg3, void *arg4, EnWallmas *arg5); -static void EnWallmas_DrawOpa(GlobalContext *globalCtx, s32 arg1, s32 arg2, s32 arg3); +static void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx); +static s32 EnWallMas_UpdatePos(GlobalContext* globalCtx, s32 arg1, s32 arg2, Actor* arg3, void* arg4, EnWallmas* arg5); +static void EnWallmas_DrawOpa(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3); static void EnWallmas_Draw(EnWallmas* this, GlobalContext* globalCtx); -const ActorInit En_Wallmas_InitVars = -{ +const ActorInit En_Wallmas_InitVars = { ACTOR_EN_WALLMAS, ACTORTYPE_ENEMY, ROOM, @@ -54,167 +53,20 @@ const ActorInit En_Wallmas_InitVars = (ActorFunc)EnWallmas_Draw, }; -static ColliderCylinderInit colCylinderInit = -{ - { - 0x00, - 0x00, - 0x09, - 0x39, - 0x10, - 0x01, - { - 0x00, - 0x00, - }, - }, - { - 0x00, - { - 0x00, - 0x00, - 0x00, - }, - 0x00000000, - 0x00, - 0x00, - { - 0x00, - 0x00, - }, - 0xFFCFFFFF, - { - 0x00, - 0x00, - 0x00, - 0x00 - }, - 0x00, - 0x01, - 0x01, - 0x00, - }, - { - 0x001E, - 0x0028, - 0x0000, - { - 0x0000, - 0x0000, - 0x0000, - }, - }, +static ColliderCylinderInit colCylinderInit = { + 0x00, 0x00, 0x09, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x00, 0x001E, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000, }; -static SubActor98Init subActor98Init = -{ - 0x04, - 0x001E, - 0x0028, - 0x96, -}; +static SubActor98Init subActor98Init = { 0x04, 0x001E, 0x0028, 0x96 }; -static ActorDamageChart damageChart = -{ - { - { - 0x1, 0x0, - }, - { - 0x0, 0x2, - }, - { - 0x0, 0x1, - }, - { - 0x0, 0x2, - }, - { - 0x1, 0x0, - }, - { - 0x0, 0x2, - }, - { - 0x0, 0x2, - }, - { - 0x1, 0x0, - }, - { - 0x0, 0x1, - }, - { - 0x0, 0x2, - }, - { - 0x0, 0x4, - }, - { - 0x2, 0x4, - }, - { - 0x0, 0x2, - }, - { - 0x4, 0x4, - }, - { - 0x0, 0x4, - }, - { - 0x0, 0x2, - }, - { - 0x0, 0x2, - }, - { - 0x2, 0x4, - }, - { - 0x0, 0x0, - }, - { - 0x4, 0x4, - }, - { - 0x0, 0x0, - }, - { - 0x0, 0x0, - }, - { - 0x0, 0x1, - }, - { - 0x0, 0x4, - }, - { - 0x0, 0x2, - }, - { - 0x0, 0x2, - }, - { - 0x0, 0x8, - }, - { - 0x0, 0x4, - }, - { - 0x0, 0x0, - }, - { - 0x0, 0x0, - }, - { - 0x0, 0x4, - }, - { - 0x0, 0x0, - }, - } -}; +static ActorDamageChart damageChart = { { + { 0x1, 0x0 }, { 0x0, 0x2 }, { 0x0, 0x1 }, { 0x0, 0x2 }, { 0x1, 0x0 }, { 0x0, 0x2 }, { 0x0, 0x2 }, { 0x1, 0x0 }, + { 0x0, 0x1 }, { 0x0, 0x2 }, { 0x0, 0x4 }, { 0x2, 0x4 }, { 0x0, 0x2 }, { 0x4, 0x4 }, { 0x0, 0x4 }, { 0x0, 0x2 }, + { 0x0, 0x2 }, { 0x2, 0x4 }, { 0x0, 0x0 }, { 0x4, 0x4 }, { 0x0, 0x0 }, { 0x0, 0x0 }, { 0x0, 0x1 }, { 0x0, 0x4 }, + { 0x0, 0x2 }, { 0x0, 0x2 }, { 0x0, 0x8 }, { 0x0, 0x4 }, { 0x0, 0x0 }, { 0x0, 0x0 }, { 0x0, 0x4 }, { 0x0, 0x0 }, +} }; static InitChainEntry initChain[3] = { ICHAIN_S8(naviEnemyId, 0x30, 1), @@ -222,10 +74,7 @@ static InitChainEntry initChain[3] = { ICHAIN_F32_DIV1000(gravity, 0xFA24, 0), }; -static Vec3f D_80B30D70 = -{ - 0.0f, 0.0f, 0.0f, -}; +static Vec3f D_80B30D70 = { 0.0f, 0.0f, 0.0f }; extern u32 D_06000EA4; extern u32 D_06000590; @@ -240,14 +89,12 @@ extern u32 D_0600A054; extern u32 D_06008688; extern u32 D_04049210; -static void EnWallmas_Init(EnWallmas *this, GlobalContext *globalCtx) -{ - EnWallmas *this2 = this; +static void EnWallmas_Init(EnWallmas* this, GlobalContext* globalCtx) { + EnWallmas* this2 = this; Actor_ProcessInitChain(&this->actor, initChain); ActorShape_Init(&this->actor.shape, 0, NULL, 0.5f); - func_800A46F8(globalCtx, &this->skelAnime, &D_06008FB0, - &D_06009DB0, &this->unkSkelAnimeStruct, &this->unk_22e, + func_800A46F8(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->unkSkelAnimeStruct, &this->unk_22e, 0x19); ActorCollider_AllocCylinder(globalCtx, &this->colCylinder); @@ -256,35 +103,27 @@ static void EnWallmas_Init(EnWallmas *this, GlobalContext *globalCtx) this2->switchFlag = (u8)(this2->actor.params >> 0x8); this->actor.params = this->actor.params & 0xFF; - if (this->actor.params == WMT_FLAG) - { - if (Flags_GetSwitch(globalCtx, this->switchFlag) != 0) - { + if (this->actor.params == WMT_FLAG) { + if (Flags_GetSwitch(globalCtx, this->switchFlag) != 0) { Actor_Kill(&this->actor); return; } EnWallmas_ProximityOrSwitchInit(this); - } - else if (this->actor.params == WMT_PROXIMITY) - { + } else if (this->actor.params == WMT_PROXIMITY) { EnWallmas_ProximityOrSwitchInit(this); - } - else - { + } else { EnWallmas_TimerInit(this, globalCtx); } } -static void EnWallmas_Destroy(EnWallmas *this, GlobalContext *globalCtx) -{ - ColliderCylinderMain *col = &this->colCylinder; +static void EnWallmas_Destroy(EnWallmas* this, GlobalContext* globalCtx) { + ColliderCylinderMain* col = &this->colCylinder; ActorCollider_FreeCylinder(globalCtx, col); } -static void EnWallmas_TimerInit(EnWallmas *this, GlobalContext *globalCtx) -{ - Player *player = PLAYER; +static void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) { + Player* player = PLAYER; this->actor.flags &= ~1; this->actor.flags |= 0x20; @@ -296,14 +135,12 @@ static void EnWallmas_TimerInit(EnWallmas *this, GlobalContext *globalCtx) this->actionFunc = (ActorFunc)&EnWallmas_WaitToDrop; } -static void EnWallmas_DropStart(EnWallmas *this, GlobalContext *globalCtx) -{ - Player *player = PLAYER; - u32 *objSegChangeAnime = &D_0600299C; +static void EnWallmas_DropStart(EnWallmas* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + u32* objSegChangeAnime = &D_0600299C; - SkelAnime_ChangeAnimation(&this->skelAnime, objSegChangeAnime, 0.0f, - 20.0f, (f32) SkelAnime_GetFrameCount(&D_0600299C), - 2, 0.0f); + SkelAnime_ChangeAnimation(&this->skelAnime, objSegChangeAnime, 0.0f, 20.0f, + (f32)SkelAnime_GetFrameCount(&D_0600299C), 2, 0.0f); this->unk_2c4 = player->actor.posRot.pos.y; this->actor.posRot.pos.y = player->actor.posRot.pos.y + 300.0f; @@ -314,63 +151,52 @@ static void EnWallmas_DropStart(EnWallmas *this, GlobalContext *globalCtx) this->actionFunc = (ActorFunc)&EnWallmas_Drop; } -static void EnWallmas_LandStart(EnWallmas *this, GlobalContext *globalCtx) -{ - u32 *objSegFrameCount = &D_060019CC; - u32 *objSegChangeAnime = &D_060019CC; +static void EnWallmas_LandStart(EnWallmas* this, GlobalContext* globalCtx) { + u32* objSegFrameCount = &D_060019CC; + u32* objSegChangeAnime = &D_060019CC; - SkelAnime_ChangeAnimation(&this->skelAnime, objSegChangeAnime, 1.0f, - 41.0f, SkelAnime_GetFrameCount(objSegFrameCount), - 2, -3.0f); + SkelAnime_ChangeAnimation(&this->skelAnime, objSegChangeAnime, 1.0f, 41.0f, + SkelAnime_GetFrameCount(objSegFrameCount), 2, -3.0f); func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_LAND); this->actionFunc = (ActorFunc)&EnWallmas_Land; } -static void EnWallmas_StandStart(EnWallmas *this) -{ +static void EnWallmas_StandStart(EnWallmas* this) { func_800A51E8(&this->skelAnime, &D_0600A054); this->actionFunc = (ActorFunc)&EnWallmas_Stand; } -static void EnWallmas_WalkStart(EnWallmas *this) -{ +static void EnWallmas_WalkStart(EnWallmas* this) { func_800A529C(&this->skelAnime, &D_060041F4, 3.0f, &this->actor); this->actionFunc = (ActorFunc)&EnWallmas_Walk; this->actor.speedXZ = 3.0f; } -static void EnWallmas_JumpToCeilingStart(EnWallmas *this) -{ +static void EnWallmas_JumpToCeilingStart(EnWallmas* this) { func_800A51E8(&this->skelAnime, &D_06009244); this->actionFunc = (ActorFunc)&EnWallmas_JumpToCeiling; this->actor.speedXZ = 0.0f; } -static void EnWallmas_ReturnToCeilingStart(EnWallmas *this) -{ - u32 *objSegFrameCount = &D_060019CC; - u32 *objSegChangeAnime = &D_060019CC; +static void EnWallmas_ReturnToCeilingStart(EnWallmas* this) { + u32* objSegFrameCount = &D_060019CC; + u32* objSegChangeAnime = &D_060019CC; this->timer = 0; this->actor.speedXZ = 0.0f; - SkelAnime_ChangeAnimation(&this->skelAnime, objSegChangeAnime, 3.0f, - 0.0f, (f32) SkelAnime_GetFrameCount(objSegFrameCount), - 2, -3.0f); + SkelAnime_ChangeAnimation(&this->skelAnime, objSegChangeAnime, 3.0f, 0.0f, + (f32)SkelAnime_GetFrameCount(objSegFrameCount), 2, -3.0f); this->actionFunc = (ActorFunc)&EnWallmas_ReturnToCeiling; } -static void EnWallmas_TakeDamageStart(EnWallmas *this) -{ +static void EnWallmas_TakeDamageStart(EnWallmas* this) { func_800A5240(&this->skelAnime, &D_06000590, -3.0f); - if ((this->colCylinder.body.colliding->toucher.flags & 0x1F824) != 0) - { + if ((this->colCylinder.body.colliding->toucher.flags & 0x1F824) != 0) { this->actor.posRot.rot.y = this->colCylinder.base.ac->posRot.rot.y; - } - else - { + } else { this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->colCylinder.base.ac) + 0x8000; } @@ -380,8 +206,7 @@ static void EnWallmas_TakeDamageStart(EnWallmas *this) this->actor.velocity.y = 10.0f; } -static void EnWallmas_DamageCoolDownStart(EnWallmas *this) -{ +static void EnWallmas_DamageCoolDownStart(EnWallmas* this) { func_800A51E8(&this->skelAnime, &D_06000EA4); this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; @@ -389,21 +214,18 @@ static void EnWallmas_DamageCoolDownStart(EnWallmas *this) this->actionFunc = (ActorFunc)&EnWallmas_DamageCoolDown; } -static void EnWallMas_DieBegin(EnWallmas *this, GlobalContext *globalCtx) -{ +static void EnWallMas_DieBegin(EnWallmas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - func_8002A6B8(globalCtx, &this->actor.posRot.pos, &D_80B30D70, - &D_80B30D70, 0xFA, -0xA, 0xFF, 0xFF, 0xFF, 0xFF, - 0, 0, 0xFF, 1, 9, 1); + func_8002A6B8(globalCtx, &this->actor.posRot.pos, &D_80B30D70, &D_80B30D70, 0xFA, -0xA, 0xFF, 0xFF, 0xFF, 0xFF, 0, + 0, 0xFF, 1, 9, 1); Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xC0); this->actionFunc = (ActorFunc)&EnWallmas_Die; } -static void EnWallmas_TakePlayerBegin(EnWallmas *this, GlobalContext *globalCtx) -{ +static void EnWallmas_TakePlayerBegin(EnWallmas* this, GlobalContext* globalCtx) { func_800A5240(&this->skelAnime, &D_06009520, -5.0f); this->timer = -0x1e; this->actionFunc = (ActorFunc)&EnWallmas_TakePlayer; @@ -415,33 +237,24 @@ static void EnWallmas_TakePlayerBegin(EnWallmas *this, GlobalContext *globalCtx) func_800800F8(globalCtx, 0x251C, 0x270F, &this->actor, 0); } -static void EnWallmas_ProximityOrSwitchInit(EnWallmas *this) -{ +static void EnWallmas_ProximityOrSwitchInit(EnWallmas* this) { this->timer = 0; this->actor.draw = NULL; this->actor.flags = this->actor.flags & ~1; - if (this->actor.params == WMT_PROXIMITY) - { + if (this->actor.params == WMT_PROXIMITY) { this->actionFunc = (ActorFunc)&EnWallmas_WaitForProximity; - } - else - { + } else { this->actionFunc = (ActorFunc)&EnWallmas_WaitForSwitchFlag; } } -static void EnWallmas_StunBegin(EnWallmas *this) -{ - SkelAnime_ChangeAnimation(&this->skelAnime, &D_060019CC, 1.5f, 0, - 20.0f, 2, -3.0f); +static void EnWallmas_StunBegin(EnWallmas* this) { + SkelAnime_ChangeAnimation(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f); this->actor.speedXZ = 0.0f; - if (this->actor.sub_98.damageEffect == 4) - { + if (this->actor.sub_98.damageEffect == 4) { func_8003426C(&this->actor, -0x8000, 0xFF, 0, 0x50); - } - else - { + } else { func_8003426C(&this->actor, 0, 0xFF, 0, 0x50); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); } @@ -450,10 +263,9 @@ static void EnWallmas_StunBegin(EnWallmas *this) this->actionFunc = (ActorFunc)&EnWallmas_Stun; } -static void EnWallmas_WaitToDrop(EnWallmas *this, GlobalContext *globalCtx) -{ - Vec3f *playerPos; - Player *player; +static void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) { + Vec3f* playerPos; + Player* player; player = PLAYER; playerPos = &player->actor.posRot.pos; @@ -461,159 +273,119 @@ static void EnWallmas_WaitToDrop(EnWallmas *this, GlobalContext *globalCtx) this->actor.unk_80 = player->actor.unk_80; this->actor.floorPoly = player->actor.floorPoly; - if (this->timer != 0) - { + if (this->timer != 0) { this->timer--; } - if (((s32)(player->stateFlags1 << 0xB) < 0) - || ((s32)(player->stateFlags1 << 4) < 0) - || ((player->actor.bgCheckFlags & 1) == 0) - || ((this->actor.params == 1) && (320.0f < Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, playerPos)))) - { + if (((s32)(player->stateFlags1 << 0xB) < 0) || ((s32)(player->stateFlags1 << 4) < 0) || + ((player->actor.bgCheckFlags & 1) == 0) || + ((this->actor.params == 1) && (320.0f < Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, playerPos)))) { func_800F8D04(NA_SE_EN_FALL_AIM); this->timer = 0x82; } - if (this->timer == 0x50) - { + if (this->timer == 0x50) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_AIM); } - if (this->timer == 0) - { + if (this->timer == 0) { EnWallmas_DropStart(this, globalCtx); } } -static void EnWallmas_Drop(EnWallmas *this, GlobalContext *globalCtx) -{ - Player *player = PLAYER; - if ((func_8008E988(globalCtx) == 0) && - (player->stateFlags2 & 0x10) == 0 && - (player->unk_A78 >= 0) && - (this->actor.xzDistanceFromLink < 30.0f) && - (this->actor.yDistanceFromLink < -5.0f) && - (-(f32)(player->unk_4DA + 0xA) < this->actor.yDistanceFromLink)) - { +static void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + if ((func_8008E988(globalCtx) == 0) && (player->stateFlags2 & 0x10) == 0 && (player->unk_A78 >= 0) && + (this->actor.xzDistanceFromLink < 30.0f) && (this->actor.yDistanceFromLink < -5.0f) && + (-(f32)(player->unk_4DA + 0xA) < this->actor.yDistanceFromLink)) { EnWallmas_TakePlayerBegin(this, globalCtx); } } -static void EnWallmas_Land(EnWallmas *this, GlobalContext *globalCtx) -{ - if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) - { +static void EnWallmas_Land(EnWallmas* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { EnWallmas_StandStart(this); } } -static void EnWallmas_Stand(EnWallmas *this, GlobalContext *globalCtx) -{ - if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) - { +static void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { EnWallmas_WalkStart(this); } Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, this->actor.rotTowardsLinkY + 0x8000, 0xB6); } -static void EnWallmas_Walk(EnWallmas *this, GlobalContext *globalCtx) -{ - if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) - { +static void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { EnWallmas_JumpToCeilingStart(this); } - Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, - (s16)((s32)this->actor.rotTowardsLinkY + 0x8000), - 0xB6); + Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, (s16)((s32)this->actor.rotTowardsLinkY + 0x8000), 0xB6); - if ((func_800A56C8(&this->skelAnime, 0.0f) != 0) || - (func_800A56C8(&this->skelAnime, 12.0f) != 0) || - (func_800A56C8(&this->skelAnime, 24.0f) != 0) || - (func_800A56C8(&this->skelAnime, 36.0f) != 0)) - { + if ((func_800A56C8(&this->skelAnime, 0.0f) != 0) || (func_800A56C8(&this->skelAnime, 12.0f) != 0) || + (func_800A56C8(&this->skelAnime, 24.0f) != 0) || (func_800A56C8(&this->skelAnime, 36.0f) != 0)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); } } -static void EnWallmas_JumpToCeiling(EnWallmas *this, GlobalContext *globalCtx) -{ - if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) - { +static void EnWallmas_JumpToCeiling(EnWallmas* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { EnWallmas_ReturnToCeilingStart(this); } } -static void EnWallmas_ReturnToCeiling(EnWallmas *this, GlobalContext *globalCtx) -{ - Player *player = PLAYER; +static void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) { + Player* player = PLAYER; SkelAnime_FrameUpdateMatrix(&this->skelAnime); - if (this->skelAnime.animCurrentFrame > 20.0f) - { + if (this->skelAnime.animCurrentFrame > 20.0f) { this->timer += 9; this->actor.posRot.pos.y = this->actor.posRot.pos.y + 30.0f; } - if (func_800A56C8(&this->skelAnime, 20.0f) != 0) - { + if (func_800A56C8(&this->skelAnime, 20.0f) != 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_UP); } - if (this->actor.yDistanceFromLink < -900.0f) - { - if (this->actor.params == WMT_FLAG) - { + if (this->actor.yDistanceFromLink < -900.0f) { + if (this->actor.params == WMT_FLAG) { Actor_Kill(&this->actor); return; } - if (this->actor.params == WMT_TIMER || Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 200.0f) - { + if (this->actor.params == WMT_TIMER || + Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 200.0f) { EnWallmas_TimerInit(this, globalCtx); return; - } - else - { + } else { EnWallmas_ProximityOrSwitchInit(this); } } } -static void EnWallmas_TakeDamage(EnWallmas *this, GlobalContext *globalCtx) -{ - if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) - { - if (this->actor.sub_98.health == 0) - { +static void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { + if (this->actor.sub_98.health == 0) { EnWallMas_DieBegin(this, globalCtx); - } - else - { + } else { EnWallmas_DamageCoolDownStart(this); } } - if (func_800A56C8(&this->skelAnime, 13.0f) != 0) - { + if (func_800A56C8(&this->skelAnime, 13.0f) != 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } Math_ApproxF(&this->actor.speedXZ, 0.0f, 0.2f); } -static void EnWallmas_DamageCoolDown(EnWallmas *this, GlobalContext *globalCtx) -{ - if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) - { +static void EnWallmas_DamageCoolDown(EnWallmas* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { EnWallmas_ReturnToCeilingStart(this); } } -static void EnWallmas_Die(EnWallmas *this, GlobalContext *globalCtx) -{ - if (Math_ApproxF(&this->actor.scale.x, 0.0f, 0.0015) != 0) - { +static void EnWallmas_Die(EnWallmas* this, GlobalContext* globalCtx) { + if (Math_ApproxF(&this->actor.scale.x, 0.0f, 0.0015) != 0) { Actor_SetScale(&this->actor, 0.01f); Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xC0); Actor_Kill(&this->actor); @@ -622,153 +394,112 @@ static void EnWallmas_Die(EnWallmas *this, GlobalContext *globalCtx) this->actor.scale.y = this->actor.scale.x; } -static void EnWallmas_TakePlayer(EnWallmas *this, GlobalContext *globalCtx) -{ - Player *player; +static void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { + Player* player; player = PLAYER; - if (func_800A56C8(&this->skelAnime, 1.0f) != 0) - { - if (LINK_IS_CHILD) - { + if (func_800A56C8(&this->skelAnime, 1.0f) != 0) { + if (LINK_IS_CHILD) { func_8002F7DC(&this->actor, NA_SE_VO_LI_DAMAGE_S_KID); - } - else - { + } else { func_8002F7DC(&this->actor, NA_SE_VO_LI_DAMAGE_S); } Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_CATCH); } - if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) - { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { player->actor.posRot.pos.x = this->actor.posRot.pos.x; player->actor.posRot.pos.z = this->actor.posRot.pos.z; - if (this->timer < 0) - { + if (this->timer < 0) { this->actor.posRot.pos.y = this->actor.posRot.pos.y + 2.0f; - } - else - { + } else { this->actor.posRot.pos.y = this->actor.posRot.pos.y + 10.0f; } - if (gSaveContext.link_age != 0) - { + if (gSaveContext.link_age != 0) { player->actor.posRot.pos.y = this->actor.posRot.pos.y - 30.0f; - } - else - { + } else { player->actor.posRot.pos.y = this->actor.posRot.pos.y - 50.0f; } - if (this->timer == -0x1E) - { - if (gSaveContext.link_age != 0) - { + if (this->timer == -0x1E) { + if (gSaveContext.link_age != 0) { func_8002F7DC(&this->actor, NA_SE_VO_LI_TAKEN_AWAY_KID); - } - else - { + } else { func_8002F7DC(&this->actor, NA_SE_VO_LI_TAKEN_AWAY); } } - if (this->timer == 0) - { + if (this->timer == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_UP); } this->timer = this->timer + 2; - } - else - { - Math_ApproxF(&this->actor.posRot.pos.y, player->actor.posRot.pos.y + (gSaveContext.link_age != 0 ? 30.0f : 50.0f) , 5.0f); + } else { + Math_ApproxF(&this->actor.posRot.pos.y, + player->actor.posRot.pos.y + (gSaveContext.link_age != 0 ? 30.0f : 50.0f), 5.0f); } Math_ApproxF(&this->actor.posRot.pos.x, player->actor.posRot.pos.x, 3.0f); Math_ApproxF(&this->actor.posRot.pos.z, player->actor.posRot.pos.z, 3.0f); - if (this->timer == 0x1E) - { + if (this->timer == 0x1E) { func_80078884(NA_SE_OC_ABYSS); func_800C0C88(globalCtx); } } -static void EnWallmas_WaitForProximity(EnWallmas *this, GlobalContext *globalCtx) -{ - Player *player = PLAYER; - if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 200.0f) - { +static void EnWallmas_WaitForProximity(EnWallmas* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 200.0f) { EnWallmas_TimerInit(this, globalCtx); } } -static void EnWallmas_WaitForSwitchFlag(EnWallmas *this, GlobalContext *globalCtx) -{ - if (Flags_GetSwitch(globalCtx, this->switchFlag) != 0) - { +static void EnWallmas_WaitForSwitchFlag(EnWallmas* this, GlobalContext* globalCtx) { + if (Flags_GetSwitch(globalCtx, this->switchFlag) != 0) { EnWallmas_TimerInit(this, globalCtx); this->timer = 0x51; } } -static void EnWallmas_Stun(EnWallmas *this, GlobalContext *globalCtx) -{ +static void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) { SkelAnime_FrameUpdateMatrix(&this->skelAnime); - if (this->timer != 0) - { + if (this->timer != 0) { this->timer--; } - if (this->timer == 0) - { - if (this->actor.sub_98.health == 0) - { + if (this->timer == 0) { + if (this->actor.sub_98.health == 0) { EnWallMas_DieBegin(this, globalCtx); - } - else - { + } else { EnWallmas_ReturnToCeilingStart(this); } } } -static void EnWallmas_ColUpdate(EnWallmas *this, GlobalContext *globalCtx) -{ - if ((this->colCylinder.base.collideFlags & 2) != 0) - { +static void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) { + if ((this->colCylinder.base.collideFlags & 2) != 0) { this->colCylinder.base.collideFlags &= ~2; func_80035650(&this->actor, &this->colCylinder.body, 1); - if ((this->actor.sub_98.damageEffect != 0) || (this->actor.sub_98.damage != 0)) - { - if (Actor_ApplyDamage(&this->actor) == 0) - { + if ((this->actor.sub_98.damageEffect != 0) || (this->actor.sub_98.damage != 0)) { + if (Actor_ApplyDamage(&this->actor) == 0) { func_80032C7C(globalCtx, &this->actor); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_DEAD); this->actor.flags &= ~1; - } - else - { - if (this->actor.sub_98.damage != 0) - { + } else { + if (this->actor.sub_98.damage != 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_DAMAGE); } } if ((this->actor.sub_98.damageEffect == DAMAGE_EFFECT_STUN_WHITE) || - (this->actor.sub_98.damageEffect == DAMAGE_EFFECT_STUN_BLUE)) - { - if (this->actionFunc != (ActorFunc)&EnWallmas_Stun) - { + (this->actor.sub_98.damageEffect == DAMAGE_EFFECT_STUN_BLUE)) { + if (this->actionFunc != (ActorFunc)&EnWallmas_Stun) { EnWallmas_StunBegin(this); } - } - else - { - if (this->actor.sub_98.damageEffect == DAMAGE_EFFECT_BURN) - { + } else { + if (this->actor.sub_98.damageEffect == DAMAGE_EFFECT_BURN) { func_8002A65C(globalCtx, &this->actor, &this->actor.posRot.pos, 0x28, 0x28); } @@ -778,9 +509,8 @@ static void EnWallmas_ColUpdate(EnWallmas *this, GlobalContext *globalCtx) } } -static void EnWallmas_Update(EnWallmas *this, GlobalContext *globalCtx) -{ - EnWallmas *this2 = this; +static void EnWallmas_Update(EnWallmas* this, GlobalContext* globalCtx) { + EnWallmas* this2 = this; char pad[4]; EnWallmas_ColUpdate(this2, globalCtx); @@ -789,63 +519,51 @@ static void EnWallmas_Update(EnWallmas *this, GlobalContext *globalCtx) if ((this2->actionFunc == (ActorFunc)&EnWallmas_WaitToDrop) || (this2->actionFunc == (ActorFunc)&EnWallmas_WaitForProximity) || (this2->actionFunc == (ActorFunc)&EnWallmas_TakePlayer) || - (this2->actionFunc == (ActorFunc)&EnWallmas_WaitForSwitchFlag)) - { + (this2->actionFunc == (ActorFunc)&EnWallmas_WaitForSwitchFlag)) { return; } if ((this2->actionFunc != (ActorFunc)&EnWallmas_ReturnToCeiling) && - (this2->actionFunc != (ActorFunc)&EnWallmas_TakePlayer)) - { + (this2->actionFunc != (ActorFunc)&EnWallmas_TakePlayer)) { Actor_MoveForward(&this->actor); } - if (this2->actionFunc != (ActorFunc)&EnWallmas_Drop) - { + if (this2->actionFunc != (ActorFunc)&EnWallmas_Drop) { func_8002E4B4(globalCtx, &this2->actor, 20.0f, 25.0f, 0.0f, 0x1D); - } - else if (this2->actor.posRot.pos.y <= this2->unk_2c4) - { + } else if (this2->actor.posRot.pos.y <= this2->unk_2c4) { this2->actor.posRot.pos.y = this2->unk_2c4; this2->actor.velocity.y = 0.0f; EnWallmas_LandStart(this2, globalCtx); } - if ((this2->actionFunc != (ActorFunc)&EnWallmas_Die) && - (this2->actionFunc != (ActorFunc)&EnWallmas_Drop)) - { + if ((this2->actionFunc != (ActorFunc)&EnWallmas_Die) && (this2->actionFunc != (ActorFunc)&EnWallmas_Drop)) { ActorCollider_Cylinder_Update(&this2->actor, &this2->colCylinder); Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this2->colCylinder); - if ((this2->actionFunc != (ActorFunc)&EnWallmas_TakeDamage) && - (this2->actor.bgCheckFlags & 1) != 0 && - (this2->actor.freeze == 0)) - { + if ((this2->actionFunc != (ActorFunc)&EnWallmas_TakeDamage) && (this2->actor.bgCheckFlags & 1) != 0 && + (this2->actor.freeze == 0)) { Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this2->colCylinder); } } Actor_SetHeight(&this2->actor, 25.0f); - if (this->actionFunc == (ActorFunc)&EnWallmas_TakeDamage) - { + if (this->actionFunc == (ActorFunc)&EnWallmas_TakeDamage) { return; } this2->actor.shape.rot.y = this2->actor.posRot.rot.y; } -static void EnWallmas_DrawXlu(EnWallmas *this, GlobalContext *globalCtx) -{ +static void EnWallmas_DrawXlu(EnWallmas* this, GlobalContext* globalCtx) { char pad[8]; MtxF mf; - GraphicsContext *gfxCtx; + GraphicsContext* gfxCtx; f32 xzScale; - Gfx *gfx[3]; + Gfx* gfx[3]; if ((this->actor.floorPoly == NULL) || - ((this->timer >= 0x51) && (this->actionFunc != (ActorFunc)&EnWallmas_Stun))) - { + ((this->timer >= 0x51) && (this->actionFunc != (ActorFunc)&EnWallmas_Stun))) { return; } @@ -859,13 +577,12 @@ static void EnWallmas_DrawXlu(EnWallmas *this, GlobalContext *globalCtx) func_80038A28(this->actor.floorPoly, this->actor.posRot.pos.x, this->actor.unk_80, this->actor.posRot.pos.z, &mf); Matrix_Mult(&mf, MTXMODE_NEW); - if ((this->actionFunc != (ActorFunc)EnWallmas_WaitToDrop) && (this->actionFunc != (ActorFunc)EnWallmas_ReturnToCeiling) && - (this->actionFunc != (ActorFunc)EnWallmas_TakePlayer) && (this->actionFunc != (ActorFunc)EnWallmas_WaitForSwitchFlag)) - { + if ((this->actionFunc != (ActorFunc)EnWallmas_WaitToDrop) && + (this->actionFunc != (ActorFunc)EnWallmas_ReturnToCeiling) && + (this->actionFunc != (ActorFunc)EnWallmas_TakePlayer) && + (this->actionFunc != (ActorFunc)EnWallmas_WaitForSwitchFlag)) { xzScale = this->actor.scale.x * 50.0f; - } - else - { + } else { xzScale = ((0x50 - this->timer) >= 0x51 ? 0x50 : (0x50 - this->timer)) * TIMER_SCALE; } @@ -875,29 +592,24 @@ static void EnWallmas_DrawXlu(EnWallmas *this, GlobalContext *globalCtx) func_800C6B54(gfx, globalCtx->state.gfxCtx, "../z_en_wallmas.c", 1426); } -static s32 EnWallMas_UpdatePos(GlobalContext *globalCtx, s32 arg1, s32 arg2, Actor *arg3, void *arg4, EnWallmas *arg5) -{ - if (arg1 == 1) - { - if (arg5->actionFunc != (ActorFunc)EnWallmas_TakePlayer) - { +static s32 EnWallMas_UpdatePos(GlobalContext* globalCtx, s32 arg1, s32 arg2, Actor* arg3, void* arg4, EnWallmas* arg5) { + if (arg1 == 1) { + if (arg5->actionFunc != (ActorFunc)EnWallmas_TakePlayer) { arg3->initPosRot.pos.x = arg3->initPosRot.pos.x - 1600.0f; - } - else - { - arg3->initPosRot.pos.x = arg3->initPosRot.pos.x - ((1600.0f * (arg5->skelAnime.animFrameCount - arg5->skelAnime.animCurrentFrame)) / arg5->skelAnime.animFrameCount); + } else { + arg3->initPosRot.pos.x = arg3->initPosRot.pos.x - + ((1600.0f * (arg5->skelAnime.animFrameCount - arg5->skelAnime.animCurrentFrame)) / + arg5->skelAnime.animFrameCount); } } return 0; } -static void EnWallmas_DrawOpa(GlobalContext *globalCtx, s32 arg1, s32 arg2, s32 arg3) -{ - GraphicsContext *gfxCtx; - Gfx *gfx[4]; +static void EnWallmas_DrawOpa(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3) { + GraphicsContext* gfxCtx; + Gfx* gfx[4]; - if (arg1 == 2) - { + if (arg1 == 2) { gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(&gfx, globalCtx->state.gfxCtx, "../z_en_wallmas.c", 1478); @@ -915,13 +627,12 @@ static void EnWallmas_DrawOpa(GlobalContext *globalCtx, s32 arg1, s32 arg2, s32 } } -static void EnWallmas_Draw(EnWallmas *this, GlobalContext *globalCtx) -{ - if (this->actionFunc != (ActorFunc)&EnWallmas_WaitToDrop) - { +static void EnWallmas_Draw(EnWallmas* this, GlobalContext* globalCtx) { + if (this->actionFunc != (ActorFunc)&EnWallmas_WaitToDrop) { func_80093D18(globalCtx->state.gfxCtx); - func_800A1AC8(globalCtx, this->skelAnime.limbIndex, this->skelAnime.actorDrawTbl, this->skelAnime.dListCount, &EnWallMas_UpdatePos, &EnWallmas_DrawOpa, &this->actor); + func_800A1AC8(globalCtx, this->skelAnime.limbIndex, this->skelAnime.actorDrawTbl, this->skelAnime.dListCount, + &EnWallMas_UpdatePos, &EnWallmas_DrawOpa, &this->actor); } EnWallmas_DrawXlu(this, globalCtx); -} \ No newline at end of file +} diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index ebe2a89f64..36a6f836e4 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -1,6 +1,6 @@ #include "z_en_weather_tag.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnWeatherTag_Init(EnWeatherTag* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index c6c0100083..41b2fa0620 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -1,6 +1,6 @@ #include "z_en_weiyer.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000005 void EnWeiyer_Init(EnWeiyer* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index a4ab4557ab..935ba04d21 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -1,6 +1,6 @@ #include "z_en_wf.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnWf_Init(EnWf* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 45a8b18a1b..207907bc0f 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -1,6 +1,6 @@ #include "z_en_wonder_item.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnWonderItem_Init(EnWonderItem* this, GlobalContext* globalCtx); @@ -43,4 +43,3 @@ const ActorInit En_Wonder_Item_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Wonder_Item/func_80B38B78.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Wonder_Item/EnWonderItem_Update.s") - diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index b87c21866f..ccb0fed444 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -1,6 +1,6 @@ #include "z_en_wonder_talk.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x08000009 void EnWonderTalk_Init(EnWonderTalk* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 17ce0a5b4c..c3799d112e 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -1,6 +1,6 @@ #include "z_en_wonder_talk2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x08000009 void EnWonderTalk2_Init(EnWonderTalk2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 9a28576839..1a49a412aa 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -1,6 +1,6 @@ #include "z_en_wood02.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnWood02_Init(EnWood02* this, GlobalContext* globalCtx); @@ -34,4 +34,3 @@ const ActorInit En_Wood02_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Wood02/EnWood02_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Wood02/EnWood02_Draw.s") - diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 8740418da2..a6a3f4468e 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -1,6 +1,6 @@ #include "z_en_xc.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnXc_Init(EnXc* this, GlobalContext* globalCtx); @@ -498,4 +498,3 @@ const ActorInit En_Xc_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B41BA4.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Xc/EnXc_Draw.s") - diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index ce68e7f1ce..de8b1b2dd7 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -1,6 +1,6 @@ #include "z_en_yabusame_mark.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void EnYabusameMark_Init(EnYabusameMark* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index 769ff86d84..b00c463139 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -1,6 +1,6 @@ #include "z_en_yukabyun.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnYukabyun_Init(EnYukabyun* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index d3523a4535..d98312c4af 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -1,6 +1,6 @@ #include "z_en_zf.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000015 void EnZf_Init(EnZf* this, GlobalContext* globalCtx); @@ -134,4 +134,3 @@ const ActorInit En_Zf_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49C2C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49E4C.s") - diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index 628cb6b10c..db7f3eebf1 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -1,6 +1,6 @@ #include "z_en_zl1.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnZl1_Init(EnZl1* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 9379f2c188..ab7dfb142e 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -1,6 +1,6 @@ #include "z_en_zl2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnZl2_Init(EnZl2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 1544c010ed..3480600106 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -1,6 +1,6 @@ #include "z_en_zl3.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnZl3_Init(EnZl3* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index dac255337d..82dc4db2dd 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -1,6 +1,6 @@ #include "z_en_zl4.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000019 void EnZl4_Init(EnZl4* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 3dba87d598..bee1111979 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -1,6 +1,6 @@ #include "z_en_zo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnZo_Init(EnZo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index 14b5cf5b7d..4bb1134fbd 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -1,6 +1,6 @@ #include "z_en_fhg.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void EnfHG_Init(EnfHG* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.c b/src/overlays/actors/ovl_End_Title/z_end_title.c index 0a60b82461..f07687b619 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -1,6 +1,6 @@ #include "z_end_title.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void EndTitle_Init(EndTitle* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 226fee15be..8835dc9199 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -1,6 +1,6 @@ #include "z_fishing.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void Fishing_Init(Fishing* this, GlobalContext* globalCtx); @@ -114,4 +114,3 @@ const ActorInit Fishing_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Fishing/func_80B7A140.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Fishing/func_80B7A278.s") - diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index 4056aa2db0..57c59ddd23 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -1,6 +1,6 @@ #include "z_item_b_heart.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void ItemBHeart_Init(ItemBHeart* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index ca79c029ba..36a89bb9c1 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -1,6 +1,6 @@ #include "z_item_etcetera.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ItemEtcetera_Init(ItemEtcetera* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index 402a0164a3..e84c5c390e 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -2,15 +2,14 @@ * File: z_item_inbox.c * Overlay: ovl_Item_Inbox * Description: Zelda's magic to open gates. -*/ + */ #include #include #include -typedef struct -{ - /* 0x0000 */ Actor actor; +typedef struct { + /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc updateFunc; } ActorItemInbox; // size = 0x0154 @@ -23,8 +22,7 @@ static void func_80B86020(ActorItemInbox* this, GlobalContext* globalCtx); static void Update(ActorItemInbox* this, GlobalContext* globalCtx); static void Draw(ActorItemInbox* this, GlobalContext* globalCtx); -const ActorInit Item_Inbox_InitVars = -{ +const ActorInit Item_Inbox_InitVars = { ACTOR_ITEM_INBOX, ACTORTYPE_NPC, ROOM, @@ -37,29 +35,25 @@ const ActorInit Item_Inbox_InitVars = (ActorFunc)Draw, }; -static void Init(ActorItemInbox* this, GlobalContext* globalCtx) -{ +static void Init(ActorItemInbox* this, GlobalContext* globalCtx) { this->updateFunc = (ActorFunc)func_80B86020; Actor_SetScale(&this->actor, 0.2); } -static void Destroy(ActorItemInbox* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorItemInbox* this, GlobalContext* globalCtx) { } -static void func_80B86020(ActorItemInbox* this, GlobalContext* globalCtx) -{ - if (Flags_GetTreasure(globalCtx, (this->actor.params >> 8) & 0x1F)) +static void func_80B86020(ActorItemInbox* this, GlobalContext* globalCtx) { + if (Flags_GetTreasure(globalCtx, (this->actor.params >> 8) & 0x1F)) { Actor_Kill(&this->actor); + } } -static void Update(ActorItemInbox* this, GlobalContext* globalCtx) -{ +static void Update(ActorItemInbox* this, GlobalContext* globalCtx) { this->updateFunc(this, globalCtx); } -static void Draw(ActorItemInbox* this, GlobalContext* globalCtx) -{ +static void Draw(ActorItemInbox* this, GlobalContext* globalCtx) { func_8002EBCC(&this->actor, globalCtx, 0); func_8002ED80(&this->actor, globalCtx, 0); func_800694A0(globalCtx, this->actor.params & 0xFF); diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 2830c7a36b..f93f75956d 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -1,6 +1,6 @@ #include "z_item_ocarina.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ItemOcarina_Init(ItemOcarina* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index 74bfbe8116..dd340a6667 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -1,6 +1,6 @@ #include "z_item_shield.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ItemShield_Init(ItemShield* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index 84b049b0c8..f373cc3ce8 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -1,6 +1,6 @@ #include "z_magic_dark.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void MagicDark_Init(MagicDark* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c index 782956beb3..3b8f49505c 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -1,6 +1,6 @@ #include "z_magic_fire.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void MagicFire_Init(MagicFire* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c index 4ae4f7984e..e674a0e837 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -1,6 +1,6 @@ #include "z_magic_wind.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void MagicWind_Init(MagicWind* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 9d12a43bd5..d93987258d 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -1,6 +1,6 @@ #include "z_mir_ray.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000030 void MirRay_Init(MirRay* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 76688efa1c..1911050285 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -1,6 +1,6 @@ #include "z_obj_bean.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00400000 void ObjBean_Init(ObjBean* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index 078def3e56..06596da0f6 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -2,26 +2,24 @@ * File: z_obj_blockstop.c * Overlay: ovl_Obj_Blockstop * Description: Stops blocks and sets relevant flags when the block is in position. -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; } ActorObjBlockstop; // size = 0x014C -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void Init(ActorObjBlockstop* this, GlobalContext* globalCtx); static void Destroy(ActorObjBlockstop* this, GlobalContext* globalCtx); static void Update(ActorObjBlockstop* this, GlobalContext* globalCtx); -const ActorInit Obj_Blockstop_InitVars = -{ +const ActorInit Obj_Blockstop_InitVars = { ACTOR_OBJ_BLOCKSTOP, ACTORTYPE_PROP, ROOM, @@ -31,40 +29,37 @@ const ActorInit Obj_Blockstop_InitVars = (ActorFunc)Init, (ActorFunc)Destroy, (ActorFunc)Update, - NULL + NULL, }; -static void Init(ActorObjBlockstop* this, GlobalContext* globalCtx) -{ - if (Flags_GetSwitch(globalCtx, this->actor.params)) +static void Init(ActorObjBlockstop* this, GlobalContext* globalCtx) { + if (Flags_GetSwitch(globalCtx, this->actor.params)) { Actor_Kill(&this->actor); - else + } else { this->actor.posRot.pos.y += 1; + } } -static void Destroy(ActorObjBlockstop* this, GlobalContext* globalCtx) -{ +static void Destroy(ActorObjBlockstop* this, GlobalContext* globalCtx) { } -static void Update(ActorObjBlockstop* this, GlobalContext* globalCtx) -{ +static void Update(ActorObjBlockstop* this, GlobalContext* globalCtx) { DynaPolyActor* dynaActor; s32 pad; Vec3f sp4C; u32 sp48; s32 pad2; - if (func_8003DF10(&globalCtx->colCtx, &this->actor.initPosRot.pos, &this->actor.posRot.pos, - &sp4C, &this->actor.floorPoly, 0, 0, 1, 1, &sp48, &this->actor)) - { + if (func_8003DF10(&globalCtx->colCtx, &this->actor.initPosRot.pos, &this->actor.posRot.pos, &sp4C, + &this->actor.floorPoly, 0, 0, 1, 1, &sp48, &this->actor)) { dynaActor = DynaPolyInfo_GetActor(&globalCtx->colCtx, sp48); - if ((dynaActor != NULL) && (dynaActor->actor.id == 0xFF)) - { - if (((dynaActor->actor.params & 0x000F) == 3) || ((dynaActor->actor.params & 0x000F) == 7)) + if ((dynaActor != NULL) && (dynaActor->actor.id == 0xFF)) { + if (((dynaActor->actor.params & 0x000F) == 3) || ((dynaActor->actor.params & 0x000F) == 7)) { func_80078884(NA_SE_SY_CORRECT_CHIME); - else + } else { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + } Flags_SetSwitch(globalCtx, this->actor.params); Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index d5cc6f8feb..54dfaf2bc5 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -2,11 +2,11 @@ * File: z_obj_bombiwa.c * Overlay: ovl_Obj_Bombiwa * Description: Round, brown, breakable boulder -*/ + */ #include "z_obj_bombiwa.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 static void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx); @@ -17,8 +17,7 @@ static void ObjBombiwa_Draw(ObjBombiwa* this, GlobalContext* globalCtx); static void ObjBombiwa_InitCollision(ObjBombiwa* this, GlobalContext* globalCtx); static void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx); -const ActorInit Obj_Bombiwa_InitVars = -{ +const ActorInit Obj_Bombiwa_InitVars = { ACTOR_OBJ_BOMBIWA, ACTORTYPE_PROP, ROOM, @@ -31,77 +30,59 @@ const ActorInit Obj_Bombiwa_InitVars = (ActorFunc)ObjBombiwa_Draw, }; -static ColliderCylinderInit colliderInit = -{ - 0x0C, 0x00, 0x0D, 0x39, - 0x20, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00000000, 0x00, 0x00, - 0x00, 0x00, 0x4FC1FFFE, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x00, - 0x0037, 0x0046, 0x0000, - 0x0000, 0x0000, 0x0000, +static ColliderCylinderInit colliderInit = { + 0x0C, 0x00, 0x0D, 0x39, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x4FC1FFFE, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x00, 0x0037, 0x0046, 0x0000, 0x0000, 0x0000, 0x0000, }; -static u32 damageChart[] = -{ - 0x0000000C, 0x003CFF00, +static u32 damageChart[] = { + 0x0000000C, + 0x003CFF00, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 0x7D0, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 0x15E, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 0x3E8, ICHAIN_STOP), }; -static s16 effectScales[] = -{ +static s16 effectScales[] = { 17, 14, 10, 8, 7, 5, 3, 2, }; -extern Gfx* D_060009E0; //dlist +extern Gfx* D_060009E0; // dlist -static void ObjBombiwa_InitCollision(ObjBombiwa* this, GlobalContext* globalCtx) -{ +static void ObjBombiwa_InitCollision(ObjBombiwa* this, GlobalContext* globalCtx) { ObjBombiwa* thisLocal = this; ActorCollider_AllocCylinder(globalCtx, &thisLocal->collider); ActorCollider_InitCylinder(globalCtx, &thisLocal->collider, &thisLocal->actor, &colliderInit); ActorCollider_Cylinder_Update(&thisLocal->actor, &thisLocal->collider); } -static void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx) -{ +static void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, initChain); ObjBombiwa_InitCollision(this, globalCtx); - if ((Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) != 0)) - { + if ((Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) != 0)) { Actor_Kill(&this->actor); - } - else - { + } else { func_80061ED4(&this->actor.sub_98.damageChart, NULL, damageChart); - if (this->actor.shape.rot.y == 0) - { - s16 rand = (s16) Math_Rand_ZeroFloat(65536.0f); + if (this->actor.shape.rot.y == 0) { + s16 rand = (s16)Math_Rand_ZeroFloat(65536.0f); this->actor.posRot.rot.y = rand; this->actor.shape.rot.y = rand; } this->actor.shape.unk_08 = -200.0f; this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 20.0f; } - } -static void ObjBombiwa_Destroy(ObjBombiwa* this, GlobalContext* globalCtx) -{ +static void ObjBombiwa_Destroy(ObjBombiwa* this, GlobalContext* globalCtx) { ActorCollider_FreeCylinder(globalCtx, &this->collider); } -static void ObjBombiwa_Break(ObjBombiwa *this, GlobalContext *globalCtx) -{ +static void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) { Vec3f temp_s2; Vec3f temp_s3; Gfx** dlist; @@ -110,8 +91,7 @@ static void ObjBombiwa_Break(ObjBombiwa *this, GlobalContext *globalCtx) s32 i; dlist = &D_060009E0; - for (i = 0; i < ARRAY_COUNT(effectScales); i++) - { + for (i = 0; i < ARRAY_COUNT(effectScales); i++) { temp_s2.x = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.x; temp_s2.y = ((Math_Rand_ZeroOne() * 5.0f) + this->actor.initPosRot.pos.y) + 8.0f; temp_s2.z = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.z; @@ -120,34 +100,29 @@ static void ObjBombiwa_Break(ObjBombiwa *this, GlobalContext *globalCtx) temp_s3.z = (Math_Rand_ZeroOne() - 0.5f) * 15.0f; scale = effectScales[i]; u0 = (scale >= 11) ? 37 : 33; - Effect_SpawnFragment(globalCtx, &temp_s2, &temp_s3, &temp_s2, -400, u0, 10, 2, 0, scale, 1, 0, 80, -1, OBJECT_BOMBIWA, dlist); + Effect_SpawnFragment(globalCtx, &temp_s2, &temp_s3, &temp_s2, -400, u0, 10, 2, 0, scale, 1, 0, 80, -1, + OBJECT_BOMBIWA, dlist); } func_80033480(globalCtx, &this->actor.posRot.pos, 60.0f, 8, 100, 160, 1); } -static void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx) -{ +static void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx) { SubGlobalContext11E60* sub_11E60; ColliderCylinderMain* collider; - if (func_80033684(globalCtx, &this->actor) != NULL || - ((this->collider.base.collideFlags & 2) != 0 && - (this->collider.body.colliding->toucher.flags & 0x40000040) != 0)) - { + if (func_80033684(globalCtx, &this->actor) != NULL || + ((this->collider.base.collideFlags & 2) != 0 && + (this->collider.body.colliding->toucher.flags & 0x40000040) != 0)) { ObjBombiwa_Break(this, globalCtx); Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 80, NA_SE_EV_WALL_BROKEN); - if (((this->actor.params >> 0xF) & 1) != 0) - { + if (((this->actor.params >> 0xF) & 1) != 0) { func_80078884(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->actor); - } - else - { + } else { this->collider.base.collideFlags &= ~0x2; - if (this->actor.xzDistanceFromLink < 800.0f) - { + if (this->actor.xzDistanceFromLink < 800.0f) { sub_11E60 = &globalCtx->sub_11E60; collider = &this->collider; Actor_CollisionCheck_SetAC(globalCtx, sub_11E60, collider); @@ -156,7 +131,6 @@ static void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx) } } -static void ObjBombiwa_Draw(ObjBombiwa* this, GlobalContext* globalCtx) -{ +static void ObjBombiwa_Draw(ObjBombiwa* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_060009E0); } diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 24d4a38145..17d1260608 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -1,6 +1,6 @@ #include "z_obj_comb.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void ObjComb_Init(ObjComb* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c index fc9d1f60bf..fdd4a085de 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c @@ -1,6 +1,6 @@ #include "z_obj_dekujr.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void ObjDekujr_Init(ObjDekujr* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index cbd00953b5..32da650c2c 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -2,11 +2,11 @@ * File: z_obj_elevator.c * Overlay: Obj_Elevator * Description: Stone Dungeon Elevator -*/ + */ #include "z_obj_elevator.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 #define SIZE_PARAM 1 @@ -21,8 +21,7 @@ static void func_80B92C80(ObjElevator* this, GlobalContext* globalCtx); static void func_80B92D20(ObjElevator* this); static void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx); -const ActorInit Obj_Elevator_InitVars = -{ +const ActorInit Obj_Elevator_InitVars = { ACTOR_OBJ_ELEVATOR, ACTORTYPE_BG, ROOM, @@ -35,25 +34,22 @@ const ActorInit Obj_Elevator_InitVars = (ActorFunc)ObjElevator_Draw, }; -static InitChainEntry initChain[] = -{ +static InitChainEntry initChain[] = { ICHAIN_F32(unk_F4, 2000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 600, ICHAIN_CONTINUE), - ICHAIN_F32(unk_FC, 2000, ICHAIN_STOP) + ICHAIN_F32(unk_FC, 2000, ICHAIN_STOP), }; -static f32 sizes[] = {0.1f, 0.05f}; +static f32 sizes[] = { 0.1f, 0.05f }; extern u32 D_06000180; extern u32 D_06000360; -static void ObjElevator_SetupAction(ObjElevator* this, ActorFunc actionFunc) -{ +static void ObjElevator_SetupAction(ObjElevator* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -static void func_80B92B08(ObjElevator* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) -{ +static void func_80B92B08(ObjElevator* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) { s16 pad1; u32 local_c = 0; s16 pad2; @@ -62,14 +58,13 @@ static void func_80B92B08(ObjElevator* this, GlobalContext* globalCtx, u32 colli DynaPolyInfo_SetActorMove(thisx, flag); DynaPolyInfo_Alloc(collision, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); - if (this->dyna.dynaPolyId == 0x32) - { - osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_elevator.c", 136, thisx->id, thisx->params); + if (this->dyna.dynaPolyId == 0x32) { + osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_elevator.c", 136, + thisx->id, thisx->params); } } -static void ObjElevator_Init(ObjElevator* this, GlobalContext* globalCtx) -{ +static void ObjElevator_Init(ObjElevator* this, GlobalContext* globalCtx) { f32 temp_f0; Actor* thisx = &this->dyna.actor; @@ -82,64 +77,49 @@ static void ObjElevator_Init(ObjElevator* this, GlobalContext* globalCtx) osSyncPrintf("(Dungeon Elevator)(arg_data 0x%04x)\n", thisx->params); } -static void ObjElevator_Destroy(ObjElevator* this, GlobalContext* globalCtx) -{ +static void ObjElevator_Destroy(ObjElevator* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void func_80B92C5C(ObjElevator* this) -{ +static void func_80B92C5C(ObjElevator* this) { ObjElevator_SetupAction(this, func_80B92C80); } -static void func_80B92C80(ObjElevator* this, GlobalContext* globalCtx) -{ +static void func_80B92C80(ObjElevator* this, GlobalContext* globalCtx) { f32 sub; Actor* thisx = &this->dyna.actor; - if ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2)) - { + if ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2)) { sub = thisx->posRot.pos.y - thisx->initPosRot.pos.y; - if (fabsf(sub) < 0.1f) - { + if (fabsf(sub) < 0.1f) { this->unk_168 = thisx->initPosRot.pos.y + ((thisx->params >> 0xC) & 0xF) * 80.0f; - } - else - { + } else { this->unk_168 = thisx->initPosRot.pos.y; } func_80B92D20(this); } } -static void func_80B92D20(ObjElevator* this) -{ +static void func_80B92D20(ObjElevator* this) { ObjElevator_SetupAction(this, func_80B92D44); } -static void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx) -{ +static void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (fabsf(Math_SmoothScaleMaxMinF(&thisx->posRot.pos.y, this->unk_168, 1.0f, this->unk_16C, 0.0f)) < 0.001f) - { + if (fabsf(Math_SmoothScaleMaxMinF(&thisx->posRot.pos.y, this->unk_168, 1.0f, this->unk_16C, 0.0f)) < 0.001f) { Audio_PlayActorSound2(thisx, NA_SE_EV_FOOT_SWITCH); func_80B92C5C(this); - } - else - { + } else { Audio_PlayActorSound2(thisx, 0x201E); } } -static void ObjElevator_Update(ObjElevator* this, GlobalContext* globalCtx) -{ - if (this->actionFunc) - { +static void ObjElevator_Update(ObjElevator* this, GlobalContext* globalCtx) { + if (this->actionFunc) { this->actionFunc(this, globalCtx); } this->unk_170 = this->dyna.unk_160; } -static void ObjElevator_Draw(ObjElevator* this, GlobalContext* globalCtx) -{ +static void ObjElevator_Draw(ObjElevator* this, GlobalContext* globalCtx) { Draw_DListOpa(globalCtx, &D_06000180); } diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index bcdffe4790..4f33e20f88 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -1,6 +1,6 @@ #include "z_obj_hamishi.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void ObjHamishi_Init(ObjHamishi* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 6196c47f06..e163ac265f 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -1,6 +1,6 @@ #include "z_obj_hana.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void ObjHana_Init(ObjHana* this, GlobalContext* globalCtx); @@ -30,6 +30,3 @@ const ActorInit Obj_Hana_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hana/ObjHana_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hana/ObjHana_Draw.s") - - - diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index 027f1d04a9..5d16e21e4e 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -1,6 +1,6 @@ #include "z_obj_hsblock.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void ObjHsblock_Init(ObjHsblock* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 39a6eb9b74..5292dd1f4a 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -1,6 +1,6 @@ #include "z_obj_ice_poly.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ObjIcePoly_Init(ObjIcePoly* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 726033ba58..70b364a9b7 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -1,6 +1,6 @@ #include "z_obj_kibako.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x04000010 void ObjKibako_Init(ObjKibako* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index a158b029dd..af59ebcbef 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -1,6 +1,6 @@ #include "z_obj_kibako2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void ObjKibako2_Init(ObjKibako2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 22f510dc1e..8e59d162e3 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -1,6 +1,6 @@ #include "z_obj_lift.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ObjLift_Init(ObjLift* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index f4d0e31192..0f9b525dc3 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -1,6 +1,6 @@ #include "z_obj_lightswitch.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ObjLightswitch_Init(ObjLightswitch* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index f43c01bb13..65ff6f8d26 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -2,21 +2,20 @@ * File: z_obj_makekinsuta.c * Overlay: ovl_Obj_Makekinsuta * Description: Skulltula Sprouting from Bean Spot. -*/ + */ #include #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc actionFunc; /* 0x150 */ s16 unk_150; /* 0x152 */ s16 unk_152; } ObjMakekinsuta; // size = 0x0154 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void ObjMakekinsuta_Init(ObjMakekinsuta* this, GlobalContext* globalCtx); @@ -24,8 +23,7 @@ static void ObjMakekinsuta_Update(ObjMakekinsuta* this, GlobalContext* globalCtx static void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx); static void func_80B983D4(ObjMakekinsuta* this, GlobalContext* globalCtx); -const ActorInit Obj_Makekinsuta_InitVars = -{ +const ActorInit Obj_Makekinsuta_InitVars = { ACTOR_OBJ_MAKEKINSUTA, ACTORTYPE_ITEMACTION, ROOM, @@ -38,49 +36,39 @@ const ActorInit Obj_Makekinsuta_InitVars = NULL, }; -static void ObjMakekinsuta_Init(ObjMakekinsuta* this, GlobalContext* globalCtx) -{ - if ((this->actor.params & 0x6000) == 0x4000) - { +static void ObjMakekinsuta_Init(ObjMakekinsuta* this, GlobalContext* globalCtx) { + if ((this->actor.params & 0x6000) == 0x4000) { osSyncPrintf(VT_FGCOL(BLUE)); - // Translation: Gold Star Enemy(arg_data %x) + // Translation: Gold Star Enemy(arg_data %x) osSyncPrintf("金スタ発生敵(arg_data %x)\n", this->actor.params); osSyncPrintf(VT_RST); - } - else - { + } else { osSyncPrintf(VT_COL(YELLOW, BLACK)); - // Translation: Invalid Argument (arg_data %x)(%s %d) + // Translation: Invalid Argument (arg_data %x)(%s %d) osSyncPrintf("引数不正 (arg_data %x)(%s %d)\n", this->actor.params, "../z_obj_makekinsuta.c", 119); osSyncPrintf(VT_RST); } this->actionFunc = func_80B98320; } -static void func_80B98320(ObjMakekinsuta* this,GlobalContext* globalCtx) -{ - if (this->unk_152 != 0) - { - if (this->unk_150 >= 0x3C && !func_8002DEEC(PLAYER)) - { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - 0, this->actor.shape.rot.y, 0, (this->actor.params | 0x8000)); - this->actionFunc = &func_80B983D4; - return; - } +static void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx) { + if (this->unk_152 != 0) { + if (this->unk_150 >= 0x3C && !func_8002DEEC(PLAYER)) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.posRot.pos.x, + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, + (this->actor.params | 0x8000)); + this->actionFunc = &func_80B983D4; + return; + } this->unk_150 = this->unk_150 + 1; return; } - this->unk_150 = 0; + this->unk_150 = 0; } -static void func_80B983D4(ObjMakekinsuta* this, GlobalContext* globalCtx) -{ - +static void func_80B983D4(ObjMakekinsuta* this, GlobalContext* globalCtx) { } -static void ObjMakekinsuta_Update(ObjMakekinsuta* this, GlobalContext* globalCtx) -{ +static void ObjMakekinsuta_Update(ObjMakekinsuta* this, GlobalContext* globalCtx) { this->actionFunc(&this->actor, globalCtx); } diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index ad8ed94938..52e7e68453 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -1,6 +1,6 @@ #include "z_obj_makeoshihiki.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000020 void ObjMakeoshihiki_Init(ObjMakeoshihiki* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 47f1739a82..23541cf9df 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -1,6 +1,6 @@ #include "z_obj_mure.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void ObjMure_Init(ObjMure* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index a53c84c165..94e3d7ffd2 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -1,6 +1,6 @@ #include "z_obj_mure2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void ObjMure2_Init(ObjMure2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index bc8effe0f8..a3587c1652 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -1,6 +1,6 @@ #include "z_obj_mure3.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000000 void ObjMure3_Init(ObjMure3* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 3de3e5734c..2563eb4a5a 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -1,6 +1,6 @@ #include "z_obj_oshihiki.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ObjOshihiki_Init(ObjOshihiki* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 5b6bf5ac64..6689ab0121 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -2,20 +2,19 @@ * File: z_obj_roomtimer.c * Overlay: ovl_Obj_Roomtimer * Description: -*/ + */ #include #include #include -typedef struct -{ - /* 0x0000 */ Actor actor; +typedef struct { + /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc updateFunc; - /* 0x0150 */ u32 switchFlag; + /* 0x0150 */ u32 switchFlag; } ActorRoomTimer; // size = 0x0154 -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 static void Init(ActorRoomTimer* this, GlobalContext* globalCtx); @@ -24,8 +23,7 @@ static void Update(ActorRoomTimer* this, GlobalContext* globalCtx); static void func_80B9D054(ActorRoomTimer* this, GlobalContext* globalCtx); static void func_80B9D0B0(ActorRoomTimer* this, GlobalContext* globalCtx); -const ActorInit Obj_Roomtimer_InitVars = -{ +const ActorInit Obj_Roomtimer_InitVars = { ACTOR_OBJ_ROOMTIMER, ACTORTYPE_ENEMY, ROOM, @@ -38,61 +36,54 @@ const ActorInit Obj_Roomtimer_InitVars = (ActorFunc)NULL, }; -static void Init(ActorRoomTimer* this, GlobalContext* globalCtx) -{ +static void Init(ActorRoomTimer* this, GlobalContext* globalCtx) { s16 params = this->actor.params; this->switchFlag = (params >> 10) & 0x3F; this->actor.params = params & 0x3FF; params = this->actor.params; - if (params != 0x3FF) - { - if (params > 600) + if (params != 0x3FF) { + if (params > 600) { this->actor.params = 600; - else + } else { this->actor.params = params; + } } this->updateFunc = (ActorFunc)func_80B9D054; } -static void Destroy(ActorRoomTimer* this, GlobalContext* globalCtx) -{ - if (this->actor.params != 0x3FF) - { - if (gSaveContext.timer_1_value > 0) +static void Destroy(ActorRoomTimer* this, GlobalContext* globalCtx) { + if (this->actor.params != 0x3FF) { + if (gSaveContext.timer_1_value > 0) { gSaveContext.timer_1_state = 10; + } } } -static void func_80B9D054(ActorRoomTimer* this, GlobalContext* globalCtx) -{ - if (this->actor.params != 0x3FF) +static void func_80B9D054(ActorRoomTimer* this, GlobalContext* globalCtx) { + if (this->actor.params != 0x3FF) { func_80088B34(this->actor.params); + } Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP); this->updateFunc = (ActorFunc)func_80B9D0B0; } -static void func_80B9D0B0(ActorRoomTimer* this, GlobalContext* globalCtx) -{ - if (Flags_GetTempClear(globalCtx, this->actor.room)) - { - if (this->actor.params != 0x3FF) +static void func_80B9D0B0(ActorRoomTimer* this, GlobalContext* globalCtx) { + if (Flags_GetTempClear(globalCtx, this->actor.room)) { + if (this->actor.params != 0x3FF) { gSaveContext.timer_1_state = 10; + } Flags_SetClear(globalCtx, this->actor.room); Flags_SetSwitch(globalCtx, this->switchFlag); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->actor); - } - else - { - if (this->actor.params != 0x3FF) - { - if (gSaveContext.timer_1_value == 0) - { + } else { + if (this->actor.params != 0x3FF) { + if (gSaveContext.timer_1_value == 0) { Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); func_800C0B60(globalCtx); // Void Out Actor_Kill(&this->actor); @@ -101,7 +92,6 @@ static void func_80B9D0B0(ActorRoomTimer* this, GlobalContext* globalCtx) } } -static void Update(ActorRoomTimer* this, GlobalContext* globalCtx) -{ +static void Update(ActorRoomTimer* this, GlobalContext* globalCtx) { this->updateFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 3be1b0ad34..43a73f406e 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -1,6 +1,6 @@ #include "z_obj_switch.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000010 void ObjSwitch_Init(ObjSwitch* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 79c658a70a..a3255aa52b 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -1,6 +1,6 @@ #include "z_obj_syokudai.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000410 void ObjSyokudai_Init(ObjSyokudai* this, GlobalContext* globalCtx); @@ -30,4 +30,3 @@ const ActorInit Obj_Syokudai_InitVars = #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Syokudai/ObjSyokudai_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Syokudai/ObjSyokudai_Draw.s") - diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index e0755c0920..30800d54d5 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -1,6 +1,6 @@ #include "z_obj_timeblock.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x0A000011 void ObjTimeblock_Init(ObjTimeblock* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 5440caeea1..ae6919493b 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -1,6 +1,6 @@ #include "z_obj_tsubo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00800010 void ObjTsubo_Init(ObjTsubo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 084a477afb..e19145bff5 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -1,6 +1,6 @@ #include "z_obj_warp2block.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x0A000011 void ObjWarp2block_Init(ObjWarp2block* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 83236cda15..96eebcf901 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -1,6 +1,6 @@ #include "z_object_kankyo.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000030 void ObjectKankyo_Init(ObjectKankyo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index cdd7de0561..6699af88f0 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -1,6 +1,6 @@ #include "z_oceff_spot.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void OceffSpot_Init(OceffSpot* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 10b22404ef..25609fa4d6 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -1,6 +1,6 @@ #include "z_oceff_storm.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000030 void OceffStorm_Init(OceffStorm* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index a5310aff19..ceec18a469 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -1,6 +1,6 @@ #include "z_oceff_wipe.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void OceffWipe_Init(OceffWipe* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index ce20d0406a..0f5ad2638b 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -1,6 +1,6 @@ #include "z_oceff_wipe2.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void OceffWipe2_Init(OceffWipe2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 00e6ec8abe..ed27e7d8dd 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -1,6 +1,6 @@ #include "z_oceff_wipe3.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void OceffWipe3_Init(OceffWipe3* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index cae47b2ac6..734b53cbbd 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -1,6 +1,6 @@ #include "z_oceff_wipe4.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x02000010 void OceffWipe4_Init(OceffWipe4* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index 4ab2513bd0..b51bc1ccf9 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -1,6 +1,6 @@ #include "z_shot_sun.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void ShotSun_Init(ShotSun* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 4f73c36e9a..ffed1b22a1 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1094,7 +1094,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_player_actor/func_808530E0.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_player_actor/func_80853148.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Blast/z_effect_ss_blast.c b/src/overlays/effects/ovl_Effect_Ss_Blast/z_effect_ss_blast.c index 0a741f327f..77c3b7629f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Blast/z_effect_ss_blast.c +++ b/src/overlays/effects/ovl_Effect_Ss_Blast/z_effect_ss_blast.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Blast/func_8099EF08.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Blast/func_8099F0AC.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_effect_ss_bomb.c b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_effect_ss_bomb.c index 1d90bd98de..45fe73bc88 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_effect_ss_bomb.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_effect_ss_bomb.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Bomb/func_8099F274.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Bomb/func_8099F4D8.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_effect_ss_bomb2.c b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_effect_ss_bomb2.c index f7dc03af7f..b4985f3bbd 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_effect_ss_bomb2.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_effect_ss_bomb2.c @@ -8,7 +8,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Bomb2/func_8099F960.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Bomb2/func_8099FCCC.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_effect_ss_bubble.c b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_effect_ss_bubble.c index 275826cdbe..8ee11f8e53 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_effect_ss_bubble.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_effect_ss_bubble.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Bubble/func_809A01CC.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Bubble/func_809A0360.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_effect_ss_d_fire.c b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_effect_ss_d_fire.c index 5a073cf053..be8a0129cc 100644 --- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_effect_ss_d_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_effect_ss_d_fire.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_D_Fire/func_809A0698.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_D_Fire/func_809A090C.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_effect_ss_dead_db.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_effect_ss_dead_db.c index 7235707b13..4f75a5671a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_effect_ss_dead_db.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_effect_ss_dead_db.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dead_Db/func_809A0BB8.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dead_Db/func_809A0DB4.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_effect_ss_dead_dd.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_effect_ss_dead_dd.c index 22c0311300..582ea22b0e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_effect_ss_dead_dd.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_effect_ss_dead_dd.c @@ -6,6 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dead_Dd/func_809A12B4.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dead_Dd/func_809A14B0.s") - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_effect_ss_dead_ds.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_effect_ss_dead_ds.c index e3fd6e9a35..d4995444ae 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_effect_ss_dead_ds.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_effect_ss_dead_ds.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dead_Ds/func_809A16F4.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dead_Ds/func_809A1A08.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_effect_ss_dead_sound.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_effect_ss_dead_sound.c index db2ecc7746..722d468899 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_effect_ss_dead_sound.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_effect_ss_dead_sound.c @@ -4,6 +4,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dead_Sound/func_809A1B30.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dead_Sound/func_809A1BD8.s") - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_effect_ss_dt_bubble.c b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_effect_ss_dt_bubble.c index 1049a55678..45f0eb9bf3 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_effect_ss_dt_bubble.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_effect_ss_dt_bubble.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dt_Bubble/func_809A1F04.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dt_Bubble/func_809A2180.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Dust/z_effect_ss_dust.c b/src/overlays/effects/ovl_Effect_Ss_Dust/z_effect_ss_dust.c index 338cfd8e19..497360c137 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dust/z_effect_ss_dust.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dust/z_effect_ss_dust.c @@ -8,7 +8,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dust/func_809A27F0.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Dust/func_809A28EC.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_effect_ss_en_fire.c b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_effect_ss_en_fire.c index a6476bef80..eb6d647d6d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_effect_ss_en_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_effect_ss_en_fire.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_En_Fire/func_809A2D28.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_En_Fire/func_809A3060.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_effect_ss_en_ice.c b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_effect_ss_en_ice.c index 757e7d236a..b34074f312 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_effect_ss_en_ice.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_effect_ss_en_ice.c @@ -8,7 +8,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_En_Ice/func_809A3988.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_En_Ice/func_809A3B60.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_effect_ss_extra.c b/src/overlays/effects/ovl_Effect_Ss_Extra/z_effect_ss_extra.c index 2fa975eea4..d3c9b4edbf 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_effect_ss_extra.c +++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_effect_ss_extra.c @@ -6,6 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Extra/func_809A3E00.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Extra/func_809A3FF8.s") - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_effect_ss_fcircle.c b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_effect_ss_fcircle.c index 5bc17afa5c..3da011570b 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_effect_ss_fcircle.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_effect_ss_fcircle.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Fcircle/func_809A41DC.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Fcircle/func_809A44E0.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_effect_ss_fhg_flash.c b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_effect_ss_fhg_flash.c index 54a2d1e595..c04ee27c9f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_effect_ss_fhg_flash.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_effect_ss_fhg_flash.c @@ -10,7 +10,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Fhg_Flash/func_809A4E28.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Fhg_Flash/func_809A4EC0.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_effect_ss_fire_tail.c b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_effect_ss_fire_tail.c index 101a40861a..09ef8ed751 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_effect_ss_fire_tail.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_effect_ss_fire_tail.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Fire_Tail/func_809A5858.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Fire_Tail/func_809A5D98.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_effect_ss_g_fire.c b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_effect_ss_g_fire.c index 2c1d6c4f55..943976af01 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_effect_ss_g_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_effect_ss_g_fire.c @@ -6,6 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Fire/func_809A6010.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Fire/func_809A60B4.s") - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_effect_ss_g_magma.c b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_effect_ss_g_magma.c index fa5a5d09b0..6dc514c3b8 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_effect_ss_g_magma.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_effect_ss_g_magma.c @@ -6,6 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Magma/func_809A62A8.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Magma/func_809A6300.s") - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_effect_ss_g_magma2.c b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_effect_ss_g_magma2.c index fae1da5642..23d10a5ac1 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_effect_ss_g_magma2.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_effect_ss_g_magma2.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Magma2/func_809A6568.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Magma2/func_809A67C0.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_effect_ss_g_ripple.c b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_effect_ss_g_ripple.c index c8213252b6..169d45524f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_effect_ss_g_ripple.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_effect_ss_g_ripple.c @@ -8,7 +8,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Ripple/func_809A6D08.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Ripple/func_809A6D40.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_effect_ss_g_spk.c b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_effect_ss_g_spk.c index 63654bf9fe..50c1df035f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_effect_ss_g_spk.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_effect_ss_g_spk.c @@ -8,7 +8,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Spk/func_809A72C0.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Spk/func_809A73C8.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_effect_ss_g_splash.c b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_effect_ss_g_splash.c index 90867018c6..87496873a1 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_effect_ss_g_splash.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_effect_ss_g_splash.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Splash/func_809A7760.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_G_Splash/func_809A7864.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_effect_ss_hahen.c b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_effect_ss_hahen.c index 3f89cfcd1c..4dca04f290 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_effect_ss_hahen.c +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_effect_ss_hahen.c @@ -10,7 +10,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Hahen/func_809A7D9C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Hahen/func_809A7F84.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_effect_ss_hitmark.c b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_effect_ss_hitmark.c index d09dc3ef74..7574886edb 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_effect_ss_hitmark.c +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_effect_ss_hitmark.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_HitMark/func_809A824C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_HitMark/func_809A8484.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_effect_ss_ice_piece.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_effect_ss_ice_piece.c index af7c0472d9..91092b680f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_effect_ss_ice_piece.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_effect_ss_ice_piece.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Ice_Piece/func_809A8850.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Ice_Piece/func_809A8AC0.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_effect_ss_ice_smoke.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_effect_ss_ice_smoke.c index a0952b1dd0..ff7c85ba14 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_effect_ss_ice_smoke.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_effect_ss_ice_smoke.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Ice_Smoke/func_809A8D18.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Ice_Smoke/func_809A9030.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_effect_ss_k_fire.c b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_effect_ss_k_fire.c index e45dd75de1..6e6749a9bf 100644 --- a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_effect_ss_k_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_effect_ss_k_fire.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_K_Fire/func_809A9280.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_K_Fire/func_809A951C.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_effect_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_effect_ss_kakera.c index 3d53bc0fbf..1b1cd9d50d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_effect_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_effect_ss_kakera.c @@ -36,7 +36,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Kakera/func_809AA230.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Kakera/func_809AA430.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_effect_ss_kirakira.c b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_effect_ss_kirakira.c index 432e20cad1..553f117911 100644 --- a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_effect_ss_kirakira.c +++ b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_effect_ss_kirakira.c @@ -10,7 +10,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_KiraKira/func_809AACAC.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_KiraKira/func_809AAD6C.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_effect_ss_lightning.c b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_effect_ss_lightning.c index 4e6ff2656c..cf29b1521e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_effect_ss_lightning.c +++ b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_effect_ss_lightning.c @@ -8,7 +8,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Lightning/func_809AB078.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Lightning/func_809AB338.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_effect_ss_sibuki.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_effect_ss_sibuki.c index 6f401acae7..5daf2d6cb2 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_effect_ss_sibuki.c +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_effect_ss_sibuki.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Sibuki/func_809AB7EC.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Sibuki/func_809AB9DC.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_effect_ss_sibuki2.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_effect_ss_sibuki2.c index 637b117b94..9a080975fc 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_effect_ss_sibuki2.c +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_effect_ss_sibuki2.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Sibuki2/func_809ABE0C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Sibuki2/func_809AC030.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c index 7eda76d1a0..9b84df0bdf 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c +++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c @@ -4,6 +4,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/func_809AC130.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/func_809AC1AC.s") - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_effect_ss_stick.c b/src/overlays/effects/ovl_Effect_Ss_Stick/z_effect_ss_stick.c index 7648629ae6..1fc5e5b32f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_effect_ss_stick.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_effect_ss_stick.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Stick/func_809AC42C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Stick/func_809AC604.s") - - - - diff --git a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_effect_ss_stone1.c b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_effect_ss_stone1.c index b2cdb6fa3a..04790b4279 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_effect_ss_stone1.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_effect_ss_stone1.c @@ -6,7 +6,3 @@ #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Stone1/func_809AC78C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/effects/ovl_Effect_Ss_Stone1/func_809AC9C0.s") - - - - diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index 98d806c01f..416b45a2e7 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -2,13 +2,12 @@ * File: z_opening.c * Overlay: ovl_opening * Description: Initializes the game into the title screen -*/ + */ #include #include -static void Opening_SetNextGameState(OpeningContext* this) -{ +static void Opening_SetNextGameState(OpeningContext* this) { gSaveContext.game_mode = 1; this->state.running = false; gSaveContext.link_age = 0; @@ -18,25 +17,19 @@ static void Opening_SetNextGameState(OpeningContext* this) SET_NEXT_GAMESTATE(&this->state, func_800BCA64, GlobalContext); } -static void func_80803C5C(OpeningContext* this) -{ - +static void func_80803C5C(OpeningContext* this) { } -static void Opening_Update(OpeningContext* this) -{ +static void Opening_Update(OpeningContext* this) { func_80095248(this->state.gfxCtx, 0, 0, 0); Opening_SetNextGameState(this); func_80803C5C(this); } -static void Opening_Destroy(OpeningContext* this) -{ - +static void Opening_Destroy(OpeningContext* this) { } -void Opening_Init(OpeningContext* this) -{ +void Opening_Init(OpeningContext* this) { R_UPDATE_RATE = 1; Matrix_Init(&this->state); func_800AA278(&this->view, this->state.gfxCtx); diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index 3ff5211d94..0ed42a3925 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -2,7 +2,7 @@ * File: z_title.c * Overlay: ovl_title * Description: Displays the Nintendo Logo -*/ + */ #include #include @@ -12,8 +12,7 @@ extern Gfx D_01002720[]; extern u8 D_01001800[]; extern u8 D_01000000[]; -void Title_PrintBuildInfo(Gfx** gfxp) -{ +void Title_PrintBuildInfo(Gfx** gfxp) { Gfx* g; GfxPrint* printer; @@ -35,14 +34,13 @@ void Title_PrintBuildInfo(Gfx** gfxp) *gfxp = g; } -// Note: In other rom versions this function also updates unk_1D4, coverAlpha, addAlpha, visibleDuration to calculate the fade-in/fade-out + the duration of the n64 logo animation -void Title_Calc(TitleContext* this) -{ +// Note: In other rom versions this function also updates unk_1D4, coverAlpha, addAlpha, visibleDuration to calculate +// the fade-in/fade-out + the duration of the n64 logo animation +void Title_Calc(TitleContext* this) { this->exit = 1; } -void Title_InitView(TitleContext* this, f32 x, f32 y, f32 z) -{ +void Title_InitView(TitleContext* this, f32 x, f32 y, f32 z) { View* view; Vec3f v1; Vec3f v2; @@ -64,8 +62,7 @@ void Title_InitView(TitleContext* this, f32 x, f32 y, f32 z) func_800AAA50(view, 0xF); } -void Title_Draw(TitleContext* this) -{ +void Title_Draw(TitleContext* this) { static s16 sTitleRotY = 0; static u32 D_808009A4 = 0; static Lights1 sTitleLights = gdSPDefLights1(0x64, 0x64, 0x64, 0xFF, 0xFF, 0xFF, 0x45, 0x45, 0x45); @@ -106,40 +103,22 @@ void Title_Draw(TitleContext* this) gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetCycleType(gfxCtx->polyOpa.p++, G_CYC_2CYCLE); gDPSetRenderMode(gfxCtx->polyOpa.p++, G_RM_XLU_SURF2, G_RM_OPA_CI | CVG_DST_WRAP); - gDPSetCombineLERP(gfxCtx->polyOpa.p++, TEXEL1, PRIMITIVE, ENV_ALPHA, TEXEL0, 0, 0, 0, TEXEL0, PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0); + gDPSetCombineLERP(gfxCtx->polyOpa.p++, TEXEL1, PRIMITIVE, ENV_ALPHA, TEXEL0, 0, 0, 0, TEXEL0, PRIMITIVE, + ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0); gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, 170, 255, 255, 255); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0, 0, 255, 128); - - gDPLoadMultiBlock(gfxCtx->polyOpa.p++, - &D_01001800, - 0x100, - 1, - G_IM_FMT_I, - G_IM_SIZ_8b, - 32, 32, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - 5, 5, - 2, 11); - - - for (idx = 0, y = 94; idx < 16; idx++, y += 2) - { - gDPLoadTextureBlock(gfxCtx->polyOpa.p++, - &D_01000000[0x180 * idx], - G_IM_FMT_I, - G_IM_SIZ_8b, - 192, 2, - 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); - gDPSetTileSize(gfxCtx->polyOpa.p++, 1, this->uls, (this->ult & 0x7F) - idx*4, 0, 0); - gSPTextureRectangle(gfxCtx->polyOpa.p++, 388, y << 2, 1156, (y+2)<<2, G_TX_RENDERTILE, 0, 0, 1024, 1024); + gDPLoadMultiBlock(gfxCtx->polyOpa.p++, &D_01001800, 0x100, 1, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, 2, 11); + + for (idx = 0, y = 94; idx < 16; idx++, y += 2) { + gDPLoadTextureBlock(gfxCtx->polyOpa.p++, &D_01000000[0x180 * idx], G_IM_FMT_I, G_IM_SIZ_8b, 192, 2, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + + gDPSetTileSize(gfxCtx->polyOpa.p++, 1, this->uls, (this->ult & 0x7F) - idx * 4, 0, 0); + gSPTextureRectangle(gfxCtx->polyOpa.p++, 388, y << 2, 1156, (y + 2) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024); } - - func_8007672C(this->state.gfxCtx, 0, 0, 0, (s16)this->coverAlpha, 2); @@ -148,8 +127,7 @@ void Title_Draw(TitleContext* this) func_800C6B54(&gfxArr, this->state.gfxCtx, "../z_title.c", 483); } -void Title_Update(TitleContext* this) -{ +void Title_Update(TitleContext* this) { GraphicsContext* gfxCtx = this->state.gfxCtx; u32 pad; Gfx* gfxArr[4]; @@ -163,38 +141,33 @@ void Title_Update(TitleContext* this) func_80095248(this->state.gfxCtx, 0, 0, 0); Title_Calc(this); Title_Draw(this); - if (D_8012DBC0) - { + if (D_8012DBC0) { gfx[0] = gfxCtx->polyOpa.p; Title_PrintBuildInfo(&gfx); gfxCtx->polyOpa.p = gfx[0]; } - if (this->exit) - { + if (this->exit) { gSaveContext.seq_index = -1; gSaveContext.night_sfx = -1; gSaveContext.game_mode = 1; this->state.running = false; - this->state.init = Opening_Init; this->state.size = sizeof(OpeningContext); + SET_NEXT_GAMESTATE(&this->state, Opening_Init, OpeningContext); } func_800C6B54(&gfxArr, this->state.gfxCtx, "../z_title.c", 541); } -void Title_Destroy(TitleContext* this) -{ +void Title_Destroy(TitleContext* this) { func_800A9AD0(this, &this->sram); } -void Title_Init(TitleContext* this) -{ +void Title_Init(TitleContext* this) { u32 size = (u32)_nintendo_rogo_staticSegmentRomEnd - (u32)_nintendo_rogo_staticSegmentRomStart; u32 pad; this->staticSegment = Game_Alloc(&this->state, size, "../z_title.c", 611); osSyncPrintf("z_title.c\n"); - if (this->staticSegment == NULL) - { + if (this->staticSegment == NULL) { __assert("this->staticSegment != NULL", "../z_title.c", 614); } DmaMgr_SendRequest1(this->staticSegment, (u32)_nintendo_rogo_staticSegmentRomStart, size, "../z_title.c", 615); From 51290f612635a87d879b6332400ad526c479441e Mon Sep 17 00:00:00 2001 From: Roman971 Date: Sun, 22 Mar 2020 22:50:11 +0100 Subject: [PATCH 17/33] Partially format header files --- include/color.h | 9 +- include/functions.h | 194 +++++----- include/ichain.h | 6 +- include/padmgr.h | 11 +- include/regs.h | 2 +- include/sched.h | 9 +- include/segment_symbols.h | 9 +- include/stdbool.h | 8 +- include/stddef.h | 2 +- include/stdlib.h | 6 +- include/string.h | 6 +- include/ultra64/types.h | 6 +- include/vt.h | 2 +- include/z64.h | 351 +++++++----------- include/z64actor.h | 95 ++--- include/z64cutscene.h | 36 +- include/z64effect.h | 9 +- include/z64item.h | 19 +- include/z64light.h | 27 +- include/z64object.h | 3 +- include/z64scene.h | 254 +++++-------- .../actors/ovl_Arms_Hook/z_arms_hook.h | 3 +- .../actors/ovl_Arrow_Fire/z_arrow_fire.h | 3 +- .../actors/ovl_Arrow_Ice/z_arrow_ice.h | 3 +- .../actors/ovl_Arrow_Light/z_arrow_light.h | 3 +- .../ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h | 3 +- .../actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h | 3 +- .../actors/ovl_Bg_Bombwall/z_bg_bombwall.h | 3 +- .../actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h | 3 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.h | 3 +- .../actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h | 3 +- .../actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h | 3 +- .../actors/ovl_Bg_Dodoago/z_bg_dodoago.h | 3 +- .../ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h | 3 +- .../ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h | 3 +- .../ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h | 3 +- .../ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h | 3 +- .../ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h | 3 +- .../ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h | 3 +- .../ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h | 3 +- .../ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h | 3 +- src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h | 3 +- .../actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h | 3 +- .../actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h | 3 +- .../ovl_Bg_Haka_Megane/z_bg_haka_megane.h | 3 +- .../ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h | 3 +- .../ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h | 3 +- .../actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h | 3 +- .../actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h | 3 +- .../actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h | 3 +- .../ovl_Bg_Haka_Water/z_bg_haka_water.h | 3 +- .../actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h | 3 +- .../ovl_Bg_Heavy_Block/z_bg_heavy_block.h | 3 +- .../ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h | 3 +- .../ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h | 3 +- .../z_bg_hidan_firewall.h | 3 +- .../ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h | 3 +- .../ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h | 3 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h | 3 +- .../ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h | 3 +- .../ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h | 3 +- .../z_bg_hidan_kowarerukabe.h | 3 +- .../ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h | 3 +- .../z_bg_hidan_rsekizou.h | 3 +- .../ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h | 3 +- .../ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h | 3 +- .../ovl_Bg_Ice_Objects/z_bg_ice_objects.h | 3 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h | 3 +- .../ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h | 3 +- .../ovl_Bg_Ice_Turara/z_bg_ice_turara.h | 3 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.h | 3 +- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.h | 3 +- .../ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h | 3 +- .../actors/ovl_Bg_Jya_Block/z_bg_jya_block.h | 3 +- .../z_bg_jya_bombchuiwa.h | 3 +- .../ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h | 3 +- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h | 3 +- .../ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h | 3 +- .../ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h | 3 +- .../ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h | 3 +- .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h | 3 +- .../ovl_Bg_Jya_Megami/z_bg_jya_megami.h | 3 +- .../z_bg_jya_zurerukabe.h | 3 +- .../ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h | 3 +- .../ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h | 3 +- .../ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h | 3 +- .../ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h | 3 +- .../ovl_Bg_Mizu_Water/z_bg_mizu_water.h | 3 +- src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h | 3 +- .../ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h | 3 +- .../ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h | 3 +- .../ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h | 3 +- .../ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h | 3 +- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h | 3 +- .../ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h | 3 +- .../z_bg_mori_kaitenkabe.h | 3 +- .../z_bg_mori_rakkatenjo.h | 3 +- .../actors/ovl_Bg_Po_Event/z_bg_po_event.h | 3 +- .../ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h | 3 +- .../actors/ovl_Bg_Pushbox/z_bg_pushbox.h | 3 +- .../ovl_Bg_Relay_Objects/z_bg_relay_objects.h | 3 +- .../z_bg_spot00_hanebasi.h | 3 +- .../z_bg_spot01_idohashira.h | 3 +- .../z_bg_spot01_idomizu.h | 3 +- .../z_bg_spot01_objects2.h | 3 +- .../z_bg_spot02_objects.h | 3 +- .../ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h | 3 +- .../ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h | 3 +- .../z_bg_spot06_objects.h | 3 +- .../ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h | 3 +- .../z_bg_spot08_bakudankabe.h | 3 +- .../z_bg_spot08_iceblock.h | 3 +- .../ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h | 3 +- .../z_bg_spot11_bakudankabe.h | 3 +- .../ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h | 3 +- .../ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h | 3 +- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h | 3 +- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h | 3 +- .../ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h | 3 +- .../z_bg_spot16_bombstone.h | 3 +- .../z_bg_spot16_doughnut.h | 3 +- .../z_bg_spot17_bakudankabe.h | 3 +- .../ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h | 3 +- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h | 3 +- .../ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h | 3 +- .../z_bg_spot18_shutter.h | 3 +- .../actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h | 3 +- .../ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h | 3 +- .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h | 3 +- .../actors/ovl_Bg_Treemouth/z_bg_treemouth.h | 3 +- .../actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h | 3 +- .../actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h | 3 +- .../ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h | 3 +- .../actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h | 3 +- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h | 3 +- .../actors/ovl_Boss_Dodongo/z_boss_dodongo.h | 3 +- src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h | 3 +- src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h | 3 +- .../actors/ovl_Boss_Ganon/z_boss_ganon.h | 3 +- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.h | 3 +- .../ovl_Boss_Ganondrof/z_boss_ganondrof.h | 3 +- .../actors/ovl_Boss_Goma/z_boss_goma.h | 3 +- src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h | 3 +- src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h | 3 +- src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h | 3 +- src/overlays/actors/ovl_Boss_Va/z_boss_va.h | 3 +- src/overlays/actors/ovl_Demo_6K/z_demo_6k.h | 3 +- src/overlays/actors/ovl_Demo_Du/z_demo_du.h | 3 +- src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h | 3 +- .../actors/ovl_Demo_Effect/z_demo_effect.h | 3 +- src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h | 3 +- .../actors/ovl_Demo_Geff/z_demo_geff.h | 3 +- src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h | 3 +- src/overlays/actors/ovl_Demo_Go/z_demo_go.h | 3 +- src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h | 3 +- src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h | 3 +- src/overlays/actors/ovl_Demo_Im/z_demo_im.h | 3 +- .../actors/ovl_Demo_Kankyo/z_demo_kankyo.h | 3 +- .../actors/ovl_Demo_Kekkai/z_demo_kekkai.h | 3 +- src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h | 3 +- src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h | 3 +- .../actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h | 3 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.h | 3 +- .../actors/ovl_Door_Gerudo/z_door_gerudo.h | 3 +- .../actors/ovl_Door_Killer/z_door_killer.h | 3 +- .../actors/ovl_Door_Shutter/z_door_shutter.h | 3 +- .../actors/ovl_Door_Warp1/z_door_warp1.h | 3 +- .../actors/ovl_Efc_Erupc/z_efc_erupc.h | 3 +- src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h | 3 +- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h | 3 +- src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h | 3 +- src/overlays/actors/ovl_En_Am/z_en_am.h | 3 +- src/overlays/actors/ovl_En_Ani/z_en_ani.h | 3 +- .../actors/ovl_En_Anubice/z_en_anubice.h | 3 +- .../ovl_En_Anubice_Fire/z_en_anubice_fire.h | 3 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.h | 3 +- .../ovl_En_Attack_Niw/z_en_attack_niw.h | 3 +- src/overlays/actors/ovl_En_Ba/z_en_ba.h | 3 +- src/overlays/actors/ovl_En_Bb/z_en_bb.h | 3 +- .../actors/ovl_En_Bdfire/z_en_bdfire.h | 3 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.h | 3 +- src/overlays/actors/ovl_En_Bili/z_en_bili.h | 3 +- .../actors/ovl_En_Blkobj/z_en_blkobj.h | 3 +- src/overlays/actors/ovl_En_Bom/z_en_bom.h | 3 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h | 3 +- .../ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h | 3 +- .../actors/ovl_En_Bom_Chu/z_en_bom_chu.h | 3 +- src/overlays/actors/ovl_En_Bombf/z_en_bombf.h | 3 +- src/overlays/actors/ovl_En_Boom/z_en_boom.h | 3 +- src/overlays/actors/ovl_En_Box/z_en_box.h | 3 +- src/overlays/actors/ovl_En_Brob/z_en_brob.h | 3 +- .../actors/ovl_En_Bubble/z_en_bubble.h | 3 +- src/overlays/actors/ovl_En_Butte/z_en_butte.h | 3 +- src/overlays/actors/ovl_En_Bw/z_en_bw.h | 3 +- src/overlays/actors/ovl_En_Bx/z_en_bx.h | 3 +- .../actors/ovl_En_Changer/z_en_changer.h | 3 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.h | 3 +- src/overlays/actors/ovl_En_Cow/z_en_cow.h | 3 +- src/overlays/actors/ovl_En_Crow/z_en_crow.h | 3 +- src/overlays/actors/ovl_En_Cs/z_en_cs.h | 3 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.h | 3 +- .../z_en_daiku_kakariko.h | 3 +- .../actors/ovl_En_Dekubaba/z_en_dekubaba.h | 3 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.h | 3 +- src/overlays/actors/ovl_En_Dh/z_en_dh.h | 3 +- src/overlays/actors/ovl_En_Dha/z_en_dha.h | 3 +- .../ovl_En_Diving_Game/z_en_diving_game.h | 3 +- src/overlays/actors/ovl_En_Dns/z_en_dns.h | 3 +- .../actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h | 3 +- .../actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h | 3 +- .../actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h | 3 +- .../actors/ovl_En_Dodojr/z_en_dodojr.h | 3 +- .../actors/ovl_En_Dodongo/z_en_dodongo.h | 3 +- src/overlays/actors/ovl_En_Dog/z_en_dog.h | 3 +- src/overlays/actors/ovl_En_Door/z_en_door.h | 3 +- src/overlays/actors/ovl_En_Ds/z_en_ds.h | 3 +- src/overlays/actors/ovl_En_Du/z_en_du.h | 3 +- .../actors/ovl_En_Dy_Extra/z_en_dy_extra.h | 3 +- src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h | 3 +- src/overlays/actors/ovl_En_Elf/z_en_elf.h | 3 +- .../actors/ovl_En_Encount1/z_en_encount1.h | 3 +- .../actors/ovl_En_Encount2/z_en_encount2.h | 3 +- .../actors/ovl_En_Ex_Item/z_en_ex_item.h | 3 +- .../actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h | 3 +- src/overlays/actors/ovl_En_Fd/z_en_fd.h | 3 +- .../actors/ovl_En_Fd_Fire/z_en_fd_fire.h | 3 +- .../actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h | 3 +- .../actors/ovl_En_Fire_Rock/z_en_fire_rock.h | 3 +- .../actors/ovl_En_Firefly/z_en_firefly.h | 3 +- src/overlays/actors/ovl_En_Fish/z_en_fish.h | 3 +- .../actors/ovl_En_Floormas/z_en_floormas.h | 3 +- src/overlays/actors/ovl_En_Fr/z_en_fr.h | 3 +- src/overlays/actors/ovl_En_Fu/z_en_fu.h | 3 +- src/overlays/actors/ovl_En_Fw/z_en_fw.h | 3 +- src/overlays/actors/ovl_En_Fz/z_en_fz.h | 3 +- .../actors/ovl_En_G_Switch/z_en_g_switch.h | 3 +- .../ovl_En_Ganon_Mant/z_en_ganon_mant.h | 3 +- src/overlays/actors/ovl_En_Gb/z_en_gb.h | 3 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.h | 3 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.h | 3 +- src/overlays/actors/ovl_En_Ge3/z_en_ge3.h | 3 +- src/overlays/actors/ovl_En_GeldB/z_en_geldb.h | 3 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.h | 3 +- src/overlays/actors/ovl_En_Gm/z_en_gm.h | 3 +- src/overlays/actors/ovl_En_Go/z_en_go.h | 3 +- src/overlays/actors/ovl_En_Go2/z_en_go2.h | 3 +- src/overlays/actors/ovl_En_Goma/z_en_goma.h | 3 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.h | 3 +- src/overlays/actors/ovl_En_Gs/z_en_gs.h | 3 +- src/overlays/actors/ovl_En_Guest/z_en_guest.h | 3 +- src/overlays/actors/ovl_En_Hata/z_en_hata.h | 3 +- .../actors/ovl_En_Heishi1/z_en_heishi1.h | 3 +- .../actors/ovl_En_Heishi2/z_en_heishi2.h | 3 +- .../actors/ovl_En_Heishi3/z_en_heishi3.h | 3 +- .../actors/ovl_En_Heishi4/z_en_heishi4.h | 3 +- .../actors/ovl_En_Hintnuts/z_en_hintnuts.h | 3 +- src/overlays/actors/ovl_En_Holl/z_en_holl.h | 3 +- .../actors/ovl_En_Honotrap/z_en_honotrap.h | 3 +- src/overlays/actors/ovl_En_Horse/z_en_horse.h | 3 +- .../z_en_horse_game_check.h | 3 +- .../ovl_En_Horse_Ganon/z_en_horse_ganon.h | 3 +- .../z_en_horse_link_child.h | 3 +- .../ovl_En_Horse_Normal/z_en_horse_normal.h | 3 +- .../ovl_En_Horse_Zelda/z_en_horse_zelda.h | 3 +- src/overlays/actors/ovl_En_Hs/z_en_hs.h | 3 +- src/overlays/actors/ovl_En_Hs2/z_en_hs2.h | 3 +- src/overlays/actors/ovl_En_Hy/z_en_hy.h | 3 +- .../actors/ovl_En_Ice_Hono/z_en_ice_hono.h | 3 +- src/overlays/actors/ovl_En_Ik/z_en_ik.h | 3 +- src/overlays/actors/ovl_En_In/z_en_in.h | 3 +- .../actors/ovl_En_Insect/z_en_insect.h | 3 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.h | 3 +- src/overlays/actors/ovl_En_Jj/z_en_jj.h | 3 +- src/overlays/actors/ovl_En_Js/z_en_js.h | 3 +- .../actors/ovl_En_Jsjutan/z_en_jsjutan.h | 3 +- .../actors/ovl_En_Kakasi/z_en_kakasi.h | 3 +- .../actors/ovl_En_Kakasi2/z_en_kakasi2.h | 3 +- .../actors/ovl_En_Kakasi3/z_en_kakasi3.h | 3 +- .../actors/ovl_En_Kanban/z_en_kanban.h | 3 +- .../actors/ovl_En_Karebaba/z_en_karebaba.h | 3 +- src/overlays/actors/ovl_En_Ko/z_en_ko.h | 3 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.h | 3 +- src/overlays/actors/ovl_En_Kz/z_en_kz.h | 3 +- src/overlays/actors/ovl_En_Light/z_en_light.h | 3 +- .../actors/ovl_En_Lightbox/z_en_lightbox.h | 3 +- .../actors/ovl_En_M_Thunder/z_en_m_thunder.h | 3 +- src/overlays/actors/ovl_En_Ma1/z_en_ma1.h | 3 +- src/overlays/actors/ovl_En_Ma2/z_en_ma2.h | 3 +- src/overlays/actors/ovl_En_Ma3/z_en_ma3.h | 3 +- src/overlays/actors/ovl_En_Mag/z_en_mag.h | 3 +- src/overlays/actors/ovl_En_Mb/z_en_mb.h | 3 +- src/overlays/actors/ovl_En_Md/z_en_md.h | 3 +- src/overlays/actors/ovl_En_Mk/z_en_mk.h | 3 +- src/overlays/actors/ovl_En_Mm/z_en_mm.h | 3 +- src/overlays/actors/ovl_En_Mm2/z_en_mm2.h | 3 +- src/overlays/actors/ovl_En_Mu/z_en_mu.h | 3 +- src/overlays/actors/ovl_En_Nb/z_en_nb.h | 3 +- src/overlays/actors/ovl_En_Niw/z_en_niw.h | 3 +- .../actors/ovl_En_Niw_Girl/z_en_niw_girl.h | 3 +- .../actors/ovl_En_Niw_Lady/z_en_niw_lady.h | 3 +- .../actors/ovl_En_Nutsball/z_en_nutsball.h | 3 +- src/overlays/actors/ovl_En_Nwc/z_en_nwc.h | 3 +- src/overlays/actors/ovl_En_Ny/z_en_ny.h | 3 +- .../ovl_En_Okarina_Tag/z_en_okarina_tag.h | 3 +- src/overlays/actors/ovl_En_Okuta/z_en_okuta.h | 3 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.h | 3 +- src/overlays/actors/ovl_En_Owl/z_en_owl.h | 3 +- src/overlays/actors/ovl_En_Part/z_en_part.h | 3 +- .../actors/ovl_En_Peehat/z_en_peehat.h | 3 +- .../actors/ovl_En_Po_Desert/z_en_po_desert.h | 3 +- .../actors/ovl_En_Po_Field/z_en_po_field.h | 3 +- .../actors/ovl_En_Po_Relay/z_en_po_relay.h | 3 +- .../ovl_En_Po_Sisters/z_en_po_sisters.h | 3 +- src/overlays/actors/ovl_En_Poh/z_en_poh.h | 3 +- .../actors/ovl_En_Pu_box/z_en_pu_box.h | 3 +- src/overlays/actors/ovl_En_Rd/z_en_rd.h | 3 +- src/overlays/actors/ovl_En_Reeba/z_en_reeba.h | 3 +- .../ovl_En_River_Sound/z_en_river_sound.h | 3 +- src/overlays/actors/ovl_En_Rl/z_en_rl.h | 3 +- src/overlays/actors/ovl_En_Rr/z_en_rr.h | 3 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.h | 3 +- src/overlays/actors/ovl_En_Ru2/z_en_ru2.h | 3 +- src/overlays/actors/ovl_En_Sa/z_en_sa.h | 3 +- src/overlays/actors/ovl_En_Sb/z_en_sb.h | 3 +- src/overlays/actors/ovl_En_Sda/z_en_sda.h | 3 +- .../actors/ovl_En_Shopnuts/z_en_shopnuts.h | 3 +- src/overlays/actors/ovl_En_Si/z_en_si.h | 3 +- .../actors/ovl_En_Siofuki/z_en_siofuki.h | 3 +- src/overlays/actors/ovl_En_Skb/z_en_skb.h | 3 +- src/overlays/actors/ovl_En_Skj/z_en_skj.h | 3 +- .../actors/ovl_En_Skjneedle/z_en_skjneedle.h | 3 +- src/overlays/actors/ovl_En_Ssh/z_en_ssh.h | 3 +- src/overlays/actors/ovl_En_St/z_en_st.h | 3 +- src/overlays/actors/ovl_En_Sth/z_en_sth.h | 3 +- .../actors/ovl_En_Stream/z_en_stream.h | 3 +- src/overlays/actors/ovl_En_Sw/z_en_sw.h | 3 +- .../ovl_En_Syateki_Itm/z_en_syateki_itm.h | 3 +- .../ovl_En_Syateki_Man/z_en_syateki_man.h | 3 +- .../ovl_En_Syateki_Niw/z_en_syateki_niw.h | 3 +- src/overlays/actors/ovl_En_Ta/z_en_ta.h | 3 +- .../ovl_En_Takara_Man/z_en_takara_man.h | 3 +- src/overlays/actors/ovl_En_Tana/z_en_tana.h | 3 +- src/overlays/actors/ovl_En_Test/z_en_test.h | 3 +- src/overlays/actors/ovl_En_Tg/z_en_tg.h | 3 +- src/overlays/actors/ovl_En_Tite/z_en_tite.h | 3 +- src/overlays/actors/ovl_En_Tk/z_en_tk.h | 15 +- .../actors/ovl_En_Torch2/z_en_torch2.h | 3 +- src/overlays/actors/ovl_En_Toryo/z_en_toryo.h | 3 +- src/overlays/actors/ovl_En_Tp/z_en_tp.h | 3 +- src/overlays/actors/ovl_En_Tr/z_en_tr.h | 3 +- src/overlays/actors/ovl_En_Trap/z_en_trap.h | 3 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h | 3 +- src/overlays/actors/ovl_En_Vali/z_en_vali.h | 3 +- .../actors/ovl_En_Vb_Ball/z_en_vb_ball.h | 3 +- .../actors/ovl_En_Viewer/z_en_viewer.h | 3 +- src/overlays/actors/ovl_En_Vm/z_en_vm.h | 3 +- .../actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h | 3 +- .../actors/ovl_En_Wallmas/z_en_wallmas.h | 9 +- .../ovl_En_Weather_Tag/z_en_weather_tag.h | 3 +- .../actors/ovl_En_Weiyer/z_en_weiyer.h | 3 +- src/overlays/actors/ovl_En_Wf/z_en_wf.h | 3 +- .../ovl_En_Wonder_Item/z_en_wonder_item.h | 3 +- .../ovl_En_Wonder_Talk/z_en_wonder_talk.h | 3 +- .../ovl_En_Wonder_Talk2/z_en_wonder_talk2.h | 3 +- .../actors/ovl_En_Wood02/z_en_wood02.h | 3 +- src/overlays/actors/ovl_En_Xc/z_en_xc.h | 3 +- .../ovl_En_Yabusame_Mark/z_en_yabusame_mark.h | 3 +- .../actors/ovl_En_Yukabyun/z_en_yukabyun.h | 3 +- src/overlays/actors/ovl_En_Zf/z_en_zf.h | 3 +- src/overlays/actors/ovl_En_Zl1/z_en_zl1.h | 3 +- src/overlays/actors/ovl_En_Zl2/z_en_zl2.h | 3 +- src/overlays/actors/ovl_En_Zl3/z_en_zl3.h | 3 +- src/overlays/actors/ovl_En_Zl4/z_en_zl4.h | 3 +- src/overlays/actors/ovl_En_Zo/z_en_zo.h | 3 +- src/overlays/actors/ovl_En_fHG/z_en_fhg.h | 3 +- .../actors/ovl_End_Title/z_end_title.h | 3 +- src/overlays/actors/ovl_Fishing/z_fishing.h | 3 +- .../actors/ovl_Item_B_Heart/z_item_b_heart.h | 3 +- .../ovl_Item_Etcetera/z_item_etcetera.h | 3 +- .../actors/ovl_Item_Ocarina/z_item_ocarina.h | 3 +- .../actors/ovl_Item_Shield/z_item_shield.h | 3 +- .../actors/ovl_Magic_Dark/z_magic_dark.h | 3 +- .../actors/ovl_Magic_Fire/z_magic_fire.h | 3 +- .../actors/ovl_Magic_Wind/z_magic_wind.h | 3 +- src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h | 3 +- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h | 3 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h | 3 +- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h | 3 +- .../actors/ovl_Obj_Dekujr/z_obj_dekujr.h | 3 +- .../actors/ovl_Obj_Elevator/z_obj_elevator.h | 3 +- .../actors/ovl_Obj_Hamishi/z_obj_hamishi.h | 3 +- src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h | 3 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.h | 3 +- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h | 3 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.h | 3 +- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.h | 3 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h | 3 +- .../ovl_Obj_Lightswitch/z_obj_lightswitch.h | 3 +- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h | 3 +- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h | 3 +- .../actors/ovl_Obj_Mure2/z_obj_mure2.h | 3 +- .../actors/ovl_Obj_Mure3/z_obj_mure3.h | 3 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h | 3 +- .../actors/ovl_Obj_Switch/z_obj_switch.h | 3 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.h | 3 +- .../ovl_Obj_Timeblock/z_obj_timeblock.h | 3 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.h | 3 +- .../ovl_Obj_Warp2block/z_obj_warp2block.h | 3 +- .../ovl_Object_Kankyo/z_object_kankyo.h | 3 +- .../actors/ovl_Oceff_Spot/z_oceff_spot.h | 3 +- .../actors/ovl_Oceff_Storm/z_oceff_storm.h | 3 +- .../actors/ovl_Oceff_Wipe/z_oceff_wipe.h | 3 +- .../actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h | 3 +- .../actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h | 3 +- .../actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h | 3 +- src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h | 3 +- undefined_syms.txt | 10 +- 417 files changed, 832 insertions(+), 1445 deletions(-) diff --git a/include/color.h b/include/color.h index c0b62c9179..94c3a20d12 100644 --- a/include/color.h +++ b/include/color.h @@ -1,18 +1,15 @@ #ifndef _COLOR_H_ #define _COLOR_H_ -typedef struct -{ +typedef struct { u8 r, g, b; } Color_RGB8; -typedef struct -{ +typedef struct { u8 r, g, b, a; } Color_RGBA8; -typedef struct -{ +typedef struct { f32 r, g, b, a; } Color_RGBAf; diff --git a/include/functions.h b/include/functions.h index f9f3cef775..62e85912a5 100644 --- a/include/functions.h +++ b/include/functions.h @@ -26,7 +26,8 @@ void DmaMgr_ThreadEntry(void* arg0); s32 DmaMgr_SendRequestImpl(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk, OSMesgQueue* queue, OSMesg msg); s32 DmaMgr_SendRequest0(u32 ram, u32 vrom, u32 size); void DmaMgr_Start(); -s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, OSMesgQueue* queue, OSMesg msg, const char* file, s32 line); +s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, OSMesgQueue* queue, OSMesg msg, + const char* file, s32 line); s32 DmaMgr_SendRequest1(void* ram0, u32 vrom, u32 size, const char* file, s32 line); void* Yaz0_FirstDMA(); void* Yaz0_NextDMA(void* curSrcPos); @@ -42,26 +43,29 @@ void isPrintfInit(); void osSyncPrintfUnused(const char* fmt, ...); void osSyncPrintf(const char* fmt, ...); void rmonPrintf(const char* fmt, ...); -u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count); +u32 is_proutSyncPrintf(void* arg0, const char* str, s32 count); void func_80002384(const char* exp, const char* file, u32 line); OSPiHandle* osDriveRomInit(); void Yaz0_Old_DecompressImpl(Yaz0Header* hdr, u8* dst); -void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace, const char* name); +void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace, + const char* name); void StackCheck_Cleanup(StackEntry* entry); StackStatus StackCheck_GetState(StackEntry* entry); u32 StackCheck_CheckAll(); u32 StackCheck_Check(StackEntry* entry); -float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, float var2, const char* var3Name, float var3); -s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2, const char* var3Name, s32 var3); +float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, + float var2, const char* var3Name, float var3); +s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2, + const char* var3Name, s32 var3); void LogUtils_LogHexDump(void* ptr, s32 size0); -void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char *name, const char *file, s32 line); +void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, s32 line); void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line); void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line); void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line); void LogUtils_LogThreadId(const char* name, s32 line); void LogUtils_HungupThread(const char* name, s32 line); void LogUtils_ResetHungup(); -char* proutSprintf(char* dst, const char *fmt, size_t size); +char* proutSprintf(char* dst, const char* fmt, size_t size); s32 vsprintf(char* dst, const char* fmt, va_list args); s32 sprintf(char* dst, const char* fmt, ...); void __osPiCreateAccessQueue(void); @@ -88,55 +92,55 @@ void __osExceptionPreamble(); // ? __osException(?); void __osEnqueueAndYield(OSThread**); void __osEnqueueThread(OSThread**, OSThread*); -OSThread *__osPopThread(OSThread**); +OSThread* __osPopThread(OSThread**); // ? __osNop(?); void __osDispatchThread(); void __osCleanupThread(void); -void __osDequeueThread(OSThread **queue, OSThread *thread); -void osDestroyThread(OSThread *thread); -void bzero(void *__s, u32 __n); +void __osDequeueThread(OSThread** queue, OSThread* thread); +void osDestroyThread(OSThread* thread); +void bzero(void* __s, u32 __n); void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri); void __osSetSR(u32); u32 __osGetSR(); -void osWritebackDCache(void *vaddr, s32 nbytes); +void osWritebackDCache(void* vaddr, s32 nbytes); void* osViGetNextFramebuffer(); -void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt); +void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt); void __osDevMgrMain(void* arg); -s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size); +s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void* dram_addr, size_t size); u32 osVirtualToPhysical(void* vaddr); void osViBlack(u8 active); -s32 __osSiRawReadIo(void *a0, u32 *a1); +s32 __osSiRawReadIo(void* a0, u32* a1); OSId osGetThreadId(OSThread* thread); OSIntMask osSetIntMask(OSIntMask); -void osViSetMode(OSViMode *mode); -u32 __osProbeTLB(void *); +void osViSetMode(OSViMode* mode); +u32 __osProbeTLB(void*); u32 osGetMemSize(void); -void osSetEventMesg(OSEvent e, OSMesgQueue *mq, OSMesg msg); -s32 _Printf(char *(*pfn)(char *, const char *, size_t), char *arg, const char *fmt, va_list ap); +void osSetEventMesg(OSEvent e, OSMesgQueue* mq, OSMesg msg); +s32 _Printf(char* (*pfn)(char*, const char*, size_t), char* arg, const char* fmt, va_list ap); void osUnmapTLBAll(void); s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction); -const u8 *strchr(const u8 *str, s32 ch); -size_t strlen(const u8 *str); -void *memcpy(void *dst, const void *src, size_t size); +const u8* strchr(const u8* str, s32 ch); +size_t strlen(const u8* str); +void* memcpy(void* dst, const void* src, size_t size); void osInvalICache(void* vaddr, s32 nbytes); void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count); void osInvalDCache(void* vaddr, s32 nbytes); u32 __osSiDeviceBusy(); void osSetThreadPri(OSThread* thread, OSPri pri); OSPri osGetThreadPri(OSThread* thread); -s32 __osEPiRawReadIo(OSPiHandle *handle, u32 devAddr, u32 *data); -void osViSwapBuffer(void *vaddr); -s32 __osEPiRawStartDma(OSPiHandle *handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size); -u32 bcmp(void *__sl,void *__s2,u32 __n); +s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data); +void osViSwapBuffer(void* vaddr); +s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size); +u32 bcmp(void* __sl, void* __s2, u32 __n); OSTime osGetTime(void); void __osTimerServicesInit(); void __osTimerInterrupt(); void __osSetTimerIntr(OSTime tim); -OSTime __osInsertTimer(OSTimer *a0); +OSTime __osInsertTimer(OSTimer* a0); u32 osGetCount(void); void __osSetGlobalIntMask(u32 mask); void __osSetCompare(u32); -void* bcopy(void *__src,void *__dest,u32 __n); +void* bcopy(void* __src, void* __dest, u32 __n); void __osResetGlobalIntMask(u32 mask); s32 __osDisableInt(void); void __osRestoreInt(s32); @@ -151,9 +155,9 @@ u32 __osGetFpcCsr(); s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); void osMapTLBRdb(void); u32 __osGetCause(); -s32 __osEPiRawWriteIo(OSPiHandle *handle, u32 devAddr, u32 data); +s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); void osCreateViManager(OSPri pri); -void viMgrMain(void *vargs); +void viMgrMain(void* vargs); OSViContext* __osViGetCurrentContext(); void osStartThread(OSThread* thread); void osViSetYScale(float scale); @@ -223,8 +227,8 @@ void func_80028B74(GlobalContext*, Vec3f*, UNK_PTR, UNK_PTR, Color_RGB8*, Color_ // ? func_80028FD8(?); // ? func_80029060(?); void Effect_SpawnFragment(GlobalContext* globalCtx, Vec3f* burstDepthY, Vec3f* burstDepthX, Vec3f* burstOrigin, - s16 gravityInfluence, s16 u0, s16 rotSpeed, s16 burstVel, u8 u1, s16 scale, u8 u2, - s16 jitter, s32 duration, s16 u3, s16 objNumber, u32 dList); + s16 gravityInfluence, s16 u0, s16 rotSpeed, s16 burstVel, u8 u1, s16 scale, u8 u2, s16 jitter, + s32 duration, s16 u3, s16 objNumber, u32 dList); // ? func_800292DC(?); // ? func_80029320(?); // ? func_80029444(?); @@ -238,7 +242,8 @@ void Effect_SpawnFragment(GlobalContext* globalCtx, Vec3f* burstDepthY, Vec3f* b // ? func_8002A32C(?); // ? func_8002A3C4(?); void func_8002A65C(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, u32 arg3, u32 arg4); -void func_8002A6B8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* arg2, Vec3f* arg3, u32 arg4, s32 arg5, u32 arg6, u32 arg7, u32 arg8, u32 arg9, u32 arg10, u32 arg11, u32 arg12, u32 arg13, u32 arg14, u32 arg15); +void func_8002A6B8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* arg2, Vec3f* arg3, u32 arg4, s32 arg5, u32 arg6, + u32 arg7, u32 arg8, u32 arg9, u32 arg10, u32 arg11, u32 arg12, u32 arg13, u32 arg14, u32 arg15); // ? func_8002A894(?); // ? func_8002A95C(?); // ? func_8002A9F4(?); @@ -268,10 +273,10 @@ void Flags_SetTempClear(GlobalContext* globalCtx, s32 flag); void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag); s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag); void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag); -void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, - s16 arg3, s16 arg4, u8 arg5, u8 arg6); -void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, - s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7); +void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s16 arg3, s16 arg4, + u8 arg5, u8 arg6); +void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s32 arg3, s32 arg4, + s32 arg5, s32 arg6, s32 arg7); s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx); void Actor_Kill(Actor* actor); void Actor_SetHeight(Actor* actor, f32 offset); @@ -357,18 +362,18 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx); s32 func_800314D4(GlobalContext* globalCtx, Actor* actorB, Vec3f* arg2, f32 arg3); void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx); -Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, - f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params); -Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId, - f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params); +Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, f32 posX, f32 posY, f32 posZ, + s16 rotX, s16 rotY, s16 rotZ, s16 params); +Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId, f32 posX, + f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params); void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx); Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx); Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx); Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player); Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType); void func_80032C7C(GlobalContext* globalCtx, Actor* actor); -void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, - s32 arg4, f32 arg5, s16 arg6, s16 arg7, u8 arg8); +void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 arg6, + s16 arg7, u8 arg8); void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5, u8 arg6); Actor* func_80033640(GlobalContext* globalCtx, Collider* collider); Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor); @@ -389,10 +394,13 @@ void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1); void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4); Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx); Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx); -s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*)); +s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), + s16 (*unkFunc2)(GlobalContext*, Actor*)); s16 func_800347E8(s16 arg0); -void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha); -void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha); +void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, + s16 alpha); +void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, + s16 alpha); void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2); void Actor_Noop(Actor* actor, GlobalContext* globalCtx); void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist); @@ -649,7 +657,7 @@ s16 func_8005A9F4(Camera* camera); // ? func_8005AFB4(?); // ? func_8005B044(?); // ? func_8005B1A4(?); -s32 CollisionBtlTbl_Get(s32 index); +s32 CollisionBtlTbl_Get(s32 index); // ? func_8005B280(?); // ? func_8005B2AC(?); // ? func_8005B65C(?); @@ -688,7 +696,8 @@ s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDi s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision); s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision); s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* arg2); -s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src); +s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, + ColliderCylinderInit* src); s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision); s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision); s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision); @@ -721,9 +730,12 @@ void func_8005D400(UNK_TYPE, UNK_TYPE); // ? func_8005D40C(?); // ? func_8005D4DC(?); // ? func_8005D62C(?); -s32 Actor_CollisionCheck_SetAT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, ColliderCylinderMain* collision); -s32 Actor_CollisionCheck_SetAC(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, ColliderCylinderMain* collision); -s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, ColliderCylinderMain* collision); +s32 Actor_CollisionCheck_SetAT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, + ColliderCylinderMain* collision); +s32 Actor_CollisionCheck_SetAC(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, + ColliderCylinderMain* collision); +s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, + ColliderCylinderMain* collision); // ? func_8005DF2C(?); // ? func_8005DF50(?); // ? func_8005DF74(?); @@ -744,8 +756,8 @@ s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60* // ? func_80061C98(?); // ? func_80061E48(?); // ? func_80061E8C(?); -void func_80061ED4(SubActorStruct98 *sub98, ActorDamageChart *damageChart, SubActor98Init *subActor98Init); -void func_80061EFC(SubActorStruct98 *sub98, ActorDamageChart *damageChart, SubActor98Init *subActor98Init); +void func_80061ED4(SubActorStruct98* sub98, ActorDamageChart* damageChart, SubActor98Init* subActor98Init); +void func_80061EFC(SubActorStruct98* sub98, ActorDamageChart* damageChart, SubActor98Init* subActor98Init); // ? func_80061F64(?); // ? func_800622E4(?); // ? func_80062530(?); @@ -768,9 +780,9 @@ void func_8006375C(s32 arg0, s32 arg1, float* d_80855320); // ? func_80063C04(?); // ? func_80063D7C(?); void DebugDisplay_Init(void); -DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, - f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, - s16 type, GraphicsContext* gfxCtx); +DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX, + f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type, + GraphicsContext* gfxCtx); void DebugDisplay_DrawObjects(GlobalContext* globalCtx); void func_8006450C(GlobalContext* globalCtx, CutsceneContext* csCtx); void func_80064534(GlobalContext* globalCtx, CutsceneContext* csCtx); @@ -884,9 +896,12 @@ void Health_InitData(GlobalContext* globalCtx); void Health_UpdateData(GlobalContext* globalCtx); void Interface_DrawHealth(GlobalContext* globalCtx); void Health_HandleCriticalAlarm(GlobalContext* globalCtx); -void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius, u32 type); -void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius); -void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius); +void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, + s16 radius, u32 type); +void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, + s16 radius); +void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, + s16 radius); void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius); void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue); void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue); @@ -1066,7 +1081,7 @@ void func_80093D18(GraphicsContext* gfxCtx); void func_80093D84(GraphicsContext* gfxCtx); // ? func_80093F34(?); // ? func_80093F58(?); -void func_80094044(GraphicsContext *gfxCtx); +void func_80094044(GraphicsContext* gfxCtx); // ? func_800940B0(?); // ? func_800942F0(?); // ? func_8009435C(?); @@ -1082,8 +1097,10 @@ Gfx* func_800946E4(Gfx* a0); // ? func_80094DB8(?); Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y); Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height); -Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2); -Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha); +Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, + u32 y2, s32 width2, s32 height2); +Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, + u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha); // ? func_80095248(?); void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3); // ? func_8009638C(?); @@ -1116,15 +1133,18 @@ void Scene_Draw(GlobalContext* globalCtx); // ? func_800A0D94(?); // ? func_800A106C(?); // ? func_800A1344(?); -void SkelAnime_Draw(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0, void* internal1); +void SkelAnime_Draw(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0, + void* internal1); // ? func_800A180C(?); -void func_800A1AC8(GlobalContext *globalCtx, u32 limbIndex, u32 actorDrawTbl, u32 dListCount, void* posUpdateFunc, void *drawFunc, Actor* actor); +void func_800A1AC8(GlobalContext* globalCtx, u32 limbIndex, u32 actorDrawTbl, u32 dListCount, void* posUpdateFunc, + void* drawFunc, Actor* actor); // ? func_800A1D8C(?); // ? func_800A1FC8(?); s32 SkelAnime_GetFrameCount(u32 animation); // ? func_800A2044(?); // ? func_800A24A0(?); -Gfx* func_800A273C(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0, void* internal1, Actor* actor, Gfx* gfx); +Gfx* func_800A273C(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0, void* internal1, + Actor* actor, Gfx* gfx); // ? func_800A2E70(?); // ? func_800A32EC(?); // ? func_800A3334(?); @@ -1139,8 +1159,10 @@ Gfx* func_800A273C(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDLis // ? func_800A3F08(?); // ? func_800A3D70(?); // ? func_800A4478(?); -void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1, u8 unk2); -void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1, u8 unk2); +void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1, + u8 unk2); +void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1, + u8 unk2); // ? func_800A4A20(?); // ? func_800A4AD8(?); // ? func_800A4D9C(?); @@ -1150,10 +1172,11 @@ void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, s32 SkelAnime_FrameUpdateMatrix(SkelAnime* skelAnime); // ? func_800A4C58(?); // ? func_800A4FE4(?); -void SkelAnime_ChangeAnimation(SkelAnime* skelAnime, u32 animation, f32 playbackSpeed, f32 unk0, f32 frameCount, u8 unk1, f32 transitionRate); -void func_800A51E8(SkelAnime *skelAnime, u32 animation); -void func_800A5240(SkelAnime *skelAnime, u32 animation, f32 unk0); -void func_800A529C(SkelAnime *skelAnime, u32 animation, f32 unk0, Actor *actor); +void SkelAnime_ChangeAnimation(SkelAnime* skelAnime, u32 animation, f32 playbackSpeed, f32 unk0, f32 frameCount, + u8 unk1, f32 transitionRate); +void func_800A51E8(SkelAnime* skelAnime, u32 animation); +void func_800A5240(SkelAnime* skelAnime, u32 animation, f32 unk0); +void func_800A529C(SkelAnime* skelAnime, u32 animation, f32 unk0, Actor* actor); // ? func_800A52F8(?); // ? func_800A54FC(?); s32 func_800A56C8(SkelAnime* skelAnime, f32 arg1); @@ -1348,7 +1371,7 @@ void KaleidoScopeCall_LoadPlayer(); void KaleidoScopeCall_Init(GlobalContext* globalCtx); void KaleidoScopeCall_Destroy(GlobalContext* globalCtx); void KaleidoScopeCall_Update(GlobalContext* globalCtx); -void KaleidoScopeCall_Draw(GlobalContext *globalCtx); +void KaleidoScopeCall_Draw(GlobalContext* globalCtx); // ? func_800BC450(?); // ? func_800BC490(?); s32 func_800BC56C(GlobalContext*, s16); @@ -1379,7 +1402,7 @@ void func_800C0704(GlobalContext*, s16, f32); // ? func_800C078C(?); // ? func_800C0808(?); // ? func_800C0874(?); -void func_800C0C88(GlobalContext *globalCtx); +void func_800C0C88(GlobalContext* globalCtx); // ? func_800C0A44(?); // ? func_800C0A88(?); void func_800C0AF4(GlobalContext*, s8, s16); @@ -1479,7 +1502,7 @@ void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size); void func_800C6AC4(Gfx** a0, GraphicsContext* gfxCtx, char* file, s32 line); void func_800C6B54(Gfx** a0, GraphicsContext* gfxCtx, char* file, s32 line); Gfx* func_800C6C20(Gfx* a0); -Gfx* func_800C6C28(Gfx* a0, Gfx* dlist); //branch dlist +Gfx* func_800C6C28(Gfx* a0, Gfx* dlist); // branch dlist // ? func_800C6C3C(?); ListAlloc* ListAlloc_Init(ListAlloc* this); void* ListAlloc_Alloc(ListAlloc* this, u32 size); @@ -1499,7 +1522,7 @@ void Main(void*); // ? func_800C7C14(?); // ? func_800C7DD0(?); void func_800C7E08(Input*, u32); -//void PadMgr_Init(PadMgr* padmgr, OSMesg mesg, UNK_TYPE arg2, OSId id, OSPri priority, void* stack); +// void PadMgr_Init(PadMgr* padmgr, OSMesg mesg, UNK_TYPE arg2, OSId id, OSPri priority, void* stack); // ? func_800C82A0(?); // ? func_800C84E4(?); // ? func_800C8534(?); @@ -1649,7 +1672,7 @@ void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ); void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c); void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg); void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg); -void IrqMgr_HandlePreNMI(IrqMgr *this); +void IrqMgr_HandlePreNMI(IrqMgr* this); void IrqMgr_CheckStack(); void IrqMgr_HandlePRENMI450(IrqMgr* this); void IrqMgr_HandlePRENMI480(IrqMgr* this); @@ -1731,7 +1754,7 @@ void FaultDrawer_VPrintf(const char*, char*); void FaultDrawer_Printf(const char*, ...); void FaultDrawer_DrawText(s32, s32, const char*, ...); void FaultDrawer_SetDrawerFB(void*, u16, u16); -void FaultDrawer_SetInputCallback(void(*)()); +void FaultDrawer_SetInputCallback(void (*)()); void FaultDrawer_SetDefault(); // ? func_800D7CD0(?); // ? func_800D7D04(?); @@ -2150,14 +2173,14 @@ void GfxPrint_VPrintf(GfxPrint*, const char*, va_list); void GfxPrint_Printf(GfxPrint*, const char*, ...); void func_800FBCE0(); void func_800FBFD8(); -void *Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd); +void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd); // ? func_800FC258(?); -void Overlay_DoRelocation(void *allocatedVRamAddress, OverlayRelocationSection *overlayInfo, void *vRamAddress); -s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, void *allocatedVRamAddress); +void Overlay_DoRelocation(void* allocatedVRamAddress, OverlayRelocationSection* overlayInfo, void* vRamAddress); +s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd, void* allocatedVRamAddress); // ? func_800FC800(?); // ? func_800FC83C(?); // ? func_800FCAB4(?); -void SystemHeap_Init(void *start, u32 size); +void SystemHeap_Init(void* start, u32 size); // ? func_800FCC00(?); // ? func_800FCC08(?); // ? func_800FCC10(?); @@ -2220,10 +2243,10 @@ u8 __osMallocIsInitalized(Arena* arena); void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node); void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, s32 line); void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line); -void* __osMallocRDebug(Arena *arena, u32 size, const char *file, s32 line); -void* __osMalloc_NoLock(Arena *arena, u32 size); +void* __osMallocRDebug(Arena* arena, u32 size, const char* file, s32 line); +void* __osMalloc_NoLock(Arena* arena, u32 size); void* __osMalloc(Arena* arena, u32 size); -void* __osMallocR(Arena *arena, u32 size); +void* __osMallocR(Arena* arena, u32 size); void __osFree_NoLock(Arena* arena, void* ptr); void __osFree(Arena* arena, void* ptr); void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line); @@ -2296,7 +2319,8 @@ s16 sins(u16); // ? func_80103210(?); // ? func_8010328C(?); // ? func_801032B0(?); -void func_80103A70(UNK_PTR, Gfx*, Hilite*, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, s32, s32); +void func_80103A70(UNK_PTR, Gfx*, Hilite*, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, + s32, s32); // ? func_80103B30(?); // ? func_80103B60(?); // ? func_80103BB0(?); diff --git a/include/ichain.h b/include/ichain.h index 21ede465c7..8b11121911 100644 --- a/include/ichain.h +++ b/include/ichain.h @@ -1,8 +1,7 @@ #ifndef _ICHAIN_H_ #define _ICHAIN_H_ -typedef struct -{ +typedef struct { u32 cont: 1; u32 type: 4; u32 offset: 11; @@ -11,8 +10,7 @@ typedef struct #define OFFSETOF(structure, member) ((size_t)&(((structure*)0)->member)) -typedef enum -{ +typedef enum { /* 0x0 */ ICHAINTYPE_U8, // sets byte /* 0x1 */ ICHAINTYPE_S8, /* 0x2 */ ICHAINTYPE_U16, // sets short diff --git a/include/padmgr.h b/include/padmgr.h index ca5c7e42dc..dda4b210fc 100644 --- a/include/padmgr.h +++ b/include/padmgr.h @@ -6,8 +6,7 @@ #include -typedef struct -{ +typedef struct { /* 0x0000 */ OSContStatus pad_status[4]; /* 0x0010 */ OSMesg msgbuf1[1]; /* 0x0014 */ OSMesg msgbuf2[1]; @@ -24,10 +23,10 @@ typedef struct /* 0x02A8 */ u8 unk_2A8; /* 0x02A9 */ u8 unk_2A9; /* 0x02AA */ u8 unk_2AA[4]; - /* 0x02AA */ u8 unk_2AE[4]; //Looks like 1 if vibration pack, 2 if (maybe controller pack)? + /* 0x02AA */ u8 unk_2AE[4]; // Looks like 1 if vibration pack, 2 if (maybe controller pack)? /* 0x02B2 */ u8 unk_2B2[4]; /* 0x02B6 */ u8 unk_2B6[4]; - /* 0x02BA */ char unk_2BA[0x02]; //probably padding + /* 0x02BA */ char unk_2BA[0x02]; // probably padding /* 0x02BC */ unk_controller_t unk_controller[4]; /* 0x045C */ u8 unk_45C; /* 0x045D */ u8 unk_45D; @@ -37,5 +36,5 @@ typedef struct /* 0x0464 */ s32 unk_464; } PadMgr; // size = 0x468 - -#endif //_PADMGR_H_ + +#endif diff --git a/include/regs.h b/include/regs.h index 6fa8a090ee..b76587458e 100644 --- a/include/regs.h +++ b/include/regs.h @@ -1,7 +1,7 @@ #ifndef _REGS_H_ #define _REGS_H_ -#define REG_GROUPS 29 //number of REG groups, i.e. REG, SREG, OREG, etc. +#define REG_GROUPS 29 // number of REG groups, i.e. REG, SREG, OREG, etc. #define REG_PAGES 6 #define REG_PER_PAGE 16 #define REG_PER_GROUP REG_PAGES * REG_PER_PAGE diff --git a/include/sched.h b/include/sched.h index ff396be94b..656e55661e 100644 --- a/include/sched.h +++ b/include/sched.h @@ -13,8 +13,7 @@ #define OS_SC_RCP_MASK 0x0003 #define OS_SC_TYPE_MASK 0x0007 -typedef struct OSScTask -{ +typedef struct OSScTask { /* 0x00 */ struct OSScTask* next; /* 0x04 */ u32 state; /* 0x08 */ u32 flags; @@ -24,14 +23,12 @@ typedef struct OSScTask /* 0x54 */ OSMesg msg; } OSScTask; -typedef struct -{ +typedef struct { /* 0x00 */ char unk_00[0x12]; /* 0x12 */ s8 unk_12; } struct_800C8BC4; -typedef struct -{ +typedef struct { /* 0x0000 */ OSMesgQueue interruptQ; /* 0x0018 */ OSMesg intBuf[8]; /* 0x0038 */ OSMesgQueue cmdQ; diff --git a/include/segment_symbols.h b/include/segment_symbols.h index 020d4c4837..aed6d2f661 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -3,20 +3,20 @@ #include -#define DECLARE_SEGMENT(name) \ +#define DECLARE_SEGMENT(name) \ extern u8 _##name##SegmentStart[]; \ extern u8 _##name##SegmentEnd[]; -#define DECLARE_ROM_SEGMENT(name) \ +#define DECLARE_ROM_SEGMENT(name) \ extern u8 _##name##SegmentRomStart[]; \ extern u8 _##name##SegmentRomEnd[]; -#define DECLARE_BSS_SEGMENT(name) \ +#define DECLARE_BSS_SEGMENT(name) \ extern u8 _##name##SegmentBssStart[]; \ extern u8 _##name##SegmentBssEnd[]; #define DECLARE_OVERLAY_SEGMENT(name) \ - DECLARE_SEGMENT(ovl_##name) \ + DECLARE_SEGMENT(ovl_##name) \ DECLARE_ROM_SEGMENT(ovl_##name) DECLARE_SEGMENT(boot) @@ -1091,5 +1091,4 @@ DECLARE_ROM_SEGMENT(testroom_room_2) DECLARE_ROM_SEGMENT(testroom_room_3) DECLARE_ROM_SEGMENT(testroom_room_4) - #endif diff --git a/include/stdbool.h b/include/stdbool.h index 87f54e45b5..519806b310 100644 --- a/include/stdbool.h +++ b/include/stdbool.h @@ -1,13 +1,13 @@ #ifndef _STDBOOL #define _STDBOOL -#define __bool_true_false_are_defined 1 +#define __bool_true_false_are_defined 1 #ifndef __cplusplus -#define bool u32 -#define false 0 -#define true 1 +#define bool u32 +#define false 0 +#define true 1 #endif /* __cplusplus */ diff --git a/include/stddef.h b/include/stddef.h index 8b46557749..16bd97a1d7 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -1,7 +1,7 @@ #ifndef _STDDEF_H_ #define _STDDEF_H_ -#define NULL ((void *)0) +#define NULL ((void*)0) typedef unsigned long size_t; diff --git a/include/stdlib.h b/include/stdlib.h index 1c7666df84..81dc327572 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,14 +1,12 @@ #ifndef _STDLIB_H_ #define _STDLIB_H_ -typedef struct lldiv_t -{ +typedef struct lldiv_t { long long quot; long long rem; } lldiv_t; -typedef struct ldiv_t -{ +typedef struct ldiv_t { long quot; long rem; } ldiv_t; diff --git a/include/string.h b/include/string.h index 35b1ffa067..29ce60a57c 100644 --- a/include/string.h +++ b/include/string.h @@ -1,8 +1,10 @@ #ifndef _STRING_H_ #define _STRING_H_ + #include + void* memcpy(void*, const void*, size_t); -size_t strlen(const u8 *str); -const u8 *strchr(const u8 *str, s32 ch); +size_t strlen(const u8* str); +const u8* strchr(const u8* str, s32 ch); #endif diff --git a/include/ultra64/types.h b/include/ultra64/types.h index 2f44e369fd..c793f8010a 100644 --- a/include/ultra64/types.h +++ b/include/ultra64/types.h @@ -24,15 +24,13 @@ typedef double f64; typedef long int Mtx_t[4][4]; -typedef union -{ +typedef union { Mtx_t m; long long int forc_structure_alignment; } Mtx; typedef float MtxF_t[4][4]; -typedef union -{ +typedef union { MtxF_t mf; struct { diff --git a/include/vt.h b/include/vt.h index fb08bc315e..46cbf05e73 100644 --- a/include/vt.h +++ b/include/vt.h @@ -25,7 +25,7 @@ #define VT_ED(n) VT_ESC VT_CSI #n "J" #define VT_SGR(n) VT_ESC VT_CSI n "m" -//Add more macros if necessary +// Add more macros if necessary #define VT_COL(back, fore) VT_SGR(VT_COLOR(BACKGROUND, back) ";" VT_COLOR(FOREGROUND, fore)) #define VT_FGCOL(color) VT_SGR(VT_COLOR(FOREGROUND, color)) #define VT_BGCOL(color) VT_SGR(VT_COLOR(BACKGROUND, color)) diff --git a/include/z64.h b/include/z64.h index c60ba8328c..6712c7e5a2 100644 --- a/include/z64.h +++ b/include/z64.h @@ -31,25 +31,22 @@ // Game Info aka. Static Context (dbg ram start: 80210A10) // Data normally accessed through REG macros (see regs.h) -typedef struct -{ - /* 0x00 */ s32 regPage; //1 is first page - /* 0x04 */ s32 regGroup; //"register" group (R, RS, RO, RP etc.) - /* 0x08 */ s32 regCur; //selected register within page +typedef struct { + /* 0x00 */ s32 regPage; // 1 is first page + /* 0x04 */ s32 regGroup; // "register" group (R, RS, RO, RP etc.) + /* 0x08 */ s32 regCur; // selected register within page /* 0x0C */ s32 dpadLast; /* 0x10 */ s32 repeat; - /* 0x14 */ s16 data[REG_GROUPS * REG_PER_GROUP]; //0xAE0 + /* 0x14 */ s16 data[REG_GROUPS * REG_PER_GROUP]; // 0xAE0 bytes } GameInfo; // size = 0x15D4 -typedef struct -{ +typedef struct { /* 0x00 */ u8 button_items[4]; /* 0x04 */ u8 c_button_slots[3]; /* 0x08 */ u16 equipment; } ItemEquips; // size = 0x0A -typedef struct -{ +typedef struct { /* 0x00 */ u32 chest; /* 0x04 */ u32 swch; /* 0x08 */ u32 clear; @@ -59,15 +56,13 @@ typedef struct /* 0x18 */ u32 rooms_2; } SaveSceneFlags; // size = 0x1C -typedef struct -{ +typedef struct { /* 0x00 */ s16 scene; /* 0x02 */ Vec3s pos; /* 0x08 */ s16 angle; } HorseData; // size = 0x0A -typedef struct -{ +typedef struct { /* 0x00 */ Vec3f pos; /* 0x0C */ s16 yaw; /* 0x0E */ s16 player_params; @@ -78,22 +73,19 @@ typedef struct /* 0x18 */ u32 temp_collect_flags; } RespawnData; // size = 0x1C -typedef enum -{ +typedef enum { /* 0x00 */ RESPAWN_MODE_DOWN, /* Normal Void Outs */ /* 0x01 */ RESPAWN_MODE_RETURN, /* Grotto Returnpoints */ /* 0x02 */ RESPAWN_MODE_TOP /* Farore's Wind */ } RespawnMode; -typedef enum -{ +typedef enum { /* 0x00 */ BTN_ENABLED, /* 0xFF */ BTN_DISABLED = 0xFF } ButtonStatus; // Save Context (dbg ram start: 8015E660) -typedef struct -{ +typedef struct { /* 0x0000 */ s32 entrance_index; /* 0x0004 */ s32 link_age; // 0: Adult; 1: Child /* 0x0008 */ s32 cutscene_index; @@ -133,8 +125,7 @@ typedef struct /* 0x00CF */ s8 defense_hearts; /* 0x00D0 */ s16 gs_tokens; /* 0x00D4 */ SaveSceneFlags scene_flags[124]; - struct - { + struct { /* 0x0E64 */ s32 pos_x; /* 0x0E68 */ s32 pos_y; /* 0x0E6C */ s32 pos_z; @@ -217,8 +208,7 @@ typedef struct /* 0x1424 */ s16 health_accumulator; } SaveContext; // size = 0x1428 -typedef struct -{ +typedef struct { /* 0x00000 */ u16 headMagic; // 1234 /* 0x00008 */ Gfx polyOpaBuffer[0x17E0]; /* 0x0BF08 */ Gfx polyXluBuffer[0x800]; @@ -228,24 +218,21 @@ typedef struct /* 0x12408 */ u16 tailMagic; // 5678 } GfxPool; // size = 0x12410 -typedef struct -{ +typedef struct { /* 0x0000 */ u32 size; /* 0x0004 */ u8* bufp; /* 0x0008 */ u8* head; /* 0x000C */ u8* tail; } TwoHeadArena; // size = 0x10 -typedef struct -{ +typedef struct { /* 0x0000 */ u32 size; /* 0x0004 */ Gfx* bufp; /* 0x0008 */ Gfx* p; /* 0x000C */ Gfx* d; } TwoHeadGfxArena; // size = 0x10 -typedef struct -{ +typedef struct { /* 0x0000 */ char unk_00[0x01B4]; /* 0x01B4 */ TwoHeadGfxArena work; /* 0x01C4 */ char unk_1C4[0x00E4]; @@ -254,12 +241,9 @@ typedef struct /* 0x02C8 */ TwoHeadGfxArena polyXlu; } GraphicsContext; -typedef struct -{ - /* 0x00 */ union - { - struct - { +typedef struct { + /* 0x00 */ union { + struct { u16 a : 1; u16 b : 1; u16 z : 1; @@ -282,8 +266,7 @@ typedef struct /* 0x03 */ s8 y; } RawInput; // size = 0x4 -typedef struct -{ +typedef struct { /* 0x00 */ RawInput raw; /* 0x04 */ u16 status; /* 0x06 */ RawInput rawPrev; @@ -298,8 +281,7 @@ typedef struct /* 0x16 */ char unk_16[0x02]; } Input; // size = 0x18 -typedef struct -{ +typedef struct { /* 0x0000 */ char unk_00[0x28]; /* 0x0028 */ Vec3f eye; /* 0x0034 */ char unk_34[0xEC]; @@ -307,15 +289,13 @@ typedef struct /* 0x0124 */ char unk_124[4]; } View; // size = 0x128 -typedef struct -{ +typedef struct { f32 unk_00; s16 unk_04; s16 unk_06; } struct_80045714; // used in z_camera.c and code_8007BF90 -typedef struct -{ +typedef struct { /* 0x0000 */ s32 unk_00; /* 0x0004 */ s16 unk_04; /* 0x0006 */ s16 unk_06; @@ -372,49 +352,42 @@ typedef struct /* 0x016A */ s16 unk_16A; // unknown if used } Camera; // size = 0x16C -typedef struct -{ +typedef struct { /* 0x0000 */ Camera activeCameras[4]; /* 0x05B0 */ Camera* activeCameraPtrs[4]; /* 0x05C0 */ s16 unk_5C0; /* 0x05C2 */ s16 unk_5C2; } CameraContext; // size = 0x5C4 -typedef struct -{ +typedef struct { /* 0x00 */ u8 musicSeq; /* 0x01 */ u8 nighttimeSFX; /* 0x02 */ char unk_02[0x2]; } SoundContext; // size = 0x4 -typedef struct -{ +typedef struct { /* 0x00 */ char unk_00[0x50]; } StaticCollisionContext; // size = 0x50 -typedef struct -{ +typedef struct { /* 0x0000 */ char unk_00[0x04]; /* 0x0004 */ ActorMesh actorMeshArr[50]; /* 0x138C */ u16 flags[50]; /* 0x13F0 */ char unk_13F0[0x24]; } DynaCollisionContext; // size = 0x1414 -typedef struct -{ +typedef struct { /* 0x0000 */ StaticCollisionContext stat; /* 0x0050 */ DynaCollisionContext dyna; } CollisionContext; // size = 0x1464 -typedef struct -{ +typedef struct { /* 0x00 */ Vec3f pos; /* 0x0C */ f32 unk_0C; // radius? /* 0x10 */ Color_RGB8 color; } TargetContextEntry; // size = 0x14 -typedef struct -{ +typedef struct { /* 0x00 */ Vec3f naviRefPos; // possibly wrong /* 0x0C */ Vec3f targetCenterPos; /* 0x18 */ Color_RGBAf naviInner; @@ -434,8 +407,7 @@ typedef struct /* 0x94 */ Actor* unk_94; } TargetContext; // size = 0x98 -typedef struct -{ +typedef struct { /* 0x00 */ u32 texture; /* 0x04 */ s16 unk_4; /* 0x06 */ s16 unk_6; @@ -447,14 +419,12 @@ typedef struct /* 0x0E */ s16 unk_E; } TitleCardContext; // size = 0x10 -typedef struct -{ +typedef struct { /* 0x00 */ u32 length; // number of actors loaded of this type /* 0x04 */ Actor* first; // pointer to first actor of this type } ActorListEntry; // size = 0x08 -typedef struct -{ +typedef struct { /* 0x0000 */ u8 unk_00; /* 0x0001 */ char unk_01[0x01]; /* 0x0002 */ u8 unk_02; @@ -464,8 +434,7 @@ typedef struct /* 0x0009 */ char unk_09[0x03]; /* 0x000C */ ActorListEntry actorList[12]; /* 0x006C */ TargetContext targetCtx; - struct - { + struct { /* 0x0104 */ u32 swch; /* 0x0108 */ u32 tempSwch; /* 0x010C */ u32 unk0; @@ -481,19 +450,16 @@ typedef struct /* 0x013C */ void* absoluteSpace; // Space used to allocate actor overlays of alloc type 1 } ActorContext; // size = 0x140 -typedef struct -{ +typedef struct { /* 0x00 */ char unk_00[0x4]; /* 0x04 */ void* segment; /* 0x08 */ u8 state; /* 0x0C */ f32 unk_0C; /* 0x10 */ u16 frames; /* 0x12 */ u16 unk_12; - union - { + union { /* 0x14 */ s32 unk_14_all; - struct - { + struct { s16 unk_14; s16 unk_16; }; @@ -507,8 +473,7 @@ typedef struct /* 0x28 */ CsCmdActorAction* actorActions[10]; } CutsceneContext; // size = 0x50 -typedef struct -{ +typedef struct { /* 0x0000 */ View view; /* 0x0128 */ char unk_128[0xE188]; /* 0xE2B0 */ void* textboxSegment; // "fukidashiSegment" @@ -534,8 +499,7 @@ typedef struct /* 0xE40E */ char unk_E40E[0x0A]; } MessageContext; // size = 0xE418 -typedef struct -{ +typedef struct { /* 0x00 */ u32 vromAddr; // VROM address (source) /* 0x04 */ void* dramAddr; // DRAM address (destination) /* 0x08 */ u32 size; // File Transfer size @@ -546,8 +510,7 @@ typedef struct /* 0x1C */ OSMesg notifyMsg; // Completion notification message } DmaRequest; // size = 0x20 -typedef struct -{ +typedef struct { /* 0x0000 */ View view; /* 0x0128 */ Vtx* vtx_128; /* 0x012C */ Vtx* vtx_12C; @@ -602,8 +565,7 @@ typedef struct /* 0x025E */ char unk_25E[0x002]; /* 0x0260 */ u8 unk_260; /* 0x0261 */ u8 unk_261; - struct - { + struct { /* 0x0262 */ u8 hGauge; // "h_gage"; unknown? /* 0x0263 */ u8 bButton; // "b_button" /* 0x0264 */ u8 aButton; // "a_button" @@ -619,8 +581,7 @@ typedef struct } restrictions; } InterfaceContext; // size = 0x270 -typedef struct -{ +typedef struct { /* 0x0000 */ View view; /* 0x0128 */ void* unk_128; /* 0x012C */ char unk_12C[0x03C]; @@ -645,8 +606,7 @@ typedef struct /* 0x025A */ char unk_25A[0x066]; } PauseContext; // size = 0x2C0 -typedef struct -{ +typedef struct { /* 0x00 */ s16 id; /* 0x04 */ void* segment; /* 0x08 */ DmaRequest dmaRequest; @@ -654,8 +614,7 @@ typedef struct /* 0x40 */ OSMesg loadMsg; } ObjectStatus; // size = 0x44 -typedef struct -{ +typedef struct { /* 0x0000 */ void* spaceStart; /* 0x0004 */ void* spaceEnd; // original name: "endSegment" /* 0x0008 */ u8 num; // number of objects in bank @@ -665,30 +624,26 @@ typedef struct /* 0x000C */ ObjectStatus status[OBJECT_EXCHANGE_BANK_MAX]; } ObjectContext; // size = 0x514 -typedef struct -{ +typedef struct { /* 0x00 */ Gfx* opa; /* 0x04 */ Gfx* xlu; } PolygonDlist; // size = 0x8 -typedef struct -{ +typedef struct { /* 0x00 */ u8 type; /* 0x01 */ u8 num; // number of dlist entries /* 0x04 */ void* start; /* 0x08 */ void* end; } Polygon; // size = 0xC -typedef struct -{ +typedef struct { /* 0x00 */ u8 type; /* 0x01 */ u8 num; // number of dlist entries /* 0x04 */ void* start; /* 0x08 */ void* end; } PolygonType0; // size = 0xC -typedef struct -{ +typedef struct { /* 0x00 */ u16 unk_00; /* 0x02 */ u8 id; /* 0x04 */ u32 source; @@ -702,15 +657,12 @@ typedef struct /* 0x18 */ u16 tlutCount; } BgImage; // size = 0x1C -typedef struct -{ +typedef struct { /* 0x00 */ u8 type; /* 0x01 */ u8 format; // 1 = single, 2 = multi /* 0x04 */ void* dlist; - union - { - struct - { + union { + struct { /* 0x08 */ u32 source; /* 0x0C */ u32 unk_0C; /* 0x10 */ u32 tlut; @@ -721,40 +673,35 @@ typedef struct /* 0x1A */ u16 mode0; /* 0x1C */ u16 tlutCount; } single; - struct - { + struct { /* 0x08 */ u8 count; /* 0x0C */ BgImage* list; } multi; }; } PolygonType1; -typedef struct -{ +typedef struct { /* 0x00 */ Vec3s pos; /* 0x06 */ s16 unk_06; /* 0x08 */ Gfx* opa; /* 0x0C */ Gfx* xlu; } PolygonDlist2; // size = 0x8 -typedef struct -{ +typedef struct { /* 0x00 */ u8 type; /* 0x01 */ u8 num; // number of dlist entries /* 0x04 */ void* start; /* 0x08 */ void* end; } PolygonType2; // size = 0xC -typedef union -{ +typedef union { Polygon polygon; PolygonType0 polygon0; PolygonType1 polygon1; PolygonType2 polygon2; } Mesh; // "Ground Shape" -typedef struct -{ +typedef struct { /* 0x00 */ s8 num; /* 0x01 */ u8 unk_01; /* 0x02 */ u8 unk_02; @@ -766,8 +713,7 @@ typedef struct /* 0x10 */ char unk_10[0x4]; } Room; // size = 0x14 -typedef struct -{ +typedef struct { /* 0x00 */ Room curRoom; /* 0x14 */ Room prevRoom; /* 0x28 */ void* bufPtrs[2]; @@ -779,21 +725,18 @@ typedef struct /* 0x70 */ OSMesg loadMsg; } RoomContext; // size = 0x74 -typedef struct -{ +typedef struct { /* 0x00 */ char unk_00[0x028C]; } SubGlobalContext11E60; // size = 0x28C -typedef struct -{ +typedef struct { /* 0x00 */ s16 id; /* 0x02 */ Vec3s pos; /* 0x08 */ Vec3s rot; /* 0x0E */ s16 params; } ActorEntry; // size = 0x10 -typedef struct -{ +typedef struct { /* 0x00 */ s8 frontRoom; // Room to switch to when triggered from the front of the object /* 0x01 */ s8 frontEffects; // How the camera reacts during the front transition /* 0x02 */ s8 backRoom; // Room to switch to when triggered from the back of the object @@ -804,39 +747,33 @@ typedef struct /* 0x0E */ s16 params; } TransitionActorEntry; // size = 0x10 -typedef struct -{ +typedef struct { /* 0x00 */ u8 spawn; /* 0x01 */ u8 room; } EntranceEntry; -typedef struct -{ +typedef struct { /* 0x00 */ u32 vromStart; /* 0x04 */ u32 vromEnd; } RomFile; // size = 0x8 -typedef struct -{ +typedef struct { /* 0x00 */ void* read_buff; } Sram; // size = 0x4 -typedef struct GameAllocEntry -{ +typedef struct GameAllocEntry { /* 0x00 */ struct GameAllocEntry* next; /* 0x04 */ struct GameAllocEntry* prev; /* 0x08 */ u32 size; /* 0x0C */ u32 unk_0C; -} GameAllocEntry; //size = 0x10 +} GameAllocEntry; // size = 0x10 -typedef struct -{ +typedef struct { /* 0x00 */ GameAllocEntry base; /* 0x10 */ GameAllocEntry* head; } GameAlloc; // size = 0x14 -typedef struct GameState -{ +typedef struct GameState { /* 0x00 */ GraphicsContext* gfxCtx; /* 0x04 */ void (*main)(struct GameState*); /* 0x08 */ void (*destroy)(struct GameState*); // "cleanup" @@ -850,8 +787,7 @@ typedef struct GameState /* 0xA0 */ u32 unk_A0; } GameState; // size = 0xA4 -typedef struct -{ +typedef struct { /* 0x0000 */ GameState state; /* 0x00A4 */ void* staticSegment; /* 0x00A8 */ View view; @@ -875,8 +811,7 @@ typedef struct } SampleContext; // Global Context (dbg ram start: 80212020) -typedef struct GlobalContext -{ +typedef struct GlobalContext { /* 0x00000 */ GameState state; /* 0x000A4 */ s16 sceneNum; /* 0x000A6 */ u8 sceneConfig; @@ -997,22 +932,19 @@ typedef struct GlobalContext /* 0x12430 */ char unk_12430[0xE8]; } GlobalContext; // size = 0x12518 -typedef struct -{ +typedef struct { /* 0x0000 */ GameState state; /* 0x00A4 */ char unk_A4[4]; /* 0x00A8 */ View view; } OpeningContext; // size = 0x1D0 -typedef enum -{ +typedef enum { DPM_UNK = 0, DPM_PLAYER = 1, DPM_ENEMY = 2 } DynaPolyMoveFlag; -typedef struct LoadedParticleEntry -{ +typedef struct LoadedParticleEntry { /* 0x0000 */ Vec3f position; /* 0x000C */ Vec3f velocity; /* 0x0018 */ Vec3f acceleration; @@ -1031,8 +963,7 @@ typedef struct LoadedParticleEntry } LoadedParticleEntry; // size = 0x60 // Some animation related structure -typedef struct -{ +typedef struct { /* 0x00 */ u32 animation; /* 0x04 */ f32 playbackSpeed; /* 0x08 */ f32 unk_08; @@ -1041,8 +972,7 @@ typedef struct /* 0x14 */ f32 transitionRate; } struct_80034EC0_Entry; // size = 0x18 -typedef struct -{ +typedef struct { /* 0x00 */ u8 limbCount; /* 0x01 */ char unk_01[0x01]; /* 0x02 */ u8 dListCount; @@ -1067,14 +997,12 @@ typedef struct /* 0x42 */ u16 unk_42; } SkelAnime; // size = 0x44 -typedef struct -{ +typedef struct { /* 0x00 */ u32 unk_00; /* 0x04 */ u32(*init)(GlobalContext*, u32, LoadedParticleEntry*, void*); } ParticleOverlayInfo; -typedef struct -{ +typedef struct { /* 0x00 */ u32 vromStart; /* 0x04 */ u32 vromEnd; /* 0x0C */ void* vramStart; @@ -1084,15 +1012,13 @@ typedef struct /* 0x18 */ u32 unk_18; // Always 0x01000000? } ParticleOverlay; -typedef struct -{ +typedef struct { /* 0x00 */ LoadedParticleEntry* data_table; // Name from debug assert /* 0x04 */ s32 searchIndex; /* 0x08 */ s32 size; } EffectTableInfo; -typedef struct -{ +typedef struct { /* 0x00 */ s8 scene; /* 0x01 */ s8 spawn; /* 0x02 */ u16 continueBgm : 1; @@ -1101,8 +1027,7 @@ typedef struct /* 0x02 */ u16 fadeOutTransition : 7; } EntranceInfo; // size = 0x4 -typedef struct -{ +typedef struct { /* 0x00 */ void* loadedRamAddr; /* 0x04 */ u32 vromStart; // if applicable /* 0x08 */ u32 vromEnd; // if applicable @@ -1117,21 +1042,18 @@ typedef struct /* 0x2C */ u32 instanceSize; } GameStateOverlay; // size = 0x30 -typedef struct PreNMIContext -{ +typedef struct PreNMIContext { /* 0x00 */ GameState state; /* 0xA4 */ u32 timer; /* 0xA8 */ UNK_TYPE unk_A8; } PreNMIContext; // size = 0xAC -typedef struct -{ +typedef struct { /* 0x00 */ s8 chestFlag; // chest icon is only displayed if this flag is not set for the current room /* 0x01 */ u8 x, y; // coordinates to place the icon (top-left corner), relative to the minimap texture } MapMarkPoint; // size = 0x3 -typedef struct -{ +typedef struct { /* 0x00 */ s8 markType; // 0 for the chest icon, 1 for the boss skull icon, -1 for none /* 0x01 */ u8 count; // number of icons to display /* 0x02 */ MapMarkPoint points[12]; @@ -1139,8 +1061,7 @@ typedef struct typedef MapMarkData MapMarksData[3]; // size = 0x72 -typedef struct DebugDispObject -{ +typedef struct DebugDispObject { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3s rot; /* 0x14 */ Vec3f scale; @@ -1149,8 +1070,7 @@ typedef struct DebugDispObject /* 0x28 */ struct DebugDispObject* next; } DebugDispObject; // size = 0x2C -typedef struct -{ +typedef struct { /* 0x00 */ Vec3s colAbsMin; /* 0x06 */ Vec3s colAbsMax; /* 0x0C */ s16 nbVertices; @@ -1163,30 +1083,26 @@ typedef struct /* 0x28 */ void* waterBoxes; } CollisionHeader; -typedef enum -{ +typedef enum { MTXMODE_NEW, // generates a new matrix MTXMODE_APPLY // applies transformation to the current matrix } MatrixMode; -typedef struct FaultClient -{ +typedef struct FaultClient { struct FaultClient* next; u32 callback; u32 param1; u32 param2; } FaultClient; -typedef struct FaultAddrConvClient -{ +typedef struct FaultAddrConvClient { struct FaultAddrConvClient* next; u32 callback; u32 param; } FaultAddrConvClient; -typedef struct -{ +typedef struct { u32 (*callback)(u32, u32); u32 param0; u32 param1; @@ -1195,8 +1111,7 @@ typedef struct OSMesg msg; } FaultClientContext; -typedef struct FaultThreadStruct -{ +typedef struct FaultThreadStruct { OSThread thread; u8 unk_1B0[0x600]; OSMesgQueue queue; @@ -1217,8 +1132,7 @@ typedef struct FaultThreadStruct u8 unk_84C[4]; } FaultThreadStruct; -typedef struct -{ +typedef struct { u16* fb; u16 w; u16 h; @@ -1236,13 +1150,12 @@ typedef struct s8 charWPad; s8 charHPad; u16 printColors[10]; - u8 escCode; //bool + u8 escCode; // bool u8 osSyncPrintfEnabled; void(*inputCallback)(); } FaultDrawer; -typedef struct GfxPrint -{ +typedef struct GfxPrint { /* 0x00 */ struct GfxPrint*(*callback)(struct GfxPrint*, const char*, size_t); /* 0x04 */ Gfx* dlist; /* 0x08 */ u16 posX; @@ -1253,8 +1166,7 @@ typedef struct GfxPrint /* 0x10 */ Color_RGBA8 color; } GfxPrint; -typedef enum -{ +typedef enum { GFXPRINT_FLAG1 = 1, GFXPRINT_USE_RGBA16 = 2, GFXPRINT_FLAG4 = 4, @@ -1263,8 +1175,7 @@ typedef enum GFXPRINT_OPEN = 0x80 } GfxPrintFlag; -typedef struct StackEntry -{ +typedef struct StackEntry { /* 0x00 */ struct StackEntry* next; /* 0x04 */ struct StackEntry* prev; /* 0x08 */ u32 head; @@ -1274,16 +1185,14 @@ typedef struct StackEntry /* 0x18 */ const char* name; } StackEntry; -typedef enum -{ +typedef enum { STACK_STATUS_OK = 0, STACK_STATUS_WARNING = 1, STACK_STATUS_OVERFLOW = 2 } StackStatus; -typedef struct -{ - /* 0x00 */ u32 magic; //IS64 +typedef struct { + /* 0x00 */ u32 magic; // IS64 /* 0x04 */ u32 get; /* 0x08 */ u8 unk_08[0x14-0x08]; /* 0x14 */ u32 put; @@ -1291,22 +1200,18 @@ typedef struct /* 0x20 */ u8 data[0x10000-0x20]; } ISVDbg; -typedef struct -{ +typedef struct { /* 0x00 */ u32 vromStart; /* 0x04 */ u32 vromEnd; /* 0x08 */ u32 romStart; /* 0x0C */ u32 romEnd; } DmaEntry; -typedef struct -{ +typedef struct { char name[0x18]; u32 mediaFormat; - union - { - struct - { + union { + struct { u16 cartId; u8 countryCode; u8 version; @@ -1315,18 +1220,17 @@ typedef struct }; } LocaleCartInfo; -typedef struct -{ - char magic[4]; //Yaz0 +typedef struct { + char magic[4]; // Yaz0 u32 decSize; - u32 compInfoOffset; //only used in yaz0_old.c - u32 uncompDataOffset; //only used in yaz0_old.c + u32 compInfoOffset; // only used in yaz0_old.c + u32 uncompDataOffset; // only used in yaz0_old.c u32 data[1]; } Yaz0Header; #define OS_SC_RETRACE_MSG 1 #define OS_SC_DONE_MSG 2 -#define OS_SC_NMI_MSG 3 //name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c +#define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c #define OS_SC_PRE_NMI_MSG 4 typedef struct { @@ -1334,16 +1238,14 @@ typedef struct { char misc[30]; } OSScMsg; -typedef struct IrqMgrClient -{ +typedef struct IrqMgrClient { struct IrqMgrClient* prev; OSMesgQueue* queue; } IrqMgrClient; -typedef struct -{ - /* 0x000 */ OSScMsg retraceMsg; //this apparently got moved from OSSched - /* 0x020 */ OSScMsg prenmiMsg; //this apparently got moved from OSSched +typedef struct { + /* 0x000 */ OSScMsg retraceMsg; // this apparently got moved from OSSched + /* 0x020 */ OSScMsg prenmiMsg; // this apparently got moved from OSSched /* 0x040 */ OSScMsg nmiMsg; /* 0x060 */ OSMesgQueue queue; /* 0x078 */ OSMesg msgBuf[8]; @@ -1353,22 +1255,20 @@ typedef struct /* 0x250 */ OSTime resetTime; /* 0x258 */ OSTimer timer; /* 0x278 */ OSTime retraceTime; -} IrqMgr; //size = 0x280 +} IrqMgr; // size = 0x280 struct ArenaNode; -typedef struct Arena -{ +typedef struct Arena { /* 0x00 */ struct ArenaNode* head; /* 0x04 */ void* start; /* 0x08 */ OSMesgQueue lock; /* 0x20 */ u8 unk_20; /* 0x21 */ u8 isInit; /* 0x22 */ u8 flag; -} Arena; //size = 0x24 +} Arena; // size = 0x24 -typedef struct ArenaNode -{ +typedef struct ArenaNode { /* 0x00 */ s16 magic; /* 0x02 */ s16 isFree; /* 0x04 */ u32 size; @@ -1379,8 +1279,8 @@ typedef struct ArenaNode /* 0x18 */ OSId threadId; /* 0x1C */ Arena* arena; /* 0x20 */ OSTime time; - /* 0x28 */ u8 unk_28[0x30-0x28]; //probably padding -} ArenaNode; //size = 0x30 + /* 0x28 */ u8 unk_28[0x30-0x28]; // probably padding +} ArenaNode; // size = 0x30 typedef struct OverlayRelocationSection { /* 0x00 */ u32 textSize; @@ -1391,33 +1291,30 @@ typedef struct OverlayRelocationSection { /* 0x14 */ u32 relocations[1]; } OverlayRelocationSection; // size >= 0x18 -typedef struct -{ +typedef struct { /* 0x00 */ void* loadedRamAddr; /* 0x04 */ u32 vromStart; /* 0x08 */ u32 vromEnd; /* 0x0C */ u8* vramStart; /* 0x10 */ u8* vramEnd; - /* 0x14 */ u32 off; //loadedRamAddr - vram + /* 0x14 */ u32 off; // loadedRamAddr - vram /* 0x18 */ const char* name; -} KaleidoManagerOvl; //size = 0x1C +} KaleidoManagerOvl; // size = 0x1C #define KALEIDO_OVL_KALEIDO_SCOPE 0 #define KALEIDO_OVL_PLAYER_ACTOR 1 #define KALEIDO_OVL_COUNT 2 -typedef struct ListAlloc -{ +typedef struct ListAlloc { /* 0x00 */ struct ListAlloc* prev; /* 0x04 */ struct ListAlloc* next; -} ListAlloc; //size = 0x8 +} ListAlloc; // size = 0x8 -typedef struct -{ +typedef struct { /* 0x00 */ u32 resetting; /* 0x04 */ u32 resetCount; /* 0x08 */ OSTime duration; /* 0x10 */ OSTime resetTime; -} PreNmiBuff; //size = 0x18 (actually osAppNmiBuffer is 0x40 bytes large but the rest is unused) +} PreNmiBuff; // size = 0x18 (actually osAppNmiBuffer is 0x40 bytes large but the rest is unused) #endif diff --git a/include/z64actor.h b/include/z64actor.h index 001a25923e..4b986b4d6e 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -13,34 +13,28 @@ struct GlobalContext; // From z64light.h struct LightMapper; -typedef struct -{ +typedef struct { f32 x, y; } Vec2f; -typedef struct -{ +typedef struct { f32 x, y, z; } Vec3f; -typedef struct -{ +typedef struct { s16 x, y, z; } Vec3s; -typedef struct -{ +typedef struct { s32 x, y, z; } Vec3i; -typedef struct -{ +typedef struct { Vec3f pos; Vec3s rot; } PosRot; // size = 0x14 -typedef struct -{ +typedef struct { /* 0x00 */ char unk_00[0x8]; /* 0x08 */ Vec3s norm; // Normal vector /* 0x0E */ s16 dist; // Plane distance from origin @@ -48,8 +42,7 @@ typedef struct typedef void (*ActorFunc)(struct Actor*, struct GlobalContext*); -typedef struct -{ +typedef struct { /* 0x00 */ s16 id; /* 0x02 */ u8 type; // Classifies actor and determines when actor will execute /* 0x03 */ u8 room; // Room instance was spawned in. If value set to FF in rom, instance does not despawn when swapping rooms @@ -62,15 +55,13 @@ typedef struct /* 0x1C */ ActorFunc draw; // Draw function } ActorInit; // size = 0x20 -typedef enum -{ +typedef enum { ALLOCTYPE_NORMAL, ALLOCTYPE_ABSOLUTE, ALLOCTYPE_PERMANENT } AllocType; -typedef struct -{ +typedef struct { /* 0x00 */ u32 vromStart; /* 0x04 */ u32 vromEnd; /* 0x08 */ void* vramStart; @@ -82,25 +73,21 @@ typedef struct /* 0x1E */ s8 nbLoaded; // original name: "clients" } ActorOverlay; // size = 0x20 -typedef struct -{ - struct - { +typedef struct { + struct { char damage : 4; char effect : 4; } attack[32]; } ActorDamageChart; -typedef struct -{ +typedef struct { /* 0x00 */ u8 health; /* 0x02 */ s16 unk_02; /* 0x04 */ s16 unk_04; /* 0x06 */ u8 mass; } SubActor98Init; -typedef struct -{ +typedef struct { /* 0x00 */ ActorDamageChart* damageChart; // For actors which contain a damage chart (example: Stalfos)... /* 0x04 */ Vec3f displacement; // Amount to correct velocity (0x5C) by when colliding into a body /* 0x10 */ s16 unk_10; @@ -114,8 +101,7 @@ typedef struct /* 0x1B */ u8 unk_1B; } SubActorStruct98; // size = 0x1C -typedef struct -{ +typedef struct { /* 0x00 */ Vec3s rot; // Current actor shape rotation /* 0x06 */ u8 unk_06; /* 0x08 */ f32 unk_08; // Model y axis offset. Represents model space units. collision mesh related @@ -125,8 +111,7 @@ typedef struct /* 0x15 */ u8 unk_15; } ActorShape; // size = 0x18 -typedef struct Actor -{ +typedef struct Actor { /* 0x000 */ s16 id; // Actor Id /* 0x002 */ u8 type; // Actor Type. Refer to the corresponding enum for values /* 0x003 */ s8 room; // Room number the actor is part of. FF denotes that the actor won't despawn on a room change @@ -198,16 +183,14 @@ typedef struct Actor /* From here on, the structure and size varies for each actor */ } Actor; // size = 0x14C -typedef enum -{ +typedef enum { COLTYPE_CYLINDER = 1, COLTYPE_CYLINDER_GROUP = 0, COLTYPE_QUAD = 3, COLTYPE_TRIANGLE_GROUP = 2 } ColliderType; -typedef struct -{ +typedef struct { /* 0x00 */ Actor* actor; /* 0x04 */ Actor* at; /* 0x08 */ Actor* ac; @@ -220,15 +203,13 @@ typedef struct /* 0x15 */ u8 type; /* Cylinder Collection, Cylinder, Triangle Collection, Quad */ } Collider; // size = 0x18 -typedef struct -{ +typedef struct { /* 0x00 */ s32 flags; /* Toucher Attack Identifier Flags */ /* 0x04 */ u8 unk_04; /* 0x05 */ u8 damage; /* Damage or Stun Timer */ } ColliderTouch; // size = 0x08 -typedef struct -{ +typedef struct { /* 0x00 */ s32 flags; /* Collision Exclusion Mask */ /* 0x04 */ u8 effect; /* Damage Effect (Knockback, Fire, etc.) */ /* 0x05 */ u8 unk_05; @@ -237,8 +218,7 @@ typedef struct /* 0x0A */ s16 unk_0A; } ColliderBump; // size = 0x0C -typedef struct ColliderBody -{ +typedef struct ColliderBody { /* 0x00 */ ColliderTouch toucher; /* 0x08 */ ColliderBump bumper; /* 0x14 */ u8 flags; @@ -251,14 +231,12 @@ typedef struct ColliderBody /* 0x24 */ struct ColliderBody* colliding; } ColliderBody; // size = 0x28 -typedef struct ColliderBodyEntry -{ +typedef struct ColliderBodyEntry { /* 0x00 */ ColliderBody c; /* 0x28 */ char unk_28[0x18]; } ColliderBodyEntry; // size = 0x40 -typedef struct -{ +typedef struct { /* 0x00 */ u8 bodyFlags; /* 0x01 */ u8 unk_09[0x3]; /* 000000 */ /* 0x04 */ s32 toucherMask; /* Attack Toucher Exclusion Mask */ @@ -273,8 +251,7 @@ typedef struct /* 0x17 */ u8 unk_1F; /* 00 */ } ColliderBodyInfoInner; // size = 0x1A -typedef struct -{ +typedef struct { /* 0x00 */ u8 unk_00; /* 0x01 */ u8 colliderFlags; /* Collider Flags */ /* 0x02 */ u8 collideFlags; /* Collide Flags */ @@ -284,30 +261,26 @@ typedef struct /* 0x06 */ u8 unk_06[0x2]; /* 0000 */ } ColliderBodyInfo; // size = 0x08 -typedef struct -{ +typedef struct { /* 0x00 */ s16 radius; /* Cylinder Radius */ /* 0x02 */ s16 height; /* Cylinder Height */ /* 0x04 */ s16 yShift; /* Shift Cylinder on Y Axis */ /* 0x06 */ Vec3s position; /* {X, Y, Z} position of Cylinder */ } ColliderDimensions; // size = 0xC -typedef struct -{ +typedef struct { /* 0x00 */ Collider base; /* 0x18 */ ColliderBody body; /* 0x40 */ ColliderDimensions dim; } ColliderCylinderMain; // size = 0x4C -typedef struct -{ +typedef struct { /* 0x00 */ ColliderBodyInfo body; /* 0x06 */ ColliderBodyInfoInner inner; /* 0x20 */ ColliderDimensions dim; } ColliderCylinderInit; // size = 0x2C -typedef struct -{ +typedef struct { /* 0x00 */ Actor* actor; /* 0x04 */ char unk_04[0x10]; /* 0x14 */ Vec3f scale1; @@ -319,8 +292,7 @@ typedef struct /* 0x54 */ char unk_54[0x10]; } ActorMesh; // size = 0x64 -typedef struct -{ +typedef struct { /* 0x000 */ Actor actor; /* 0x14C */ u32 dynaPolyId; /* 0x150 */ f32 unk_150; @@ -332,8 +304,7 @@ typedef struct /* 0x162 */ s16 unk_162; } DynaPolyActor; // size = 0x164 -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ s8 currentTunic; /* 0x014D */ s8 currentSword; @@ -408,10 +379,9 @@ typedef struct /* 0x0A60 */ char unk_A60[0x18]; /* 0x0A78 */ s8 unk_A78; /* 0x0A79 */ char unk_A79[0x1B]; -} Player; //size = 0xA94 +} Player; // size = 0xA94 -typedef enum -{ +typedef enum { /* 0x00 */ ACTORTYPE_SWITCH, /* 0x01 */ ACTORTYPE_BG, /* 0x02 */ ACTORTYPE_PLAYER, @@ -426,8 +396,7 @@ typedef enum /* 0x0B */ ACTORTYPE_CHEST } ActorType; -typedef enum -{ +typedef enum { /* 0x0000 */ ACTOR_PLAYER, /* 0x0001 */ ACTOR_UNSET_1, /* 0x0002 */ ACTOR_EN_TEST, diff --git a/include/z64cutscene.h b/include/z64cutscene.h index d7d27481ad..91be35f82e 100644 --- a/include/z64cutscene.h +++ b/include/z64cutscene.h @@ -1,16 +1,14 @@ #ifndef _Z64CUTSCENE_H_ #define _Z64CUTSCENE_H_ -typedef struct -{ +typedef struct { /* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger /* 0x02 */ u8 ageRestriction; // 0 for adult only, 1 for child only, 2 for both ages /* 0x03 */ u8 flag; // event_chk_inf flag bound to the entrance cutscene /* 0x04 */ u32 segAddr; // segment offset location of the cutscene } EntranceCutscene; // size = 0x8 -typedef struct -{ +typedef struct { /* 0x00 */ s8 continueFlag; /* 0x01 */ s8 cameraRoll; /* 0x02 */ s16 nextPointFrame; @@ -18,38 +16,33 @@ typedef struct /* 0x08 */ Vec3s pos; } CutsceneCameraPoint; // size = 0x10 -typedef struct -{ +typedef struct { /* 0x00 */ u16 base; /* 0x02 */ u16 startFrame; /* 0x04 */ u16 endFrame; } CsCmdBase; -typedef struct -{ +typedef struct { /* 0x00 */ u8 unk_00; /* 0x01 */ u8 setting; /* 0x02 */ u16 startFrame; /* 0x04 */ u16 endFrame; } CsCmdEnvLighting; -typedef struct -{ +typedef struct { /* 0x00 */ u8 unk_00; /* 0x01 */ u8 sequence; /* 0x02 */ u16 startFrame; /* 0x04 */ u16 endFrame; } CsCmdMusicChange; -typedef struct -{ +typedef struct { /* 0x00 */ u16 type; /* 0x02 */ u16 startFrame; /* 0x04 */ u16 endFrame; } CsCmdMusicFade; -typedef struct -{ +typedef struct { /* 0x00 */ u16 unk_00; /* 0x02 */ u16 startFrame; /* 0x04 */ u16 endFrame; @@ -58,8 +51,7 @@ typedef struct /* 0x08 */ u8 unk_08; } CsCmdUnknown9; -typedef struct -{ +typedef struct { /* 0x00 */ u16 unk_00; /* 0x02 */ u16 startFrame; /* 0x04 */ u16 endFrame; @@ -67,8 +59,7 @@ typedef struct /* 0x07 */ u8 minute; } CsCmdDayTime; -typedef struct -{ +typedef struct { /* 0x00 */ u16 base; /* 0x02 */ u16 startFrame; /* 0x04 */ u16 endFrame; @@ -77,8 +68,7 @@ typedef struct /* 0x0A */ u16 textId2; } CsCmdTextbox; // size = 0xC -typedef struct -{ +typedef struct { /* 0x00 */ u16 action; /* 0x02 */ u16 startFrame; /* 0x04 */ u16 endFrame; @@ -88,8 +78,7 @@ typedef struct /* 0x24 */ Vec3i normal; } CsCmdActorAction; // size = 0x30 -typedef enum -{ +typedef enum { CS_STATE_IDLE, CS_STATE_SKIPPABLE_INIT, CS_STATE_SKIPPABLE_EXEC, @@ -97,8 +86,7 @@ typedef enum CS_STATE_UNSKIPPABLE_EXEC } CutsceneState; -typedef enum -{ +typedef enum { CS_CMD_00 = 0x0000, CS_CMD_CAMERA_POS = 0x0001, CS_CMD_CAMERA_FOCUS = 0x0002, diff --git a/include/z64effect.h b/include/z64effect.h index b7d11270e6..4f83f2e883 100644 --- a/include/z64effect.h +++ b/include/z64effect.h @@ -2,18 +2,17 @@ #define _Z64EFFECT_H_ #include -/* gz has trail related structs but they seem to be different in dbg*/ -typedef struct -{ +// gz has trail related structs but they seem to be different in dbg +typedef struct { /* 0x0000 */ char unk_00[0x184]; /* 0x0184 */ Color_RGBA8 p1Start; /* 0x0188 */ Color_RGBA8 p2Start; /* 0x018C */ Color_RGBA8 p1End; /* 0x0190 */ Color_RGBA8 p2End; - /* 0x0194 */ u32 unk_194; //these are proably bytes + /* 0x0194 */ u32 unk_194; // these are proably bytes /* 0x0198 */ u32 unk_198; /* 0x019C */ u32 unk_19C; /* 0x01A0 */ -} TrailEffect; //size = unk +} TrailEffect; // size = unk #endif diff --git a/include/z64item.h b/include/z64item.h index 1c8e84705e..39a70b8037 100644 --- a/include/z64item.h +++ b/include/z64item.h @@ -1,16 +1,14 @@ #ifndef _Z64ITEM_H_ #define _Z64ITEM_H_ -typedef enum -{ +typedef enum { /* 0x00 */ EQUIP_SWORD, /* 0x01 */ EQUIP_SHIELD, /* 0x02 */ EQUIP_TUNIC, /* 0x03 */ EQUIP_BOOTS } EquipmentType; -typedef enum -{ +typedef enum { /* 0x00 */ UPG_QUIVER, /* 0x01 */ UPG_BOMB_BAG, /* 0x02 */ UPG_STRENGTH, @@ -21,8 +19,7 @@ typedef enum /* 0x07 */ UPG_NUTS } UpgradeType; -typedef enum -{ +typedef enum { /* 0x00 */ SLOT_STICK, /* 0x01 */ SLOT_NUT, /* 0x02 */ SLOT_BOMB, @@ -50,8 +47,7 @@ typedef enum /* 0xFF */ SLOT_NONE = 0xFF } InventorySlot; -typedef enum -{ +typedef enum { /* 0x00 */ ITEM_STICK, /* 0x01 */ ITEM_NUT, /* 0x02 */ ITEM_BOMB, @@ -212,8 +208,7 @@ typedef enum } ItemID; // Get Item result may vary depending on context (chest/shop/scrub/drop) -typedef enum -{ +typedef enum { /* 0x00 */ GI_INVALID, // Link picks up chest and it sends him flying upwards /* 0x01 */ GI_BOMBS_5, /* 0x02 */ GI_NUTS_5, @@ -258,8 +253,8 @@ typedef enum /* 0x29 */ GI_SHIELD_DEKU, // or blue rupee if you have the shield /* 0x2A */ GI_SHIELD_HYLIAN, // or blue rupee if you have the shield /* 0x2B */ GI_SHIELD_MIRROR, - /* 0x2C */ GI_TUNIC_GORON, // or blue rupee if you have the tunic - /* 0x2D */ GI_TUNIC_ZORA, // or blue rupee if you have the tunic + /* 0x2C */ GI_TUNIC_GORON, // or blue rupee if you have the tunic + /* 0x2D */ GI_TUNIC_ZORA, // or blue rupee if you have the tunic /* 0x2E */ GI_BOOTS_IRON, /* 0x2F */ GI_BOOTS_HOVER, /* 0x30 */ GI_QUIVER_40, diff --git a/include/z64light.h b/include/z64light.h index 35e0bf8184..68a2e63945 100644 --- a/include/z64light.h +++ b/include/z64light.h @@ -4,15 +4,13 @@ #include #include -typedef struct z_Light_t -{ +typedef struct z_Light_t { /* 0x0 */ struct LightInfo* info; /* 0x4 */ struct z_Light_t* prev; /* 0x8 */ struct z_Light_t* next; } z_Light; -typedef struct -{ +typedef struct { /* 0x0 */ z_Light* lightsHead; /* 0x4 */ u8 ambientRed; /* 0x5 */ u8 ambientGreen; @@ -24,21 +22,18 @@ typedef struct /* 0xC */ s16 unk_0C; } LightingContext; -typedef struct -{ +typedef struct { /* 0x000 */ int numOccupied; /* 0x004 */ int nextFree; /* 0x008 */ z_Light lights[32]; } LightsList; -typedef struct -{ +typedef struct { /* 0x0 */ u8 type; /* 0x2 */ u16 params[6]; } LightInfo; -typedef struct -{ +typedef struct { /* 0x0 */ s8 dirX; /* 0x1 */ s8 dirY; /* 0x2 */ s8 dirZ; @@ -48,8 +43,7 @@ typedef struct /* 0x6 */ u16 pad[3]; } LightInfoDirectionalParams; -typedef struct -{ +typedef struct { /* 0x0 */ s16 posX; /* 0x2 */ s16 posY; /* 0x4 */ s16 posZ; @@ -60,8 +54,7 @@ typedef struct /* 0xA */ s16 radius; } LightInfoPositionalParams; -typedef struct -{ +typedef struct { /* 0x00 */ u8 numLights; /* 0x01 */ u8 enablePosLights; /* 0x02 */ UNK_TYPE1 pad2[6]; @@ -69,14 +62,12 @@ typedef struct /* 0x10 */ Light lights[7]; } LightMapper; -typedef struct -{ +typedef struct { /* 0x0 */ u8 type; /* 0x2 */ LightInfoDirectionalParams params; } LightInfoDirectional; -typedef struct -{ +typedef struct { /* 0x0 */ u8 type; /* 0x2 */ LightInfoPositionalParams params; } LightInfoPositional; diff --git a/include/z64object.h b/include/z64object.h index 102190fe40..54271d82f4 100644 --- a/include/z64object.h +++ b/include/z64object.h @@ -3,8 +3,7 @@ #define OBJECT_EXCHANGE_BANK_MAX 19 -typedef enum -{ +typedef enum { /* 0x0000 */ OBJECT_UNSET_0, /* 0x0001 */ OBJECT_GAMEPLAY_KEEP, /* 0x0002 */ OBJECT_GAMEPLAY_FIELD_KEEP, diff --git a/include/z64scene.h b/include/z64scene.h index 20370040e6..d6b87447d5 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -1,8 +1,7 @@ #ifndef _Z64SCENE_H_ #define _Z64SCENE_H_ -typedef struct -{ +typedef struct { /* 0x00 */ u32 sceneVromStart; /* 0x04 */ u32 sceneVromEnd; /* 0x08 */ u32 titleVromStart; @@ -13,50 +12,43 @@ typedef struct /* 0x13 */ u8 unk_13; } Scene; // size = 0x14 -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 data2; } SCmdBase; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 segment; } SCmdSpawnList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 num; /* 0x04 */ u32 segment; } SCmdActorList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 segment; } SCmdCsCameraList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 segment; } SCmdColHeader; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 num; /* 0x04 */ u32 segment; } SCmdRoomList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[2]; @@ -66,71 +58,61 @@ typedef struct /* 0x07 */ u8 unk_07; } SCmdWindSettings; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 segment; } SCmdEntranceList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 naviMsgNum; /* 0x04 */ u32 keepObjectId; } SCmdSpecialFiles; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 gpFlag1; /* 0x04 */ u32 gpFlag2; } SCmdRoomBehavior; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 segment; } SCmdMesh; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 num; /* 0x04 */ u32 segment; } SCmdObjectList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 num; /* 0x04 */ u32 segment; } SCmdLightList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 segment; } SCmdPathList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 num; /* 0x04 */ u32 segment; } SCmdTransiActorList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 num; /* 0x04 */ u32 segment; } SCmdLightSettingList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[2]; @@ -139,8 +121,7 @@ typedef struct /* 0x06 */ u8 unk_06; } SCmdTimeSettings; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[2]; @@ -149,8 +130,7 @@ typedef struct /* 0x06 */ u8 unk_06; } SCmdSkyboxSettings; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[2]; @@ -158,22 +138,19 @@ typedef struct /* 0x05 */ u8 unk_05; } SCmdSkyboxDisables; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 data2; } SCmdEndMarker; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 segment; } SCmdExitList; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 bgmId; /* 0x02 */ char pad[4]; @@ -181,42 +158,36 @@ typedef struct /* 0x07 */ u8 musicSeq; } SCmdSoundSettings; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[5]; /* 0x07 */ u8 echo; } SCmdEchoSettings; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 segment; } SCmdCutsceneData; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 segment; } SCmdAltHeaders; -typedef struct -{ +typedef struct { /* 0x00 */ u8 code; /* 0x01 */ u8 cameraMovement; /* 0x04 */ u32 area; } SCmdMiscSettings; -typedef struct -{ +typedef struct { u8 headerType; } MeshHeaderBase; -typedef struct -{ +typedef struct { MeshHeaderBase base; u8 numEntries; @@ -224,180 +195,144 @@ typedef struct u32 dListEnd; } MeshHeader0; -typedef struct -{ +typedef struct { u32 opaqueDList; - u32 translucentDList; + u32 translucentDList; } MeshEntry0; -typedef struct -{ +typedef struct { MeshHeaderBase base; - u8 format; u32 entryRecord; } MeshHeader1Base; -typedef struct -{ +typedef struct { MeshHeader1Base base; - u32 imagePtr; // 0x08 - - u32 unknown; // 0x0C - u32 unknown2; // 0x10 - - u16 bgWidth; // 0x14 - u16 bgHeight; // 0x16 - - u8 imageFormat; // 0x18 - u8 imageSize; // 0x19 - u16 imagePal; // 0x1A - u16 imageFlip; // 0x1C - + u32 unknown; // 0x0C + u32 unknown2; // 0x10 + u16 bgWidth; // 0x14 + u16 bgHeight; // 0x16 + u8 imageFormat; // 0x18 + u8 imageSize; // 0x19 + u16 imagePal; // 0x1A + u16 imageFlip; // 0x1C } MeshHeader1Single; -typedef struct -{ +typedef struct { MeshHeader1Base base; - u8 bgCnt; u32 bgRecordPtr; - } MeshHeader1Multi; -typedef struct -{ +typedef struct { u16 unknown; // 0x00 - s8 bgID; // 0x02 - - u32 imagePtr; // 0x04 - u32 unknown2; // 0x08 - u32 unknown3; // 0x0C - - u16 bgWidth; // 0x10 - u16 bgHeight; // 0x12 - - u8 imageFmt; // 0x14 - u8 imageSize; // 0x15 - u16 imagePal; // 0x16 - u16 imageFlip; // 0x18 + s8 bgID; // 0x02 + u32 imagePtr; // 0x04 + u32 unknown2; // 0x08 + u32 unknown3; // 0x0C + u16 bgWidth; // 0x10 + u16 bgHeight; // 0x12 + u8 imageFmt; // 0x14 + u8 imageSize; // 0x15 + u16 imagePal; // 0x16 + u16 imageFlip; // 0x18 } BackgroundRecord; -typedef struct -{ - s16 playerXMax, playerZMax; - s16 playerXMin, playerZMin; - - u32 opaqueDList; - u32 translucentDList; +typedef struct { + s16 playerXMax, playerZMax; + s16 playerXMin, playerZMin; + u32 opaqueDList; + u32 translucentDList; } MeshEntry2; -typedef struct -{ +typedef struct { MeshHeaderBase base; - u8 numEntries; - u32 dListStart; - u32 dListEnd; + u32 dListStart; + u32 dListEnd; } MeshHeader2; -typedef struct -{ +typedef struct { u8 ambientClrR, ambientClrG, ambientClrB; - u8 diffuseClrA_R, diffuseClrA_G, diffuseClrA_B; u8 diffuseDirA_X, diffuseDirA_Y, diffuseDirA_Z; u8 diffuseClrB_R, diffuseClrB_G, diffuseClrB_B; u8 diffuseDirB_X, diffuseDirB_Y, diffuseDirB_Z; - u8 fogClrR, fogClrG, fogClrB; u16 unk; u16 drawDistance; } LightSettings; -typedef struct -{ +typedef struct { s16 absMinX, absMinY, absMinZ; s16 absMaxX, absMaxY, absMaxZ; - s16 numVerts; - s32 vtxSegmentOffset; - s16 numPolygons; - s32 polySegmentOffset; - s32 polyTypeDefSegmentOffset; - s32 camDataSegmentOffset; - - s16 numWaterBoxes; - s32 waterBoxSegmentOffset; + s16 numVerts; + s32 vtxSegmentOffset; + s16 numPolygons; + s32 polySegmentOffset; + s32 polyTypeDefSegmentOffset; + s32 camDataSegmentOffset; + s16 numWaterBoxes; + s32 waterBoxSegmentOffset; } ColHeader; -typedef struct -{ +typedef struct { s16 cameraSType; // 0x00 - s16 numCameras; // 0x02 - s32 camPosDataSeg; // 0x04 + s16 numCameras; // 0x02 + s32 camPosDataSeg; // 0x04 } CamData; -typedef struct -{ +typedef struct { u32 unknown; u32 camPosDataSeg; } CamPosDataEntry; /* -typedef union -{ +typedef union { _CamData data; long long int forceStructAlignment; } CamData; */ -typedef struct -{ +typedef struct { s16 posX, posY, posZ; - s16 rotX, rotY, rotZ; - s16 fov; - s16 jfifId; - s16 unk; - //s16 unk2; - //s32 unk; + s16 rotX, rotY, rotZ; + s16 fov; + s16 jfifId; + s16 unk; } CamPosData; /* -typedef union -{ +typedef union { _CamPosData data; long long int forceStructAlignment; } CamPosData; */ -typedef struct -{ +typedef struct { s16 type; - s16 vtxA, vtxB, vtxC; - s16 a, b, c, d; + s16 vtxA, vtxB, vtxC; + s16 a, b, c, d; } RoomPoly; -typedef struct -{ +typedef struct { s16 xMin; - s16 ySurface; - s16 zMin; - s16 xLength; - s16 zLength; - s32 properties; + s16 ySurface; + s16 zMin; + s16 xLength; + s16 zLength; + s32 properties; } WaterBoxHeader; -typedef struct -{ +typedef struct { /* 0x00 */ u8 count; // Total number of points in the path for the actor to follow /* 0x04 */ Vec3s* path; // Segment Address of the start of the path list } Path; // size = 0x8 -typedef union -{ +typedef union { SCmdBase base; SCmdSpawnList spawnList; SCmdActorList actorList; @@ -426,8 +361,7 @@ typedef union SCmdAltHeaders altHeaders; } SceneCmd; // size = 0x8 -typedef enum -{ +typedef enum { /* 0x00 */ SCENE_YDAN, /* 0x01 */ SCENE_DDAN, /* 0x02 */ SCENE_BDAN, diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h index 59af6ae3bf..9e3a512f45 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xCC]; } ArmsHook; // size = 0x0218 diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h index be16627ada..abafd70da0 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } ArrowFire; // size = 0x016C diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h index e521d49c7a..25f6f108d8 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } ArrowIce; // size = 0x016C diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h index 095d0083fb..8f4e5946b4 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } ArrowLight; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h index a3741853eb..b8f17306ca 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x70]; } BgBdanObjects; // size = 0x01BC diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h index 7f59b8ddf6..539b1096bb 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h @@ -6,8 +6,7 @@ #include "../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h" -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; /* 0x0168 */ u8 unk_168; diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h index 71ac27a9ba..a16b9953da 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x158]; } BgBombwall; // size = 0x02A4 diff --git a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h index 365c301426..26f70c5ba6 100644 --- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h +++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x3C]; } BgBowlWall; // size = 0x0188 diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h index ce803a1a36..9495d4afc5 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xA4]; } BgBreakwall; // size = 0x01F0 diff --git a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h index 0f4c909107..e71bd1bab8 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h +++ b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24]; } BgDdanJd; // size = 0x0170 diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h index 506265edb8..920ad7bbb9 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x7C]; } BgDdanKd; // size = 0x01C8 diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h index 4ed426f8e5..d9723c5ffa 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x104]; } BgDodoago; // size = 0x0250 diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h index ab11be53b1..2ab814b2f7 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x3768]; } BgDyYoseizo; // size = 0x38B4 diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h index 6210ae7235..5ff64f5555 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x40]; } BgGanonOtyuka; // size = 0x018C diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h index 0ba1fccc8b..324f131fd4 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x30]; } BgGateShutter; // size = 0x017C diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h index 7d9b5ed751..2ea2d90c08 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C]; } BgGjyoBridge; // size = 0x0168 diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h index a9f4ab84cd..0137cb5123 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24]; } BgGndDarkmeiro; // size = 0x0170 diff --git a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h index 10a26d04c7..b469b6d344 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2C]; } BgGndFiremeiro; // size = 0x0178 diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h index f40ac8cbcc..b7e0af4d9c 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x28]; } BgGndIceblock; // size = 0x0174 diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h index 34fe10639f..1382a62f06 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x54]; } BgGndSoulmeiro; // size = 0x01A0 diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h index dda5c3645f..40142a6d76 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C]; } BgHaka; // size = 0x0168 diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h index 6d8dcbd8c6..17cbd7542f 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x28]; } BgHakaGate; // size = 0x0174 diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h index a87b0253e6..7d23ebe985 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgHakaHuta; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h index 722caa107c..06fb457b62 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgHakaMegane; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h index c079c8438b..67bd9e5f3e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgHakaMeganeBG; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h index 81cb928247..0059304f7c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1EC]; } BgHakaSgami; // size = 0x0338 diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h index 67d947d9f2..58645f3a36 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2C]; } BgHakaShip; // size = 0x0178 diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h index a7bc324ca4..5585c68b6e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x150]; } BgHakaTrap; // size = 0x029C diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h index 0ed6c47ace..b968c39005 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xB8]; } BgHakaTubo; // size = 0x0204 diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h index ca188cfe65..a45e557115 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8]; } BgHakaWater; // size = 0x0154 diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h index 739edab305..9336251a14 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x6C]; } BgHakaZou; // size = 0x01B8 diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h index 63ebafd878..17c5ad63c9 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2C]; } BgHeavyBlock; // size = 0x0178 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h index 7db2eed1b0..45b444e8dd 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x58]; } BgHidanCurtain; // size = 0x01A4 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h index 5aeec9aec9..aa3e8ca7ff 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1B0]; } BgHidanDalm; // size = 0x02FC diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index afde1bf451..578fd0d3eb 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x54]; } BgHidanFirewall; // size = 0x01A0 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h index 39b01cdd2e..72ba3b6238 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; /* 0x0168 */ s16 unk_168; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h index 047d5ec930..9e034748b4 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x54]; } BgHidanFwbig; // size = 0x01A0 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h index 6de37dba6d..5d04123025 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xFC]; } BgHidanHamstep; // size = 0x0248 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h index 7eabc91821..c2f58676db 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xF8]; } BgHidanHrock; // size = 0x0244 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h index 3b43ccbb44..a7aed6b28b 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgHidanKousi; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h index 4950d16209..0cec631daa 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x78]; } BgHidanKowarerukabe; // size = 0x01C4 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h index 17c2aa9f23..7b44289fef 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x7C]; } BgHidanRock; // size = 0x01C8 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h index 190723bc95..c7d08acc7f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1BC]; } BgHidanRsekizou; // size = 0x0308 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h index 52e588a88e..26c0af193f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C8]; } BgHidanSekizou; // size = 0x0314 diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h index 7f1df8300d..d0dbbe1f21 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC0]; } BgHidanSima; // size = 0x020C diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h index ff8d5232da..b258abe517 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h +++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x28]; } BgIceObjects; // size = 0x0174 diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h index 5f42358a2d..bf9d7aad73 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xB8]; } BgIceShelter; // size = 0x0204 diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h index f425c21edf..08d8caafea 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C]; } BgIceShutter; // size = 0x0168 diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h index 1e1fcc87a6..850af930ec 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x6C]; } BgIceTurara; // size = 0x01B8 diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h index ea6980aad7..0205b7721c 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C]; } BgIngate; // size = 0x0168 diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h index 7796b4aa01..0cabc4bbf9 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x70]; } BgJya1flift; // size = 0x01BC diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h index 2884a1541a..af7cb1594d 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x28]; } BgJyaBigmirror; // size = 0x0174 diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h index e44c4508e6..c4975cbab3 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x18]; } BgJyaBlock; // size = 0x0164 diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h index 1ad9d826bd..bcb45f9fbb 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x6C]; } BgJyaBombchuiwa; // size = 0x01B8 diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h index 0e9c972eab..38b0e769b9 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x7C]; } BgJyaBombiwa; // size = 0x01C8 diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h index 5f37401fa1..6ae32f2363 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1058]; } BgJyaCobra; // size = 0x11A4 diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h index 7dcd17837e..6ded63227c 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x70]; } BgJyaGoroiwa; // size = 0x01BC diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h index 310431c04a..6160c7a79e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x68]; } BgJyaHaheniron; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h index ac5bcbaae5..8146f09036 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x68]; } BgJyaIronobj; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h index 02298abfa3..02ecd34b14 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgJyaLift; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h index fdb8f1cde5..8a6e850f1a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1F0]; } BgJyaMegami; // size = 0x033C diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h index edac4a1d65..d12cfe1d14 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24]; } BgJyaZurerukabe; // size = 0x0170 diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h index dea622d054..9bbfa6ad00 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x64]; } BgMenkuriEye; // size = 0x01B0 diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h index dba523ae17..c2cac4d00a 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x170]; } BgMizuBwall; // size = 0x02BC diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h index c1a9a9de84..6fc6e82178 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x3C]; } BgMizuMovebg; // size = 0x0188 diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h index 405de54870..0e046eff1e 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x44]; } BgMizuShutter; // size = 0x0190 diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h index e9c00f9802..1d90ac5def 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x14]; } BgMizuWater; // size = 0x0160 diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h index eec94e3231..f3dc4e62e0 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ s8 objBankIndex; /* 0x0168 */ ActorFunc actionFunc; diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h index 8e9b0736c3..b9d1185741 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgMoriBigst; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h index 25ab5be59d..6f082503f9 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x28]; } BgMoriElevator; // size = 0x0174 diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h index e776ac96fe..6136cb76d7 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x84]; } BgMoriHashigo; // size = 0x01D0 diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h index 5a13463d31..bdaa4a740c 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgMoriHashira4; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h index 36f5973fcb..430556237b 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgMoriHineri; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h index 38f5302158..2f95a92828 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x14]; } BgMoriIdomizu; // size = 0x0160 diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h index 6f37fcaf39..16f34297e8 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x3C]; } BgMoriKaitenkabe; // size = 0x0188 diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h index 572069596f..a32e9aa375 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2C]; } BgMoriRakkatenjo; // size = 0x0178 diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h index ed3fb4b4a3..26e67f46c5 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xFC]; } BgPoEvent; // size = 0x0248 diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h index 8f230a312a..ae63a79d35 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x64]; } BgPoSyokudai; // size = 0x01B0 diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h index 02c7007ed8..2eaa88edeb 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; } BgPushbox; // size = 0x0168 diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h index 1552ff38cb..bb12bea5a8 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgRelayObjects; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h index 76b7cebf0b..b0349e7894 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x34]; } BgSpot00Hanebasi; // size = 0x0180 diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h index 73ac76f1dd..e828535164 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x28]; } BgSpot01Idohashira; // size = 0x0174 diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h index 7735b626d4..e2a45cc9e5 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h +++ b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC]; } BgSpot01Idomizu; // size = 0x0158 diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h index 2974744384..500a119ecb 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x34]; } BgSpot01Objects2; // size = 0x0180 diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h index 075e53b13a..8960981df1 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x28]; } BgSpot02Objects; // size = 0x0174 diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h index 242d6c2cda..ba99052668 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2C]; } BgSpot03Taki; // size = 0x0178 diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h index d44173d853..b54c3899b9 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgSpot05Soko; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h index f2e06d2ea3..8714e39425 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x84]; } BgSpot06Objects; // size = 0x01D0 diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h index aa2e959136..03c3f84d06 100644 --- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h +++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C]; } BgSpot07Taki; // size = 0x0168 diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h index 2f69deee89..61f4a49033 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xF8]; } BgSpot08Bakudankabe; // size = 0x0244 diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h index 0b35be6050..52ba109cfd 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x50]; } BgSpot08Iceblock; // size = 0x019C diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h index 21dedca5fc..55bbe8dce9 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C]; } BgSpot09Obj; // size = 0x0168 diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h index 22b2eec71f..0ec8df015d 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x64]; } BgSpot11Bakudankabe; // size = 0x01B0 diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h index d3cb66bdef..1a798a3b8f 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8]; } BgSpot11Oasis; // size = 0x0154 diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h index 0ce1c02927..3a6d11ba25 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgSpot12Gate; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h index d2a559245e..8b748fa09e 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgSpot12Saku; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h index 2d717d023a..864fb5f466 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x38]; } BgSpot15Rrbox; // size = 0x0184 diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h index 171ea2a56c..abd85de7b4 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; /* 0x0168 */ UNK_PTR unk_168; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h index 110146e8a5..6b783597f9 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xCC]; } BgSpot16Bombstone; // size = 0x0218 diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h index 2a4edd3af7..e5d67ef288 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8]; } BgSpot16Doughnut; // size = 0x0154 diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h index 0a7bdaa4b7..ae924fa65a 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x18]; } BgSpot17Bakudankabe; // size = 0x0164 diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h index 6ce42d70cc..a0dde3dd85 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h +++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; } BgSpot17Funen; // size = 0x014C diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h index 6640c8b85a..602cdb0798 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xD0]; } BgSpot18Basket; // size = 0x021C diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h index 6d3dd11d6d..0e64ee38bd 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgSpot18Obj; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h index cb5b8bb8f5..ec8ba7caf2 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C]; } BgSpot18Shutter; // size = 0x0168 diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h index 9333dd51e8..2cec575530 100644 --- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h +++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgSstFloor; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h index 1f45607f14..d0e0a3c3c5 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h +++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8]; } BgTokiHikari; // size = 0x0154 diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h index efc0f885d6..4fd13fbb0b 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc actionFunc; /* 0x0150 */ ColliderCylinderMain collider; diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h index 82a53bffd4..04ebf7f946 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24]; } BgTreemouth; // size = 0x0170 diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h index 9ebf0b72e5..019b2b1b3a 100644 --- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h +++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x30]; } BgVbSima; // size = 0x017C diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h index a3c63196f9..e28f071d96 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgYdanHasi; // size = 0x016C diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h index 03f82f48b3..45120c41d6 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xF8]; } BgYdanMaruta; // size = 0x0244 diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h index 3d70d8a79b..371d348bad 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xFC]; } BgYdanSp; // size = 0x0248 diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h index 3a856be401..ac05e9b1c0 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } BgZg; // size = 0x016C diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h index 080bffc72b..49a07c917d 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x16D4]; } BossDodongo; // size = 0x1820 diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h index ae578e7464..be2c70ca7e 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4254]; } BossFd; // size = 0x43A0 diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h index c935af8c0e..3d37e66ba9 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1530]; } BossFd2; // size = 0x167C diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h index 058196fb5b..2be2e94ed5 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x5D0]; } BossGanon; // size = 0x071C diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h index 9c5d15019b..6b6db36c5e 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x798]; } BossGanon2; // size = 0x08E4 diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h index 599bc0a416..914c6f93cd 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x42C]; } BossGanondrof; // size = 0x0578 diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h index f2f4bed056..1688420d95 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x9D0]; } BossGoma; // size = 0x0B1C diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h index d2097fae4f..f8d42f3b94 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1440]; } BossMo; // size = 0x158C diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h index a490941799..5a68f78104 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x94C]; } BossSst; // size = 0x0A98 diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h index ad2e3006c2..4fe49f172e 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x568]; } BossTw; // size = 0x06B4 diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.h b/src/overlays/actors/ovl_Boss_Va/z_boss_va.h index 188cf6fa16..4649741234 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.h +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x26C]; } BossVa; // size = 0x03B8 diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h index 3fd4cb929f..6a75229c55 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x148]; } Demo6K; // size = 0x0294 diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.h b/src/overlays/actors/ovl_Demo_Du/z_demo_du.h index 4b83fa4cc0..7e7c7625ed 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.h +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x68]; } DemoDu; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h index a8fdd9f4a6..749dff3d6c 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x5C]; } DemoEc; // size = 0x01A8 diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h index ad6052a754..8c6e3c99d4 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x54]; } DemoEffect; // size = 0x01A0 diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h index 32e3f5d291..3bd5f8a3de 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x38]; } DemoExt; // size = 0x0184 diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h index 68c10d6b53..3438bada7b 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h @@ -6,8 +6,7 @@ #include "../ovl_Demo_Gt/z_demo_gt.h" -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ s32 action; /* 0x0150 */ s32 drawConfig; diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h index 7b55ee8801..7ecc19ffd5 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x12C]; } DemoGj; // size = 0x0278 diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.h b/src/overlays/actors/ovl_Demo_Go/z_demo_go.h index 6eb7a02107..4c67507efa 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.h +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ s16 unk_190; diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h index adad6369eb..42d0ce5c4d 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x5C]; } DemoGt; // size = 0x01A8 diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h index d0515daedb..83d98cfff9 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x68]; } DemoIk; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h index df3255b3a9..9329900aaa 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1B0]; } DemoIm; // size = 0x02FC diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h index 4a3d741477..42d7366cbc 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4B8]; } DemoKankyo; // size = 0x0604 diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h index 7248e00b1d..4dda63a5cc 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xB0]; } DemoKekkai; // size = 0x01FC diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h index b873eb12c9..1d17aef02f 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x68]; } DemoSa; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h index dc7921a0d0..f074cfb9d1 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8]; } DemoShd; // size = 0x0154 diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h index ad5345ab3f..4016a8f162 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x30]; } DemoTreLgt; // size = 0x017C diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.h b/src/overlays/actors/ovl_Door_Ana/z_door_ana.h index d80dc2c275..98718e330d 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.h +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinderMain collider; /* 0x0198 */ ActorFunc actionFunc; diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h index e8ef9ecc96..9d067bafcf 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } DoorGerudo; // size = 0x016C diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h index 24b6be0d94..61e98f9768 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x138]; } DoorKiller; // size = 0x0284 diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h index 0c0e688c87..3958d04c09 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2C]; } DoorShutter; // size = 0x0178 diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h index 150fcf89e3..96a6ef1004 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xA4]; } DoorWarp1; // size = 0x01F0 diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h index 6d82aa44d4..237abbb5e7 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1780]; } EfcErupc; // size = 0x18CC diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h index 35ee2c81ea..7f7628f545 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x41C]; } EffDust; // size = 0x0568 diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h index fe81cd8a94..d702df439a 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4]; } ElfMsg; // size = 0x0150 diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h index b1520dad5f..e2989dcaaa 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4]; } ElfMsg2; // size = 0x0150 diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.h b/src/overlays/actors/ovl_En_Am/z_en_am.h index 3213146799..22862bdf8b 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.h +++ b/src/overlays/actors/ovl_En_Am/z_en_am.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x240]; } EnAm; // size = 0x038C diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/src/overlays/actors/ovl_En_Ani/z_en_ani.h index 05b739e3d5..45b7e37208 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x168]; } EnAni; // size = 0x02B4 diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h index c93250b0d1..e99538465c 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C8]; } EnAnubice; // size = 0x0314 diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h index 99d9f4b9de..56d42b7890 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xA8]; } EnAnubiceFire; // size = 0x01F4 diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h index 9ee4d7fd8b..f683d0281e 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x114]; } EnArrow; // size = 0x0260 diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h index b4eaf8c106..e1184b8e86 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x19C]; } EnAttackNiw; // size = 0x02E8 diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.h b/src/overlays/actors/ovl_En_Ba/z_en_ba.h index 837b04b83e..dddb2e475a 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.h +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x274]; } EnBa; // size = 0x03C0 diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.h b/src/overlays/actors/ovl_En_Bb/z_en_bb.h index d5961b0047..f44c5b981a 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.h +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1DC]; } EnBb; // size = 0x0328 diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h index b9708ec64c..c226f5f42e 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x98]; } EnBdfire; // size = 0x01E4 diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h index a0df60028d..aed87b3d7c 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x238]; } EnBigokuta; // size = 0x0384 diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.h b/src/overlays/actors/ovl_En_Bili/z_en_bili.h index 29f11d3699..e98b229e64 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.h +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xD4]; } EnBili; // size = 0x0220 diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h index 93d53fd06f..1bceccc739 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } EnBlkobj; // size = 0x016C diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/src/overlays/actors/ovl_En_Bom/z_en_bom.h index ce9f141c32..0e971d9316 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xBC]; } EnBom; // size = 0x0208 diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h index cd4bde14d3..27fdd364c9 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x10C]; /* 0x0258 */ u8 unk_258; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h index 99e6b0e2f4..84d85c978d 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x35B8]; } EnBomBowlPit; // size = 0x3704 diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h index 4221392c2a..a6c90ea11a 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x98]; } EnBomChu; // size = 0x01E4 diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h index 3ffe1fa6a6..513dd6b0cc 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC4]; } EnBombf; // size = 0x0210 diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.h b/src/overlays/actors/ovl_En_Boom/z_en_boom.h index 1dd70eb49c..473fe4060a 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.h +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ Collider collider; /* 0x0164 */ char unk_164[0x68]; diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.h b/src/overlays/actors/ovl_En_Box/z_en_box.h index 7410fd7bab..69243cde30 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.h +++ b/src/overlays/actors/ovl_En_Box/z_en_box.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xB0]; } EnBox; // size = 0x01FC diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.h b/src/overlays/actors/ovl_En_Brob/z_en_brob.h index dfeb43901e..5e7eb39ffb 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.h +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x174]; } EnBrob; // size = 0x02C0 diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h index c54c573a16..71ee1c728c 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x114]; } EnBubble; // size = 0x0260 diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.h b/src/overlays/actors/ovl_En_Butte/z_en_butte.h index 759789c02c..1ebc03e530 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.h +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x11C]; } EnButte; // size = 0x0268 diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.h b/src/overlays/actors/ovl_En_Bw/z_en_bw.h index 7d6dc660ac..75c530f530 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.h +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1E0]; } EnBw; // size = 0x032C diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.h b/src/overlays/actors/ovl_En_Bx/z_en_bx.h index b86e858759..548e622b57 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.h +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x14C]; } EnBx; // size = 0x0298 diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.h b/src/overlays/actors/ovl_En_Changer/z_en_changer.h index df13fff6f2..7d65022c98 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.h +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } EnChanger; // size = 0x016C diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h index 707fc7f5a4..e3ea98d2cb 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xB8]; } EnClearTag; // size = 0x0204 diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.h b/src/overlays/actors/ovl_En_Cow/z_en_cow.h index 57be216b4f..7b44f77718 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.h +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x134]; } EnCow; // size = 0x0280 diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.h b/src/overlays/actors/ovl_En_Crow/z_en_crow.h index 4a7d8652c3..fab96e46fd 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.h +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x14C]; } EnCrow; // size = 0x0298 diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.h b/src/overlays/actors/ovl_En_Cs/z_en_cs.h index e792341d23..0e4ebf4354 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.h +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1F8]; } EnCs; // size = 0x0344 diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h index e30b4cbb60..6aeb560733 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x200]; } EnDaiku; // size = 0x034C diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h index 6592043b68..f706015b57 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1BC]; } EnDaikuKakariko; // size = 0x0308 diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h index 96eec70eff..21cad286ab 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2CC]; } EnDekubaba; // size = 0x0418 diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h index 838af2bd3b..60db09f886 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C8]; } EnDekunuts; // size = 0x0314 diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.h b/src/overlays/actors/ovl_En_Dh/z_en_dh.h index 1d11cf00ef..de718b72ac 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.h +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1D8]; } EnDh; // size = 0x0324 diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.h b/src/overlays/actors/ovl_En_Dha/z_en_dha.h index c3debba7e3..4bf3641969 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.h +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x214]; } EnDha; // size = 0x0360 diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h index 94bafbcdbf..04b34a3d99 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24C]; } EnDivingGame; // size = 0x0398 diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.h b/src/overlays/actors/ovl_En_Dns/z_en_dns.h index 868fa7a51a..32720a0a3c 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.h +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x17C]; } EnDns; // size = 0x02C8 diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h index 3aecc6c9a4..70933f292f 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xB4]; } EnDntDemo; // size = 0x0200 diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h index ae85ff3f86..9d9af938d4 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x15C]; } EnDntJiji; // size = 0x02A8 diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h index 76edc1a55e..517e023113 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x214]; } EnDntNomal; // size = 0x0360 diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h index a12d8284f3..5ed8290a3e 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x174]; } EnDodojr; // size = 0x02C0 diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h index f181465adc..874eabcdc1 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x5DC]; } EnDodongo; // size = 0x0728 diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.h b/src/overlays/actors/ovl_En_Dog/z_en_dog.h index 56010c68a3..30dda5534b 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.h +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ ActorFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.h b/src/overlays/actors/ovl_En_Door/z_en_door.h index b696902510..dd0fac0624 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.h +++ b/src/overlays/actors/ovl_En_Door/z_en_door.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8C]; } EnDoor; // size = 0x01D8 diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.h b/src/overlays/actors/ovl_En_Ds/z_en_ds.h index c99c150c02..83a850659f 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.h +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xA4]; } EnDs; // size = 0x01F0 diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.h b/src/overlays/actors/ovl_En_Du/z_en_du.h index 8e79b4578c..8941e278bb 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.h +++ b/src/overlays/actors/ovl_En_Du/z_en_du.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xD0]; } EnDu; // size = 0x021C diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h index 65fba617a7..c29c9363f9 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x28]; } EnDyExtra; // size = 0x0174 diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h index 73ccc4c35a..27e109ab39 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x188]; } EnEiyer; // size = 0x02D4 diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.h b/src/overlays/actors/ovl_En_Elf/z_en_elf.h index ecc3bf5bdc..559d07103f 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.h +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x184]; } EnElf; // size = 0x02D0 diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h index 843a271f3f..d5a2702948 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24]; } EnEncount1; // size = 0x0170 diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index 7b04e6a9cf..e286022ea8 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8D4]; } EnEncount2; // size = 0x0A20 diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h index ea27019aae..c70a494b90 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x38]; } EnExItem; // size = 0x0184 diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h index accdfb6233..c56dbf8376 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x18]; } EnExRuppy; // size = 0x0164 diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.h b/src/overlays/actors/ovl_En_Fd/z_en_fd.h index a96e301f8a..b8a4291fbd 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.h +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x3094]; } EnFd; // size = 0x31E0 diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h index ae0e2e14ea..6403c2dcb0 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x60]; } EnFdFire; // size = 0x01AC diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h index 480e79da75..c3a27e7438 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xB8]; } EnFhgFire; // size = 0x0204 diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h index b8ed87b6b6..e8b1758a13 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x94]; } EnFireRock; // size = 0x01E0 diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h index 6de17fea14..f5d6c8b13d 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x228]; } EnFirefly; // size = 0x0374 diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.h b/src/overlays/actors/ovl_En_Fish/z_en_fish.h index 6092a2a232..9144ef12c9 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.h +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x108]; } EnFish; // size = 0x0254 diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h index 646fff24bc..fd7c3ea0c1 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C8]; } EnFloormas; // size = 0x0314 diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.h b/src/overlays/actors/ovl_En_Fr/z_en_fr.h index 5513c891c1..eaddf83acd 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.h +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x278]; } EnFr; // size = 0x03C4 diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.h b/src/overlays/actors/ovl_En_Fu/z_en_fu.h index d55bc54466..58e1802b29 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.h +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x164]; } EnFu; // size = 0x02B0 diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.h b/src/overlays/actors/ovl_En_Fw/z_en_fw.h index 498be04158..df3ea6cf74 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.h +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x5B4]; } EnFw; // size = 0x0700 diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.h b/src/overlays/actors/ovl_En_Fz/z_en_fz.h index a174fa5289..2424186a2e 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.h +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xA88]; } EnFz; // size = 0x0BD4 diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h index cc39ade23f..9f265dffaa 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x11AC]; } EnGSwitch; // size = 0x12F8 diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h index e4048f8078..065813074a 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x15BC]; } EnGanonMant; // size = 0x1708 diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.h b/src/overlays/actors/ovl_En_Gb/z_en_gb.h index d9a285fdcb..11d0d4fae8 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.h +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2EC]; } EnGb; // size = 0x0438 diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h index a814745388..3b7c60e966 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x170]; } EnGe1; // size = 0x02BC diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h index 2a3ad727bf..31798fa869 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C0]; } EnGe2; // size = 0x030C diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h index 0ebc827a3a..746cc1e2a7 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C8]; } EnGe3; // size = 0x0314 diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h index 743545a8bc..dfc77d4c96 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x398]; } EnGeldB; // size = 0x04E4 diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h index 106616016e..ee750bd851 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x88]; } EnGirlA; // size = 0x01D4 diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.h b/src/overlays/actors/ovl_En_Gm/z_en_gm.h index f5a2922df2..4c0f3ce9aa 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.h +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x184]; } EnGm; // size = 0x02D0 diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h index 4ba9bd25dc..a29a392d0e 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x57C]; } EnGo; // size = 0x06C8 diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.h b/src/overlays/actors/ovl_En_Go2/z_en_go2.h index 67e0e37025..c0507cd12b 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.h +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x454]; } EnGo2; // size = 0x05A0 diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.h b/src/overlays/actors/ovl_En_Goma/z_en_goma.h index 153a91f12a..23501da8c1 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.h +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x258]; } EnGoma; // size = 0x03A4 diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h index 0cd104fa8b..e98804eac5 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x88]; } EnGoroiwa; // size = 0x01D4 diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.h b/src/overlays/actors/ovl_En_Gs/z_en_gs.h index 673107fb74..edbb4ac95e 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.h +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xBC]; } EnGs; // size = 0x0208 diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.h b/src/overlays/actors/ovl_En_Guest/z_en_guest.h index 51c27ca385..450012f6d9 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.h +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C4]; } EnGuest; // size = 0x0310 diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.h b/src/overlays/actors/ovl_En_Hata/z_en_hata.h index fc6fc37bd6..f95f7192ae 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.h +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x130]; } EnHata; // size = 0x027C diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h index a49f8272d3..d6f5cf38b6 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x160]; } EnHeishi1; // size = 0x02AC diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h index 3360f9756b..97e0208bfe 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x298]; } EnHeishi2; // size = 0x03E4 diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h index 8d0b448104..8657e22e0b 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x17C]; } EnHeishi3; // size = 0x02C8 diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h index f70c1372aa..5030657514 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1BC]; } EnHeishi4; // size = 0x0308 diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h index c46fb5a236..d04fddf3d7 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x114]; } EnHintnuts; // size = 0x0260 diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.h b/src/overlays/actors/ovl_En_Holl/z_en_holl.h index a67f29af66..dbdc1c46aa 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.h +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8]; } EnHoll; // size = 0x0154 diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h index 64d6555602..180c02198e 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xF8]; } EnHonotrap; // size = 0x0244 diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.h b/src/overlays/actors/ovl_En_Horse/z_en_horse.h index 50f30d4ff6..d019746285 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.h +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2B0]; } EnHorse; // size = 0x03FC diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h index 9b166fd014..4b36416149 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x58]; } EnHorseGameCheck; // size = 0x01A4 diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h index ba9e941714..dc777e1325 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x15C]; } EnHorseGanon; // size = 0x02A8 diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h index c37c1ef3cf..f4aac29510 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x158]; } EnHorseLinkChild; // size = 0x02A4 diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h index 7ee00d78ac..bea6647a98 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1DC]; } EnHorseNormal; // size = 0x0328 diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h index 2e050baf3d..e6f4d88736 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x15C]; } EnHorseZelda; // size = 0x02A8 diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.h b/src/overlays/actors/ovl_En_Hs/z_en_hs.h index f8820dcf88..8adc56204a 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.h +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x164]; } EnHs; // size = 0x02B0 diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h index 9bd26e37e9..cf3ff6d6c9 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x164]; } EnHs2; // size = 0x02B0 diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.h b/src/overlays/actors/ovl_En_Hy/z_en_hy.h index 5e0f578195..60c865a8a6 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.h +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1E8]; } EnHy; // size = 0x0334 diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h index afe286bdfe..064a7ce08a 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x70]; } EnIceHono; // size = 0x01BC diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h index bb1699367e..3ccf47aae4 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x390]; } EnIk; // size = 0x04DC diff --git a/src/overlays/actors/ovl_En_In/z_en_in.h b/src/overlays/actors/ovl_En_In/z_en_in.h index ae29d2173a..a1addb31a3 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/src/overlays/actors/ovl_En_In/z_en_in.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x25C]; } EnIn; // size = 0x03A8 diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.h b/src/overlays/actors/ovl_En_Insect/z_en_insect.h index a75acd1c25..f077314636 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.h +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1E0]; } EnInsect; // size = 0x032C diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h index 33dd5d53cc..1d4a2f5d6b 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x50]; } EnIshi; // size = 0x019C diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.h b/src/overlays/actors/ovl_En_Jj/z_en_jj.h index c41ae27dfc..27a95976b1 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.h +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C8]; } EnJj; // size = 0x0314 diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.h b/src/overlays/actors/ovl_En_Js/z_en_js.h index 1ffc115b94..c224fd7112 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.h +++ b/src/overlays/actors/ovl_En_Js/z_en_js.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x144]; } EnJs; // size = 0x0290 diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h index d38b4495b1..f8e824fed7 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2C]; } EnJsjutan; // size = 0x0178 diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h index 915fbb92f9..6e7b67f83a 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC0]; } EnKakasi; // size = 0x020C diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h index b14e22f812..21b8e99bcc 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xAC]; } EnKakasi2; // size = 0x01F8 diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h index 2e5ba888a5..f05a1da965 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC0]; } EnKakasi3; // size = 0x020C diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h index 4571f5db3b..4fcef5126d 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xA0]; } EnKanban; // size = 0x01EC diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h index 3f9f88811a..61bb985245 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x144]; } EnKarebaba; // size = 0x0290 diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.h b/src/overlays/actors/ovl_En_Ko/z_en_ko.h index 87561ad639..cc6498ddda 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.h +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1D8]; } EnKo; // size = 0x0324 diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h index 90e846566c..5ab94474c0 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x54]; } EnKusa; // size = 0x01A0 diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.h b/src/overlays/actors/ovl_En_Kz/z_en_kz.h index e9564196b4..3ef60df623 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.h +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x18C]; } EnKz; // size = 0x02D8 diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.h b/src/overlays/actors/ovl_En_Light/z_en_light.h index 5ef50d44ee..2cc729a4ef 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.h +++ b/src/overlays/actors/ovl_En_Light/z_en_light.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x18]; } EnLight; // size = 0x0164 diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h index 13ad74109c..6da101d0f0 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; } EnLightbox; // size = 0x0164 diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h index 971f4826b9..ab3552ef9c 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x80]; } EnMThunder; // size = 0x01CC diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h index 8df5ea2ccb..16d1c5aead 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC4]; } EnMa1; // size = 0x0210 diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h index faeb94e31a..456fe9e86a 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x138]; } EnMa2; // size = 0x0284 diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h index b014fbc42d..1771ccc14c 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x138]; } EnMa3; // size = 0x0284 diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.h b/src/overlays/actors/ovl_En_Mag/z_en_mag.h index a5f6b88997..77e0b361ab 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.h +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xE1DC]; } EnMag; // size = 0xE328 diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.h b/src/overlays/actors/ovl_En_Mb/z_en_mb.h index ed4a0796f5..49171df5d7 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.h +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x3C0]; } EnMb; // size = 0x050C diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.h b/src/overlays/actors/ovl_En_Md/z_en_md.h index 7b20229f05..1da1f5d22c 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.h +++ b/src/overlays/actors/ovl_En_Md/z_en_md.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1D8]; } EnMd; // size = 0x0324 diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.h b/src/overlays/actors/ovl_En_Mk/z_en_mk.h index b636ac3ce2..0a090eff9f 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.h +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x13C]; } EnMk; // size = 0x0288 diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.h b/src/overlays/actors/ovl_En_Mm/z_en_mm.h index b9bc8f713b..405ed9fd46 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.h +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1D4]; } EnMm; // size = 0x0320 diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h index 27ce017292..700c18a6c1 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x170]; } EnMm2; // size = 0x02BC diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.h b/src/overlays/actors/ovl_En_Mu/z_en_mu.h index 12236c7c1d..f8a1fd4c08 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.h +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x100]; } EnMu; // size = 0x024C diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.h b/src/overlays/actors/ovl_En_Nb/z_en_nb.h index df20f1cf64..cdfb468d21 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.h +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1DC]; } EnNb; // size = 0x0328 diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.h b/src/overlays/actors/ovl_En_Niw/z_en_niw.h index 92486e6548..e5706c393a 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.h +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x66C]; } EnNiw; // size = 0x07B8 diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h index a18fe9b09a..879b626f58 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1B0]; } EnNiwGirl; // size = 0x02FC diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h index f57dfa7f87..787b7cf90d 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1B0]; } EnNiwLady; // size = 0x02FC diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h index 317cc53f4b..50d12e96a3 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc actionFunc; /* 0x0150 */ s8 objBankIndex; diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h index d40769ca99..ab8470fafe 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x5E8]; } EnNwc; // size = 0x0734 diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.h b/src/overlays/actors/ovl_En_Ny/z_en_ny.h index dc978b6aa7..5de276a97c 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.h +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x16C]; } EnNy; // size = 0x02B8 diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h index 1320eb6a07..309b9ef2ec 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x14]; } EnOkarinaTag; // size = 0x0160 diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h index ba034417a3..11718e1402 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x270]; } EnOkuta; // size = 0x03BC diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 53ffc2f992..494bd29c9a 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x18C]; } EnOssan; // size = 0x02D8 diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.h b/src/overlays/actors/ovl_En_Owl/z_en_owl.h index 7905a9a555..7ea9981230 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.h +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2C8]; } EnOwl; // size = 0x0414 diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.h b/src/overlays/actors/ovl_En_Part/z_en_part.h index c98a3e0873..83b79ff263 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.h +++ b/src/overlays/actors/ovl_En_Part/z_en_part.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x10]; } EnPart; // size = 0x015C diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h index f43f3452e8..6472e19f15 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2E0]; } EnPeehat; // size = 0x042C diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h index ed76b2980f..2ec01d80f4 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x138]; } EnPoDesert; // size = 0x0284 diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h index 2a9b5d637f..b02ef552b9 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x190]; } EnPoField; // size = 0x02DC diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h index 6fe030c5c5..a0206ed18e 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x190]; } EnPoRelay; // size = 0x02DC diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h index ba7ba23cf7..c6c42f566b 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1EC]; } EnPoSisters; // size = 0x0338 diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.h b/src/overlays/actors/ovl_En_Poh/z_en_poh.h index 3f546e8606..d86bb95ec0 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.h +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x25C]; } EnPoh; // size = 0x03A8 diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h index 6aa1ec66dd..b92b70c764 100644 --- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h +++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ u32 unk_164; } EnPubox; // size = 0x0168 diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index b889da5a22..da0b003b60 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x220]; } EnRd; // size = 0x036C diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h index 9bf94bc805..f5adf86a23 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x190]; } EnReeba; // size = 0x02DC diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h index bcf1e16abe..b1c159d819 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4]; } EnRiverSound; // size = 0x0150 diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.h b/src/overlays/actors/ovl_En_Rl/z_en_rl.h index a9c961eb4b..219f5d2405 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.h +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x60]; } EnRl; // size = 0x01AC diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.h b/src/overlays/actors/ovl_En_Rr/z_en_rr.h index 0a393589ee..0da6399002 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.h +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2278]; } EnRr; // size = 0x23C4 diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h index 2504a23a6c..ddce050cb6 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x250]; } EnRu1; // size = 0x039C diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h index 0d727163dd..36f2dbf86f 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C8]; } EnRu2; // size = 0x0314 diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.h b/src/overlays/actors/ovl_En_Sa/z_en_sa.h index 62393e6ede..2afd947990 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.h +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1A0]; } EnSa; // size = 0x02EC diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.h b/src/overlays/actors/ovl_En_Sb/z_en_sb.h index c8873d3c7c..d07cb4318e 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.h +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xBC]; } EnSb; // size = 0x0208 diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.h b/src/overlays/actors/ovl_En_Sda/z_en_sda.h index 4ae165daa4..3f90433a31 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.h +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; } EnSda; // size = 0x014C diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h index ca72fc92e7..162173b1d0 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x170]; } EnShopnuts; // size = 0x02BC diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.h b/src/overlays/actors/ovl_En_Si/z_en_si.h index c6409c5d93..a185c3f2d3 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.h +++ b/src/overlays/actors/ovl_En_Si/z_en_si.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x54]; } EnSi; // size = 0x01A0 diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h index fa7c479f74..a30af51dd0 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x54]; } EnSiofuki; // size = 0x01A0 diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.h b/src/overlays/actors/ovl_En_Skb/z_en_skb.h index fcdf838caf..326be9e01b 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.h +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1F8]; } EnSkb; // size = 0x0344 diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.h b/src/overlays/actors/ovl_En_Skj/z_en_skj.h index 5a0b897c5f..65b0ffaa08 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.h +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1B4]; } EnSkj; // size = 0x0300 diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h index f80c035a3d..32ea97d942 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x9C]; } EnSkjneedle; // size = 0x01E8 diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h index 66cbe1228b..ba67891656 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x488]; } EnSsh; // size = 0x05D4 diff --git a/src/overlays/actors/ovl_En_St/z_en_st.h b/src/overlays/actors/ovl_En_St/z_en_st.h index 1948ef4aa8..52a2e3d75f 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/src/overlays/actors/ovl_En_St/z_en_st.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x430]; } EnSt; // size = 0x057C diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.h b/src/overlays/actors/ovl_En_Sth/z_en_sth.h index 5d42f29b70..041dca283f 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.h +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x170]; } EnSth; // size = 0x02BC diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.h b/src/overlays/actors/ovl_En_Stream/z_en_stream.h index a03a883092..85cd7d46aa 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.h +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC]; } EnStream; // size = 0x0158 diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.h b/src/overlays/actors/ovl_En_Sw/z_en_sw.h index 6fe25d3931..fa3dde25aa 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.h +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x38C]; } EnSw; // size = 0x04D8 diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h index c720d252e2..499252a875 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8C]; } EnSyatekiItm; // size = 0x01D8 diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h index c7e4f7d04f..5053a29c73 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xE0]; } EnSyatekiMan; // size = 0x022C diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h index 55b0693ee9..1ad7a1b9e5 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x314]; } EnSyatekiNiw; // size = 0x0460 diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.h b/src/overlays/actors/ovl_En_Ta/z_en_ta.h index 45f431e1fa..87f51efc4b 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.h +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x19C]; } EnTa; // size = 0x02E8 diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h index 874b9e9db9..11f49f16e8 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xEC]; } EnTakaraMan; // size = 0x0238 diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.h b/src/overlays/actors/ovl_En_Tana/z_en_tana.h index dc09b884ca..cee15e7527 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.h +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; } EnTana; // size = 0x014C diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.h b/src/overlays/actors/ovl_En_Test/z_en_test.h index 4f8341896f..0ed753ca5c 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.h +++ b/src/overlays/actors/ovl_En_Test/z_en_test.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x7DC]; } EnTest; // size = 0x0928 diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.h b/src/overlays/actors/ovl_En_Tg/z_en_tg.h index b9f2be3808..3fda08222e 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.h +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC0]; } EnTg; // size = 0x020C diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.h b/src/overlays/actors/ovl_En_Tite/z_en_tite.h index a147c3bbfd..f7d7fdc4a2 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.h +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x22C]; } EnTite; // size = 0x0378 diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/src/overlays/actors/ovl_En_Tk/z_en_tk.h index 9aacdf1a5e..5d3f67fe83 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -5,8 +5,7 @@ #include /* Dirt particle effect */ -typedef struct -{ +typedef struct { /* 0x0000 */ u8 active; /* 0x0001 */ u8 timeLeft; /* 0x0002 */ u8 timeTotal; @@ -20,20 +19,18 @@ typedef struct typedef struct EnTk EnTk; -typedef void EnTkFunc(EnTk *this, GlobalContext *ctxt); +typedef void EnTkFunc(EnTk* this, GlobalContext* globalCtx); -struct EnTk -{ +struct EnTk { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnim; - /* 0x0190 */ EnTkFunc *actionFunc; - /* 0x0194 */ ColliderCylinderMain - collider; + /* 0x0190 */ EnTkFunc* actionFunc; + /* 0x0194 */ ColliderCylinderMain collider; /* 0x01E0 */ s16 h_1E0; /* 0x01E2 */ char unk_1E2[0x26]; /* 0x0208 */ u8 validDigHere; /* 0x0209 */ u8 rewardCount[4]; - /* 0x0210 */ Actor *currentSpot; + /* 0x0210 */ Actor* currentSpot; /* 0x0214 */ s32 currentReward; /* 0x0218 */ s16 blinkCycles; /* 0x021A */ s16 rewardTimer; diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h index 627af71f2a..9f730e7f4c 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x948]; } EnTorch2; // size = 0x0A94 diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h index 977b152e73..2367c6f547 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x194]; } EnToryo; // size = 0x02E0 diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.h b/src/overlays/actors/ovl_En_Tp/z_en_tp.h index 9a6f2e5ff8..5b2f6950ab 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.h +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8C]; } EnTp; // size = 0x01D8 diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.h b/src/overlays/actors/ovl_En_Tr/z_en_tr.h index 429cfbba1c..ee8b8d06d0 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.h +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x19C]; } EnTr; // size = 0x02E8 diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.h b/src/overlays/actors/ovl_En_Trap/z_en_trap.h index 563e704052..118ea8b935 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.h +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xA0]; } EnTrap; // size = 0x01EC diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h index 55a3a5a937..c734b043ce 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc actionFunc; /* 0x0150 */ f32 targetY; diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.h b/src/overlays/actors/ovl_En_Vali/z_en_vali.h index 9725c2e318..92ff5c5f33 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.h +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2FC]; } EnVali; // size = 0x0448 diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h index 60177a9f36..6a97868754 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x68]; } EnVbBall; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h index cfd8d786a7..6fb70b5045 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4AC]; } EnViewer; // size = 0x05F8 diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.h b/src/overlays/actors/ovl_En_Vm/z_en_vm.h index 44bc0ad470..34ce379127 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.h +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x268]; } EnVm; // size = 0x03B4 diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h index 22819eddef..c26e459646 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24]; } EnWallTubo; // size = 0x0170 diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h index 3a5c48fc11..1855cdd332 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h @@ -5,13 +5,12 @@ #include typedef enum { - WMT_TIMER, - WMT_PROXIMITY, - WMT_FLAG, + /* 0x00 */ WMT_TIMER, + /* 0x01 */ WMT_PROXIMITY, + /* 0x02 */ WMT_FLAG } WallmasType; -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ ActorFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h index 13bebb7568..366c6d8945 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8]; } EnWeatherTag; // size = 0x0154 diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h index d0286b66b7..384d37a4df 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x184]; } EnWeiyer; // size = 0x02D0 diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.h b/src/overlays/actors/ovl_En_Wf/z_en_wf.h index ef1a8bcfed..9d71bbe8ef 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.h +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x390]; } EnWf; // size = 0x04DC diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h index ba600c6028..d858c5f3c6 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x84]; } EnWonderItem; // size = 0x01D0 diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h index ca519abd1b..0febeaaab7 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C]; } EnWonderTalk; // size = 0x0168 diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h index d9756df6fe..fe59248a76 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24]; } EnWonderTalk2; // size = 0x0170 diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h index 785dd78d03..1ddd777bff 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x58]; } EnWood02; // size = 0x01A4 diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.h b/src/overlays/actors/ovl_En_Xc/z_en_xc.h index 813fa65d0f..9a3039119a 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.h +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1F0]; } EnXc; // size = 0x033C diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h index 547e7ec0eb..b53b9e6e7d 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC4]; } EnYabusameMark; // size = 0x0210 diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h index 596e159eaa..19aab38e09 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x54]; } EnYukabyun; // size = 0x01A0 diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.h b/src/overlays/actors/ovl_En_Zf/z_en_zf.h index 077309579b..1ca95b82a6 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.h +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x41C]; } EnZf; // size = 0x0568 diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h index 7ac10d9deb..cd1c981099 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC0]; } EnZl1; // size = 0x020C diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h index 092d1d2a3f..bc51e995b4 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x134]; } EnZl2; // size = 0x0280 diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h index 2d79f615cf..6ddea4df83 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2D4]; } EnZl3; // size = 0x0420 diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h index 59aacef8fb..64766821ce 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1A4]; } EnZl4; // size = 0x02F0 diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.h b/src/overlays/actors/ovl_En_Zo/z_en_zo.h index 86fe3db233..cc751d35b6 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.h +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x55C]; } EnZo; // size = 0x06A8 diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.h b/src/overlays/actors/ovl_En_fHG/z_en_fhg.h index 7051e5c3ee..6aef028f7d 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.h +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x148]; } EnfHG; // size = 0x0294 diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.h b/src/overlays/actors/ovl_End_Title/z_end_title.h index 6a7a2b260d..60448c1153 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.h +++ b/src/overlays/actors/ovl_End_Title/z_end_title.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4]; } EndTitle; // size = 0x0150 diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.h b/src/overlays/actors/ovl_Fishing/z_fishing.h index c59d17494b..7fcc3229c8 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.h +++ b/src/overlays/actors/ovl_Fishing/z_fishing.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x404]; } Fishing; // size = 0x0550 diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h index 452507e66e..b21f4e36d1 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x20]; } ItemBHeart; // size = 0x016C diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h index e349929750..f2968c1061 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x14]; } ItemEtcetera; // size = 0x0160 diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h index c4485290a1..ecfd75e9e9 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x8]; } ItemOcarina; // size = 0x0154 diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.h b/src/overlays/actors/ovl_Item_Shield/z_item_shield.h index 3dec65ab15..ea09856ba6 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.h +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC0]; } ItemShield; // size = 0x020C diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h index c76cc54ad2..737fb79d0b 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x18]; } MagicDark; // size = 0x0164 diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h index c72dd6b0b4..581b609571 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x60]; } MagicFire; // size = 0x01AC diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h index e95d5c29aa..7544a85cd6 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x28]; } MagicWind; // size = 0x0174 diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h index d27c6a2fb2..cd3d6bbd98 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x164]; } MirRay; // size = 0x02B0 diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h index c6de07526f..dcfbf9787c 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xAC]; } ObjBean; // size = 0x01F8 diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h index beafae8fbe..9f1c2797b8 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinderMain collider; } ObjBombiwa; // size = 0x0198 diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h index 03947d8dd7..650ad1e261 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x68]; } ObjComb; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h index 87548b8fc0..06c79f327a 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x58]; } ObjDekujr; // size = 0x01A4 diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h index 5f93abe84e..0d7e05bf3c 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; /* 0x0168 */ f32 unk_168; diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h index e00e4fe815..d411caf3a0 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x5C]; } ObjHamishi; // size = 0x01A8 diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h index 5c4749a02d..0feb73700b 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4C]; } ObjHana; // size = 0x0198 diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h index b004f2d8e2..2311f5d8bc 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1C]; } ObjHsblock; // size = 0x0168 diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h index cc5168fa4e..1a549e6790 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xA0]; } ObjIcePoly; // size = 0x01EC diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h index cf0c603f16..f6ec5b7681 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x50]; } ObjKibako; // size = 0x019C diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h index d49de8784b..31e7ff4a09 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x6C]; } ObjKibako2; // size = 0x01B8 diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h index 030ec997e0..d964a978ea 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24]; } ObjLift; // size = 0x0170 diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h index 42a1d5d744..5c4733fd60 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x78]; } ObjLightswitch; // size = 0x01C4 diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h index f3e14dd51c..c74da7055d 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; } ObjMakeoshihiki; // size = 0x014C diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h index 266b23bf9d..f52a99457b 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x60]; } ObjMure; // size = 0x01AC diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h index 9ff8e3be26..cf5879ab2b 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x3C]; } ObjMure2; // size = 0x0188 diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h index 5c8fa8d6c4..e66ee67d25 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x24]; } ObjMure3; // size = 0x0170 diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h index c10e454edf..a8c6c3fc8e 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x88]; } ObjOshihiki; // size = 0x01D4 diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h index 7e94e6e732..05953d002a 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x10C]; } ObjSwitch; // size = 0x0258 diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h index d9c323dd44..a19fef9b41 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xB0]; } ObjSyokudai; // size = 0x01FC diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h index 41d8764e09..eb337b5136 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x30]; } ObjTimeblock; // size = 0x017C diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h index 1cb8e3d03a..7d0bd71315 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x54]; } ObjTsubo; // size = 0x01A0 diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h index 8918cdcdb6..768a85afdc 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x2C]; } ObjWarp2block; // size = 0x0178 diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h index 99afff0768..1b47732923 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x1514]; } ObjectKankyo; // size = 0x1660 diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h index 1552a52aed..aa0121833b 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x34]; } OceffSpot; // size = 0x0180 diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h index 75fd1ffe14..51623ec8f3 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0xC]; } OceffStorm; // size = 0x0158 diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h index cd2e3f6ffb..6cda7cfe43 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4]; } OceffWipe; // size = 0x0150 diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h index 5835387723..63417a3efa 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4]; } OceffWipe2; // size = 0x0150 diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h index c5937e8eba..1564054464 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4]; } OceffWipe3; // size = 0x0150 diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h index 1d586388da..ba47313545 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x4]; } OceffWipe4; // size = 0x0150 diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h index 8bdaaaed3c..6a0c9b88db 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x5C]; } ShotSun; // size = 0x01A8 diff --git a/undefined_syms.txt b/undefined_syms.txt index 1e6763936b..90850b9584 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -55,10 +55,10 @@ D_A4600024 = 0xA4600024; D_A4600028 = 0xA4600028; D_A460002C = 0xA460002C; D_A4600030 = 0xA4600030; -D_A4800000 = 0xA4800000; //SI_DRAM_ADDR_REG -D_A4800004 = 0xA4800004; //SI_PIF_ADDR_RD64B_REG -D_A4800010 = 0xA4800010; //SI_PIF_ADDR_WR64B_REG -D_A4800018 = 0xA4800018; //SI_STATUS_REG +D_A4800000 = 0xA4800000; // SI_DRAM_ADDR_REG +D_A4800004 = 0xA4800004; // SI_PIF_ADDR_RD64B_REG +D_A4800010 = 0xA4800010; // SI_PIF_ADDR_WR64B_REG +D_A4800018 = 0xA4800018; // SI_STATUS_REG // segment addresses D_02000000 = 0x02000000; @@ -205,7 +205,7 @@ D_060074EC = 0x060074EC; D_060038FC = 0x060038FC; D_06002590 = 0x06002590; -//z_en_ms +// z_en_ms D_060005EC = 0x060005EC; D_06003DC0 = 0x06003DC0; From 80bced5204831599abbd81bc25cfd272b041a64f Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 22 Mar 2020 17:56:08 -0400 Subject: [PATCH 18/33] Decompiled ovl_Bg_Gate_Shutter --- .../BgGateShutter_Destroy.s | 16 --- .../ovl_Bg_Gate_Shutter/BgGateShutter_Draw.s | 54 ------- .../ovl_Bg_Gate_Shutter/BgGateShutter_Init.s | 74 ---------- .../BgGateShutter_Update.s | 17 --- .../ovl_Bg_Gate_Shutter/func_8087828C.s | 35 ----- .../ovl_Bg_Gate_Shutter/func_80878300.s | 50 ------- .../ovl_Bg_Gate_Shutter/func_808783AC.s | 14 -- .../ovl_Bg_Gate_Shutter/func_808783D4.s | 53 ------- data/overlays/actors/z_bg_gate_shutter.data.s | 16 --- .../overlays/actors/z_bg_gate_shutter.reloc.s | 11 -- .../actors/z_bg_gate_shutter.rodata.s | 35 ----- spec | 4 +- .../ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c | 134 ++++++++++++++++-- .../ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h | 11 +- undefined_syms.txt | 4 + 15 files changed, 134 insertions(+), 394 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_8087828C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_80878300.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783AC.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783D4.s delete mode 100644 data/overlays/actors/z_bg_gate_shutter.data.s delete mode 100644 data/overlays/actors/z_bg_gate_shutter.reloc.s delete mode 100644 data/overlays/actors/z_bg_gate_shutter.rodata.s diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Destroy.s deleted file mode 100644 index 6fb3929a19..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Destroy.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel BgGateShutter_Destroy -/* 000FC 8087825C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00100 80878260 AFA40018 */ sw $a0, 0x0018($sp) -/* 00104 80878264 8FAE0018 */ lw $t6, 0x0018($sp) -/* 00108 80878268 AFBF0014 */ sw $ra, 0x0014($sp) -/* 0010C 8087826C 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00110 80878270 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810 -/* 00114 80878274 0C00FB56 */ jal DynaPolyInfo_Free - ## DynaPolyInfo_delReserve -/* 00118 80878278 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C -/* 0011C 8087827C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00120 80878280 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00124 80878284 03E00008 */ jr $ra -/* 00128 80878288 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Draw.s deleted file mode 100644 index bbc1eb91aa..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Draw.s +++ /dev/null @@ -1,54 +0,0 @@ -glabel BgGateShutter_Draw -/* 00360 808784C0 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 00364 808784C4 AFBF001C */ sw $ra, 0x001C($sp) -/* 00368 808784C8 AFB00018 */ sw $s0, 0x0018($sp) -/* 0036C 808784CC AFA40040 */ sw $a0, 0x0040($sp) -/* 00370 808784D0 AFA50044 */ sw $a1, 0x0044($sp) -/* 00374 808784D4 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 00378 808784D8 3C068088 */ lui $a2, %hi(D_808785E0) ## $a2 = 80880000 -/* 0037C 808784DC 24C685E0 */ addiu $a2, $a2, %lo(D_808785E0) ## $a2 = 808785E0 -/* 00380 808784E0 27A4002C */ addiu $a0, $sp, 0x002C ## $a0 = FFFFFFEC -/* 00384 808784E4 24070143 */ addiu $a3, $zero, 0x0143 ## $a3 = 00000143 -/* 00388 808784E8 0C031AB1 */ jal func_800C6AC4 -/* 0038C 808784EC 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 00390 808784F0 8FAF0044 */ lw $t7, 0x0044($sp) -/* 00394 808784F4 0C024F46 */ jal func_80093D18 -/* 00398 808784F8 8DE40000 */ lw $a0, 0x0000($t7) ## 00000000 -/* 0039C 808784FC 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 003A0 80878500 3C19DA38 */ lui $t9, 0xDA38 ## $t9 = DA380000 -/* 003A4 80878504 37390003 */ ori $t9, $t9, 0x0003 ## $t9 = DA380003 -/* 003A8 80878508 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008 -/* 003AC 8087850C AE1802C0 */ sw $t8, 0x02C0($s0) ## 000002C0 -/* 003B0 80878510 AC590000 */ sw $t9, 0x0000($v0) ## 00000000 -/* 003B4 80878514 8FA80044 */ lw $t0, 0x0044($sp) -/* 003B8 80878518 3C058088 */ lui $a1, %hi(D_808785F8) ## $a1 = 80880000 -/* 003BC 8087851C 24A585F8 */ addiu $a1, $a1, %lo(D_808785F8) ## $a1 = 808785F8 -/* 003C0 80878520 8D040000 */ lw $a0, 0x0000($t0) ## 00000000 -/* 003C4 80878524 24060148 */ addiu $a2, $zero, 0x0148 ## $a2 = 00000148 -/* 003C8 80878528 0C0346A2 */ jal Matrix_NewMtx -/* 003CC 8087852C AFA20028 */ sw $v0, 0x0028($sp) -/* 003D0 80878530 8FA30028 */ lw $v1, 0x0028($sp) -/* 003D4 80878534 3C0B0600 */ lui $t3, 0x0600 ## $t3 = 06000000 -/* 003D8 80878538 256B1CD0 */ addiu $t3, $t3, 0x1CD0 ## $t3 = 06001CD0 -/* 003DC 8087853C AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 003E0 80878540 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 003E4 80878544 3C0ADE00 */ lui $t2, 0xDE00 ## $t2 = DE000000 -/* 003E8 80878548 3C068088 */ lui $a2, %hi(D_80878610) ## $a2 = 80880000 -/* 003EC 8087854C 24490008 */ addiu $t1, $v0, 0x0008 ## $t1 = 00000008 -/* 003F0 80878550 AE0902C0 */ sw $t1, 0x02C0($s0) ## 000002C0 -/* 003F4 80878554 AC4B0004 */ sw $t3, 0x0004($v0) ## 00000004 -/* 003F8 80878558 AC4A0000 */ sw $t2, 0x0000($v0) ## 00000000 -/* 003FC 8087855C 8FAC0044 */ lw $t4, 0x0044($sp) -/* 00400 80878560 24C68610 */ addiu $a2, $a2, %lo(D_80878610) ## $a2 = 80878610 -/* 00404 80878564 27A4002C */ addiu $a0, $sp, 0x002C ## $a0 = FFFFFFEC -/* 00408 80878568 2407014D */ addiu $a3, $zero, 0x014D ## $a3 = 0000014D -/* 0040C 8087856C 0C031AD5 */ jal func_800C6B54 -/* 00410 80878570 8D850000 */ lw $a1, 0x0000($t4) ## 00000000 -/* 00414 80878574 8FBF001C */ lw $ra, 0x001C($sp) -/* 00418 80878578 8FB00018 */ lw $s0, 0x0018($sp) -/* 0041C 8087857C 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 00420 80878580 03E00008 */ jr $ra -/* 00424 80878584 00000000 */ nop -/* 00428 80878588 00000000 */ nop -/* 0042C 8087858C 00000000 */ nop - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Init.s deleted file mode 100644 index 314c0cf2a9..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Init.s +++ /dev/null @@ -1,74 +0,0 @@ -glabel BgGateShutter_Init -/* 00000 80878160 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 00004 80878164 AFBF001C */ sw $ra, 0x001C($sp) -/* 00008 80878168 AFB00018 */ sw $s0, 0x0018($sp) -/* 0000C 8087816C AFA50034 */ sw $a1, 0x0034($sp) -/* 00010 80878170 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00014 80878174 AFA00020 */ sw $zero, 0x0020($sp) -/* 00018 80878178 0C010D20 */ jal DynaPolyInfo_SetActorMove - -/* 0001C 8087817C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00020 80878180 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 00024 80878184 24841DA8 */ addiu $a0, $a0, 0x1DA8 ## $a0 = 06001DA8 -/* 00028 80878188 0C010620 */ jal DynaPolyInfo_Alloc - -/* 0002C 8087818C 27A50020 */ addiu $a1, $sp, 0x0020 ## $a1 = FFFFFFF0 -/* 00030 80878190 8FA40034 */ lw $a0, 0x0034($sp) -/* 00034 80878194 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00038 80878198 8FA70020 */ lw $a3, 0x0020($sp) -/* 0003C 8087819C 0C00FA9D */ jal DynaPolyInfo_RegisterActor - ## DynaPolyInfo_setActor -/* 00040 808781A0 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 00044 808781A4 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 00048 808781A8 C6060028 */ lwc1 $f6, 0x0028($s0) ## 00000028 -/* 0004C 808781AC C608002C */ lwc1 $f8, 0x002C($s0) ## 0000002C -/* 00050 808781B0 3C038016 */ lui $v1, 0x8016 ## $v1 = 80160000 -/* 00054 808781B4 2463E660 */ addiu $v1, $v1, 0xE660 ## $v1 = 8015E660 -/* 00058 808781B8 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 0005C 808781BC E604016C */ swc1 $f4, 0x016C($s0) ## 0000016C -/* 00060 808781C0 E6060170 */ swc1 $f6, 0x0170($s0) ## 00000170 -/* 00064 808781C4 E6080174 */ swc1 $f8, 0x0174($s0) ## 00000174 -/* 00068 808781C8 946E0F06 */ lhu $t6, 0x0F06($v1) ## 8015F566 -/* 0006C 808781CC 8FA80034 */ lw $t0, 0x0034($sp) -/* 00070 808781D0 31CF0040 */ andi $t7, $t6, 0x0040 ## $t7 = 00000000 -/* 00074 808781D4 55E00006 */ bnel $t7, $zero, .L808781F0 -/* 00078 808781D8 850900A4 */ lh $t1, 0x00A4($t0) ## 000000A4 -/* 0007C 808781DC 94780EDC */ lhu $t8, 0x0EDC($v1) ## 8015F53C -/* 00080 808781E0 33190020 */ andi $t9, $t8, 0x0020 ## $t9 = 00000000 -/* 00084 808781E4 5320000B */ beql $t9, $zero, .L80878214 -/* 00088 808781E8 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 0008C 808781EC 850900A4 */ lh $t1, 0x00A4($t0) ## 000000A4 -.L808781F0: -/* 00090 808781F0 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -/* 00094 808781F4 15210006 */ bne $t1, $at, .L80878210 -/* 00098 808781F8 3C01C2B2 */ lui $at, 0xC2B2 ## $at = C2B20000 -/* 0009C 808781FC 44815000 */ mtc1 $at, $f10 ## $f10 = -89.00 -/* 000A0 80878200 3C018088 */ lui $at, %hi(D_80878628) ## $at = 80880000 -/* 000A4 80878204 E60A0024 */ swc1 $f10, 0x0024($s0) ## 00000024 -/* 000A8 80878208 C4308628 */ lwc1 $f16, %lo(D_80878628)($at) -/* 000AC 8087820C E610002C */ swc1 $f16, 0x002C($s0) ## 0000002C -.L80878210: -/* 000B0 80878210 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -.L80878214: -/* 000B4 80878214 44810000 */ mtc1 $at, $f0 ## $f0 = 1.00 -/* 000B8 80878218 3C048088 */ lui $a0, %hi(D_808785B0) ## $a0 = 80880000 -/* 000BC 8087821C 248485B0 */ addiu $a0, $a0, %lo(D_808785B0) ## $a0 = 808785B0 -/* 000C0 80878220 E6000050 */ swc1 $f0, 0x0050($s0) ## 00000050 -/* 000C4 80878224 E6000054 */ swc1 $f0, 0x0054($s0) ## 00000054 -/* 000C8 80878228 0C00084C */ jal osSyncPrintf - -/* 000CC 8087822C E6000058 */ swc1 $f0, 0x0058($s0) ## 00000058 -/* 000D0 80878230 3C048088 */ lui $a0, %hi(D_808785B4) ## $a0 = 80880000 -/* 000D4 80878234 0C00084C */ jal osSyncPrintf - -/* 000D8 80878238 248485B4 */ addiu $a0, $a0, %lo(D_808785B4) ## $a0 = 808785B4 -/* 000DC 8087823C 3C0A8088 */ lui $t2, %hi(func_8087828C) ## $t2 = 80880000 -/* 000E0 80878240 254A828C */ addiu $t2, $t2, %lo(func_8087828C) ## $t2 = 8087828C -/* 000E4 80878244 AE0A0164 */ sw $t2, 0x0164($s0) ## 00000164 -/* 000E8 80878248 8FBF001C */ lw $ra, 0x001C($sp) -/* 000EC 8087824C 8FB00018 */ lw $s0, 0x0018($sp) -/* 000F0 80878250 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 000F4 80878254 03E00008 */ jr $ra -/* 000F8 80878258 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Update.s deleted file mode 100644 index 935caa05c2..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Update.s +++ /dev/null @@ -1,17 +0,0 @@ -glabel BgGateShutter_Update -/* 0032C 8087848C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00330 80878490 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00334 80878494 84820178 */ lh $v0, 0x0178($a0) ## 00000178 -/* 00338 80878498 10400002 */ beq $v0, $zero, .L808784A4 -/* 0033C 8087849C 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 00340 808784A0 A48E0178 */ sh $t6, 0x0178($a0) ## 00000178 -.L808784A4: -/* 00344 808784A4 8C990164 */ lw $t9, 0x0164($a0) ## 00000164 -/* 00348 808784A8 0320F809 */ jalr $ra, $t9 -/* 0034C 808784AC 00000000 */ nop -/* 00350 808784B0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00354 808784B4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00358 808784B8 03E00008 */ jr $ra -/* 0035C 808784BC 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_8087828C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_8087828C.s deleted file mode 100644 index 297619a72e..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_8087828C.s +++ /dev/null @@ -1,35 +0,0 @@ -glabel func_8087828C -/* 0012C 8087828C AFA50004 */ sw $a1, 0x0004($sp) -/* 00130 80878290 84820168 */ lh $v0, 0x0168($a0) ## 00000168 -/* 00134 80878294 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 00138 80878298 3C0E8016 */ lui $t6, 0x8016 ## $t6 = 80160000 -/* 0013C 8087829C 1441000B */ bne $v0, $at, .L808782CC -/* 00140 808782A0 24030002 */ addiu $v1, $zero, 0x0002 ## $v1 = 00000002 -/* 00144 808782A4 95CEF566 */ lhu $t6, -0x0A9A($t6) ## 8015F566 -/* 00148 808782A8 3C188088 */ lui $t8, %hi(func_80878300) ## $t8 = 80880000 -/* 0014C 808782AC 27188300 */ addiu $t8, $t8, %lo(func_80878300) ## $t8 = 80878300 -/* 00150 808782B0 31CF0040 */ andi $t7, $t6, 0x0040 ## $t7 = 00000000 -/* 00154 808782B4 15E00005 */ bne $t7, $zero, .L808782CC -/* 00158 808782B8 00000000 */ nop -/* 0015C 808782BC 24030002 */ addiu $v1, $zero, 0x0002 ## $v1 = 00000002 -/* 00160 808782C0 A4830178 */ sh $v1, 0x0178($a0) ## 00000178 -/* 00164 808782C4 03E00008 */ jr $ra -/* 00168 808782C8 AC980164 */ sw $t8, 0x0164($a0) ## 00000164 -.L808782CC: -/* 0016C 808782CC 14620005 */ bne $v1, $v0, .L808782E4 -/* 00170 808782D0 3C198088 */ lui $t9, %hi(func_80878300) ## $t9 = 80880000 -/* 00174 808782D4 27398300 */ addiu $t9, $t9, %lo(func_80878300) ## $t9 = 80878300 -/* 00178 808782D8 A4830178 */ sh $v1, 0x0178($a0) ## 00000178 -/* 0017C 808782DC 03E00008 */ jr $ra -/* 00180 808782E0 AC990164 */ sw $t9, 0x0164($a0) ## 00000164 -.L808782E4: -/* 00184 808782E4 04410004 */ bgez $v0, .L808782F8 -/* 00188 808782E8 3C088088 */ lui $t0, %hi(func_808783D4) ## $t0 = 80880000 -/* 0018C 808782EC 250883D4 */ addiu $t0, $t0, %lo(func_808783D4) ## $t0 = 808783D4 -/* 00190 808782F0 A4830178 */ sh $v1, 0x0178($a0) ## 00000178 -/* 00194 808782F4 AC880164 */ sw $t0, 0x0164($a0) ## 00000164 -.L808782F8: -/* 00198 808782F8 03E00008 */ jr $ra -/* 0019C 808782FC 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_80878300.s b/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_80878300.s deleted file mode 100644 index dcc9629abf..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_80878300.s +++ /dev/null @@ -1,50 +0,0 @@ -glabel func_80878300 -/* 001A0 80878300 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 001A4 80878304 AFBF001C */ sw $ra, 0x001C($sp) -/* 001A8 80878308 AFB00018 */ sw $s0, 0x0018($sp) -/* 001AC 8087830C AFA50024 */ sw $a1, 0x0024($sp) -/* 001B0 80878310 848E0178 */ lh $t6, 0x0178($a0) ## 00000178 -/* 001B4 80878314 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 001B8 80878318 55C00020 */ bnel $t6, $zero, .L8087839C -/* 001BC 8087831C 8FBF001C */ lw $ra, 0x001C($sp) -/* 001C0 80878320 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 001C4 80878324 24052067 */ addiu $a1, $zero, 0x2067 ## $a1 = 00002067 -/* 001C8 80878328 3C014000 */ lui $at, 0x4000 ## $at = 40000000 -/* 001CC 8087832C 44813000 */ mtc1 $at, $f6 ## $f6 = 2.00 -/* 001D0 80878330 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 001D4 80878334 3C05C4AB */ lui $a1, 0xC4AB ## $a1 = C4AB0000 -/* 001D8 80878338 3C063F4C */ lui $a2, 0x3F4C ## $a2 = 3F4C0000 -/* 001DC 8087833C 46062201 */ sub.s $f8, $f4, $f6 -/* 001E0 80878340 3C073E99 */ lui $a3, 0x3E99 ## $a3 = 3E990000 -/* 001E4 80878344 34E7999A */ ori $a3, $a3, 0x999A ## $a3 = 3E99999A -/* 001E8 80878348 34C6CCCD */ ori $a2, $a2, 0xCCCD ## $a2 = 3F4CCCCD -/* 001EC 8087834C E6080024 */ swc1 $f8, 0x0024($s0) ## 00000024 -/* 001F0 80878350 34A5E000 */ ori $a1, $a1, 0xE000 ## $a1 = C4ABE000 -/* 001F4 80878354 0C01E107 */ jal Math_SmoothScaleMaxF - -/* 001F8 80878358 2604002C */ addiu $a0, $s0, 0x002C ## $a0 = 0000002C -/* 001FC 8087835C 3C01C2B2 */ lui $at, 0xC2B2 ## $at = C2B20000 -/* 00200 80878360 44818000 */ mtc1 $at, $f16 ## $f16 = -89.00 -/* 00204 80878364 C60A0024 */ lwc1 $f10, 0x0024($s0) ## 00000024 -/* 00208 80878368 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0020C 8087836C 4610503C */ c.lt.s $f10, $f16 -/* 00210 80878370 00000000 */ nop -/* 00214 80878374 45020009 */ bc1fl .L8087839C -/* 00218 80878378 8FBF001C */ lw $ra, 0x001C($sp) -/* 0021C 8087837C 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 00220 80878380 2405280E */ addiu $a1, $zero, 0x280E ## $a1 = 0000280E -/* 00224 80878384 3C188088 */ lui $t8, %hi(func_808783AC) ## $t8 = 80880000 -/* 00228 80878388 240F001E */ addiu $t7, $zero, 0x001E ## $t7 = 0000001E -/* 0022C 8087838C 271883AC */ addiu $t8, $t8, %lo(func_808783AC) ## $t8 = 808783AC -/* 00230 80878390 A60F0178 */ sh $t7, 0x0178($s0) ## 00000178 -/* 00234 80878394 AE180164 */ sw $t8, 0x0164($s0) ## 00000164 -/* 00238 80878398 8FBF001C */ lw $ra, 0x001C($sp) -.L8087839C: -/* 0023C 8087839C 8FB00018 */ lw $s0, 0x0018($sp) -/* 00240 808783A0 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00244 808783A4 03E00008 */ jr $ra -/* 00248 808783A8 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783AC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783AC.s deleted file mode 100644 index 375c43f2dd..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783AC.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel func_808783AC -/* 0024C 808783AC AFA50004 */ sw $a1, 0x0004($sp) -/* 00250 808783B0 848E0178 */ lh $t6, 0x0178($a0) ## 00000178 -/* 00254 808783B4 3C0F8088 */ lui $t7, %hi(func_8087828C) ## $t7 = 80880000 -/* 00258 808783B8 25EF828C */ addiu $t7, $t7, %lo(func_8087828C) ## $t7 = 8087828C -/* 0025C 808783BC 15C00003 */ bne $t6, $zero, .L808783CC -/* 00260 808783C0 00000000 */ nop -/* 00264 808783C4 A4800168 */ sh $zero, 0x0168($a0) ## 00000168 -/* 00268 808783C8 AC8F0164 */ sw $t7, 0x0164($a0) ## 00000164 -.L808783CC: -/* 0026C 808783CC 03E00008 */ jr $ra -/* 00270 808783D0 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783D4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783D4.s deleted file mode 100644 index 838cb21690..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783D4.s +++ /dev/null @@ -1,53 +0,0 @@ -glabel func_808783D4 -/* 00274 808783D4 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00278 808783D8 AFBF001C */ sw $ra, 0x001C($sp) -/* 0027C 808783DC AFB00018 */ sw $s0, 0x0018($sp) -/* 00280 808783E0 AFA50024 */ sw $a1, 0x0024($sp) -/* 00284 808783E4 848E0178 */ lh $t6, 0x0178($a0) ## 00000178 -/* 00288 808783E8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0028C 808783EC 55C00023 */ bnel $t6, $zero, .L8087847C -/* 00290 808783F0 8FBF001C */ lw $ra, 0x001C($sp) -/* 00294 808783F4 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 00298 808783F8 24052067 */ addiu $a1, $zero, 0x2067 ## $a1 = 00002067 -/* 0029C 808783FC 3C014000 */ lui $at, 0x4000 ## $at = 40000000 -/* 002A0 80878400 44813000 */ mtc1 $at, $f6 ## $f6 = 2.00 -/* 002A4 80878404 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 002A8 80878408 3C05C4A8 */ lui $a1, 0xC4A8 ## $a1 = C4A80000 -/* 002AC 8087840C 3C063F4C */ lui $a2, 0x3F4C ## $a2 = 3F4C0000 -/* 002B0 80878410 46062200 */ add.s $f8, $f4, $f6 -/* 002B4 80878414 3C073E99 */ lui $a3, 0x3E99 ## $a3 = 3E990000 -/* 002B8 80878418 34E7999A */ ori $a3, $a3, 0x999A ## $a3 = 3E99999A -/* 002BC 8087841C 34C6CCCD */ ori $a2, $a2, 0xCCCD ## $a2 = 3F4CCCCD -/* 002C0 80878420 E6080024 */ swc1 $f8, 0x0024($s0) ## 00000024 -/* 002C4 80878424 34A5C000 */ ori $a1, $a1, 0xC000 ## $a1 = C4A8C000 -/* 002C8 80878428 0C01E107 */ jal Math_SmoothScaleMaxF - -/* 002CC 8087842C 2604002C */ addiu $a0, $s0, 0x002C ## $a0 = 0000002C -/* 002D0 80878430 3C0142B4 */ lui $at, 0x42B4 ## $at = 42B40000 -/* 002D4 80878434 44815000 */ mtc1 $at, $f10 ## $f10 = 90.00 -/* 002D8 80878438 C6100024 */ lwc1 $f16, 0x0024($s0) ## 00000024 -/* 002DC 8087843C 3C0142B6 */ lui $at, 0x42B6 ## $at = 42B60000 -/* 002E0 80878440 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002E4 80878444 4610503C */ c.lt.s $f10, $f16 -/* 002E8 80878448 00000000 */ nop -/* 002EC 8087844C 4502000B */ bc1fl .L8087847C -/* 002F0 80878450 8FBF001C */ lw $ra, 0x001C($sp) -/* 002F4 80878454 44819000 */ mtc1 $at, $f18 ## $f18 = 91.00 -/* 002F8 80878458 2405280E */ addiu $a1, $zero, 0x280E ## $a1 = 0000280E -/* 002FC 8087845C 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 00300 80878460 E6120024 */ swc1 $f18, 0x0024($s0) ## 00000024 -/* 00304 80878464 3C188088 */ lui $t8, %hi(func_808783AC) ## $t8 = 80880000 -/* 00308 80878468 240F001E */ addiu $t7, $zero, 0x001E ## $t7 = 0000001E -/* 0030C 8087846C 271883AC */ addiu $t8, $t8, %lo(func_808783AC) ## $t8 = 808783AC -/* 00310 80878470 A60F0178 */ sh $t7, 0x0178($s0) ## 00000178 -/* 00314 80878474 AE180164 */ sw $t8, 0x0164($s0) ## 00000164 -/* 00318 80878478 8FBF001C */ lw $ra, 0x001C($sp) -.L8087847C: -/* 0031C 8087847C 8FB00018 */ lw $s0, 0x0018($sp) -/* 00320 80878480 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00324 80878484 03E00008 */ jr $ra -/* 00328 80878488 00000000 */ nop - - diff --git a/data/overlays/actors/z_bg_gate_shutter.data.s b/data/overlays/actors/z_bg_gate_shutter.data.s deleted file mode 100644 index ad3a0bc524..0000000000 --- a/data/overlays/actors/z_bg_gate_shutter.data.s +++ /dev/null @@ -1,16 +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_Gate_Shutter_InitVars - .word 0x01000700, 0x00000000, 0x01810000, 0x0000017C -.word BgGateShutter_Init -.word BgGateShutter_Destroy -.word BgGateShutter_Update -.word BgGateShutter_Draw - diff --git a/data/overlays/actors/z_bg_gate_shutter.reloc.s b/data/overlays/actors/z_bg_gate_shutter.reloc.s deleted file mode 100644 index 791f19b2db..0000000000 --- a/data/overlays/actors/z_bg_gate_shutter.reloc.s +++ /dev/null @@ -1,11 +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_80878630 - -.incbin "baserom/ovl_Bg_Gate_Shutter", 0x4D0, 0x00000090 diff --git a/data/overlays/actors/z_bg_gate_shutter.rodata.s b/data/overlays/actors/z_bg_gate_shutter.rodata.s deleted file mode 100644 index dfbe7fefd7..0000000000 --- a/data/overlays/actors/z_bg_gate_shutter.rodata.s +++ /dev/null @@ -1,35 +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_808785B0 - .word 0x0A0A0000 -glabel D_808785B4 - - .asciz " ☆☆☆☆☆ 柵でたなぁ ☆☆☆☆☆ \n" - .balign 4 - -glabel D_808785E0 - - .asciz "../z_bg_gate_shutter.c" - .balign 4 - -glabel D_808785F8 - - .asciz "../z_bg_gate_shutter.c" - .balign 4 - -glabel D_80878610 - - .asciz "../z_bg_gate_shutter.c" - .balign 4 - -glabel D_80878628 - .word 0xC4ABE000, 0x00000000 - - diff --git a/spec b/spec index 7cc90e17c2..1c5e4ba705 100644 --- a/spec +++ b/spec @@ -788,9 +788,7 @@ endseg beginseg name "ovl_Bg_Gate_Shutter" include "build/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.o" - include "build/data/overlays/actors/z_bg_gate_shutter.data.o" - include "build/data/overlays/actors/z_bg_gate_shutter.rodata.o" - include "build/data/overlays/actors/z_bg_gate_shutter.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index baa83eb800..89d663788e 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -1,14 +1,26 @@ +/* + * File: z_bg_gate_shutter.c + * Overlay: Bg_Gate_Shutter + * Description: +*/ + #include "z_bg_gate_shutter.h" +#include + #define ROOM 0x00 #define FLAGS 0x00000000 -void BgGateShutter_Init(BgGateShutter* this, GlobalContext* globalCtx); -void BgGateShutter_Destroy(BgGateShutter* this, GlobalContext* globalCtx); -void BgGateShutter_Update(BgGateShutter* this, GlobalContext* globalCtx); -void BgGateShutter_Draw(BgGateShutter* this, GlobalContext* globalCtx); +static void BgGateShutter_Init(BgGateShutter* this, GlobalContext* globalCtx); +static void BgGateShutter_Destroy(BgGateShutter* this, GlobalContext* globalCtx); +static void BgGateShutter_Update(BgGateShutter* this, GlobalContext* globalCtx); +static void BgGateShutter_Draw(BgGateShutter* this, GlobalContext* globalCtx); + +static void func_8087828C(BgGateShutter* this, GlobalContext* globalCtx); +static void func_80878300(BgGateShutter* this, GlobalContext* globalCtx); +static void func_808783AC(BgGateShutter* this, GlobalContext* globalCtx); +static void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx); -/* const ActorInit Bg_Gate_Shutter_InitVars = { ACTOR_BG_GATE_SHUTTER, @@ -22,19 +34,113 @@ const ActorInit Bg_Gate_Shutter_InitVars = (ActorFunc)BgGateShutter_Update, (ActorFunc)BgGateShutter_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Destroy.s") +extern UNK_PTR D_06001CD0; +extern UNK_PTR D_06001DA8; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_8087828C.s") +static void BgGateShutter_Init(BgGateShutter* this, GlobalContext* globalCtx) { + s32 pad[2]; + Actor* thisx = &this->dyna.actor; + s32 local_c = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_80878300.s") + DynaPolyInfo_SetActorMove(thisx, 0); + DynaPolyInfo_Alloc(&D_06001DA8, &local_c); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); + this->somePosX = thisx->posRot.pos.x; + this->somePosY = thisx->posRot.pos.y; + this->somePosZ = thisx->posRot.pos.z; + if ((gSaveContext.inf_table[7] & 0x40) || (gSaveContext.event_chk_inf[4] & 0x20)) { + if (globalCtx->sceneNum == SCENE_SPOT01) { + thisx->posRot.pos.x = -89.0f; + thisx->posRot.pos.z = -1375.0f; + } + } + thisx->scale.x = 1.0f; + thisx->scale.y = 1.0f; + thisx->scale.z = 1.0f; + osSyncPrintf("\n\n"); + osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 柵でたなぁ ☆☆☆☆☆ \n" VT_RST); + this->actionFunc = (ActorFunc)func_8087828C; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783AC.s") +static void BgGateShutter_Destroy(BgGateShutter* this, GlobalContext* globalCtx) { + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/func_808783D4.s") +static void func_8087828C(BgGateShutter* this, GlobalContext* globalCtx) { + if (this->unk_168 == 1) { + if (!(gSaveContext.inf_table[7] & 0x40)) { + this->unk_178 = 2; + this->actionFunc = (ActorFunc)func_80878300; + return; + } + } + if (this->unk_168 == 2) { + this->unk_178 = 2; + this->actionFunc = (ActorFunc)func_80878300; + return; + } + if (this->unk_168 < 0) { + this->unk_178 = 2; + this->actionFunc = (ActorFunc)func_808783D4; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Update.s") +static void func_80878300(BgGateShutter* this, GlobalContext* globalCtx) { + Actor* thisx = &this->dyna.actor; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Gate_Shutter/BgGateShutter_Draw.s") + if (this->unk_178 == 0) { + Audio_PlayActorSound2(thisx, 0x2067); + thisx->posRot.pos.x -= 2.0f; + Math_SmoothScaleMaxF(&thisx->posRot.pos.z, -1375.0f, 0.8f, 0.3f); + if (thisx->posRot.pos.x < -89.0f) { + Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); + this->unk_178 = 0x1E; + this->actionFunc = (ActorFunc)func_808783AC; + } + } +} + +static void func_808783AC(BgGateShutter* this, GlobalContext* globalCtx) { + if (this->unk_178 == 0) { + this->unk_168 = 0; + this->actionFunc = (ActorFunc)func_8087828C; + } +} + +static void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx) { + Actor* thisx = &this->dyna.actor; + + if (this->unk_178 == 0) { + Audio_PlayActorSound2(thisx, 0x2067); + thisx->posRot.pos.x += 2.0f; + Math_SmoothScaleMaxF(&thisx->posRot.pos.z, -1350.0f, 0.8f, 0.3f); + if (thisx->posRot.pos.x > 90.0f) { + thisx->posRot.pos.x = 91.0f; + Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); + this->unk_178 = 30; + this->actionFunc = (ActorFunc)func_808783AC; + } + } +} + +static void BgGateShutter_Update(BgGateShutter* this, GlobalContext* globalCtx) { + if (this->unk_178 != 0) { + this->unk_178 -= 1; + } + this->actionFunc(this, globalCtx); +} + +static void BgGateShutter_Draw(BgGateShutter* this, GlobalContext* globalCtx) { + GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; + Gfx* gfxArr[4]; + + func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 323); + func_80093D18(globalCtx->state.gfxCtx); + + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 328), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001CD0); + + func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 333); +} diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h index 0ba1fccc8b..a567112cfc 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h @@ -6,8 +6,15 @@ typedef struct { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x30]; + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ ActorFunc actionFunc; + /* 0x0168 */ s16 unk_168; + /* 0x016A */ char unk_16A[0x2]; + /* 0x016C */ f32 somePosX; + /* 0x0170 */ f32 somePosY; + /* 0x0174 */ f32 somePosZ; + /* 0x0178 */ s16 unk_178; + /* 0x017A */ char unk_17A[0x2]; } BgGateShutter; // size = 0x017C extern const ActorInit Bg_Gate_Shutter_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 1e6763936b..b55bcdce50 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -239,6 +239,10 @@ D_06000B70 = 0x06000B70; // z_effect_ss_extra D_06000DC0 = 0x06000DC0; +// z_bg_gate_shutter +D_06001CD0 = 0x06001CD0; +D_06001DA8 = 0x06001DA8; + // z_bg_gjyo_bridge D_06000600 = 0x06000600; D_06000DB8 = 0x06000DB8; From 0f7cc04f430f0b98b98e51de08a94f2c326ba36e Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 22 Mar 2020 17:57:28 -0400 Subject: [PATCH 19/33] Removed header padding --- src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h index a567112cfc..25275bb107 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h @@ -9,12 +9,10 @@ typedef struct /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; /* 0x0168 */ s16 unk_168; - /* 0x016A */ char unk_16A[0x2]; /* 0x016C */ f32 somePosX; /* 0x0170 */ f32 somePosY; /* 0x0174 */ f32 somePosZ; /* 0x0178 */ s16 unk_178; - /* 0x017A */ char unk_17A[0x2]; } BgGateShutter; // size = 0x017C extern const ActorInit Bg_Gate_Shutter_InitVars; From 6b84b3e2b220a87e5568e9023fce06755e11e6ed Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 22 Mar 2020 19:28:20 -0400 Subject: [PATCH 20/33] +x on format.sh, header brace fix --- format.sh | 0 src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) mode change 100644 => 100755 format.sh diff --git a/format.sh b/format.sh old mode 100644 new mode 100755 diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h index 25275bb107..84c3afb408 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h @@ -4,8 +4,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; /* 0x0168 */ s16 unk_168; From 9408bc077009aec22f444937045641cf5a046fa7 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 22 Mar 2020 19:32:28 -0400 Subject: [PATCH 21/33] clang-format --- .../actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index 2e22057aab..9e5f5f585c 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -2,7 +2,7 @@ * File: z_bg_gate_shutter.c * Overlay: Bg_Gate_Shutter * Description: -*/ + */ #include "z_bg_gate_shutter.h" @@ -21,8 +21,7 @@ static void func_80878300(BgGateShutter* this, GlobalContext* globalCtx); static void func_808783AC(BgGateShutter* this, GlobalContext* globalCtx); static void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx); -const ActorInit Bg_Gate_Shutter_InitVars = -{ +const ActorInit Bg_Gate_Shutter_InitVars = { ACTOR_BG_GATE_SHUTTER, ACTORTYPE_ITEMACTION, ROOM, @@ -141,6 +140,6 @@ static void BgGateShutter_Draw(BgGateShutter* this, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 328), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001CD0); - + func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 333); } From 64b5536ab8344ec9fc6e0a3be53d275743b67087 Mon Sep 17 00:00:00 2001 From: Roman971 Date: Mon, 23 Mar 2020 01:38:25 +0100 Subject: [PATCH 22/33] Fix remaining non matchings --- .../fault_drawer/FaultDrawer_DrawRecImpl.s | 82 ---- .../code/z_actor/TitleCard_Draw.s | 388 ------------------ .../code/z_debug/func_8006376C.s | 52 --- include/z64actor.h | 3 +- src/code/fault_drawer.c | 53 ++- src/code/z_actor.c | 139 ++++--- src/code/z_camera.c | 5 +- src/code/z_debug.c | 24 +- src/code/z_lifemeter.c | 2 +- src/code/z_room.c | 2 +- src/code/z_scene.c | 2 +- 11 files changed, 114 insertions(+), 638 deletions(-) delete mode 100644 asm/non_matchings/code/fault_drawer/FaultDrawer_DrawRecImpl.s delete mode 100644 asm/non_matchings/code/z_actor/TitleCard_Draw.s delete mode 100644 asm/non_matchings/code/z_debug/func_8006376C.s diff --git a/asm/non_matchings/code/fault_drawer/FaultDrawer_DrawRecImpl.s b/asm/non_matchings/code/fault_drawer/FaultDrawer_DrawRecImpl.s deleted file mode 100644 index a0b2f6c39f..0000000000 --- a/asm/non_matchings/code/fault_drawer/FaultDrawer_DrawRecImpl.s +++ /dev/null @@ -1,82 +0,0 @@ -glabel FaultDrawer_DrawRecImpl -/* B4D920 800D6780 3C0EFFFA */ lui $t6, (0xFFFA5A5A >> 16) # lui $t6, 0xfffa -/* B4D924 800D6784 03A07825 */ move $t7, $sp -/* B4D928 800D6788 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* B4D92C 800D678C 35CE5A5A */ ori $t6, (0xFFFA5A5A & 0xFFFF) # ori $t6, $t6, 0x5a5a -.L800D6790: -/* B4D930 800D6790 25EFFFF8 */ addiu $t7, $t7, -8 -/* B4D934 800D6794 ADEE0000 */ sw $t6, ($t7) -/* B4D938 800D6798 15FDFFFD */ bne $t7, $sp, .L800D6790 -/* B4D93C 800D679C ADEE0004 */ sw $t6, 4($t7) -/* B4D940 800D67A0 3C0D8017 */ lui $t5, %hi(sFaultDrawerStruct) # $t5, 0x8017 -/* B4D944 800D67A4 25ADB680 */ addiu $t5, %lo(sFaultDrawerStruct) # addiu $t5, $t5, -0x4980 -/* B4D948 800D67A8 AFBF0014 */ sw $ra, 0x14($sp) -/* B4D94C 800D67AC 95A90004 */ lhu $t1, 4($t5) -/* B4D950 800D67B0 95AE0006 */ lhu $t6, 6($t5) -/* B4D954 800D67B4 00C41823 */ subu $v1, $a2, $a0 -/* B4D958 800D67B8 00E55823 */ subu $t3, $a3, $a1 -/* B4D95C 800D67BC 24630001 */ addiu $v1, $v1, 1 -/* B4D960 800D67C0 256B0001 */ addiu $t3, $t3, 1 -/* B4D964 800D67C4 01241023 */ subu $v0, $t1, $a0 -/* B4D968 800D67C8 00604025 */ move $t0, $v1 -/* B4D96C 800D67CC 01605025 */ move $t2, $t3 -/* B4D970 800D67D0 1840002E */ blez $v0, .L800D688C -/* B4D974 800D67D4 01C56023 */ subu $t4, $t6, $a1 -/* B4D978 800D67D8 1980002C */ blez $t4, .L800D688C -/* B4D97C 800D67DC 0043082A */ slt $at, $v0, $v1 -/* B4D980 800D67E0 50200003 */ beql $at, $zero, .L800D67F0 -/* B4D984 800D67E4 018B082A */ slt $at, $t4, $t3 -/* B4D988 800D67E8 00404025 */ move $t0, $v0 -/* B4D98C 800D67EC 018B082A */ slt $at, $t4, $t3 -.L800D67F0: -/* B4D990 800D67F0 10200002 */ beqz $at, .L800D67FC -/* B4D994 800D67F4 00000000 */ nop -/* B4D998 800D67F8 01805025 */ move $t2, $t4 -.L800D67FC: -/* B4D99C 800D67FC 01250019 */ multu $t1, $a1 -/* B4D9A0 800D6800 8DB90000 */ lw $t9, ($t5) -/* B4D9A4 800D6804 00003825 */ move $a3, $zero -/* B4D9A8 800D6808 00007812 */ mflo $t7 -/* B4D9AC 800D680C 000FC040 */ sll $t8, $t7, 1 -/* B4D9B0 800D6810 00047840 */ sll $t7, $a0, 1 -/* B4D9B4 800D6814 03197021 */ addu $t6, $t8, $t9 -/* B4D9B8 800D6818 1940001A */ blez $t2, .L800D6884 -/* B4D9BC 800D681C 01CF1021 */ addu $v0, $t6, $t7 -/* B4D9C0 800D6820 97A4002A */ lhu $a0, 0x2a($sp) -.L800D6824: -/* B4D9C4 800D6824 19000012 */ blez $t0, .L800D6870 -/* B4D9C8 800D6828 00001825 */ move $v1, $zero -/* B4D9CC 800D682C 31060003 */ andi $a2, $t0, 3 -/* B4D9D0 800D6830 10C00007 */ beqz $a2, .L800D6850 -/* B4D9D4 800D6834 3C098017 */ lui $t1, %hi(sFaultDrawerStruct+4) # $t1, 0x8017 -/* B4D9D8 800D6838 00C02825 */ move $a1, $a2 -.L800D683C: -/* B4D9DC 800D683C 24630001 */ addiu $v1, $v1, 1 -/* B4D9E0 800D6840 A4440000 */ sh $a0, ($v0) -/* B4D9E4 800D6844 14A3FFFD */ bne $a1, $v1, .L800D683C -/* B4D9E8 800D6848 24420002 */ addiu $v0, $v0, 2 -/* B4D9EC 800D684C 10680007 */ beq $v1, $t0, .L800D686C -.L800D6850: -/* B4D9F0 800D6850 24630004 */ addiu $v1, $v1, 4 -/* B4D9F4 800D6854 A4440002 */ sh $a0, 2($v0) -/* B4D9F8 800D6858 A4440004 */ sh $a0, 4($v0) -/* B4D9FC 800D685C A4440006 */ sh $a0, 6($v0) -/* B4DA00 800D6860 24420008 */ addiu $v0, $v0, 8 -/* B4DA04 800D6864 1468FFFA */ bne $v1, $t0, .L800D6850 -/* B4DA08 800D6868 A444FFF8 */ sh $a0, -8($v0) -.L800D686C: -/* B4DA0C 800D686C 9529B684 */ lhu $t1, %lo(sFaultDrawerStruct+4)($t1) -.L800D6870: -/* B4DA10 800D6870 0128C023 */ subu $t8, $t1, $t0 -/* B4DA14 800D6874 24E70001 */ addiu $a3, $a3, 1 -/* B4DA18 800D6878 0018C840 */ sll $t9, $t8, 1 -/* B4DA1C 800D687C 14EAFFE9 */ bne $a3, $t2, .L800D6824 -/* B4DA20 800D6880 00591021 */ addu $v0, $v0, $t9 -.L800D6884: -/* B4DA24 800D6884 0C041924 */ jal osWritebackDCacheAll -/* B4DA28 800D6888 00000000 */ nop -.L800D688C: -/* B4DA2C 800D688C 8FBF0014 */ lw $ra, 0x14($sp) -/* B4DA30 800D6890 27BD0018 */ addiu $sp, $sp, 0x18 -/* B4DA34 800D6894 03E00008 */ jr $ra -/* B4DA38 800D6898 00000000 */ nop \ No newline at end of file diff --git a/asm/non_matchings/code/z_actor/TitleCard_Draw.s b/asm/non_matchings/code/z_actor/TitleCard_Draw.s deleted file mode 100644 index de9f881306..0000000000 --- a/asm/non_matchings/code/z_actor/TitleCard_Draw.s +++ /dev/null @@ -1,388 +0,0 @@ -.rdata -glabel D_80136160 - .asciz "../z_actor.c" - .balign 4 - -glabel D_80136170 - .asciz "../z_actor.c" - .balign 4 - -.text -glabel TitleCard_Draw -/* AA414C 8002CFAC 27BDFF30 */ addiu $sp, $sp, -0xd0 -/* AA4150 8002CFB0 AFBF0014 */ sw $ra, 0x14($sp) -/* AA4154 8002CFB4 AFA400D0 */ sw $a0, 0xd0($sp) -/* AA4158 8002CFB8 AFA500D4 */ sw $a1, 0xd4($sp) -/* AA415C 8002CFBC 84AF000C */ lh $t7, 0xc($a1) -/* AA4160 8002CFC0 3C068013 */ lui $a2, %hi(D_80136160) # $a2, 0x8013 -/* AA4164 8002CFC4 24C66160 */ addiu $a2, %lo(D_80136160) # addiu $a2, $a2, 0x6160 -/* AA4168 8002CFC8 51E00159 */ beql $t7, $zero, .L8002D530 -/* AA416C 8002CFCC 8FBF0014 */ lw $ra, 0x14($sp) -/* AA4170 8002CFD0 90AA0008 */ lbu $t2, 8($a1) -/* AA4174 8002CFD4 84B80004 */ lh $t8, 4($a1) -/* AA4178 8002CFD8 90A90009 */ lbu $t1, 9($a1) -/* AA417C 8002CFDC 000A1040 */ sll $v0, $t2, 1 -/* AA4180 8002CFE0 0018C880 */ sll $t9, $t8, 2 -/* AA4184 8002CFE4 03227823 */ subu $t7, $t9, $v0 -/* AA4188 8002CFE8 AFAF00C0 */ sw $t7, 0xc0($sp) -/* AA418C 8002CFEC 84B80006 */ lh $t8, 6($a1) -/* AA4190 8002CFF0 00097840 */ sll $t7, $t1, 1 -/* AA4194 8002CFF4 24070B08 */ li $a3, 2824 -/* AA4198 8002CFF8 0018C880 */ sll $t9, $t8, 2 -/* AA419C 8002CFFC 032F7023 */ subu $t6, $t9, $t7 -/* AA41A0 8002D000 AFAE00B8 */ sw $t6, 0xb8($sp) -/* AA41A4 8002D004 8C850000 */ lw $a1, ($a0) -/* AA41A8 8002D008 AFA20038 */ sw $v0, 0x38($sp) -/* AA41AC 8002D00C 27A4009C */ addiu $a0, $sp, 0x9c -/* AA41B0 8002D010 AFAA00CC */ sw $t2, 0xcc($sp) -/* AA41B4 8002D014 AFA900C8 */ sw $t1, 0xc8($sp) -/* AA41B8 8002D018 0C031AB1 */ jal func_800C6AC4 -/* AA41BC 8002D01C AFA500AC */ sw $a1, 0xac($sp) -/* AA41C0 8002D020 8FA900C8 */ lw $t1, 0xc8($sp) -/* AA41C4 8002D024 8FAA00CC */ lw $t2, 0xcc($sp) -/* AA41C8 8002D028 3C198016 */ lui $t9, %hi(gSaveContext+0x1409) # $t9, 0x8016 -/* AA41CC 8002D02C 9339FA69 */ lbu $t9, %lo(gSaveContext+0x1409)($t9) -/* AA41D0 8002D030 01490019 */ multu $t2, $t1 -/* AA41D4 8002D034 8FA800AC */ lw $t0, 0xac($sp) -/* AA41D8 8002D038 8FAB00D4 */ lw $t3, 0xd4($sp) -/* AA41DC 8002D03C 240E1000 */ li $t6, 4096 -/* AA41E0 8002D040 00002812 */ mflo $a1 -/* AA41E4 8002D044 28A11001 */ slti $at, $a1, 0x1001 -/* AA41E8 8002D048 00000000 */ nop -/* AA41EC 8002D04C 00B90019 */ multu $a1, $t9 -/* AA41F0 8002D050 8FB900B8 */ lw $t9, 0xb8($sp) -/* AA41F4 8002D054 00007812 */ mflo $t7 -/* AA41F8 8002D058 AFAF00B0 */ sw $t7, 0xb0($sp) -/* AA41FC 8002D05C 54200011 */ bnezl $at, .L8002D0A4 -/* AA4200 8002D060 0009C080 */ sll $t8, $t1, 2 -/* AA4204 8002D064 01CA001A */ div $zero, $t6, $t2 -/* AA4208 8002D068 00004812 */ mflo $t1 -/* AA420C 8002D06C 15400002 */ bnez $t2, .L8002D078 -/* AA4210 8002D070 00000000 */ nop -/* AA4214 8002D074 0007000D */ break 7 -.L8002D078: -/* AA4218 8002D078 2401FFFF */ li $at, -1 -/* AA421C 8002D07C 15410004 */ bne $t2, $at, .L8002D090 -/* AA4220 8002D080 3C018000 */ lui $at, 0x8000 -/* AA4224 8002D084 15C10002 */ bne $t6, $at, .L8002D090 -/* AA4228 8002D088 00000000 */ nop -/* AA422C 8002D08C 0006000D */ break 6 -.L8002D090: -/* AA4230 8002D090 01490019 */ multu $t2, $t1 -/* AA4234 8002D094 00002812 */ mflo $a1 -/* AA4238 8002D098 00000000 */ nop -/* AA423C 8002D09C 00000000 */ nop -/* AA4240 8002D0A0 0009C080 */ sll $t8, $t1, 2 -.L8002D0A4: -/* AA4244 8002D0A4 03196021 */ addu $t4, $t8, $t9 -/* AA4248 8002D0A8 AFAC00B4 */ sw $t4, 0xb4($sp) -/* AA424C 8002D0AC 8D0402B0 */ lw $a0, 0x2b0($t0) -/* AA4250 8002D0B0 AFAC0030 */ sw $t4, 0x30($sp) -/* AA4254 8002D0B4 AFAA00CC */ sw $t2, 0xcc($sp) -/* AA4258 8002D0B8 AFA900C8 */ sw $t1, 0xc8($sp) -/* AA425C 8002D0BC AFA800AC */ sw $t0, 0xac($sp) -/* AA4260 8002D0C0 0C024E02 */ jal func_80093808 -/* AA4264 8002D0C4 AFA50034 */ sw $a1, 0x34($sp) -/* AA4268 8002D0C8 8FA800AC */ lw $t0, 0xac($sp) -/* AA426C 8002D0CC 8FA50034 */ lw $a1, 0x34($sp) -/* AA4270 8002D0D0 8FAA00CC */ lw $t2, 0xcc($sp) -/* AA4274 8002D0D4 8FAB00D4 */ lw $t3, 0xd4($sp) -/* AA4278 8002D0D8 8FA900C8 */ lw $t1, 0xc8($sp) -/* AA427C 8002D0DC 8FAC0030 */ lw $t4, 0x30($sp) -/* AA4280 8002D0E0 244F0008 */ addiu $t7, $v0, 8 -/* AA4284 8002D0E4 AD0202B0 */ sw $v0, 0x2b0($t0) -/* AA4288 8002D0E8 3C0EFA00 */ lui $t6, 0xfa00 -/* AA428C 8002D0EC AD0F02B0 */ sw $t7, 0x2b0($t0) -/* AA4290 8002D0F0 AC4E0000 */ sw $t6, ($v0) -/* AA4294 8002D0F4 9163000F */ lbu $v1, 0xf($t3) -/* AA4298 8002D0F8 01403825 */ move $a3, $t2 -/* AA429C 8002D0FC 24ED0007 */ addiu $t5, $a3, 7 -/* AA42A0 8002D100 0003C600 */ sll $t8, $v1, 0x18 -/* AA42A4 8002D104 0003CC00 */ sll $t9, $v1, 0x10 -/* AA42A8 8002D108 03197825 */ or $t7, $t8, $t9 -/* AA42AC 8002D10C 00037200 */ sll $t6, $v1, 8 -/* AA42B0 8002D110 01EEC025 */ or $t8, $t7, $t6 -/* AA42B4 8002D114 916F000D */ lbu $t7, 0xd($t3) -/* AA42B8 8002D118 24A30001 */ addiu $v1, $a1, 1 -/* AA42BC 8002D11C 00031843 */ sra $v1, $v1, 1 -/* AA42C0 8002D120 030F7025 */ or $t6, $t8, $t7 -/* AA42C4 8002D124 AC4E0004 */ sw $t6, 4($v0) -/* AA42C8 8002D128 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA42CC 8002D12C 3C18FD70 */ lui $t8, 0xfd70 -/* AA42D0 8002D130 2463FFFF */ addiu $v1, $v1, -1 -/* AA42D4 8002D134 24590008 */ addiu $t9, $v0, 8 -/* AA42D8 8002D138 AD1902B0 */ sw $t9, 0x2b0($t0) -/* AA42DC 8002D13C AC580000 */ sw $t8, ($v0) -/* AA42E0 8002D140 8FAE00B0 */ lw $t6, 0xb0($sp) -/* AA42E4 8002D144 8D6F0000 */ lw $t7, ($t3) -/* AA42E8 8002D148 000D68C3 */ sra $t5, $t5, 3 -/* AA42EC 8002D14C 31AD01FF */ andi $t5, $t5, 0x1ff -/* AA42F0 8002D150 01EEC821 */ addu $t9, $t7, $t6 -/* AA42F4 8002D154 AC590004 */ sw $t9, 4($v0) -/* AA42F8 8002D158 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA42FC 8002D15C 3C0E0700 */ lui $t6, 0x700 -/* AA4300 8002D160 3C0FF570 */ lui $t7, 0xf570 -/* AA4304 8002D164 24580008 */ addiu $t8, $v0, 8 -/* AA4308 8002D168 AD1802B0 */ sw $t8, 0x2b0($t0) -/* AA430C 8002D16C AC4E0004 */ sw $t6, 4($v0) -/* AA4310 8002D170 AC4F0000 */ sw $t7, ($v0) -/* AA4314 8002D174 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA4318 8002D178 3C18E600 */ lui $t8, 0xe600 -/* AA431C 8002D17C 3C0EF300 */ lui $t6, 0xf300 -/* AA4320 8002D180 24590008 */ addiu $t9, $v0, 8 -/* AA4324 8002D184 AD1902B0 */ sw $t9, 0x2b0($t0) -/* AA4328 8002D188 AC400004 */ sw $zero, 4($v0) -/* AA432C 8002D18C AC580000 */ sw $t8, ($v0) -/* AA4330 8002D190 8D0602B0 */ lw $a2, 0x2b0($t0) -/* AA4334 8002D194 286107FF */ slti $at, $v1, 0x7ff -/* AA4338 8002D198 000D6A40 */ sll $t5, $t5, 9 -/* AA433C 8002D19C 24CF0008 */ addiu $t7, $a2, 8 -/* AA4340 8002D1A0 AD0F02B0 */ sw $t7, 0x2b0($t0) -/* AA4344 8002D1A4 10200003 */ beqz $at, .L8002D1B4 -/* AA4348 8002D1A8 ACCE0000 */ sw $t6, ($a2) -/* AA434C 8002D1AC 10000002 */ b .L8002D1B8 -/* AA4350 8002D1B0 00602025 */ move $a0, $v1 -.L8002D1B4: -/* AA4354 8002D1B4 240407FF */ li $a0, 2047 -.L8002D1B8: -/* AA4358 8002D1B8 04E10003 */ bgez $a3, .L8002D1C8 -/* AA435C 8002D1BC 000728C3 */ sra $a1, $a3, 3 -/* AA4360 8002D1C0 24E10007 */ addiu $at, $a3, 7 -/* AA4364 8002D1C4 000128C3 */ sra $a1, $at, 3 -.L8002D1C8: -/* AA4368 8002D1C8 1CA00003 */ bgtz $a1, .L8002D1D8 -/* AA436C 8002D1CC 2547FFFF */ addiu $a3, $t2, -1 -/* AA4370 8002D1D0 10000002 */ b .L8002D1DC -/* AA4374 8002D1D4 24030001 */ li $v1, 1 -.L8002D1D8: -/* AA4378 8002D1D8 00A01825 */ move $v1, $a1 -.L8002D1DC: -/* AA437C 8002D1DC 1CA00003 */ bgtz $a1, .L8002D1EC -/* AA4380 8002D1E0 247907FF */ addiu $t9, $v1, 0x7ff -/* AA4384 8002D1E4 10000002 */ b .L8002D1F0 -/* AA4388 8002D1E8 24020001 */ li $v0, 1 -.L8002D1EC: -/* AA438C 8002D1EC 00A01025 */ move $v0, $a1 -.L8002D1F0: -/* AA4390 8002D1F0 0322001A */ div $zero, $t9, $v0 -/* AA4394 8002D1F4 14400002 */ bnez $v0, .L8002D200 -/* AA4398 8002D1F8 00000000 */ nop -/* AA439C 8002D1FC 0007000D */ break 7 -.L8002D200: -/* AA43A0 8002D200 2401FFFF */ li $at, -1 -/* AA43A4 8002D204 14410004 */ bne $v0, $at, .L8002D218 -/* AA43A8 8002D208 3C018000 */ lui $at, 0x8000 -/* AA43AC 8002D20C 17210002 */ bne $t9, $at, .L8002D218 -/* AA43B0 8002D210 00000000 */ nop -/* AA43B4 8002D214 0006000D */ break 6 -.L8002D218: -/* AA43B8 8002D218 0000C012 */ mflo $t8 -/* AA43BC 8002D21C 330F0FFF */ andi $t7, $t8, 0xfff -/* AA43C0 8002D220 3C010700 */ lui $at, 0x700 -/* AA43C4 8002D224 30990FFF */ andi $t9, $a0, 0xfff -/* AA43C8 8002D228 0019C300 */ sll $t8, $t9, 0xc -/* AA43CC 8002D22C 01E17025 */ or $t6, $t7, $at -/* AA43D0 8002D230 01D87825 */ or $t7, $t6, $t8 -/* AA43D4 8002D234 ACCF0004 */ sw $t7, 4($a2) -/* AA43D8 8002D238 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA43DC 8002D23C 3C0EE700 */ lui $t6, 0xe700 -/* AA43E0 8002D240 3C01F568 */ lui $at, 0xf568 -/* AA43E4 8002D244 24590008 */ addiu $t9, $v0, 8 -/* AA43E8 8002D248 AD1902B0 */ sw $t9, 0x2b0($t0) -/* AA43EC 8002D24C AC400004 */ sw $zero, 4($v0) -/* AA43F0 8002D250 AC4E0000 */ sw $t6, ($v0) -/* AA43F4 8002D254 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA43F8 8002D258 01A16825 */ or $t5, $t5, $at -/* AA43FC 8002D25C 252EFFFF */ addiu $t6, $t1, -1 -/* AA4400 8002D260 24580008 */ addiu $t8, $v0, 8 -/* AA4404 8002D264 AD1802B0 */ sw $t8, 0x2b0($t0) -/* AA4408 8002D268 AC400004 */ sw $zero, 4($v0) -/* AA440C 8002D26C AC4D0000 */ sw $t5, ($v0) -/* AA4410 8002D270 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA4414 8002D274 00073880 */ sll $a3, $a3, 2 -/* AA4418 8002D278 30E70FFF */ andi $a3, $a3, 0xfff -/* AA441C 8002D27C 244F0008 */ addiu $t7, $v0, 8 -/* AA4420 8002D280 AD0F02B0 */ sw $t7, 0x2b0($t0) -/* AA4424 8002D284 000EC080 */ sll $t8, $t6, 2 -/* AA4428 8002D288 3C19F200 */ lui $t9, 0xf200 -/* AA442C 8002D28C 330F0FFF */ andi $t7, $t8, 0xfff -/* AA4430 8002D290 00073B00 */ sll $a3, $a3, 0xc -/* AA4434 8002D294 AC590000 */ sw $t9, ($v0) -/* AA4438 8002D298 00EFC825 */ or $t9, $a3, $t7 -/* AA443C 8002D29C AC590004 */ sw $t9, 4($v0) -/* AA4440 8002D2A0 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA4444 8002D2A4 8FA600C0 */ lw $a2, 0xc0($sp) -/* AA4448 8002D2A8 2599FFFF */ addiu $t9, $t4, -1 -/* AA444C 8002D2AC 244E0008 */ addiu $t6, $v0, 8 -/* AA4450 8002D2B0 AD0E02B0 */ sw $t6, 0x2b0($t0) -/* AA4454 8002D2B4 8FB80038 */ lw $t8, 0x38($sp) -/* AA4458 8002D2B8 3C01E400 */ lui $at, 0xe400 -/* AA445C 8002D2BC 332E0FFF */ andi $t6, $t9, 0xfff -/* AA4460 8002D2C0 00187840 */ sll $t7, $t8, 1 -/* AA4464 8002D2C4 01E62021 */ addu $a0, $t7, $a2 -/* AA4468 8002D2C8 2484FFFC */ addiu $a0, $a0, -4 -/* AA446C 8002D2CC 30840FFF */ andi $a0, $a0, 0xfff -/* AA4470 8002D2D0 00042300 */ sll $a0, $a0, 0xc -/* AA4474 8002D2D4 00812025 */ or $a0, $a0, $at -/* AA4478 8002D2D8 008EC025 */ or $t8, $a0, $t6 -/* AA447C 8002D2DC AC580000 */ sw $t8, ($v0) -/* AA4480 8002D2E0 8FAF00B8 */ lw $t7, 0xb8($sp) -/* AA4484 8002D2E4 30DF0FFF */ andi $ra, $a2, 0xfff -/* AA4488 8002D2E8 001FFB00 */ sll $ra, $ra, 0xc -/* AA448C 8002D2EC 31F90FFF */ andi $t9, $t7, 0xfff -/* AA4490 8002D2F0 03F97025 */ or $t6, $ra, $t9 -/* AA4494 8002D2F4 AC4E0004 */ sw $t6, 4($v0) -/* AA4498 8002D2F8 AFA4001C */ sw $a0, 0x1c($sp) -/* AA449C 8002D2FC 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA44A0 8002D300 3C0CE100 */ lui $t4, 0xe100 -/* AA44A4 8002D304 3C0E0400 */ lui $t6, (0x04000400 >> 16) # lui $t6, 0x400 -/* AA44A8 8002D308 24580008 */ addiu $t8, $v0, 8 -/* AA44AC 8002D30C AD1802B0 */ sw $t8, 0x2b0($t0) -/* AA44B0 8002D310 AC400004 */ sw $zero, 4($v0) -/* AA44B4 8002D314 AC4C0000 */ sw $t4, ($v0) -/* AA44B8 8002D318 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA44BC 8002D31C 35CE0400 */ ori $t6, (0x04000400 & 0xFFFF) # ori $t6, $t6, 0x400 -/* AA44C0 8002D320 3C19F100 */ lui $t9, 0xf100 -/* AA44C4 8002D324 244F0008 */ addiu $t7, $v0, 8 -/* AA44C8 8002D328 AD0F02B0 */ sw $t7, 0x2b0($t0) -/* AA44CC 8002D32C AC4E0004 */ sw $t6, 4($v0) -/* AA44D0 8002D330 AC590000 */ sw $t9, ($v0) -/* AA44D4 8002D334 91780009 */ lbu $t8, 9($t3) -/* AA44D8 8002D338 00401825 */ move $v1, $v0 -/* AA44DC 8002D33C 03094823 */ subu $t1, $t8, $t1 -/* AA44E0 8002D340 59200074 */ blezl $t1, .L8002D514 -/* AA44E4 8002D344 8FB800D0 */ lw $t8, 0xd0($sp) -/* AA44E8 8002D348 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA44EC 8002D34C 3C19FD70 */ lui $t9, 0xfd70 -/* AA44F0 8002D350 01490019 */ multu $t2, $t1 -/* AA44F4 8002D354 244F0008 */ addiu $t7, $v0, 8 -/* AA44F8 8002D358 AD0F02B0 */ sw $t7, 0x2b0($t0) -/* AA44FC 8002D35C AC590000 */ sw $t9, ($v0) -/* AA4500 8002D360 8FB800B0 */ lw $t8, 0xb0($sp) -/* AA4504 8002D364 8D6E0000 */ lw $t6, ($t3) -/* AA4508 8002D368 240407FF */ li $a0, 2047 -/* AA450C 8002D36C 01D87821 */ addu $t7, $t6, $t8 -/* AA4510 8002D370 25F91000 */ addiu $t9, $t7, 0x1000 -/* AA4514 8002D374 AC590004 */ sw $t9, 4($v0) -/* AA4518 8002D378 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA451C 8002D37C 3C0F0700 */ lui $t7, 0x700 -/* AA4520 8002D380 3C18F570 */ lui $t8, 0xf570 -/* AA4524 8002D384 244E0008 */ addiu $t6, $v0, 8 -/* AA4528 8002D388 AD0E02B0 */ sw $t6, 0x2b0($t0) -/* AA452C 8002D38C AC4F0004 */ sw $t7, 4($v0) -/* AA4530 8002D390 AC580000 */ sw $t8, ($v0) -/* AA4534 8002D394 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA4538 8002D398 3C0EE600 */ lui $t6, 0xe600 -/* AA453C 8002D39C 00001812 */ mflo $v1 -/* AA4540 8002D3A0 24590008 */ addiu $t9, $v0, 8 -/* AA4544 8002D3A4 AD1902B0 */ sw $t9, 0x2b0($t0) -/* AA4548 8002D3A8 AC400004 */ sw $zero, 4($v0) -/* AA454C 8002D3AC AC4E0000 */ sw $t6, ($v0) -/* AA4550 8002D3B0 8D0602B0 */ lw $a2, 0x2b0($t0) -/* AA4554 8002D3B4 24630001 */ addiu $v1, $v1, 1 -/* AA4558 8002D3B8 00031843 */ sra $v1, $v1, 1 -/* AA455C 8002D3BC 2463FFFF */ addiu $v1, $v1, -1 -/* AA4560 8002D3C0 24D80008 */ addiu $t8, $a2, 8 -/* AA4564 8002D3C4 AD1802B0 */ sw $t8, 0x2b0($t0) -/* AA4568 8002D3C8 286107FF */ slti $at, $v1, 0x7ff -/* AA456C 8002D3CC 3C0FF300 */ lui $t7, 0xf300 -/* AA4570 8002D3D0 10200003 */ beqz $at, .L8002D3E0 -/* AA4574 8002D3D4 ACCF0000 */ sw $t7, ($a2) -/* AA4578 8002D3D8 10000001 */ b .L8002D3E0 -/* AA457C 8002D3DC 00602025 */ move $a0, $v1 -.L8002D3E0: -/* AA4580 8002D3E0 1CA00003 */ bgtz $a1, .L8002D3F0 -/* AA4584 8002D3E4 00A01825 */ move $v1, $a1 -/* AA4588 8002D3E8 10000001 */ b .L8002D3F0 -/* AA458C 8002D3EC 24030001 */ li $v1, 1 -.L8002D3F0: -/* AA4590 8002D3F0 1CA00003 */ bgtz $a1, .L8002D400 -/* AA4594 8002D3F4 247907FF */ addiu $t9, $v1, 0x7ff -/* AA4598 8002D3F8 10000002 */ b .L8002D404 -/* AA459C 8002D3FC 24020001 */ li $v0, 1 -.L8002D400: -/* AA45A0 8002D400 00A01025 */ move $v0, $a1 -.L8002D404: -/* AA45A4 8002D404 0322001A */ div $zero, $t9, $v0 -/* AA45A8 8002D408 14400002 */ bnez $v0, .L8002D414 -/* AA45AC 8002D40C 00000000 */ nop -/* AA45B0 8002D410 0007000D */ break 7 -.L8002D414: -/* AA45B4 8002D414 2401FFFF */ li $at, -1 -/* AA45B8 8002D418 14410004 */ bne $v0, $at, .L8002D42C -/* AA45BC 8002D41C 3C018000 */ lui $at, 0x8000 -/* AA45C0 8002D420 17210002 */ bne $t9, $at, .L8002D42C -/* AA45C4 8002D424 00000000 */ nop -/* AA45C8 8002D428 0006000D */ break 6 -.L8002D42C: -/* AA45CC 8002D42C 00007012 */ mflo $t6 -/* AA45D0 8002D430 31D80FFF */ andi $t8, $t6, 0xfff -/* AA45D4 8002D434 3C010700 */ lui $at, 0x700 -/* AA45D8 8002D438 30990FFF */ andi $t9, $a0, 0xfff -/* AA45DC 8002D43C 00197300 */ sll $t6, $t9, 0xc -/* AA45E0 8002D440 03017825 */ or $t7, $t8, $at -/* AA45E4 8002D444 01EEC025 */ or $t8, $t7, $t6 -/* AA45E8 8002D448 ACD80004 */ sw $t8, 4($a2) -/* AA45EC 8002D44C 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA45F0 8002D450 3C0FE700 */ lui $t7, 0xe700 -/* AA45F4 8002D454 24590008 */ addiu $t9, $v0, 8 -/* AA45F8 8002D458 AD1902B0 */ sw $t9, 0x2b0($t0) -/* AA45FC 8002D45C AC400004 */ sw $zero, 4($v0) -/* AA4600 8002D460 AC4F0000 */ sw $t7, ($v0) -/* AA4604 8002D464 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA4608 8002D468 252FFFFF */ addiu $t7, $t1, -1 -/* AA460C 8002D46C 3C19F200 */ lui $t9, 0xf200 -/* AA4610 8002D470 244E0008 */ addiu $t6, $v0, 8 -/* AA4614 8002D474 AD0E02B0 */ sw $t6, 0x2b0($t0) -/* AA4618 8002D478 AC400004 */ sw $zero, 4($v0) -/* AA461C 8002D47C AC4D0000 */ sw $t5, ($v0) -/* AA4620 8002D480 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA4624 8002D484 000F7080 */ sll $t6, $t7, 2 -/* AA4628 8002D488 24580008 */ addiu $t8, $v0, 8 -/* AA462C 8002D48C AD1802B0 */ sw $t8, 0x2b0($t0) -/* AA4630 8002D490 31D80FFF */ andi $t8, $t6, 0xfff -/* AA4634 8002D494 AC590000 */ sw $t9, ($v0) -/* AA4638 8002D498 00F8C825 */ or $t9, $a3, $t8 -/* AA463C 8002D49C AC590004 */ sw $t9, 4($v0) -/* AA4640 8002D4A0 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA4644 8002D4A4 8FA400B4 */ lw $a0, 0xb4($sp) -/* AA4648 8002D4A8 0009C080 */ sll $t8, $t1, 2 -/* AA464C 8002D4AC 244F0008 */ addiu $t7, $v0, 8 -/* AA4650 8002D4B0 AD0F02B0 */ sw $t7, 0x2b0($t0) -/* AA4654 8002D4B4 0098C821 */ addu $t9, $a0, $t8 -/* AA4658 8002D4B8 8FAE001C */ lw $t6, 0x1c($sp) -/* AA465C 8002D4BC 272FFFFF */ addiu $t7, $t9, -1 -/* AA4660 8002D4C0 31F80FFF */ andi $t8, $t7, 0xfff -/* AA4664 8002D4C4 308F0FFF */ andi $t7, $a0, 0xfff -/* AA4668 8002D4C8 01D8C825 */ or $t9, $t6, $t8 -/* AA466C 8002D4CC 03EF7025 */ or $t6, $ra, $t7 -/* AA4670 8002D4D0 AC4E0004 */ sw $t6, 4($v0) -/* AA4674 8002D4D4 AC590000 */ sw $t9, ($v0) -/* AA4678 8002D4D8 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA467C 8002D4DC 3C0E0400 */ lui $t6, (0x04000400 >> 16) # lui $t6, 0x400 -/* AA4680 8002D4E0 35CE0400 */ ori $t6, (0x04000400 & 0xFFFF) # ori $t6, $t6, 0x400 -/* AA4684 8002D4E4 24580008 */ addiu $t8, $v0, 8 -/* AA4688 8002D4E8 AD1802B0 */ sw $t8, 0x2b0($t0) -/* AA468C 8002D4EC AC400004 */ sw $zero, 4($v0) -/* AA4690 8002D4F0 AC4C0000 */ sw $t4, ($v0) -/* AA4694 8002D4F4 8D0202B0 */ lw $v0, 0x2b0($t0) -/* AA4698 8002D4F8 3C0FF100 */ lui $t7, 0xf100 -/* AA469C 8002D4FC 24590008 */ addiu $t9, $v0, 8 -/* AA46A0 8002D500 AD1902B0 */ sw $t9, 0x2b0($t0) -/* AA46A4 8002D504 AC4E0004 */ sw $t6, 4($v0) -/* AA46A8 8002D508 AC4F0000 */ sw $t7, ($v0) -/* AA46AC 8002D50C 00401825 */ move $v1, $v0 -/* AA46B0 8002D510 8FB800D0 */ lw $t8, 0xd0($sp) -.L8002D514: -/* AA46B4 8002D514 3C068013 */ lui $a2, %hi(D_80136170) # $a2, 0x8013 -/* AA46B8 8002D518 24C66170 */ addiu $a2, %lo(D_80136170) # addiu $a2, $a2, 0x6170 -/* AA46BC 8002D51C 27A4009C */ addiu $a0, $sp, 0x9c -/* AA46C0 8002D520 24070B40 */ li $a3, 2880 -/* AA46C4 8002D524 0C031AD5 */ jal func_800C6B54 -/* AA46C8 8002D528 8F050000 */ lw $a1, ($t8) -/* AA46CC 8002D52C 8FBF0014 */ lw $ra, 0x14($sp) -.L8002D530: -/* AA46D0 8002D530 27BD00D0 */ addiu $sp, $sp, 0xd0 -/* AA46D4 8002D534 03E00008 */ jr $ra -/* AA46D8 8002D538 00000000 */ nop - diff --git a/asm/non_matchings/code/z_debug/func_8006376C.s b/asm/non_matchings/code/z_debug/func_8006376C.s deleted file mode 100644 index d8645d0e1a..0000000000 --- a/asm/non_matchings/code/z_debug/func_8006376C.s +++ /dev/null @@ -1,52 +0,0 @@ -glabel func_8006376C -/* ADA90C 8006376C 3C098012 */ lui $t1, %hi(D_8011E0B0) # $t1, 0x8012 -/* ADA910 80063770 2529E0B0 */ addiu $t1, %lo(D_8011E0B0) # addiu $t1, $t1, -0x1f50 -/* ADA914 80063774 85230000 */ lh $v1, ($t1) -/* ADA918 80063778 27BDFFF8 */ addiu $sp, $sp, -8 -/* ADA91C 8006377C 3C0F8016 */ lui $t7, %hi(D_8015FA98) # $t7, 0x8016 -/* ADA920 80063780 00037080 */ sll $t6, $v1, 2 -/* ADA924 80063784 01C37023 */ subu $t6, $t6, $v1 -/* ADA928 80063788 AFB00004 */ sw $s0, 4($sp) -/* ADA92C 8006378C AFA40008 */ sw $a0, 8($sp) -/* ADA930 80063790 AFA5000C */ sw $a1, 0xc($sp) -/* ADA934 80063794 AFA60010 */ sw $a2, 0x10($sp) -/* ADA938 80063798 000E70C0 */ sll $t6, $t6, 3 -/* ADA93C 8006379C 25EFFA98 */ addiu $t7, %lo(D_8015FA98) # addiu $t7, $t7, -0x568 -/* ADA940 800637A0 28610016 */ slti $at, $v1, 0x16 -/* ADA944 800637A4 30C600FF */ andi $a2, $a2, 0xff -/* ADA948 800637A8 30A500FF */ andi $a1, $a1, 0xff -/* ADA94C 800637AC 308400FF */ andi $a0, $a0, 0xff -/* ADA950 800637B0 00E08025 */ move $s0, $a3 -/* ADA954 800637B4 10200019 */ beqz $at, .L8006381C -/* ADA958 800637B8 01CF1021 */ addu $v0, $t6, $t7 -/* ADA95C 800637BC A0440000 */ sb $a0, ($v0) -/* ADA960 800637C0 A0450001 */ sb $a1, 1($v0) -/* ADA964 800637C4 A0460002 */ sb $a2, 2($v0) -/* ADA968 800637C8 90E70000 */ lbu $a3, ($a3) -/* ADA96C 800637CC 00001825 */ move $v1, $zero -/* ADA970 800637D0 24480004 */ addiu $t0, $v0, 4 -/* ADA974 800637D4 26100001 */ addiu $s0, $s0, 1 -/* ADA978 800637D8 10E0000C */ beqz $a3, .L8006380C -/* ADA97C 800637DC A0470003 */ sb $a3, 3($v0) -.L800637E0: -/* ADA980 800637E0 28620015 */ slti $v0, $v1, 0x15 -/* ADA984 800637E4 24630001 */ addiu $v1, $v1, 1 -/* ADA988 800637E8 00031C00 */ sll $v1, $v1, 0x10 -/* ADA98C 800637EC 38420001 */ xori $v0, $v0, 1 -/* ADA990 800637F0 14400006 */ bnez $v0, .L8006380C -/* ADA994 800637F4 00031C03 */ sra $v1, $v1, 0x10 -/* ADA998 800637F8 92070000 */ lbu $a3, ($s0) -/* ADA99C 800637FC 25080001 */ addiu $t0, $t0, 1 -/* ADA9A0 80063800 26100001 */ addiu $s0, $s0, 1 -/* ADA9A4 80063804 14E0FFF6 */ bnez $a3, .L800637E0 -/* ADA9A8 80063808 A107FFFF */ sb $a3, -1($t0) -.L8006380C: -/* ADA9AC 8006380C A1000000 */ sb $zero, ($t0) -/* ADA9B0 80063810 85380000 */ lh $t8, ($t1) -/* ADA9B4 80063814 27190001 */ addiu $t9, $t8, 1 -/* ADA9B8 80063818 A5390000 */ sh $t9, ($t1) -.L8006381C: -/* ADA9BC 8006381C 8FB00004 */ lw $s0, 4($sp) -/* ADA9C0 80063820 03E00008 */ jr $ra -/* ADA9C4 80063824 27BD0008 */ addiu $sp, $sp, 8 - diff --git a/include/z64actor.h b/include/z64actor.h index 4b986b4d6e..9a18e6d5c4 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -144,8 +144,7 @@ typedef struct Actor { /* 0x094 */ f32 yDistanceFromLink; /* 0x098 */ SubActorStruct98 sub_98; /* 0x0B4 */ ActorShape shape; - /* 0x0CC */ Vec3f unk_CC; // Used in Link, not Deku Babas - /* 0x0D8 */ Vec3f unk_D8; // Used in Link, not Deku Babas + /* 0x0CC */ Vec3f unk_CC[2]; /* 0x0E4 */ Vec3f unk_E4; // Stores result of some vector transformation involving actor xyz vector, and a matrix at Global Context + 11D60 /* 0x0F0 */ f32 unk_F0; // Related to above /* 0x0F4 */ f32 unk_F4; diff --git a/src/code/fault_drawer.c b/src/code/fault_drawer.c index 8d85af18b3..b17679d355 100644 --- a/src/code/fault_drawer.c +++ b/src/code/fault_drawer.c @@ -65,38 +65,51 @@ void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) { sFaultDrawerStruct.osSyncPrintfEnabled = enabled; } -#ifdef NON_MATCHING -void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 color) { - if (sFaultDrawerStruct.w - xstart > 0 && sFaultDrawerStruct.h - ystart > 0) { - s32 x, y; +void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color) { + u16* fb; + s32 x, y; + s32 xDiff = sFaultDrawerStruct.w - xStart; + s32 yDiff = sFaultDrawerStruct.h - yStart; + s32 xSize = xEnd - xStart + 1; + s32 ySize = yEnd - yStart + 1; - for (y = 0; y <= yend - ystart; y++) - for (x = 0; x <= xend - xstart; x++) - sFaultDrawerStruct.fb[sFaultDrawerStruct.w * y + x] = color; + if (xDiff > 0 && yDiff > 0) { + if (xDiff < xSize) { + xSize = xDiff; + } + + if (yDiff < ySize) { + ySize = yDiff; + } + + fb = sFaultDrawerStruct.fb + sFaultDrawerStruct.w * yStart + xStart; + for (y = 0; y < ySize; y++) { + for (x = 0; x < xSize; x++) { + *fb++ = color; + } + fb += sFaultDrawerStruct.w - xSize; + } osWritebackDCacheAll(); } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/fault_drawer/FaultDrawer_DrawRecImpl.s") -#endif #ifdef NON_MATCHING // regalloc and minor ordering differences void FaultDrawer_DrawChar(char c) { + u16* fb; s32 x, y; u32* dataPtr; - u16* fb; + s32 cursorX = sFaultDrawerStruct.cursorX; + s32 cursorY = sFaultDrawerStruct.cursorY; dataPtr = &sFaultDrawerStruct.fontData[((c & 4) >> 2) + ((c / 8) * 16)]; + fb = sFaultDrawerStruct.fb + sFaultDrawerStruct.w * cursorY + cursorX; - fb = &sFaultDrawerStruct.fb[sFaultDrawerStruct.cursorY * sFaultDrawerStruct.w]; - fb = &fb[sFaultDrawerStruct.cursorX]; - - if ((sFaultDrawerStruct.xStart <= sFaultDrawerStruct.cursorX) && - ((sFaultDrawerStruct.charW + sFaultDrawerStruct.cursorX - 1) <= sFaultDrawerStruct.xEnd) && - (sFaultDrawerStruct.yStart <= sFaultDrawerStruct.cursorY) && - ((sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY - 1) <= sFaultDrawerStruct.yEnd)) { + if ((sFaultDrawerStruct.xStart <= cursorX) && + ((sFaultDrawerStruct.charW + cursorX - 1) <= sFaultDrawerStruct.xEnd) && + (sFaultDrawerStruct.yStart <= cursorY) && + ((sFaultDrawerStruct.charH + cursorY - 1) <= sFaultDrawerStruct.yEnd)) { for (y = 0; y < sFaultDrawerStruct.charH; y++) { u32 mask = 0x10000000 << (c % 4); u32 data = *dataPtr; @@ -152,7 +165,7 @@ void FaultDrawer_SetBackColor(u16 color) { } void FaultDrawer_SetFontColor(u16 color) { - FaultDrawer_SetForeColor((u16)(color | 1)); // force alpha to be set + FaultDrawer_SetForeColor(color | 1); // force alpha to be set } void FaultDrawer_SetCharPad(s8 padW, s8 padH) { @@ -260,7 +273,7 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) { } void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) { - sFaultDrawerStruct.fb = (u16*)fb; + sFaultDrawerStruct.fb = fb; sFaultDrawerStruct.w = w; sFaultDrawerStruct.h = h; } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index be598da4a1..5fa59e19bc 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -96,14 +96,14 @@ void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, } #ifdef NON_MATCHING -// this function still needs a lot of work +// saved register, stack usage and minor ordering differences void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) { GraphicsContext* gfxCtx; MtxF spE8; - Vec2f spE0; - s32 index; + f32 spE0[2]; + s32 i; f32* spAC; - Gfx* gfxArr[7]; + Gfx* gfxArr[4]; f32 temp_10; u8 temp_14; f32 temp_f0; @@ -124,8 +124,8 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa if (temp_f20 > 20.0f) { temp_10 = actor->shape.unk_10; - actor->shape.unk_10 *= 0.3f; temp_14 = actor->shape.unk_14; + actor->shape.unk_10 *= 0.3f; actor->shape.unk_14 *= ((temp_f20 - 20.0f) * 0.02f) > 1.0f ? 1.0f : ((temp_f20 - 20.0f) * 0.02f); ActorShadow_DrawFunc_Circle(actor, lightMapper, globalCtx); actor->shape.unk_10 = temp_10; @@ -133,18 +133,18 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa } if (temp_f20 < 200.0f) { - spAC = &spE0.x; - gfxCtx = globalCtx->state.gfxCtx; - temp_s6 = lightMapper->numLights - 2; + phi_s7 = &actor->unk_CC[0]; + spAC = &spE0[0]; + temp_s6 = lightMapper->numLights; + temp_s6 -= 2; + gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 1741); gfxCtx->polyOpa.p = func_80093774(gfxCtx->polyOpa.p, 0x2C); actor->shape.unk_15 = 0; - phi_s7 = &actor->unk_CC; - - for (index = 0; index < 2; index++) { + for (i = 0; i < 2; i++) { phi_s7->y += 50.0f; *spAC = func_800BFCB8(globalCtx, &spE8, phi_s7); phi_s7->y -= 50.0f; @@ -162,12 +162,12 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa if (30.0f < phi_f2) phi_f2 = 30.0f; - temp_f24 = actor->shape.unk_14 * (1.0f - (phi_f2 * (1.f / 30))); + temp_f24 = actor->shape.unk_14 * (1.0f - (phi_f2 * (1.0f / 30))); if (30.0f < phi_f2) phi_f2 = 30.0f; - temp_f20_2 = 1.0f - (phi_f2 * (1.f / 70)); + temp_f20_2 = 1.0f - (phi_f2 * (1.0f / 70)); temp_f22_2 = (actor->shape.unk_10 * temp_f20_2) * actor->scale.x; phi_s2 = 0; @@ -198,14 +198,11 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa phi_s7++; } - if (!(actor->bgCheckFlags & 1)) + if (!(actor->bgCheckFlags & 1)) { actor->shape.unk_15 = 0; - else if (actor->shape.unk_15 == 3) { - temp_f0 = actor->unk_CC.y - actor->unk_D8.y; - if ((spE0.x + temp_f0) < (spE0.y - temp_f0)) - actor->shape.unk_15 = 2; - else - actor->shape.unk_15 = 1; + } else if (actor->shape.unk_15 == 3) { + temp_f0 = actor->unk_CC[0].y - actor->unk_CC[1].y; + actor->shape.unk_15 = ((spE0[0] + temp_f0) < (spE0[1] - temp_f0)) ? 2 : 1; } func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 1831); @@ -217,9 +214,9 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, UNK_PTR arg3, s32 arg4, UNK_PTR arg5) { if (arg1 == arg2) { - Matrix_MultVec3f(arg3, &actor->unk_CC); + Matrix_MultVec3f(arg3, &actor->unk_CC[0]); } else if (arg1 == arg4) { - Matrix_MultVec3f(arg5, &actor->unk_D8); + Matrix_MultVec3f(arg5, &actor->unk_CC[1]); } } @@ -310,25 +307,25 @@ void func_8002C0C0(TargetContext* targetCtx, Actor* actor, GlobalContext* global } #ifdef NON_MATCHING -// this function still needs some work +// regalloc and minor ordering differences void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { Actor* actor; Player* player; GraphicsContext* gfxCtx; - Gfx* gfxArr[5]; + Gfx* gfxArr[4]; + TargetContextEntry* entry; s16 spCE; + f32 temp1; Vec3f spBC; s32 spB8; f32 spB4; s32 spB0; s32 spAC; - s32 i; - TargetContextEntry* entry; - f32 temp1; f32 var1; f32 var2; - Vec3f* vec; + s32 i; + actor = targetCtx->targetedActor; gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 2029); @@ -343,11 +340,11 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { else spB8 = 3; - if (targetCtx->targetedActor != NULL) { - Math_Vec3f_Copy(&targetCtx->targetCenterPos, &targetCtx->targetedActor->posRot2.pos); + if (actor != NULL) { + Math_Vec3f_Copy(&targetCtx->targetCenterPos, &actor->posRot2.pos); var1 = (500.0f - targetCtx->unk_44) / 420.0f; } else { - targetCtx->unk_48 -= 0x78; + targetCtx->unk_48 -= 120; if (targetCtx->unk_48 < 0) targetCtx->unk_48 = 0; spCE = targetCtx->unk_48; @@ -355,13 +352,13 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { func_8002BE04(globalCtx, &targetCtx->targetCenterPos, &spBC, &spB4); - temp1 = ((spBC.x * spB4) * 160.0f) * var1; - spBC.x = (temp1 < -320.0f) ? -320.0f : ((temp1 > 320.0f) ? 320.0f : temp1); + temp1 = ((spBC.x * spB4) * 160) * var1; + spBC.x = (temp1 < -320) ? -320 : ((temp1 > 320) ? 320 : temp1); - temp1 = ((spBC.y * spB4) * 120.0f) * var1; - spBC.y = (temp1 < -240.0f) ? -240.0f : ((temp1 > 240.0f) ? 240.0f : temp1); + temp1 = ((spBC.y * spB4) * 120) * var1; + spBC.y = (temp1 < -240) ? -240 : ((temp1 > 240) ? 240 : temp1); - spBC.z *= var1; + spBC.z = spBC.z * var1; targetCtx->unk_4C--; if (targetCtx->unk_4C < 0) @@ -369,7 +366,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { func_8002BE64(targetCtx, targetCtx->unk_4C, spBC.x, spBC.y, spBC.z); - if ((!(player->stateFlags1 & 0x40)) || (targetCtx->targetedActor != player->unk_664)) { + if ((!(player->stateFlags1 & 0x40)) || (actor != player->unk_664)) { gfxCtx->overlay.p = func_80093774(gfxCtx->overlay.p, 0x39); for (spB0 = 0, spAC = targetCtx->unk_4C; spB0 < spB8; spB0++) { @@ -720,20 +717,17 @@ void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) { } } -#ifdef NON_MATCHING -// major ordering and stack usage differences void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { s32 spCC; s32 spC8; s32 unk1; s32 spC0; - s32 unk2; + s32 sp38; s32 spB8; s32 spB4; s32 spB0; GraphicsContext* gfxCtx; Gfx* gfxArr[4]; - s32 sp38; if (titleCtx->unk_C != 0) { spCC = titleCtx->unk_8; @@ -743,14 +737,13 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { sp38 = spCC * 2; gfxCtx = globalCtx->state.gfxCtx; - func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 2824); spB0 = spCC * spC8 * gSaveContext.language; - spC8 = (spCC * spC8 > 0x1000) ? 0x1000 / spCC : spC8; + spB4 = spB8 + (spC8 * 4); - spB4 = (spC8 * 4) + spB8; + if (1) {} // Necessary to match gfxCtx->overlay.p = func_80093808(gfxCtx->overlay.p); @@ -761,8 +754,8 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB8, ((sp38 * 2) + spC0) - 4, spB8 - 1, G_TX_RENDERTILE, 0, 0, - 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB8, ((sp38 * 2) + spC0) - 4, spB8 + (spC8 * 4) - 1, + G_TX_RENDERTILE, 0, 0, 1024, 1024); spC8 = titleCtx->unk_9 - spC8; @@ -771,16 +764,13 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { spC8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB4, ((sp38 * 2) + spC0) - 4, spB4 - 1, G_TX_RENDERTILE, 0, - 0, 1024, 1024); + gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB4, ((sp38 * 2) + spC0) - 4, spB4 + (spC8 * 4) - 1, + G_TX_RENDERTILE, 0, 0, 1024, 1024); } func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 2880); } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/TitleCard_Draw.s") -#endif s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx) { if ((globalCtx->actorCtx.titleCtx.delayB != 0) || (globalCtx->actorCtx.titleCtx.unk_C != 0)) { @@ -1802,7 +1792,8 @@ Color_RGB8 D_80116060 = { 0xFF, 0xFF, 0xFF }; Color_RGB8 D_80116064 = { 0x64, 0xC8, 0x00 }; #ifdef NON_MATCHING -// this function still needs a lot of work +// saved register, stack usage and minor ordering differences +// this also doesn't generate a few useless struct copies void func_8002FBAC(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* gfxArr[6]; @@ -1810,6 +1801,7 @@ void func_8002FBAC(GlobalContext* globalCtx) { f32 spD8; f32 spD4; s32 spD0; + s32 spCC; f32 spC0; Vec3f spB4; Vec3f spA4; @@ -1839,6 +1831,7 @@ void func_8002FBAC(GlobalContext* globalCtx) { spD4 = 1.0f; temp_a3 = gSaveContext.respawn[RESPAWN_MODE_TOP].data - 0x28; + spCC = temp_a3; if (temp_a3 < 0) { gSaveContext.respawn[RESPAWN_MODE_TOP].data++; @@ -1871,7 +1864,7 @@ void func_8002FBAC(GlobalContext* globalCtx) { temp_f12 = sp9C * 0.5f; temp_f14 = temp_ret - temp_f12; spD8 += sqrtf((temp_f12 * temp_f12) - (temp_f14 * temp_f14)) * 0.2f; - osSyncPrintf("-------- DISPLAY Y=%f\n", (f64)spD8); + osSyncPrintf("-------- DISPLAY Y=%f\n", spD8); } spA4.x = Math_Rand_CenteredFloat(6.0f) + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x; @@ -1886,6 +1879,7 @@ void func_8002FBAC(GlobalContext* globalCtx) { gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0x28; } + // somehow this shouldn't be optimized out gSaveContext.respawn[RESPAWN_MODE_TOP].pos = gSaveContext.respawn[RESPAWN_MODE_TOP].pos; } else if (temp_a3 > 0) { temp_f12 = temp_a3 * 0.1f; @@ -1914,7 +1908,7 @@ void func_8002FBAC(GlobalContext* globalCtx) { gSaveContext.respawn[RESPAWN_MODE_TOP].data++; } - spD4 = temp_a3 * 0.200000000000000011102230246252 + 1.0f; + spD4 = spCC * 0.200000000000000011102230246252 + 1.0f; } if ((globalCtx->csCtx.state == 0) && @@ -3723,17 +3717,15 @@ struct_80116130 D_80116130[13] = { }; #ifdef NON_MATCHING -// this function still needs a lot of work +// regalloc differences void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7, u8 arg8) { s16 sp46; s16 sp44; - s16 temp1; - s16 sp40; s16 temp2; + s16 sp40; + s16 temp1; Vec3f sp30; - s16 temp3; - s16 temp4; sp30.x = actor->posRot.pos.x; sp30.y = actor->posRot.pos.y + arg1->unk_14; @@ -3741,27 +3733,34 @@ void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3, sp46 = Math_Vec3f_Pitch(&sp30, &arg1->unk_18); sp44 = Math_Vec3f_Yaw(&sp30, &arg1->unk_18); + sp40 = Math_Vec3f_Yaw(&actor->posRot.pos, &arg1->unk_18) - actor->shape.rot.y; - temp1 = Math_Vec3f_Yaw(&actor->posRot.pos, &arg1->unk_18) - actor->shape.rot.y; + temp1 = (sp40 < -arg2) ? -arg2 : ((sp40 > arg2) ? arg2 : sp40); + Math_SmoothScaleMaxMinS(&arg1->unk_0A, temp1, 6, 2000, 1); - Math_SmoothScaleMaxMinS(&arg1->unk_0A, (temp1 < -arg2) ? -arg2 : ((temp1 > arg2) ? arg2 : temp1), 6, 2000, 1); + sp40 = (ABS(sp40) >= 0x8000) ? 0 : ((sp40 >= 0) ? sp40 : -sp40); + arg1->unk_0A = ((arg1->unk_0A < -sp40) ? -sp40 : ((arg1->unk_0A > sp40) ? sp40 : arg1->unk_0A)); - temp3 = (ABS(temp1) >= 0x8000) ? 0 : ((temp1 >= 0) ? temp1 : -temp1); - arg1->unk_0A = ((arg1->unk_0A < -temp3) ? -temp3 : ((arg1->unk_0A > temp3) ? temp3 : arg1->unk_0A)); + sp40 = sp40 - arg1->unk_0A; - sp40 = temp1 - arg1->unk_0A; - Math_SmoothScaleMaxMinS(&arg1->unk_10, (sp40 < -arg5) ? -arg5 : ((sp40 > arg5) ? arg5 : sp40), 6, 2000, 1); + temp1 = (sp40 < -arg5) ? -arg5 : ((sp40 > arg5) ? arg5 : sp40); + Math_SmoothScaleMaxMinS(&arg1->unk_10, temp1, 6, 2000, 1); - temp4 = (ABS(sp40) >= 0x8000) ? 0 : ((sp40 >= 0) ? sp40 : -sp40); - arg1->unk_10 = ((arg1->unk_10 < -temp4) ? -temp4 : ((arg1->unk_10 > temp4) ? temp4 : arg1->unk_10)); + sp40 = (ABS(sp40) >= 0x8000) ? 0 : ((sp40 >= 0) ? sp40 : -sp40); + arg1->unk_10 = ((arg1->unk_10 < -sp40) ? -sp40 : ((arg1->unk_10 > sp40) ? sp40 : arg1->unk_10)); - if (arg8 != 0) + if (arg8 != 0) { + if (arg3) {} // Seems necessary to match Math_SmoothScaleMaxMinS(&actor->shape.rot.y, sp44, 6, 2000, 1); + } - Math_SmoothScaleMaxMinS(&arg1->unk_08, (sp46 < arg4) ? arg4 : ((sp46 > arg3) ? arg3 : sp46), 6, 2000, 1); + temp1 = (sp46 < arg4) ? arg4 : ((sp46 > arg3) ? arg3 : sp46); + Math_SmoothScaleMaxMinS(&arg1->unk_08, temp1, 6, 2000, 1); temp2 = sp46 - arg1->unk_08; - Math_SmoothScaleMaxMinS(&arg1->unk_0E, (temp2 < arg7) ? arg4 : ((temp2 > arg6) ? arg3 : temp2), 6, 2000, 1); + + temp1 = (temp2 < arg7) ? arg7 : ((temp2 > arg6) ? arg6 : temp2); + Math_SmoothScaleMaxMinS(&arg1->unk_0E, temp1, 6, 2000, 1); } #else #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800344BC.s") diff --git a/src/code/z_camera.c b/src/code/z_camera.c index d7b0108d54..9dd358ffcc 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -520,7 +520,7 @@ s32 func_80045B08(Camera* camera, struct_80045714* b, f32 c, s16 d) { return 1; } -#ifdef NON_MATCHING +/* // someone who's not me can have fun with this function s32 func_80045C74(Camera* camera, struct_80045714* b, f32 c, f32* d, s16 arg4) { Vec3f sp70; @@ -593,9 +593,8 @@ s32 func_80045C74(Camera* camera, struct_80045714* b, f32 c, f32* d, s16 arg4) { return 1; } -#else +*/ #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80045C74.s") -#endif // 421 lines #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800460A8.s") diff --git a/src/code/z_debug.c b/src/code/z_debug.c index e0c1c4f9f8..e5bc9199f2 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -1,8 +1,5 @@ #include #include -#include -#include -#include #include typedef struct { @@ -60,29 +57,24 @@ void func_800636C0() { void func_8006375C(s32 arg0, s32 arg1, float* d_80855320) { } -#ifdef NON_MATCHING // regalloc // Copy Camera Debugger Text void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) { PrintTextBuffer* buf; char* bufText; - s16 i; // v1 + s16 i; buf = &D_8015FA98[D_8011E0B0]; if (D_8011E0B0 < 0x16) { - buf->x = x; buf->y = y; buf->colorId = colorId; i = 0; - bufText = buf->text + 1; - - if (*buf->text = *text++) { - do - if (i++ > 0x14) { - break; - } - while (*bufText++ = *text++); + bufText = buf->text; + while (*bufText++ = *text++) { + if (i++ > 0x14) { + break; + } } *bufText = '\0'; @@ -90,10 +82,6 @@ void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) { } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_8006376C.s") -#endif - // Draw Text void func_80063828(GfxPrint* gfxPrint) { s32 i; diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index b69ac8b344..27050cf24f 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -48,7 +48,7 @@ void Health_InitData(GlobalContext* globalCtx) { } #ifdef NON_MATCHING -// this function still needs some work +// this function still needs some work but it should be functionally equivalent void Health_UpdateData(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; f32 temp_f0 = interfaceCtx->unk_1FE * 0.1f; diff --git a/src/code/z_room.c b/src/code/z_room.c index f9973bfeaf..f225ef77fb 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -85,7 +85,7 @@ typedef struct struct_80095D04 { // Room Draw Polygon Type 2 #ifdef NON_MATCHING -// this function still needs some work +// this function still needs some work but it should be functionally equivalent void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) { PolygonType2* polygon2; PolygonDlist2* polygonDlist; diff --git a/src/code/z_scene.c b/src/code/z_scene.c index c8c97459cb..949e1e41cb 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -280,7 +280,7 @@ void func_80098958(GlobalContext* globalCtx, SceneCmd* cmd) { // Scene Command 0x0B: Object List #ifdef NON_MATCHING -// this function still needs some work +// this function still needs some work but it should be functionally equivalent void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd) { s32 i, j, k; s16* objectEntry; From 5f3db569f9420e034da3a6da9fd1eaf011e31f22 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 22 Mar 2020 20:39:12 -0400 Subject: [PATCH 23/33] else if --- .../ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index 9e5f5f585c..109f159e0c 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -67,19 +67,15 @@ static void BgGateShutter_Destroy(BgGateShutter* this, GlobalContext* globalCtx) } static void func_8087828C(BgGateShutter* this, GlobalContext* globalCtx) { - if (this->unk_168 == 1) { - if (!(gSaveContext.inf_table[7] & 0x40)) { - this->unk_178 = 2; - this->actionFunc = (ActorFunc)func_80878300; - return; - } - } - if (this->unk_168 == 2) { + if (this->unk_168 == 1 && !(gSaveContext.inf_table[7] & 0x40)) { this->unk_178 = 2; this->actionFunc = (ActorFunc)func_80878300; - return; } - if (this->unk_168 < 0) { + else if (this->unk_168 == 2) { + this->unk_178 = 2; + this->actionFunc = (ActorFunc)func_80878300; + } + else if (this->unk_168 < 0) { this->unk_178 = 2; this->actionFunc = (ActorFunc)func_808783D4; } From 7c9291c59ecfe38660bdf546b33dd338c105bc09 Mon Sep 17 00:00:00 2001 From: Roman971 Date: Mon, 23 Mar 2020 01:49:30 +0100 Subject: [PATCH 24/33] Update progress script to default to decomp progress --- progress.py | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/progress.py b/progress.py index 8353eead4d..62d201c853 100644 --- a/progress.py +++ b/progress.py @@ -1,4 +1,24 @@ +#!/usr/bin/env python3 + import os +import re +import argparse + +parser = argparse.ArgumentParser(description="Computes current progress throughout the whole project.") +parser.add_argument("-m", "--matching", dest='matching', action='store_true', + help="Output matching progress instead of decompilation progress") +args = parser.parse_args() + +NON_MATCHING_PATTERN = "#ifdef\s+NON_MATCHING.*?#pragma\s+GLOBAL_ASM\s*\(\s*\"(.*?)\"\s*\).*?#endif" + +def GetNonMatchingFunctions(files): + functions = [] + + for file in files: + with open(file) as f: + functions += re.findall(NON_MATCHING_PATTERN, f.read(), re.DOTALL) + + return functions def ReadAllLines(fileName): lineList = list() @@ -7,27 +27,30 @@ def ReadAllLines(fileName): return lineList -def GetFiles(path): +def GetFiles(path, ext): files = [] for r, d, f in os.walk(path): for file in f: - if '.s' in file: + if file.endswith(ext): files.append(os.path.join(r, file)) return files +nonMatchingFunctions = GetNonMatchingFunctions(GetFiles("src", ".c")) if not args.matching else [] + def GetNonMatchingSize(path): size = 0 - asmFiles = GetFiles(path) + asmFiles = GetFiles(path, ".s") for asmFilePath in asmFiles: - asmLines = ReadAllLines(asmFilePath) + if asmFilePath not in nonMatchingFunctions: + asmLines = ReadAllLines(asmFilePath) - for asmLine in asmLines: - if (asmLine.startswith("/*")): - size += 4 + for asmLine in asmLines: + if (asmLine.startswith("/*")): + size += 4 return size @@ -97,12 +120,13 @@ ovlPct = 100 * ovl / ovlSize compiled_bytes = total bytesPerHeartPiece = compiled_bytes / 80 +adjective = "decompiled" if not args.matching else "matched" + print(str(total) + " total bytes of decompilable code\n") -print(str(src) + " bytes of code in src " + str(srcPct) + "%\n") -#print(str(asm) + " bytes of code in asm " + str(asmPct) + "%\n") -print(str(boot) + "/" + str(bootSize) + " bytes of code in boot " + str(bootPct) + "%\n") -print(str(code) + "/" + str(codeSize) + " bytes of code in code " + str(codePct) + "%\n") -print(str(ovl) + "/" + str(ovlSize) + " bytes of code in overlays " + str(ovlPct) + "%\n") +print(str(src) + " bytes " + adjective + " in src " + str(srcPct) + "%\n") +print(str(boot) + "/" + str(bootSize) + " bytes " + adjective + " in boot " + str(bootPct) + "%\n") +print(str(code) + "/" + str(codeSize) + " bytes " + adjective + " in code " + str(codePct) + "%\n") +print(str(ovl) + "/" + str(ovlSize) + " bytes " + adjective + " in overlays " + str(ovlPct) + "%\n") print("------------------------------------\n") heartPieces = int(src / bytesPerHeartPiece) From 1876dc0c5c5bafebee6b49feee0ce097ad7f4345 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 22 Mar 2020 21:05:09 -0400 Subject: [PATCH 25/33] UNK_PTR->UNK_TYPE --- src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index 109f159e0c..4d0e42b6aa 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -34,8 +34,8 @@ const ActorInit Bg_Gate_Shutter_InitVars = { (ActorFunc)BgGateShutter_Draw, }; -extern UNK_PTR D_06001CD0; -extern UNK_PTR D_06001DA8; +extern UNK_TYPE D_06001CD0; +extern UNK_TYPE D_06001DA8; static void BgGateShutter_Init(BgGateShutter* this, GlobalContext* globalCtx) { s32 pad[2]; From 8c99bdd00f2fd191d69e02f5091bc36d3eb2a45d Mon Sep 17 00:00:00 2001 From: Lucas Shaw Date: Sun, 22 Mar 2020 22:55:05 -0700 Subject: [PATCH 26/33] ovl_Bg_Zg OK --- .../overlays/actors/ovl_Bg_Zg/BgZg_Destroy.s | 16 -- .../overlays/actors/ovl_Bg_Zg/BgZg_Draw.s | 32 ---- .../overlays/actors/ovl_Bg_Zg/BgZg_Init.s | 69 -------- .../overlays/actors/ovl_Bg_Zg/BgZg_Update.s | 30 ---- .../overlays/actors/ovl_Bg_Zg/func_808C0C50.s | 22 --- .../overlays/actors/ovl_Bg_Zg/func_808C0C98.s | 16 -- .../overlays/actors/ovl_Bg_Zg/func_808C0CC8.s | 6 - .../overlays/actors/ovl_Bg_Zg/func_808C0CD4.s | 17 -- .../overlays/actors/ovl_Bg_Zg/func_808C0D08.s | 45 ------ .../overlays/actors/ovl_Bg_Zg/func_808C0EEC.s | 50 ------ data/overlays/actors/z_bg_zg.data.s | 23 --- data/overlays/actors/z_bg_zg.reloc.s | 11 -- data/overlays/actors/z_bg_zg.rodata.s | 37 ----- spec | 4 +- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 153 ++++++++++++++++-- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h | 6 +- undefined_syms.txt | 3 + 17 files changed, 145 insertions(+), 395 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C50.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C98.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CC8.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CD4.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0D08.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0EEC.s delete mode 100644 data/overlays/actors/z_bg_zg.data.s delete mode 100644 data/overlays/actors/z_bg_zg.reloc.s delete mode 100644 data/overlays/actors/z_bg_zg.rodata.s diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Destroy.s deleted file mode 100644 index 12e174449e..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Destroy.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel BgZg_Destroy -/* 00000 808C0C20 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00004 808C0C24 AFA40018 */ sw $a0, 0x0018($sp) -/* 00008 808C0C28 8FAE0018 */ lw $t6, 0x0018($sp) -/* 0000C 808C0C2C AFBF0014 */ sw $ra, 0x0014($sp) -/* 00010 808C0C30 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00014 808C0C34 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810 -/* 00018 808C0C38 0C00FB56 */ jal DynaPolyInfo_Free - ## DynaPolyInfo_delReserve -/* 0001C 808C0C3C 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C -/* 00020 808C0C40 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00024 808C0C44 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00028 808C0C48 03E00008 */ jr $ra -/* 0002C 808C0C4C 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Draw.s deleted file mode 100644 index 11c8a28ef3..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Draw.s +++ /dev/null @@ -1,32 +0,0 @@ -glabel BgZg_Draw -/* 00388 808C0FA8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0038C 808C0FAC AFBF0014 */ sw $ra, 0x0014($sp) -/* 00390 808C0FB0 8C820168 */ lw $v0, 0x0168($a0) ## 00000168 -/* 00394 808C0FB4 04400008 */ bltz $v0, .L808C0FD8 -/* 00398 808C0FB8 00000000 */ nop -/* 0039C 808C0FBC 1C400006 */ bgtz $v0, .L808C0FD8 -/* 003A0 808C0FC0 00027080 */ sll $t6, $v0, 2 -/* 003A4 808C0FC4 3C03808C */ lui $v1, %hi(D_808C101C) ## $v1 = 808C0000 -/* 003A8 808C0FC8 006E1821 */ addu $v1, $v1, $t6 -/* 003AC 808C0FCC 8C63101C */ lw $v1, %lo(D_808C101C)($v1) -/* 003B0 808C0FD0 14600006 */ bne $v1, $zero, .L808C0FEC -/* 003B4 808C0FD4 00000000 */ nop -.L808C0FD8: -/* 003B8 808C0FD8 3C04808C */ lui $a0, %hi(D_808C10AC) ## $a0 = 808C0000 -/* 003BC 808C0FDC 0C00084C */ jal osSyncPrintf - -/* 003C0 808C0FE0 248410AC */ addiu $a0, $a0, %lo(D_808C10AC) ## $a0 = 808C10AC -/* 003C4 808C0FE4 10000004 */ beq $zero, $zero, .L808C0FF8 -/* 003C8 808C0FE8 8FBF0014 */ lw $ra, 0x0014($sp) -.L808C0FEC: -/* 003CC 808C0FEC 0060F809 */ jalr $ra, $v1 -/* 003D0 808C0FF0 00000000 */ nop -/* 003D4 808C0FF4 8FBF0014 */ lw $ra, 0x0014($sp) -.L808C0FF8: -/* 003D8 808C0FF8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 003DC 808C0FFC 03E00008 */ jr $ra -/* 003E0 808C1000 00000000 */ nop -/* 003E4 808C1004 00000000 */ nop -/* 003E8 808C1008 00000000 */ nop -/* 003EC 808C100C 00000000 */ nop - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Init.s deleted file mode 100644 index 1d0af8010d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Init.s +++ /dev/null @@ -1,69 +0,0 @@ -glabel BgZg_Init -/* 001E4 808C0E04 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 001E8 808C0E08 AFA50034 */ sw $a1, 0x0034($sp) -/* 001EC 808C0E0C AFBF001C */ sw $ra, 0x001C($sp) -/* 001F0 808C0E10 AFB00018 */ sw $s0, 0x0018($sp) -/* 001F4 808C0E14 3C05808C */ lui $a1, %hi(D_808C1018) ## $a1 = 808C0000 -/* 001F8 808C0E18 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 001FC 808C0E1C 0C01E037 */ jal Actor_ProcessInitChain - -/* 00200 808C0E20 24A51018 */ addiu $a1, $a1, %lo(D_808C1018) ## $a1 = 808C1018 -/* 00204 808C0E24 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00208 808C0E28 0C010D20 */ jal DynaPolyInfo_SetActorMove - -/* 0020C 808C0E2C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00210 808C0E30 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 00214 808C0E34 AFA00020 */ sw $zero, 0x0020($sp) -/* 00218 808C0E38 248411D4 */ addiu $a0, $a0, 0x11D4 ## $a0 = 060011D4 -/* 0021C 808C0E3C 0C010620 */ jal DynaPolyInfo_Alloc - -/* 00220 808C0E40 27A50020 */ addiu $a1, $sp, 0x0020 ## $a1 = FFFFFFF0 -/* 00224 808C0E44 8FA40034 */ lw $a0, 0x0034($sp) -/* 00228 808C0E48 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 0022C 808C0E4C 8FA70020 */ lw $a3, 0x0020($sp) -/* 00230 808C0E50 0C00FA9D */ jal DynaPolyInfo_RegisterActor - ## DynaPolyInfo_setActor -/* 00234 808C0E54 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 00238 808C0E58 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 0023C 808C0E5C 0C230332 */ jal func_808C0CC8 -/* 00240 808C0E60 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00244 808C0E64 24010008 */ addiu $at, $zero, 0x0008 ## $at = 00000008 -/* 00248 808C0E68 10410005 */ beq $v0, $at, .L808C0E80 -/* 0024C 808C0E6C 00000000 */ nop -/* 00250 808C0E70 0C230332 */ jal func_808C0CC8 -/* 00254 808C0E74 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00258 808C0E78 24010009 */ addiu $at, $zero, 0x0009 ## $at = 00000009 -/* 0025C 808C0E7C 1441000D */ bne $v0, $at, .L808C0EB4 -.L808C0E80: -/* 00260 808C0E80 3C01808C */ lui $at, %hi(D_808C10E8) ## $at = 808C0000 -/* 00264 808C0E84 C42010E8 */ lwc1 $f0, %lo(D_808C10E8)($at) -/* 00268 808C0E88 C6040050 */ lwc1 $f4, 0x0050($s0) ## 00000050 -/* 0026C 808C0E8C C6080058 */ lwc1 $f8, 0x0058($s0) ## 00000058 -/* 00270 808C0E90 3C01808C */ lui $at, %hi(D_808C10EC) ## $at = 808C0000 -/* 00274 808C0E94 46002182 */ mul.s $f6, $f4, $f0 -/* 00278 808C0E98 C6100054 */ lwc1 $f16, 0x0054($s0) ## 00000054 -/* 0027C 808C0E9C 46004282 */ mul.s $f10, $f8, $f0 -/* 00280 808C0EA0 E6060050 */ swc1 $f6, 0x0050($s0) ## 00000050 -/* 00284 808C0EA4 E60A0058 */ swc1 $f10, 0x0058($s0) ## 00000058 -/* 00288 808C0EA8 C43210EC */ lwc1 $f18, %lo(D_808C10EC)($at) -/* 0028C 808C0EAC 46128102 */ mul.s $f4, $f16, $f18 -/* 00290 808C0EB0 E6040054 */ swc1 $f4, 0x0054($s0) ## 00000054 -.L808C0EB4: -/* 00294 808C0EB4 AE000164 */ sw $zero, 0x0164($s0) ## 00000164 -/* 00298 808C0EB8 AE000168 */ sw $zero, 0x0168($s0) ## 00000168 -/* 0029C 808C0EBC 8FA50034 */ lw $a1, 0x0034($sp) -/* 002A0 808C0EC0 0C230326 */ jal func_808C0C98 -/* 002A4 808C0EC4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002A8 808C0EC8 50400004 */ beql $v0, $zero, .L808C0EDC -/* 002AC 808C0ECC 8FBF001C */ lw $ra, 0x001C($sp) -/* 002B0 808C0ED0 0C00B55C */ jal Actor_Kill - -/* 002B4 808C0ED4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002B8 808C0ED8 8FBF001C */ lw $ra, 0x001C($sp) -.L808C0EDC: -/* 002BC 808C0EDC 8FB00018 */ lw $s0, 0x0018($sp) -/* 002C0 808C0EE0 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 002C4 808C0EE4 03E00008 */ jr $ra -/* 002C8 808C0EE8 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Update.s deleted file mode 100644 index a60ee97dd9..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Update.s +++ /dev/null @@ -1,30 +0,0 @@ -glabel BgZg_Update -/* 00188 808C0DA8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0018C 808C0DAC AFBF0014 */ sw $ra, 0x0014($sp) -/* 00190 808C0DB0 8C820164 */ lw $v0, 0x0164($a0) ## 00000164 -/* 00194 808C0DB4 04400008 */ bltz $v0, .L808C0DD8 -/* 00198 808C0DB8 28410002 */ slti $at, $v0, 0x0002 -/* 0019C 808C0DBC 10200006 */ beq $at, $zero, .L808C0DD8 -/* 001A0 808C0DC0 00027080 */ sll $t6, $v0, 2 -/* 001A4 808C0DC4 3C03808C */ lui $v1, %hi(D_808C1010) ## $v1 = 808C0000 -/* 001A8 808C0DC8 006E1821 */ addu $v1, $v1, $t6 -/* 001AC 808C0DCC 8C631010 */ lw $v1, %lo(D_808C1010)($v1) -/* 001B0 808C0DD0 14600006 */ bne $v1, $zero, .L808C0DEC -/* 001B4 808C0DD4 00000000 */ nop -.L808C0DD8: -/* 001B8 808C0DD8 3C04808C */ lui $a0, %hi(D_808C1040) ## $a0 = 808C0000 -/* 001BC 808C0DDC 0C00084C */ jal osSyncPrintf - -/* 001C0 808C0DE0 24841040 */ addiu $a0, $a0, %lo(D_808C1040) ## $a0 = 808C1040 -/* 001C4 808C0DE4 10000004 */ beq $zero, $zero, .L808C0DF8 -/* 001C8 808C0DE8 8FBF0014 */ lw $ra, 0x0014($sp) -.L808C0DEC: -/* 001CC 808C0DEC 0060F809 */ jalr $ra, $v1 -/* 001D0 808C0DF0 00000000 */ nop -/* 001D4 808C0DF4 8FBF0014 */ lw $ra, 0x0014($sp) -.L808C0DF8: -/* 001D8 808C0DF8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 001DC 808C0DFC 03E00008 */ jr $ra -/* 001E0 808C0E00 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C50.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C50.s deleted file mode 100644 index 01a7dc5a76..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C50.s +++ /dev/null @@ -1,22 +0,0 @@ -glabel func_808C0C50 -/* 00030 808C0C50 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00034 808C0C54 AFA40020 */ sw $a0, 0x0020($sp) -/* 00038 808C0C58 8FA50020 */ lw $a1, 0x0020($sp) -/* 0003C 808C0C5C 3C078013 */ lui $a3, 0x8013 ## $a3 = 80130000 -/* 00040 808C0C60 3C0E8013 */ lui $t6, 0x8013 ## $t6 = 80130000 -/* 00044 808C0C64 24E733E0 */ addiu $a3, $a3, 0x33E0 ## $a3 = 801333E0 -/* 00048 808C0C68 AFBF001C */ sw $ra, 0x001C($sp) -/* 0004C 808C0C6C 25CE33E8 */ addiu $t6, $t6, 0x33E8 ## $t6 = 801333E8 -/* 00050 808C0C70 AFAE0014 */ sw $t6, 0x0014($sp) -/* 00054 808C0C74 AFA70010 */ sw $a3, 0x0010($sp) -/* 00058 808C0C78 24042859 */ addiu $a0, $zero, 0x2859 ## $a0 = 00002859 -/* 0005C 808C0C7C 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 00060 808C0C80 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 00064 808C0C84 24A500E4 */ addiu $a1, $a1, 0x00E4 ## $a1 = 000000E4 -/* 00068 808C0C88 8FBF001C */ lw $ra, 0x001C($sp) -/* 0006C 808C0C8C 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00070 808C0C90 03E00008 */ jr $ra -/* 00074 808C0C94 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C98.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C98.s deleted file mode 100644 index fdf9c48315..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C98.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel func_808C0C98 -/* 00078 808C0C98 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0007C 808C0C9C AFBF0014 */ sw $ra, 0x0014($sp) -/* 00080 808C0CA0 00A03825 */ or $a3, $a1, $zero ## $a3 = 00000000 -/* 00084 808C0CA4 8485001C */ lh $a1, 0x001C($a0) ## 0000001C -/* 00088 808C0CA8 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 0008C 808C0CAC 00052A03 */ sra $a1, $a1, 8 -/* 00090 808C0CB0 0C00B2D0 */ jal Flags_GetSwitch - -/* 00094 808C0CB4 30A500FF */ andi $a1, $a1, 0x00FF ## $a1 = 00000000 -/* 00098 808C0CB8 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0009C 808C0CBC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 000A0 808C0CC0 03E00008 */ jr $ra -/* 000A4 808C0CC4 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CC8.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CC8.s deleted file mode 100644 index 37811b7e0c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CC8.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel func_808C0CC8 -/* 000A8 808C0CC8 8483001C */ lh $v1, 0x001C($a0) ## 0000001C -/* 000AC 808C0CCC 03E00008 */ jr $ra -/* 000B0 808C0CD0 306200FF */ andi $v0, $v1, 0x00FF ## $v0 = 00000000 - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CD4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CD4.s deleted file mode 100644 index 78c0d2e9ca..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CD4.s +++ /dev/null @@ -1,17 +0,0 @@ -glabel func_808C0CD4 -/* 000B4 808C0CD4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 000B8 808C0CD8 AFBF0014 */ sw $ra, 0x0014($sp) -/* 000BC 808C0CDC 0C230326 */ jal func_808C0C98 -/* 000C0 808C0CE0 AFA40018 */ sw $a0, 0x0018($sp) -/* 000C4 808C0CE4 10400004 */ beq $v0, $zero, .L808C0CF8 -/* 000C8 808C0CE8 8FA40018 */ lw $a0, 0x0018($sp) -/* 000CC 808C0CEC 240E0001 */ addiu $t6, $zero, 0x0001 ## $t6 = 00000001 -/* 000D0 808C0CF0 0C230314 */ jal func_808C0C50 -/* 000D4 808C0CF4 AC8E0164 */ sw $t6, 0x0164($a0) ## 00000164 -.L808C0CF8: -/* 000D8 808C0CF8 8FBF0014 */ lw $ra, 0x0014($sp) -/* 000DC 808C0CFC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 000E0 808C0D00 03E00008 */ jr $ra -/* 000E4 808C0D04 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0D08.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0D08.s deleted file mode 100644 index 948fcbad58..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0D08.s +++ /dev/null @@ -1,45 +0,0 @@ -glabel func_808C0D08 -/* 000E8 808C0D08 3C028016 */ lui $v0, 0x8016 ## $v0 = 80160000 -/* 000EC 808C0D0C 2442FA90 */ addiu $v0, $v0, 0xFA90 ## $v0 = 8015FA90 -/* 000F0 808C0D10 8C4E0000 */ lw $t6, 0x0000($v0) ## 8015FA90 -/* 000F4 808C0D14 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 000F8 808C0D18 AFBF0014 */ sw $ra, 0x0014($sp) -/* 000FC 808C0D1C AFA5001C */ sw $a1, 0x001C($sp) -/* 00100 808C0D20 85CF1474 */ lh $t7, 0x1474($t6) ## 00001474 -/* 00104 808C0D24 3C01808C */ lui $at, %hi(D_808C10E4) ## $at = 808C0000 -/* 00108 808C0D28 C42010E4 */ lwc1 $f0, %lo(D_808C10E4)($at) -/* 0010C 808C0D2C 448F2000 */ mtc1 $t7, $f4 ## $f4 = 0.00 -/* 00110 808C0D30 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 00114 808C0D34 44814000 */ mtc1 $at, $f8 ## $f8 = 20.00 -/* 00118 808C0D38 468021A0 */ cvt.s.w $f6, $f4 -/* 0011C 808C0D3C C4920028 */ lwc1 $f18, 0x0028($a0) ## 00000028 -/* 00120 808C0D40 3C014348 */ lui $at, 0x4348 ## $at = 43480000 -/* 00124 808C0D44 46083280 */ add.s $f10, $f6, $f8 -/* 00128 808C0D48 46005402 */ mul.s $f16, $f10, $f0 -/* 0012C 808C0D4C 46109100 */ add.s $f4, $f18, $f16 -/* 00130 808C0D50 44819000 */ mtc1 $at, $f18 ## $f18 = 200.00 -/* 00134 808C0D54 E4840028 */ swc1 $f4, 0x0028($a0) ## 00000028 -/* 00138 808C0D58 8C580000 */ lw $t8, 0x0000($v0) ## 8015FA90 -/* 0013C 808C0D5C C4860028 */ lwc1 $f6, 0x0028($a0) ## 00000028 -/* 00140 808C0D60 87191476 */ lh $t9, 0x1476($t8) ## 00001476 -/* 00144 808C0D64 44994000 */ mtc1 $t9, $f8 ## $f8 = 0.00 -/* 00148 808C0D68 00000000 */ nop -/* 0014C 808C0D6C 468042A0 */ cvt.s.w $f10, $f8 -/* 00150 808C0D70 C488000C */ lwc1 $f8, 0x000C($a0) ## 0000000C -/* 00154 808C0D74 46125400 */ add.s $f16, $f10, $f18 -/* 00158 808C0D78 46008102 */ mul.s $f4, $f16, $f0 -/* 0015C 808C0D7C 46082280 */ add.s $f10, $f4, $f8 -/* 00160 808C0D80 4606503E */ c.le.s $f10, $f6 -/* 00164 808C0D84 00000000 */ nop -/* 00168 808C0D88 45020004 */ bc1fl .L808C0D9C -/* 0016C 808C0D8C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00170 808C0D90 0C00B55C */ jal Actor_Kill - -/* 00174 808C0D94 00000000 */ nop -/* 00178 808C0D98 8FBF0014 */ lw $ra, 0x0014($sp) -.L808C0D9C: -/* 0017C 808C0D9C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00180 808C0DA0 03E00008 */ jr $ra -/* 00184 808C0DA4 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0EEC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0EEC.s deleted file mode 100644 index 198f798de0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0EEC.s +++ /dev/null @@ -1,50 +0,0 @@ -glabel func_808C0EEC -/* 002CC 808C0EEC 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8 -/* 002D0 808C0EF0 AFBF001C */ sw $ra, 0x001C($sp) -/* 002D4 808C0EF4 AFB00018 */ sw $s0, 0x0018($sp) -/* 002D8 808C0EF8 AFA40048 */ sw $a0, 0x0048($sp) -/* 002DC 808C0EFC AFA5004C */ sw $a1, 0x004C($sp) -/* 002E0 808C0F00 8CB00000 */ lw $s0, 0x0000($a1) ## 00000000 -/* 002E4 808C0F04 3C06808C */ lui $a2, %hi(D_808C107C) ## $a2 = 808C0000 -/* 002E8 808C0F08 24C6107C */ addiu $a2, $a2, %lo(D_808C107C) ## $a2 = 808C107C -/* 002EC 808C0F0C 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE8 -/* 002F0 808C0F10 24070137 */ addiu $a3, $zero, 0x0137 ## $a3 = 00000137 -/* 002F4 808C0F14 0C031AB1 */ jal func_800C6AC4 -/* 002F8 808C0F18 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 002FC 808C0F1C 0C024F46 */ jal func_80093D18 -/* 00300 808C0F20 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00304 808C0F24 8E0302C0 */ lw $v1, 0x02C0($s0) ## 000002C0 -/* 00308 808C0F28 3C18DA38 */ lui $t8, 0xDA38 ## $t8 = DA380000 -/* 0030C 808C0F2C 37180003 */ ori $t8, $t8, 0x0003 ## $t8 = DA380003 -/* 00310 808C0F30 246F0008 */ addiu $t7, $v1, 0x0008 ## $t7 = 00000008 -/* 00314 808C0F34 AE0F02C0 */ sw $t7, 0x02C0($s0) ## 000002C0 -/* 00318 808C0F38 3C05808C */ lui $a1, %hi(D_808C108C) ## $a1 = 808C0000 -/* 0031C 808C0F3C AC780000 */ sw $t8, 0x0000($v1) ## 00000000 -/* 00320 808C0F40 24A5108C */ addiu $a1, $a1, %lo(D_808C108C) ## $a1 = 808C108C -/* 00324 808C0F44 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00328 808C0F48 2406013B */ addiu $a2, $zero, 0x013B ## $a2 = 0000013B -/* 0032C 808C0F4C 0C0346A2 */ jal Matrix_NewMtx -/* 00330 808C0F50 AFA3002C */ sw $v1, 0x002C($sp) -/* 00334 808C0F54 8FA7002C */ lw $a3, 0x002C($sp) -/* 00338 808C0F58 3C090600 */ lui $t1, 0x0600 ## $t1 = 06000000 -/* 0033C 808C0F5C 25291080 */ addiu $t1, $t1, 0x1080 ## $t1 = 06001080 -/* 00340 808C0F60 ACE20004 */ sw $v0, 0x0004($a3) ## 00000004 -/* 00344 808C0F64 8E0302C0 */ lw $v1, 0x02C0($s0) ## 000002C0 -/* 00348 808C0F68 3C08DE00 */ lui $t0, 0xDE00 ## $t0 = DE000000 -/* 0034C 808C0F6C 3C06808C */ lui $a2, %hi(D_808C109C) ## $a2 = 808C0000 -/* 00350 808C0F70 24790008 */ addiu $t9, $v1, 0x0008 ## $t9 = 00000008 -/* 00354 808C0F74 AE1902C0 */ sw $t9, 0x02C0($s0) ## 000002C0 -/* 00358 808C0F78 24C6109C */ addiu $a2, $a2, %lo(D_808C109C) ## $a2 = 808C109C -/* 0035C 808C0F7C 24070140 */ addiu $a3, $zero, 0x0140 ## $a3 = 00000140 -/* 00360 808C0F80 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE8 -/* 00364 808C0F84 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00368 808C0F88 AC690004 */ sw $t1, 0x0004($v1) ## 00000004 -/* 0036C 808C0F8C 0C031AD5 */ jal func_800C6B54 -/* 00370 808C0F90 AC680000 */ sw $t0, 0x0000($v1) ## 00000000 -/* 00374 808C0F94 8FBF001C */ lw $ra, 0x001C($sp) -/* 00378 808C0F98 8FB00018 */ lw $s0, 0x0018($sp) -/* 0037C 808C0F9C 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000 -/* 00380 808C0FA0 03E00008 */ jr $ra -/* 00384 808C0FA4 00000000 */ nop - - diff --git a/data/overlays/actors/z_bg_zg.data.s b/data/overlays/actors/z_bg_zg.data.s deleted file mode 100644 index bc07cdaf9d..0000000000 --- a/data/overlays/actors/z_bg_zg.data.s +++ /dev/null @@ -1,23 +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 D_808C1010 - .word func_808C0CD4 -.word func_808C0D08 -glabel D_808C1018 - .word 0x485003E8 -glabel D_808C101C - .word func_808C0EEC -glabel Bg_Zg_InitVars - .word 0x01770400, 0x00000010, 0x01560000, 0x0000016C -.word BgZg_Init -.word BgZg_Destroy -.word BgZg_Update -.word BgZg_Draw - diff --git a/data/overlays/actors/z_bg_zg.reloc.s b/data/overlays/actors/z_bg_zg.reloc.s deleted file mode 100644 index b612e3c404..0000000000 --- a/data/overlays/actors/z_bg_zg.reloc.s +++ /dev/null @@ -1,11 +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_808C10F0 - -.incbin "baserom/ovl_Bg_Zg", 0x4D0, 0x000000A0 diff --git a/data/overlays/actors/z_bg_zg.rodata.s b/data/overlays/actors/z_bg_zg.rodata.s deleted file mode 100644 index ff40292d05..0000000000 --- a/data/overlays/actors/z_bg_zg.rodata.s +++ /dev/null @@ -1,37 +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_808C1040 - .asciz "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" - .balign 4 - -glabel D_808C107C - .asciz "../z_bg_zg.c" - .balign 4 - -glabel D_808C108C - .asciz "../z_bg_zg.c" - .balign 4 - -glabel D_808C109C - .asciz "../z_bg_zg.c" - .balign 4 - -glabel D_808C10AC - .asciz "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" - .balign 4 - -glabel D_808C10E4 - .word 0x3F99999A -glabel D_808C10E8 - .word 0x3FA66666 -glabel D_808C10EC - .word 0x3F99999A - - diff --git a/spec b/spec index db21d2c688..9a15576626 100644 --- a/spec +++ b/spec @@ -1642,9 +1642,7 @@ endseg beginseg name "ovl_Bg_Zg" include "build/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.o" - include "build/data/overlays/actors/z_bg_zg.data.o" - include "build/data/overlays/actors/z_bg_zg.rodata.o" - include "build/data/overlays/actors/z_bg_zg.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Zg/z_bg_zg_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index 5bc3369bb2..3db69157c3 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -3,12 +3,26 @@ #define ROOM 0x00 #define FLAGS 0x00000010 -void BgZg_Init(BgZg* this, GlobalContext* globalCtx); -void BgZg_Destroy(BgZg* this, GlobalContext* globalCtx); -void BgZg_Update(BgZg* this, GlobalContext* globalCtx); -void BgZg_Draw(BgZg* this, GlobalContext* globalCtx); +static void BgZg_Init(BgZg* this, GlobalContext* globalCtx); +static void BgZg_Destroy(BgZg* this, GlobalContext* globalCtx); +static void BgZg_Update(BgZg* this, GlobalContext* globalCtx); +static void BgZg_Draw(BgZg* this, GlobalContext* globalCtx); +static void func_808C0C50(BgZg* this); +static s32 func_808C0C98(BgZg* this, GlobalContext* globalCtx); +static s32 func_808C0CC8(BgZg* this); +static void func_808C0CD4(BgZg* this, GlobalContext* globalCtx); +static void func_808C0D08(BgZg* this, GlobalContext* globalCtx); +static void func_808C0EEC(BgZg* this, GlobalContext* globalCtx); + +static const ActorFunc funcTbl[] = { (ActorFunc)func_808C0CD4, (ActorFunc)func_808C0D08 }; + +static InitChainEntry initChain[] = +{ + ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP) +}; + +static const ActorFunc funcTbl2[] = { (ActorFunc) func_808C0EEC }; -/* const ActorInit Bg_Zg_InitVars = { ACTOR_BG_ZG, @@ -22,23 +36,130 @@ const ActorInit Bg_Zg_InitVars = (ActorFunc)BgZg_Update, (ActorFunc)BgZg_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Destroy.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C50.s") +extern u32 D_06001080; +extern u32 D_060011D4; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0C98.s") +static void BgZg_Destroy(BgZg* this, GlobalContext* globalCtx) +{ + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CC8.s") +static void func_808C0C50(BgZg* this) +{ + Audio_PlaySoundGeneral(NA_SE_EV_METALDOOR_OPEN, &this->dyna.actor.unk_E4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0CD4.s") +static s32 func_808C0C98(BgZg* this, GlobalContext* globalCtx) +{ + Actor* thisx = &this->dyna.actor; + s32 flag; + flag = (thisx->params >> 8) & 0xFF; + return Flags_GetSwitch(globalCtx, flag); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0D08.s") +static s32 func_808C0CC8(BgZg* this) +{ + s32 flag = this->dyna.actor.params & 0xFF; + return flag; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Update.s") +static void func_808C0CD4(BgZg* this, GlobalContext* globalCtx) +{ + if (func_808C0C98(this, globalCtx) != 0) + { + this->funcIndex = 1; + func_808C0C50(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Init.s") +static void func_808C0D08(BgZg* this, GlobalContext* globalCtx) +{ + Actor* thisx = &this->dyna.actor; + + thisx->posRot.pos.y += (kREG(16) + 20.0f) * 1.2f; + if ((((kREG(17) + 200.0f) * 1.2f) + thisx->initPosRot.pos.y) <= thisx->posRot.pos.y) + { + Actor_Kill(thisx); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/func_808C0EEC.s") +static void BgZg_Update(BgZg *this,GlobalContext *globalCtx) +{ + s32 funcIndex = this->funcIndex; + + if (((funcIndex < 0) || (1 < funcIndex)) || (funcTbl[funcIndex] == NULL)) + { + // Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!" + osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + } + else + { + funcTbl[funcIndex](&this->dyna.actor, globalCtx); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Zg/BgZg_Draw.s") +} + +static void BgZg_Init(BgZg* this, GlobalContext* globalCtx) { + s32 sp20[2]; + Actor* thisx = &this->dyna.actor; + u32 local_c; + + Actor_ProcessInitChain(thisx, initChain); + DynaPolyInfo_SetActorMove(thisx, DPM_UNK); + local_c = 0; + DynaPolyInfo_Alloc(&D_060011D4, &local_c); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); + if ((func_808C0CC8(this) == 8) || (func_808C0CC8(this) == 9)) + { + thisx->scale.x = thisx->scale.x * 1.3f; + thisx->scale.z = thisx->scale.z * 1.3f; + thisx->scale.y = thisx->scale.y * 1.2f; + } + + else + { + + } + + this->funcIndex = 0; + this->unk_168 = 0; + if (func_808C0C98(this, globalCtx) != 0) + { + Actor_Kill(thisx); + } +} + +static void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) +{ + + GraphicsContext* gfxCtx; + GraphicsContext* tempgfxCtx; // oddly needs this to match + Gfx* gfxArr[4]; + + tempgfxCtx = globalCtx->state.gfxCtx; + gfxCtx = tempgfxCtx; + func_800C6AC4(gfxArr, gfxCtx, "../z_bg_zg.c", 311); + + func_80093D18(gfxCtx); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(gfxCtx, "../z_bg_zg.c", 315), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001080); + func_800C6B54(gfxArr, gfxCtx, "../z_bg_zg.c", 320); +} + +static void BgZg_Draw(BgZg* this, GlobalContext* globalCtx) +{ + s32 funcIndex = this->unk_168; + + if (((funcIndex < 0) || (0 < funcIndex)) || funcTbl2[funcIndex] == 0) + { + // Translates to: "Drawing mode is wrong !!!!!!!!!!!!!!!!!!!!!!!!!" + osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + } + else + { + funcTbl2[funcIndex](this, globalCtx); + } +} \ No newline at end of file diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h index 3a856be401..6d7d6f7dc5 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h @@ -3,11 +3,13 @@ #include #include +#include typedef struct { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x20]; + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ s32 funcIndex; + /* 0x0168 */ s32 unk_168; } BgZg; // size = 0x016C extern const ActorInit Bg_Zg_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index b36919f649..8583d3a7f7 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -412,3 +412,6 @@ D_060009E0 = 0x060009E0; // z_bg_toki_swd D_06001BD0 = 0x06001BD0; +// z_bg_zg +D_060011D4 = 0x060011D4; +D_06001080 = 0x06001080; From 62e7a8c0376666f7ab8ca49e44eb831d6232d61e Mon Sep 17 00:00:00 2001 From: Lucas Shaw Date: Sun, 22 Mar 2020 22:55:37 -0700 Subject: [PATCH 27/33] formatting fix --- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index 3db69157c3..3573d46fc6 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -101,7 +101,8 @@ static void BgZg_Update(BgZg *this,GlobalContext *globalCtx) } -static void BgZg_Init(BgZg* this, GlobalContext* globalCtx) { +static void BgZg_Init(BgZg* this, GlobalContext* globalCtx) +{ s32 sp20[2]; Actor* thisx = &this->dyna.actor; u32 local_c; From a3ba02618bee825dfa82c9c6a321b24534e5a3b5 Mon Sep 17 00:00:00 2001 From: Lucas Shaw Date: Sun, 22 Mar 2020 23:40:12 -0700 Subject: [PATCH 28/33] Added description --- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index eb70ada22f..95aee2317f 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -1,3 +1,9 @@ +/* + * File: z_bg_zg.c + * Overlay: ovl_Bg_Zg + * Description: Metal bars (Ganon's Castle) + */ + #include "z_bg_zg.h" #define ROOM 0x00 From 385f77fb480f7bdebbc72e0b24e528085e0dadf2 Mon Sep 17 00:00:00 2001 From: dark-samus Date: Mon, 23 Mar 2020 06:35:43 -0400 Subject: [PATCH 29/33] match the final non-matching in boot! --- src/boot/yaz0.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/boot/yaz0.c b/src/boot/yaz0.c index 5954e28aaa..379d4ca467 100644 --- a/src/boot/yaz0.c +++ b/src/boot/yaz0.c @@ -51,10 +51,6 @@ void* Yaz0_NextDMA(void* curSrcPos) { return dst; } -#ifdef NON_MATCHING -// has an extra check at the start of the small compressed loop -// along with an extra move instruction -// maybe some regalloc differences besides these issues void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst) { u32 bitIdx; u8* src; @@ -63,46 +59,45 @@ void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst) { u32 nibble; u8* backPtr; s32 chunkSize; - u32 curDecBit; u32 off; bitIdx = 0; - src = hdr->data; + src = (u8*)hdr->data; dstEnd = dst + hdr->decSize; do { if (bitIdx == 0) { - if ((sYaz0MaxPtr < (u32)src) && (sYaz0CurSize != 0)) + if ((sYaz0MaxPtr < (u32)src) && (sYaz0CurSize != 0)) { src = Yaz0_NextDMA(src); + } chunkHeader = *src++; bitIdx = 8; } - curDecBit = chunkHeader & (1 << 7); - chunkHeader <<= 1; - - if (curDecBit) { // uncompressed - *dst++ = *src++; + if (chunkHeader & (1 << 7)) { // uncompressed + *dst = *src; + dst++; + src++; } else { // compressed + off = ((*src & 0xF) << 8 | *(src + 1)); nibble = *src >> 4; - backPtr = dst - (*(src + 1) | (*src & 0xF) << 8); + backPtr = dst - off; src += 2; chunkSize = (nibble == 0) // N = chunkSize; B = back offset ? *src++ + 0x12 // 3 bytes 0B BB NN : nibble + 2; // 2 bytes NB BB - for (off = chunkSize; off > 0; off--) + do { *dst++ = *(backPtr++ - 1); + chunkSize--; + } while (chunkSize != 0); } - + chunkHeader <<= 1; bitIdx--; } while (dst != dstEnd); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/boot/yaz0/Yaz0_DecompressImpl.s") -#endif void Yaz0_Decompress(u32 romStart, void* dst, u32 size) { sYaz0CurRomStart = romStart; From 7db0ed672a1c4517d64a559b7a8644be81731d2c Mon Sep 17 00:00:00 2001 From: dark-samus Date: Mon, 23 Mar 2020 06:54:52 -0400 Subject: [PATCH 30/33] remove asm for Yaz0_DecompressImpl --- .../boot/yaz0/Yaz0_DecompressImpl.s | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 asm/non_matchings/boot/yaz0/Yaz0_DecompressImpl.s diff --git a/asm/non_matchings/boot/yaz0/Yaz0_DecompressImpl.s b/asm/non_matchings/boot/yaz0/Yaz0_DecompressImpl.s deleted file mode 100644 index 4219a519cc..0000000000 --- a/asm/non_matchings/boot/yaz0/Yaz0_DecompressImpl.s +++ /dev/null @@ -1,99 +0,0 @@ -glabel Yaz0_DecompressImpl -/* 0028B0 80001CB0 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0028B4 80001CB4 AFBF002C */ sw $ra, 0x2c($sp) -/* 0028B8 80001CB8 AFB40028 */ sw $s4, 0x28($sp) -/* 0028BC 80001CBC AFB30024 */ sw $s3, 0x24($sp) -/* 0028C0 80001CC0 AFB20020 */ sw $s2, 0x20($sp) -/* 0028C4 80001CC4 AFB1001C */ sw $s1, 0x1c($sp) -/* 0028C8 80001CC8 AFB00018 */ sw $s0, 0x18($sp) -/* 0028CC 80001CCC 8C8E0004 */ lw $t6, 4($a0) -/* 0028D0 80001CD0 3C128001 */ lui $s2, %hi(sYaz0MaxPtr) # $s2, 0x8001 -/* 0028D4 80001CD4 3C138001 */ lui $s3, %hi(sYaz0CurSize) # $s3, 0x8001 -/* 0028D8 80001CD8 00A08025 */ move $s0, $a1 -/* 0028DC 80001CDC 00003025 */ move $a2, $zero -/* 0028E0 80001CE0 24910010 */ addiu $s1, $a0, 0x10 -/* 0028E4 80001CE4 267344E8 */ addiu $s3, %lo(sYaz0CurSize) # addiu $s3, $s3, 0x44e8 -/* 0028E8 80001CE8 265244EC */ addiu $s2, %lo(sYaz0MaxPtr) # addiu $s2, $s2, 0x44ec -/* 0028EC 80001CEC 8FA70030 */ lw $a3, 0x30($sp) -/* 0028F0 80001CF0 01C5A021 */ addu $s4, $t6, $a1 -.L80001CF4: -/* 0028F4 80001CF4 54C0000F */ bnezl $a2, .L80001D34 -/* 0028F8 80001CF8 30F90080 */ andi $t9, $a3, 0x80 -/* 0028FC 80001CFC 8E4F0000 */ lw $t7, ($s2) -/* 002900 80001D00 01F1082B */ sltu $at, $t7, $s1 -/* 002904 80001D04 50200008 */ beql $at, $zero, .L80001D28 -/* 002908 80001D08 92270000 */ lbu $a3, ($s1) -/* 00290C 80001D0C 8E780000 */ lw $t8, ($s3) -/* 002910 80001D10 53000005 */ beql $t8, $zero, .L80001D28 -/* 002914 80001D14 92270000 */ lbu $a3, ($s1) -/* 002918 80001D18 0C0006F2 */ jal Yaz0_NextDMA -/* 00291C 80001D1C 02202025 */ move $a0, $s1 -/* 002920 80001D20 00408825 */ move $s1, $v0 -/* 002924 80001D24 92270000 */ lbu $a3, ($s1) -.L80001D28: -/* 002928 80001D28 26310001 */ addiu $s1, $s1, 1 -/* 00292C 80001D2C 24060008 */ li $a2, 8 -/* 002930 80001D30 30F90080 */ andi $t9, $a3, 0x80 -.L80001D34: -/* 002934 80001D34 13200006 */ beqz $t9, .L80001D50 -/* 002938 80001D38 00073840 */ sll $a3, $a3, 1 -/* 00293C 80001D3C 92280000 */ lbu $t0, ($s1) -/* 002940 80001D40 26100001 */ addiu $s0, $s0, 1 -/* 002944 80001D44 26310001 */ addiu $s1, $s1, 1 -/* 002948 80001D48 10000027 */ b .L80001DE8 -/* 00294C 80001D4C A208FFFF */ sb $t0, -1($s0) -.L80001D50: -/* 002950 80001D50 92230000 */ lbu $v1, ($s1) -/* 002954 80001D54 92290001 */ lbu $t1, 1($s1) -/* 002958 80001D58 26310002 */ addiu $s1, $s1, 2 -/* 00295C 80001D5C 306A000F */ andi $t2, $v1, 0xf -/* 002960 80001D60 000A5A00 */ sll $t3, $t2, 8 -/* 002964 80001D64 00032903 */ sra $a1, $v1, 4 -/* 002968 80001D68 012B2025 */ or $a0, $t1, $t3 -/* 00296C 80001D6C 14A00005 */ bnez $a1, .L80001D84 -/* 002970 80001D70 02041023 */ subu $v0, $s0, $a0 -/* 002974 80001D74 92230000 */ lbu $v1, ($s1) -/* 002978 80001D78 26310001 */ addiu $s1, $s1, 1 -/* 00297C 80001D7C 10000002 */ b .L80001D88 -/* 002980 80001D80 24630012 */ addiu $v1, $v1, 0x12 -.L80001D84: -/* 002984 80001D84 24A30002 */ addiu $v1, $a1, 2 -.L80001D88: -/* 002988 80001D88 30650003 */ andi $a1, $v1, 3 -/* 00298C 80001D8C 00052823 */ negu $a1, $a1 -/* 002990 80001D90 10A00009 */ beqz $a1, .L80001DB8 -/* 002994 80001D94 00A32021 */ addu $a0, $a1, $v1 -.L80001D98: -/* 002998 80001D98 904CFFFF */ lbu $t4, -1($v0) -/* 00299C 80001D9C 2463FFFF */ addiu $v1, $v1, -1 -/* 0029A0 80001DA0 26100001 */ addiu $s0, $s0, 1 -/* 0029A4 80001DA4 24420001 */ addiu $v0, $v0, 1 -/* 0029A8 80001DA8 1483FFFB */ bne $a0, $v1, .L80001D98 -/* 0029AC 80001DAC A20CFFFF */ sb $t4, -1($s0) -/* 0029B0 80001DB0 1060000D */ beqz $v1, .L80001DE8 -/* 0029B4 80001DB4 00000000 */ nop -.L80001DB8: -/* 0029B8 80001DB8 904DFFFF */ lbu $t5, -1($v0) -/* 0029BC 80001DBC 2463FFFC */ addiu $v1, $v1, -4 -/* 0029C0 80001DC0 26100004 */ addiu $s0, $s0, 4 -/* 0029C4 80001DC4 A20DFFFC */ sb $t5, -4($s0) -/* 0029C8 80001DC8 904E0000 */ lbu $t6, ($v0) -/* 0029CC 80001DCC 24420004 */ addiu $v0, $v0, 4 -/* 0029D0 80001DD0 A20EFFFD */ sb $t6, -3($s0) -/* 0029D4 80001DD4 904FFFFD */ lbu $t7, -3($v0) -/* 0029D8 80001DD8 A20FFFFE */ sb $t7, -2($s0) -/* 0029DC 80001DDC 9058FFFE */ lbu $t8, -2($v0) -/* 0029E0 80001DE0 1460FFF5 */ bnez $v1, .L80001DB8 -/* 0029E4 80001DE4 A218FFFF */ sb $t8, -1($s0) -.L80001DE8: -/* 0029E8 80001DE8 1614FFC2 */ bne $s0, $s4, .L80001CF4 -/* 0029EC 80001DEC 24C6FFFF */ addiu $a2, $a2, -1 -/* 0029F0 80001DF0 8FBF002C */ lw $ra, 0x2c($sp) -/* 0029F4 80001DF4 AFA70030 */ sw $a3, 0x30($sp) -/* 0029F8 80001DF8 8FB00018 */ lw $s0, 0x18($sp) -/* 0029FC 80001DFC 8FB1001C */ lw $s1, 0x1c($sp) -/* 002A00 80001E00 8FB20020 */ lw $s2, 0x20($sp) -/* 002A04 80001E04 8FB30024 */ lw $s3, 0x24($sp) -/* 002A08 80001E08 8FB40028 */ lw $s4, 0x28($sp) -/* 002A0C 80001E0C 03E00008 */ jr $ra -/* 002A10 80001E10 27BD0040 */ addiu $sp, $sp, 0x40 \ No newline at end of file From 3c53052726b72a63ebddb866524fe9cdc3832c5a Mon Sep 17 00:00:00 2001 From: shawlucas Date: Mon, 23 Mar 2020 12:10:06 -0700 Subject: [PATCH 31/33] updated ovl_bg_zg formatting --- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 99 +++++++++---------------- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h | 3 +- 2 files changed, 37 insertions(+), 65 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index 95aee2317f..d647ff1e67 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -22,15 +22,11 @@ static void func_808C0EEC(BgZg* this, GlobalContext* globalCtx); static const ActorFunc funcTbl[] = { (ActorFunc)func_808C0CD4, (ActorFunc)func_808C0D08 }; -static InitChainEntry initChain[] = -{ - ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP) -}; +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP) }; -static const ActorFunc funcTbl2[] = { (ActorFunc) func_808C0EEC }; +static const ActorFunc funcTbl2[] = { (ActorFunc)func_808C0EEC }; -const ActorInit Bg_Zg_InitVars = -{ +const ActorInit Bg_Zg_InitVars = { ACTOR_BG_ZG, ACTORTYPE_NPC, ROOM, @@ -46,100 +42,80 @@ const ActorInit Bg_Zg_InitVars = extern u32 D_06001080; extern u32 D_060011D4; -static void BgZg_Destroy(BgZg* this, GlobalContext* globalCtx) -{ +static void BgZg_Destroy(BgZg* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -static void func_808C0C50(BgZg* this) -{ - Audio_PlaySoundGeneral(NA_SE_EV_METALDOOR_OPEN, &this->dyna.actor.unk_E4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); +static void func_808C0C50(BgZg* this) { + Audio_PlaySoundGeneral(NA_SE_EV_METALDOOR_OPEN, &this->dyna.actor.unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -static s32 func_808C0C98(BgZg* this, GlobalContext* globalCtx) -{ +static s32 func_808C0C98(BgZg* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; s32 flag; flag = (thisx->params >> 8) & 0xFF; return Flags_GetSwitch(globalCtx, flag); } -static s32 func_808C0CC8(BgZg* this) -{ +static s32 func_808C0CC8(BgZg* this) { s32 flag = this->dyna.actor.params & 0xFF; return flag; } -static void func_808C0CD4(BgZg* this, GlobalContext* globalCtx) -{ - if (func_808C0C98(this, globalCtx) != 0) - { +static void func_808C0CD4(BgZg* this, GlobalContext* globalCtx) { + if (func_808C0C98(this, globalCtx) != 0) { this->funcIndex = 1; func_808C0C50(this); } } -static void func_808C0D08(BgZg* this, GlobalContext* globalCtx) -{ +static void func_808C0D08(BgZg* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - + thisx->posRot.pos.y += (kREG(16) + 20.0f) * 1.2f; - if ((((kREG(17) + 200.0f) * 1.2f) + thisx->initPosRot.pos.y) <= thisx->posRot.pos.y) - { + if ((((kREG(17) + 200.0f) * 1.2f) + thisx->initPosRot.pos.y) <= thisx->posRot.pos.y) { Actor_Kill(thisx); - } + } } -static void BgZg_Update(BgZg *this,GlobalContext *globalCtx) -{ - s32 funcIndex = this->funcIndex; - - if (((funcIndex < 0) || (1 < funcIndex)) || (funcTbl[funcIndex] == NULL)) - { - // Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!" - osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); - } - else - { - funcTbl[funcIndex](&this->dyna.actor, globalCtx); - } +static void BgZg_Update(BgZg* this, GlobalContext* globalCtx) { + s32 funcIndex = this->funcIndex; + if (((funcIndex < 0) || (1 < funcIndex)) || (funcTbl[funcIndex] == NULL)) { + // Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!" + osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + } else { + funcTbl[funcIndex](&this->dyna.actor, globalCtx); + } } -static void BgZg_Init(BgZg* this, GlobalContext* globalCtx) -{ +static void BgZg_Init(BgZg* this, GlobalContext* globalCtx) { s32 sp20[2]; Actor* thisx = &this->dyna.actor; u32 local_c; - + Actor_ProcessInitChain(thisx, initChain); DynaPolyInfo_SetActorMove(thisx, DPM_UNK); local_c = 0; DynaPolyInfo_Alloc(&D_060011D4, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); - if ((func_808C0CC8(this) == 8) || (func_808C0CC8(this) == 9)) - { + if ((func_808C0CC8(this) == 8) || (func_808C0CC8(this) == 9)) { thisx->scale.x = thisx->scale.x * 1.3f; thisx->scale.z = thisx->scale.z * 1.3f; thisx->scale.y = thisx->scale.y * 1.2f; - } - - else - { + } + else { } this->funcIndex = 0; this->unk_168 = 0; - if (func_808C0C98(this, globalCtx) != 0) - { + if (func_808C0C98(this, globalCtx) != 0) { Actor_Kill(thisx); } } -static void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) -{ +static void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx; GraphicsContext* tempgfxCtx; // oddly needs this to match @@ -148,25 +124,22 @@ static void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) tempgfxCtx = globalCtx->state.gfxCtx; gfxCtx = tempgfxCtx; func_800C6AC4(gfxArr, gfxCtx, "../z_bg_zg.c", 311); - + func_80093D18(gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(gfxCtx, "../z_bg_zg.c", 315), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(gfxCtx, "../z_bg_zg.c", 315), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001080); func_800C6B54(gfxArr, gfxCtx, "../z_bg_zg.c", 320); } -static void BgZg_Draw(BgZg* this, GlobalContext* globalCtx) -{ +static void BgZg_Draw(BgZg* this, GlobalContext* globalCtx) { s32 funcIndex = this->unk_168; - if (((funcIndex < 0) || (0 < funcIndex)) || funcTbl2[funcIndex] == 0) - { + if (((funcIndex < 0) || (0 < funcIndex)) || funcTbl2[funcIndex] == 0) { // Translates to: "Drawing mode is wrong !!!!!!!!!!!!!!!!!!!!!!!!!" osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); - } - else - { + } else { funcTbl2[funcIndex](this, globalCtx); } -} \ No newline at end of file +} diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h index 6d7d6f7dc5..28b0fc049f 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h @@ -5,8 +5,7 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ s32 funcIndex; /* 0x0168 */ s32 unk_168; From 032a8de42fd86b27ad2d12ac9c37940e38bf3fd5 Mon Sep 17 00:00:00 2001 From: shawlucas Date: Mon, 23 Mar 2020 12:59:58 -0700 Subject: [PATCH 32/33] Made suggested changes --- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 30 +++++++++++-------------- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h | 4 ++-- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index d647ff1e67..65a69c214c 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -20,11 +20,11 @@ static void func_808C0CD4(BgZg* this, GlobalContext* globalCtx); static void func_808C0D08(BgZg* this, GlobalContext* globalCtx); static void func_808C0EEC(BgZg* this, GlobalContext* globalCtx); -static const ActorFunc funcTbl[] = { (ActorFunc)func_808C0CD4, (ActorFunc)func_808C0D08 }; +static const ActorFunc actionFuncs[] = { (ActorFunc)func_808C0CD4, (ActorFunc)func_808C0D08, }; -static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP) }; +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; -static const ActorFunc funcTbl2[] = { (ActorFunc)func_808C0EEC }; +static const ActorFunc drawFuncs[] = { (ActorFunc)func_808C0EEC, }; const ActorInit Bg_Zg_InitVars = { ACTOR_BG_ZG, @@ -52,8 +52,7 @@ static void func_808C0C50(BgZg* this) { static s32 func_808C0C98(BgZg* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - s32 flag; - flag = (thisx->params >> 8) & 0xFF; + s32 flag = (thisx->params >> 8) & 0xFF; return Flags_GetSwitch(globalCtx, flag); } @@ -64,7 +63,7 @@ static s32 func_808C0CC8(BgZg* this) { static void func_808C0CD4(BgZg* this, GlobalContext* globalCtx) { if (func_808C0C98(this, globalCtx) != 0) { - this->funcIndex = 1; + this->action = 1; func_808C0C50(this); } } @@ -79,13 +78,13 @@ static void func_808C0D08(BgZg* this, GlobalContext* globalCtx) { } static void BgZg_Update(BgZg* this, GlobalContext* globalCtx) { - s32 funcIndex = this->funcIndex; + s32 action = this->action; - if (((funcIndex < 0) || (1 < funcIndex)) || (funcTbl[funcIndex] == NULL)) { + if (((action < 0) || (1 < action)) || (actionFuncs[action] == NULL)) { // Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!" osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); } else { - funcTbl[funcIndex](&this->dyna.actor, globalCtx); + actionFuncs[action](&this->dyna.actor, globalCtx); } } @@ -105,11 +104,8 @@ static void BgZg_Init(BgZg* this, GlobalContext* globalCtx) { thisx->scale.y = thisx->scale.y * 1.2f; } - else { - } - - this->funcIndex = 0; - this->unk_168 = 0; + this->action = 0; + this->drawConfig = 0; if (func_808C0C98(this, globalCtx) != 0) { Actor_Kill(thisx); } @@ -134,12 +130,12 @@ static void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) { } static void BgZg_Draw(BgZg* this, GlobalContext* globalCtx) { - s32 funcIndex = this->unk_168; + s32 action = this->drawConfig; - if (((funcIndex < 0) || (0 < funcIndex)) || funcTbl2[funcIndex] == 0) { + if (((action < 0) || (action > 0)) || drawFuncs[action] == 0) { // Translates to: "Drawing mode is wrong !!!!!!!!!!!!!!!!!!!!!!!!!" osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); } else { - funcTbl2[funcIndex](this, globalCtx); + drawFuncs[action](this, globalCtx); } } diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h index 28b0fc049f..ab959e101b 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h @@ -7,8 +7,8 @@ typedef struct { /* 0x0000 */ DynaPolyActor dyna; - /* 0x0164 */ s32 funcIndex; - /* 0x0168 */ s32 unk_168; + /* 0x0164 */ s32 action; + /* 0x0168 */ s32 drawConfig; } BgZg; // size = 0x016C extern const ActorInit Bg_Zg_InitVars; From 7bc9d3863c9800a699a9ec84c21e33bd5d3936d3 Mon Sep 17 00:00:00 2001 From: shawlucas Date: Mon, 23 Mar 2020 13:00:47 -0700 Subject: [PATCH 33/33] Made more suggested changes --- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index 65a69c214c..b1a828e3cf 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -132,7 +132,7 @@ static void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) { static void BgZg_Draw(BgZg* this, GlobalContext* globalCtx) { s32 action = this->drawConfig; - if (((action < 0) || (action > 0)) || drawFuncs[action] == 0) { + if (((action < 0) || (action > 0)) || drawFuncs[action] == NULL) { // Translates to: "Drawing mode is wrong !!!!!!!!!!!!!!!!!!!!!!!!!" osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); } else {