From 65e956a272a63d193fcefa916d95d5fe791ec072 Mon Sep 17 00:00:00 2001 From: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Date: Thu, 14 Jan 2021 19:28:36 +0000 Subject: [PATCH] DemoExt OK and documented (#586) * OK * all functions and variables named * delete asm * data inlined * Merge remote-tracking branch 'upstream/master' into demo_ext * addressed review comments * formatter * addressed review comments --- .../actors/ovl_Demo_Ext/DemoExt_Destroy.s | 4 - .../actors/ovl_Demo_Ext/DemoExt_Draw.s | 35 --- .../actors/ovl_Demo_Ext/DemoExt_Init.s | 46 --- .../actors/ovl_Demo_Ext/DemoExt_Update.s | 34 --- .../actors/ovl_Demo_Ext/func_80977450.s | 37 --- .../actors/ovl_Demo_Ext/func_809774D8.s | 11 - .../actors/ovl_Demo_Ext/func_809774FC.s | 4 - .../actors/ovl_Demo_Ext/func_80977508.s | 36 --- .../actors/ovl_Demo_Ext/func_80977590.s | 6 - .../actors/ovl_Demo_Ext/func_809775A4.s | 30 -- .../actors/ovl_Demo_Ext/func_80977610.s | 62 ---- .../actors/ovl_Demo_Ext/func_809776D0.s | 21 -- .../actors/ovl_Demo_Ext/func_8097771C.s | 82 ------ .../actors/ovl_Demo_Ext/func_80977854.s | 9 - .../actors/ovl_Demo_Ext/func_80977874.s | 15 - .../actors/ovl_Demo_Ext/func_809778AC.s | 16 -- .../actors/ovl_Demo_Ext/func_80977944.s | 4 - .../actors/ovl_Demo_Ext/func_80977950.s | 192 ------------- data/overlays/actors/z_demo_ext.data.s | 26 -- data/overlays/actors/z_demo_ext.reloc.s | 13 - spec | 3 +- src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c | 264 +++++++++++++++--- src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h | 14 +- 23 files changed, 240 insertions(+), 724 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977450.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774D8.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774FC.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977508.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977590.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809775A4.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977610.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809776D0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_8097771C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977854.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977874.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809778AC.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977944.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977950.s delete mode 100644 data/overlays/actors/z_demo_ext.data.s delete mode 100644 data/overlays/actors/z_demo_ext.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Destroy.s deleted file mode 100644 index f404e231dc..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Destroy.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel DemoExt_Destroy -/* 00000 80977390 AFA40000 */ sw $a0, 0x0000($sp) -/* 00004 80977394 03E00008 */ jr $ra -/* 00008 80977398 AFA50004 */ sw $a1, 0x0004($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Draw.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Draw.s deleted file mode 100644 index 651359273c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Draw.s +++ /dev/null @@ -1,35 +0,0 @@ -.rdata -glabel D_80977D50 - .asciz "\x1b[31m描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n\x1b[m" - .balign 4 - -.text -glabel DemoExt_Draw -/* 00880 80977C10 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00884 80977C14 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00888 80977C18 8C820150 */ lw $v0, 0x0150($a0) ## 00000150 -/* 0088C 80977C1C 04400008 */ bltz $v0, .L80977C40 -/* 00890 80977C20 28410002 */ slti $at, $v0, 0x0002 -/* 00894 80977C24 10200006 */ beq $at, $zero, .L80977C40 -/* 00898 80977C28 00027080 */ sll $t6, $v0, 2 -/* 0089C 80977C2C 3C038097 */ lui $v1, %hi(D_80977C7C) ## $v1 = 80970000 -/* 008A0 80977C30 006E1821 */ addu $v1, $v1, $t6 -/* 008A4 80977C34 8C637C7C */ lw $v1, %lo(D_80977C7C)($v1) -/* 008A8 80977C38 14600006 */ bne $v1, $zero, .L80977C54 -/* 008AC 80977C3C 00000000 */ nop -.L80977C40: -/* 008B0 80977C40 3C048097 */ lui $a0, %hi(D_80977D50) ## $a0 = 80970000 -/* 008B4 80977C44 0C00084C */ jal osSyncPrintf - -/* 008B8 80977C48 24847D50 */ addiu $a0, $a0, %lo(D_80977D50) ## $a0 = 80977D50 -/* 008BC 80977C4C 10000004 */ beq $zero, $zero, .L80977C60 -/* 008C0 80977C50 8FBF0014 */ lw $ra, 0x0014($sp) -.L80977C54: -/* 008C4 80977C54 0060F809 */ jalr $ra, $v1 -/* 008C8 80977C58 00000000 */ nop -/* 008CC 80977C5C 8FBF0014 */ lw $ra, 0x0014($sp) -.L80977C60: -/* 008D0 80977C60 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 008D4 80977C64 03E00008 */ jr $ra -/* 008D8 80977C68 00000000 */ nop -/* 008DC 80977C6C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Init.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Init.s deleted file mode 100644 index f97fb7e355..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Init.s +++ /dev/null @@ -1,46 +0,0 @@ -glabel DemoExt_Init -/* 0000C 8097739C AFA50004 */ sw $a1, 0x0004($sp) -/* 00010 809773A0 3C028016 */ lui $v0, %hi(gGameInfo) -/* 00014 809773A4 240E0019 */ addiu $t6, $zero, 0x0019 ## $t6 = 00000019 -/* 00018 809773A8 240F0028 */ addiu $t7, $zero, 0x0028 ## $t7 = 00000028 -/* 0001C 809773AC 24180005 */ addiu $t8, $zero, 0x0005 ## $t8 = 00000005 -/* 00020 809773B0 2419001E */ addiu $t9, $zero, 0x001E ## $t9 = 0000001E -/* 00024 809773B4 2442FA90 */ addiu $v0, %lo(gGameInfo) -/* 00028 809773B8 A48E0158 */ sh $t6, 0x0158($a0) ## 00000158 -/* 0002C 809773BC A48F015A */ sh $t7, 0x015A($a0) ## 0000015A -/* 00030 809773C0 A498015C */ sh $t8, 0x015C($a0) ## 0000015C -/* 00034 809773C4 A499015E */ sh $t9, 0x015E($a0) ## 0000015E -/* 00038 809773C8 8C480000 */ lw $t0, 0x0000($v0) ## 8015FA90 -/* 0003C 809773CC 3C0143C8 */ lui $at, 0x43C8 ## $at = 43C80000 -/* 00040 809773D0 44810000 */ mtc1 $at, $f0 ## $f0 = 400.00 -/* 00044 809773D4 8509148C */ lh $t1, 0x148C($t0) ## 0000148C -/* 00048 809773D8 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 0004C 809773DC 44819000 */ mtc1 $at, $f18 ## $f18 = 100.00 -/* 00050 809773E0 252A00FF */ addiu $t2, $t1, 0x00FF ## $t2 = 000000FF -/* 00054 809773E4 AC8A0170 */ sw $t2, 0x0170($a0) ## 00000170 -/* 00058 809773E8 8C4B0000 */ lw $t3, 0x0000($v0) ## 8015FA90 -/* 0005C 809773EC 856C1494 */ lh $t4, 0x1494($t3) ## 00001494 -/* 00060 809773F0 258D00FF */ addiu $t5, $t4, 0x00FF ## $t5 = 000000FF -/* 00064 809773F4 AC8D0174 */ sw $t5, 0x0174($a0) ## 00000174 -/* 00068 809773F8 8C4E0000 */ lw $t6, 0x0000($v0) ## 8015FA90 -/* 0006C 809773FC 85CF147A */ lh $t7, 0x147A($t6) ## 00001493 -/* 00070 80977400 448F2000 */ mtc1 $t7, $f4 ## $f4 = 0.00 -/* 00074 80977404 00000000 */ nop -/* 00078 80977408 468021A0 */ cvt.s.w $f6, $f4 -/* 0007C 8097740C 46003200 */ add.s $f8, $f6, $f0 -/* 00080 80977410 E4880178 */ swc1 $f8, 0x0178($a0) ## 00000178 -/* 00084 80977414 8C580000 */ lw $t8, 0x0000($v0) ## 8015FA90 -/* 00088 80977418 8719147C */ lh $t9, 0x147C($t8) ## 00001481 -/* 0008C 8097741C 44995000 */ mtc1 $t9, $f10 ## $f10 = 0.00 -/* 00090 80977420 00000000 */ nop -/* 00094 80977424 46805420 */ cvt.s.w $f16, $f10 -/* 00098 80977428 46128100 */ add.s $f4, $f16, $f18 -/* 0009C 8097742C E484017C */ swc1 $f4, 0x017C($a0) ## 0000017C -/* 000A0 80977430 8C480000 */ lw $t0, 0x0000($v0) ## 8015FA90 -/* 000A4 80977434 8509147E */ lh $t1, 0x147E($t0) ## 0000147E -/* 000A8 80977438 44893000 */ mtc1 $t1, $f6 ## $f6 = 0.00 -/* 000AC 8097743C 00000000 */ nop -/* 000B0 80977440 46803220 */ cvt.s.w $f8, $f6 -/* 000B4 80977444 46004280 */ add.s $f10, $f8, $f0 -/* 000B8 80977448 03E00008 */ jr $ra -/* 000BC 8097744C E48A0180 */ swc1 $f10, 0x0180($a0) ## 00000180 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Update.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Update.s deleted file mode 100644 index de0e907770..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Update.s +++ /dev/null @@ -1,34 +0,0 @@ -.rdata -glabel D_80977CE4 - .asciz "\x1b[31mメインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n\x1b[m" - .balign 4 - -.text -glabel DemoExt_Update -/* 00558 809778E8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0055C 809778EC AFBF0014 */ sw $ra, 0x0014($sp) -/* 00560 809778F0 8C82014C */ lw $v0, 0x014C($a0) ## 0000014C -/* 00564 809778F4 04400008 */ bltz $v0, .L80977918 -/* 00568 809778F8 28410003 */ slti $at, $v0, 0x0003 -/* 0056C 809778FC 10200006 */ beq $at, $zero, .L80977918 -/* 00570 80977900 00027080 */ sll $t6, $v0, 2 -/* 00574 80977904 3C038097 */ lui $v1, %hi(D_80977C70) ## $v1 = 80970000 -/* 00578 80977908 006E1821 */ addu $v1, $v1, $t6 -/* 0057C 8097790C 8C637C70 */ lw $v1, %lo(D_80977C70)($v1) -/* 00580 80977910 14600006 */ bne $v1, $zero, .L8097792C -/* 00584 80977914 00000000 */ nop -.L80977918: -/* 00588 80977918 3C048097 */ lui $a0, %hi(D_80977CE4) ## $a0 = 80970000 -/* 0058C 8097791C 0C00084C */ jal osSyncPrintf - -/* 00590 80977920 24847CE4 */ addiu $a0, $a0, %lo(D_80977CE4) ## $a0 = 80977CE4 -/* 00594 80977924 10000004 */ beq $zero, $zero, .L80977938 -/* 00598 80977928 8FBF0014 */ lw $ra, 0x0014($sp) -.L8097792C: -/* 0059C 8097792C 0060F809 */ jalr $ra, $v1 -/* 005A0 80977930 00000000 */ nop -/* 005A4 80977934 8FBF0014 */ lw $ra, 0x0014($sp) -.L80977938: -/* 005A8 80977938 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 005AC 8097793C 03E00008 */ jr $ra -/* 005B0 80977940 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977450.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977450.s deleted file mode 100644 index 2379ebc9a8..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977450.s +++ /dev/null @@ -1,37 +0,0 @@ -glabel func_80977450 -/* 000C0 80977450 3C0E8016 */ lui $t6, %hi(gGameInfo) -/* 000C4 80977454 8DCEFA90 */ lw $t6, %lo(gGameInfo)($t6) -/* 000C8 80977458 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 000CC 8097745C AFBF001C */ sw $ra, 0x001C($sp) -/* 000D0 80977460 AFA40020 */ sw $a0, 0x0020($sp) -/* 000D4 80977464 85CF149A */ lh $t7, 0x149A($t6) ## 8016149A -/* 000D8 80977468 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 000DC 8097746C 44814000 */ mtc1 $at, $f8 ## $f8 = 40.00 -/* 000E0 80977470 448F2000 */ mtc1 $t7, $f4 ## $f4 = 0.00 -/* 000E4 80977474 3C014170 */ lui $at, 0x4170 ## $at = 41700000 -/* 000E8 80977478 44818000 */ mtc1 $at, $f16 ## $f16 = 15.00 -/* 000EC 8097747C 468021A0 */ cvt.s.w $f6, $f4 -/* 000F0 80977480 C484016C */ lwc1 $f4, 0x016C($a0) ## 0000016C -/* 000F4 80977484 0080C025 */ or $t8, $a0, $zero ## $t8 = 00000000 -/* 000F8 80977488 3C078013 */ lui $a3, %hi(D_801333E0) -/* 000FC 8097748C 3C198013 */ lui $t9, %hi(D_801333E8) -/* 00100 80977490 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 00104 80977494 46083280 */ add.s $f10, $f6, $f8 -/* 00108 80977498 273933E8 */ addiu $t9, %lo(D_801333E8) -/* 0010C 8097749C 270500E4 */ addiu $a1, $t8, 0x00E4 ## $a1 = 000000E4 -/* 00110 809774A0 24042040 */ addiu $a0, $zero, 0x2040 ## $a0 = 00002040 -/* 00114 809774A4 46105481 */ sub.s $f18, $f10, $f16 -/* 00118 809774A8 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 0011C 809774AC 4612203E */ c.le.s $f4, $f18 -/* 00120 809774B0 00000000 */ nop -/* 00124 809774B4 45020005 */ bc1fl .L809774CC -/* 00128 809774B8 8FBF001C */ lw $ra, 0x001C($sp) -/* 0012C 809774BC AFA70010 */ sw $a3, 0x0010($sp) -/* 00130 809774C0 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 00134 809774C4 AFB90014 */ sw $t9, 0x0014($sp) -/* 00138 809774C8 8FBF001C */ lw $ra, 0x001C($sp) -.L809774CC: -/* 0013C 809774CC 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00140 809774D0 03E00008 */ jr $ra -/* 00144 809774D4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774D8.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774D8.s deleted file mode 100644 index a432379723..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774D8.s +++ /dev/null @@ -1,11 +0,0 @@ -glabel func_809774D8 -/* 00148 809774D8 908E1D6C */ lbu $t6, 0x1D6C($a0) ## 00001D6C -/* 0014C 809774DC 00057880 */ sll $t7, $a1, 2 -/* 00150 809774E0 008FC021 */ addu $t8, $a0, $t7 -/* 00154 809774E4 11C00003 */ beq $t6, $zero, .L809774F4 -/* 00158 809774E8 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 0015C 809774EC 03E00008 */ jr $ra -/* 00160 809774F0 8F021D8C */ lw $v0, 0x1D8C($t8) ## 00001D8C -.L809774F4: -/* 00164 809774F4 03E00008 */ jr $ra -/* 00168 809774F8 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774FC.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774FC.s deleted file mode 100644 index bcc061bc13..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774FC.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel func_809774FC -/* 0016C 809774FC AC80014C */ sw $zero, 0x014C($a0) ## 0000014C -/* 00170 80977500 03E00008 */ jr $ra -/* 00174 80977504 AC800150 */ sw $zero, 0x0150($a0) ## 00000150 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977508.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977508.s deleted file mode 100644 index 7fba58e211..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977508.s +++ /dev/null @@ -1,36 +0,0 @@ -glabel func_80977508 -/* 00178 80977508 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0017C 8097750C 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 00180 80977510 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00184 80977514 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00188 80977518 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005 -/* 0018C 8097751C 0C25DD36 */ jal func_809774D8 -/* 00190 80977520 AFA60018 */ sw $a2, 0x0018($sp) -/* 00194 80977524 10400013 */ beq $v0, $zero, .L80977574 -/* 00198 80977528 8FA60018 */ lw $a2, 0x0018($sp) -/* 0019C 8097752C 8C4E000C */ lw $t6, 0x000C($v0) ## 0000000C -/* 001A0 80977530 448E2000 */ mtc1 $t6, $f4 ## $f4 = 0.00 -/* 001A4 80977534 00000000 */ nop -/* 001A8 80977538 468021A0 */ cvt.s.w $f6, $f4 -/* 001AC 8097753C E4C60024 */ swc1 $f6, 0x0024($a2) ## 00000024 -/* 001B0 80977540 8C4F0010 */ lw $t7, 0x0010($v0) ## 00000010 -/* 001B4 80977544 448F4000 */ mtc1 $t7, $f8 ## $f8 = 0.00 -/* 001B8 80977548 00000000 */ nop -/* 001BC 8097754C 468042A0 */ cvt.s.w $f10, $f8 -/* 001C0 80977550 E4CA0028 */ swc1 $f10, 0x0028($a2) ## 00000028 -/* 001C4 80977554 8C580014 */ lw $t8, 0x0014($v0) ## 00000014 -/* 001C8 80977558 44988000 */ mtc1 $t8, $f16 ## $f16 = 0.00 -/* 001CC 8097755C 00000000 */ nop -/* 001D0 80977560 468084A0 */ cvt.s.w $f18, $f16 -/* 001D4 80977564 E4D2002C */ swc1 $f18, 0x002C($a2) ## 0000002C -/* 001D8 80977568 84430008 */ lh $v1, 0x0008($v0) ## 00000008 -/* 001DC 8097756C A4C300B6 */ sh $v1, 0x00B6($a2) ## 000000B6 -/* 001E0 80977570 A4C30032 */ sh $v1, 0x0032($a2) ## 00000032 -.L80977574: -/* 001E4 80977574 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 001E8 80977578 ACC2014C */ sw $v0, 0x014C($a2) ## 0000014C -/* 001EC 8097757C ACC20150 */ sw $v0, 0x0150($a2) ## 00000150 -/* 001F0 80977580 8FBF0014 */ lw $ra, 0x0014($sp) -/* 001F4 80977584 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 001F8 80977588 03E00008 */ jr $ra -/* 001FC 8097758C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977590.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977590.s deleted file mode 100644 index d0f0b795cb..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977590.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel func_80977590 -/* 00200 80977590 240E0002 */ addiu $t6, $zero, 0x0002 ## $t6 = 00000002 -/* 00204 80977594 240F0001 */ addiu $t7, $zero, 0x0001 ## $t7 = 00000001 -/* 00208 80977598 AC8E014C */ sw $t6, 0x014C($a0) ## 0000014C -/* 0020C 8097759C 03E00008 */ jr $ra -/* 00210 809775A0 AC8F0150 */ sw $t7, 0x0150($a0) ## 00000150 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809775A4.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809775A4.s deleted file mode 100644 index 6323d854ad..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809775A4.s +++ /dev/null @@ -1,30 +0,0 @@ -glabel func_809775A4 -/* 00214 809775A4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00218 809775A8 AFBF0014 */ sw $ra, 0x0014($sp) -/* 0021C 809775AC 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 00220 809775B0 44813000 */ mtc1 $at, $f6 ## $f6 = 1.00 -/* 00224 809775B4 C484016C */ lwc1 $f4, 0x016C($a0) ## 0000016C -/* 00228 809775B8 3C0E8016 */ lui $t6, %hi(gGameInfo) -/* 0022C 809775BC 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 00230 809775C0 46062200 */ add.s $f8, $f4, $f6 -/* 00234 809775C4 44812000 */ mtc1 $at, $f4 ## $f4 = 40.00 -/* 00238 809775C8 E488016C */ swc1 $f8, 0x016C($a0) ## 0000016C -/* 0023C 809775CC 8DCEFA90 */ lw $t6, %lo(gGameInfo)($t6) -/* 00240 809775D0 C48A016C */ lwc1 $f10, 0x016C($a0) ## 0000016C -/* 00244 809775D4 85CF149A */ lh $t7, 0x149A($t6) ## 8016149A -/* 00248 809775D8 448F8000 */ mtc1 $t7, $f16 ## $f16 = 0.00 -/* 0024C 809775DC 00000000 */ nop -/* 00250 809775E0 468084A0 */ cvt.s.w $f18, $f16 -/* 00254 809775E4 46049180 */ add.s $f6, $f18, $f4 -/* 00258 809775E8 460A303E */ c.le.s $f6, $f10 -/* 0025C 809775EC 00000000 */ nop -/* 00260 809775F0 45020004 */ bc1fl .L80977604 -/* 00264 809775F4 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00268 809775F8 0C00B55C */ jal Actor_Kill - -/* 0026C 809775FC 00000000 */ nop -/* 00270 80977600 8FBF0014 */ lw $ra, 0x0014($sp) -.L80977604: -/* 00274 80977604 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00278 80977608 03E00008 */ jr $ra -/* 0027C 8097760C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977610.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977610.s deleted file mode 100644 index be57ccbc5b..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977610.s +++ /dev/null @@ -1,62 +0,0 @@ -.rdata -glabel D_80977CB0 - .asciz "Demo_Ext_Check_DemoMode:そんな動作は無い!!!!!!!!\n" - .balign 4 - -.text -glabel func_80977610 -/* 00280 80977610 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00284 80977614 AFB00018 */ sw $s0, 0x0018($sp) -/* 00288 80977618 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0028C 8097761C AFBF001C */ sw $ra, 0x001C($sp) -/* 00290 80977620 AFA5002C */ sw $a1, 0x002C($sp) -/* 00294 80977624 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00298 80977628 0C25DD36 */ jal func_809774D8 -/* 0029C 8097762C 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005 -/* 002A0 80977630 50400023 */ beql $v0, $zero, .L809776C0 -/* 002A4 80977634 8FBF001C */ lw $ra, 0x001C($sp) -/* 002A8 80977638 94460000 */ lhu $a2, 0x0000($v0) ## 00000000 -/* 002AC 8097763C 8E030154 */ lw $v1, 0x0154($s0) ## 00000154 -/* 002B0 80977640 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 002B4 80977644 50C3001E */ beql $a2, $v1, .L809776C0 -/* 002B8 80977648 8FBF001C */ lw $ra, 0x001C($sp) -/* 002BC 8097764C 10C10009 */ beq $a2, $at, .L80977674 -/* 002C0 80977650 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002C4 80977654 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 002C8 80977658 10C1000A */ beq $a2, $at, .L80977684 -/* 002CC 8097765C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002D0 80977660 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 002D4 80977664 10C1000C */ beq $a2, $at, .L80977698 -/* 002D8 80977668 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002DC 8097766C 1000000E */ beq $zero, $zero, .L809776A8 -/* 002E0 80977670 3C048097 */ lui $a0, %hi(D_80977CB0) ## $a0 = 80970000 -.L80977674: -/* 002E4 80977674 0C25DD3F */ jal func_809774FC -/* 002E8 80977678 AFA60020 */ sw $a2, 0x0020($sp) -/* 002EC 8097767C 1000000E */ beq $zero, $zero, .L809776B8 -/* 002F0 80977680 8FA60020 */ lw $a2, 0x0020($sp) -.L80977684: -/* 002F4 80977684 8FA5002C */ lw $a1, 0x002C($sp) -/* 002F8 80977688 0C25DD42 */ jal func_80977508 -/* 002FC 8097768C AFA60020 */ sw $a2, 0x0020($sp) -/* 00300 80977690 10000009 */ beq $zero, $zero, .L809776B8 -/* 00304 80977694 8FA60020 */ lw $a2, 0x0020($sp) -.L80977698: -/* 00308 80977698 0C25DD64 */ jal func_80977590 -/* 0030C 8097769C AFA60020 */ sw $a2, 0x0020($sp) -/* 00310 809776A0 10000005 */ beq $zero, $zero, .L809776B8 -/* 00314 809776A4 8FA60020 */ lw $a2, 0x0020($sp) -.L809776A8: -/* 00318 809776A8 24847CB0 */ addiu $a0, $a0, %lo(D_80977CB0) ## $a0 = 00007CB0 -/* 0031C 809776AC 0C00084C */ jal osSyncPrintf - -/* 00320 809776B0 AFA60020 */ sw $a2, 0x0020($sp) -/* 00324 809776B4 8FA60020 */ lw $a2, 0x0020($sp) -.L809776B8: -/* 00328 809776B8 AE060154 */ sw $a2, 0x0154($s0) ## 00000154 -/* 0032C 809776BC 8FBF001C */ lw $ra, 0x001C($sp) -.L809776C0: -/* 00330 809776C0 8FB00018 */ lw $s0, 0x0018($sp) -/* 00334 809776C4 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 00338 809776C8 03E00008 */ jr $ra -/* 0033C 809776CC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809776D0.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809776D0.s deleted file mode 100644 index 446212a208..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809776D0.s +++ /dev/null @@ -1,21 +0,0 @@ -glabel func_809776D0 -/* 00340 809776D0 24020003 */ addiu $v0, $zero, 0x0003 ## $v0 = 00000003 -/* 00344 809776D4 24830166 */ addiu $v1, $a0, 0x0166 ## $v1 = 00000166 -/* 00348 809776D8 2485015E */ addiu $a1, $a0, 0x015E ## $a1 = 0000015E -.L809776DC: -/* 0034C 809776DC 846E0000 */ lh $t6, 0x0000($v1) ## 00000166 -/* 00350 809776E0 84AF0000 */ lh $t7, 0x0000($a1) ## 0000015E -/* 00354 809776E4 2442FFFF */ addiu $v0, $v0, 0xFFFF ## $v0 = 00000002 -/* 00358 809776E8 2463FFFE */ addiu $v1, $v1, 0xFFFE ## $v1 = 00000164 -/* 0035C 809776EC 01CFC021 */ addu $t8, $t6, $t7 -/* 00360 809776F0 24A5FFFE */ addiu $a1, $a1, 0xFFFE ## $a1 = 0000015C -/* 00364 809776F4 1440FFF9 */ bne $v0, $zero, .L809776DC -/* 00368 809776F8 A4780002 */ sh $t8, 0x0002($v1) ## 00000166 -/* 0036C 809776FC 3C088016 */ lui $t0, %hi(gGameInfo) -/* 00370 80977700 8D08FA90 */ lw $t0, %lo(gGameInfo)($t0) -/* 00374 80977704 84990168 */ lh $t9, 0x0168($a0) ## 00000168 -/* 00378 80977708 85091498 */ lh $t1, 0x1498($t0) ## 80161498 -/* 0037C 8097770C 252C03E8 */ addiu $t4, $t1, 0x03E8 ## $t4 = 000003E8 -/* 00380 80977710 032C6821 */ addu $t5, $t9, $t4 -/* 00384 80977714 03E00008 */ jr $ra -/* 00388 80977718 A48D0168 */ sh $t5, 0x0168($a0) ## 00000168 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_8097771C.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_8097771C.s deleted file mode 100644 index b67ad74f2d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_8097771C.s +++ /dev/null @@ -1,82 +0,0 @@ -glabel func_8097771C -/* 0038C 8097771C 3C058016 */ lui $a1, %hi(gGameInfo) -/* 00390 80977720 24A5FA90 */ addiu $a1, %lo(gGameInfo) -/* 00394 80977724 8CA30000 */ lw $v1, 0x0000($a1) ## 8015FA90 -/* 00398 80977728 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 0039C 8097772C 44814000 */ mtc1 $at, $f8 ## $f8 = 40.00 -/* 003A0 80977730 846E149A */ lh $t6, 0x149A($v1) ## 0000149A -/* 003A4 80977734 C48A016C */ lwc1 $f10, 0x016C($a0) ## 0000016C -/* 003A8 80977738 44806000 */ mtc1 $zero, $f12 ## $f12 = 0.00 -/* 003AC 8097773C 448E2000 */ mtc1 $t6, $f4 ## $f4 = 0.00 -/* 003B0 80977740 00000000 */ nop -/* 003B4 80977744 468021A0 */ cvt.s.w $f6, $f4 -/* 003B8 80977748 46083080 */ add.s $f2, $f6, $f8 -/* 003BC 8097774C 460A1401 */ sub.s $f16, $f2, $f10 -/* 003C0 80977750 46028003 */ div.s $f0, $f16, $f2 -/* 003C4 80977754 460C003C */ c.lt.s $f0, $f12 -/* 003C8 80977758 00000000 */ nop -/* 003CC 8097775C 45020003 */ bc1fl .L8097776C -/* 003D0 80977760 846F148C */ lh $t7, 0x148C($v1) ## 0000148C -/* 003D4 80977764 46006006 */ mov.s $f0, $f12 -/* 003D8 80977768 846F148C */ lh $t7, 0x148C($v1) ## 0000148C -.L8097776C: -/* 003DC 8097776C 3C0143C8 */ lui $at, 0x43C8 ## $at = 43C80000 -/* 003E0 80977770 44811000 */ mtc1 $at, $f2 ## $f2 = 400.00 -/* 003E4 80977774 25F800FF */ addiu $t8, $t7, 0x00FF ## $t8 = 000000FF -/* 003E8 80977778 44989000 */ mtc1 $t8, $f18 ## $f18 = 0.00 -/* 003EC 8097777C 3C014F80 */ lui $at, 0x4F80 ## $at = 4F800000 -/* 003F0 80977780 07010004 */ bgez $t8, .L80977794 -/* 003F4 80977784 46809120 */ cvt.s.w $f4, $f18 -/* 003F8 80977788 44813000 */ mtc1 $at, $f6 ## $f6 = 4294967296.00 -/* 003FC 8097778C 00000000 */ nop -/* 00400 80977790 46062100 */ add.s $f4, $f4, $f6 -.L80977794: -/* 00404 80977794 46002202 */ mul.s $f8, $f4, $f0 -/* 00408 80977798 3C014F80 */ lui $at, 0x4F80 ## $at = 4F800000 -/* 0040C 8097779C 4600428D */ trunc.w.s $f10, $f8 -/* 00410 809777A0 44085000 */ mfc1 $t0, $f10 -/* 00414 809777A4 00000000 */ nop -/* 00418 809777A8 AC880170 */ sw $t0, 0x0170($a0) ## 00000170 -/* 0041C 809777AC 8CA90000 */ lw $t1, 0x0000($a1) ## 8015FA90 -/* 00420 809777B0 852A1494 */ lh $t2, 0x1494($t1) ## 00001494 -/* 00424 809777B4 254B00FF */ addiu $t3, $t2, 0x00FF ## $t3 = 000000FF -/* 00428 809777B8 448B8000 */ mtc1 $t3, $f16 ## $f16 = 0.00 -/* 0042C 809777BC 05610004 */ bgez $t3, .L809777D0 -/* 00430 809777C0 468084A0 */ cvt.s.w $f18, $f16 -/* 00434 809777C4 44813000 */ mtc1 $at, $f6 ## $f6 = 4294967296.00 -/* 00438 809777C8 00000000 */ nop -/* 0043C 809777CC 46069480 */ add.s $f18, $f18, $f6 -.L809777D0: -/* 00440 809777D0 46009102 */ mul.s $f4, $f18, $f0 -/* 00444 809777D4 24820178 */ addiu $v0, $a0, 0x0178 ## $v0 = 00000178 -/* 00448 809777D8 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 0044C 809777DC 4600220D */ trunc.w.s $f8, $f4 -/* 00450 809777E0 440D4000 */ mfc1 $t5, $f8 -/* 00454 809777E4 00000000 */ nop -/* 00458 809777E8 AC8D0174 */ sw $t5, 0x0174($a0) ## 00000174 -/* 0045C 809777EC 8CAE0000 */ lw $t6, 0x0000($a1) ## 8015FA90 -/* 00460 809777F0 85CF147A */ lh $t7, 0x147A($t6) ## 0000147A -/* 00464 809777F4 448F5000 */ mtc1 $t7, $f10 ## $f10 = 0.00 -/* 00468 809777F8 00000000 */ nop -/* 0046C 809777FC 46805420 */ cvt.s.w $f16, $f10 -/* 00470 80977800 44815000 */ mtc1 $at, $f10 ## $f10 = 100.00 -/* 00474 80977804 46028180 */ add.s $f6, $f16, $f2 -/* 00478 80977808 46003482 */ mul.s $f18, $f6, $f0 -/* 0047C 8097780C E4520000 */ swc1 $f18, 0x0000($v0) ## 00000178 -/* 00480 80977810 8CB80000 */ lw $t8, 0x0000($a1) ## 8015FA90 -/* 00484 80977814 8719147C */ lh $t9, 0x147C($t8) ## 0000157B -/* 00488 80977818 44992000 */ mtc1 $t9, $f4 ## $f4 = 0.00 -/* 0048C 8097781C 00000000 */ nop -/* 00490 80977820 46802220 */ cvt.s.w $f8, $f4 -/* 00494 80977824 460A4400 */ add.s $f16, $f8, $f10 -/* 00498 80977828 46008182 */ mul.s $f6, $f16, $f0 -/* 0049C 8097782C E4460004 */ swc1 $f6, 0x0004($v0) ## 0000017C -/* 004A0 80977830 8CA80000 */ lw $t0, 0x0000($a1) ## 8015FA90 -/* 004A4 80977834 8509147E */ lh $t1, 0x147E($t0) ## 0000147E -/* 004A8 80977838 44899000 */ mtc1 $t1, $f18 ## $f18 = 0.00 -/* 004AC 8097783C 00000000 */ nop -/* 004B0 80977840 46809120 */ cvt.s.w $f4, $f18 -/* 004B4 80977844 46022200 */ add.s $f8, $f4, $f2 -/* 004B8 80977848 46004282 */ mul.s $f10, $f8, $f0 -/* 004BC 8097784C 03E00008 */ jr $ra -/* 004C0 80977850 E44A0008 */ swc1 $f10, 0x0008($v0) ## 00000180 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977854.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977854.s deleted file mode 100644 index 2b314bd8db..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977854.s +++ /dev/null @@ -1,9 +0,0 @@ -glabel func_80977854 -/* 004C4 80977854 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 004C8 80977858 AFBF0014 */ sw $ra, 0x0014($sp) -/* 004CC 8097785C 0C25DD84 */ jal func_80977610 -/* 004D0 80977860 00000000 */ nop -/* 004D4 80977864 8FBF0014 */ lw $ra, 0x0014($sp) -/* 004D8 80977868 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 004DC 8097786C 03E00008 */ jr $ra -/* 004E0 80977870 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977874.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977874.s deleted file mode 100644 index aadd485d38..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977874.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_80977874 -/* 004E4 80977874 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 004E8 80977878 AFBF0014 */ sw $ra, 0x0014($sp) -/* 004EC 8097787C AFA40018 */ sw $a0, 0x0018($sp) -/* 004F0 80977880 0C25DD14 */ jal func_80977450 -/* 004F4 80977884 AFA5001C */ sw $a1, 0x001C($sp) -/* 004F8 80977888 0C25DDB4 */ jal func_809776D0 -/* 004FC 8097788C 8FA40018 */ lw $a0, 0x0018($sp) -/* 00500 80977890 8FA40018 */ lw $a0, 0x0018($sp) -/* 00504 80977894 0C25DD84 */ jal func_80977610 -/* 00508 80977898 8FA5001C */ lw $a1, 0x001C($sp) -/* 0050C 8097789C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00510 809778A0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00514 809778A4 03E00008 */ jr $ra -/* 00518 809778A8 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809778AC.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809778AC.s deleted file mode 100644 index bd70e5508d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809778AC.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel func_809778AC -/* 0051C 809778AC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00520 809778B0 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00524 809778B4 AFA40018 */ sw $a0, 0x0018($sp) -/* 00528 809778B8 0C25DD14 */ jal func_80977450 -/* 0052C 809778BC AFA5001C */ sw $a1, 0x001C($sp) -/* 00530 809778C0 0C25DDB4 */ jal func_809776D0 -/* 00534 809778C4 8FA40018 */ lw $a0, 0x0018($sp) -/* 00538 809778C8 0C25DDC7 */ jal func_8097771C -/* 0053C 809778CC 8FA40018 */ lw $a0, 0x0018($sp) -/* 00540 809778D0 0C25DD69 */ jal func_809775A4 -/* 00544 809778D4 8FA40018 */ lw $a0, 0x0018($sp) -/* 00548 809778D8 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0054C 809778DC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00550 809778E0 03E00008 */ jr $ra -/* 00554 809778E4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977944.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977944.s deleted file mode 100644 index 569c5fd6ef..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977944.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel func_80977944 -/* 005B4 80977944 AFA40000 */ sw $a0, 0x0000($sp) -/* 005B8 80977948 03E00008 */ jr $ra -/* 005BC 8097794C AFA50004 */ sw $a1, 0x0004($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977950.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977950.s deleted file mode 100644 index 39186cb7f1..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977950.s +++ /dev/null @@ -1,192 +0,0 @@ -.rdata -glabel D_80977D20 - .asciz "../z_demo_ext.c" - .balign 4 - -glabel D_80977D30 - .asciz "../z_demo_ext.c" - .balign 4 - -glabel D_80977D40 - .asciz "../z_demo_ext.c" - .balign 4 - -.text -glabel func_80977950 -/* 005C0 80977950 27BDFF78 */ addiu $sp, $sp, 0xFF78 ## $sp = FFFFFF78 -/* 005C4 80977954 AFBF003C */ sw $ra, 0x003C($sp) -/* 005C8 80977958 AFB00038 */ sw $s0, 0x0038($sp) -/* 005CC 8097795C AFA40088 */ sw $a0, 0x0088($sp) -/* 005D0 80977960 8CB00000 */ lw $s0, 0x0000($a1) ## 00000000 -/* 005D4 80977964 24050040 */ addiu $a1, $zero, 0x0040 ## $a1 = 00000040 -/* 005D8 80977968 0C031A73 */ jal Graph_Alloc - -/* 005DC 8097796C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 005E0 80977970 3C068097 */ lui $a2, %hi(D_80977D20) ## $a2 = 80970000 -/* 005E4 80977974 AFA20080 */ sw $v0, 0x0080($sp) -/* 005E8 80977978 24C67D20 */ addiu $a2, $a2, %lo(D_80977D20) ## $a2 = 80977D20 -/* 005EC 8097797C 27A40060 */ addiu $a0, $sp, 0x0060 ## $a0 = FFFFFFD8 -/* 005F0 80977980 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 005F4 80977984 0C031AB1 */ jal Graph_OpenDisps -/* 005F8 80977988 240701CC */ addiu $a3, $zero, 0x01CC ## $a3 = 000001CC -/* 005FC 8097798C 0C034213 */ jal Matrix_Push -/* 00600 80977990 00000000 */ nop -/* 00604 80977994 8FA20088 */ lw $v0, 0x0088($sp) -/* 00608 80977998 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 0060C 8097799C 24420178 */ addiu $v0, $v0, 0x0178 ## $v0 = 00000178 -/* 00610 809779A0 8C460008 */ lw $a2, 0x0008($v0) ## 00000180 -/* 00614 809779A4 C44E0004 */ lwc1 $f14, 0x0004($v0) ## 0000017C -/* 00618 809779A8 0C0342A3 */ jal Matrix_Scale -/* 0061C 809779AC C44C0000 */ lwc1 $f12, 0x0000($v0) ## 00000178 -/* 00620 809779B0 3C028016 */ lui $v0, %hi(gGameInfo) -/* 00624 809779B4 8C42FA90 */ lw $v0, %lo(gGameInfo)($v0) -/* 00628 809779B8 8FAE0088 */ lw $t6, 0x0088($sp) -/* 0062C 809779BC 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 00630 809779C0 84441474 */ lh $a0, 0x1474($v0) ## 80161474 -/* 00634 809779C4 84461478 */ lh $a2, 0x1478($v0) ## 80161478 -/* 00638 809779C8 85C50168 */ lh $a1, 0x0168($t6) ## 00000168 -/* 0063C 809779CC 24844000 */ addiu $a0, $a0, 0x4000 ## $a0 = 00004000 -/* 00640 809779D0 00042400 */ sll $a0, $a0, 16 -/* 00644 809779D4 0C034421 */ jal Matrix_RotateRPY -/* 00648 809779D8 00042403 */ sra $a0, $a0, 16 -/* 0064C 809779DC 3C028016 */ lui $v0, %hi(gGameInfo) -/* 00650 809779E0 8C42FA90 */ lw $v0, %lo(gGameInfo)($v0) -/* 00654 809779E4 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 00658 809779E8 84591484 */ lh $t9, 0x1484($v0) ## 80161484 -/* 0065C 809779EC 844F1480 */ lh $t7, 0x1480($v0) ## 80161480 -/* 00660 809779F0 84581482 */ lh $t8, 0x1482($v0) ## 80161482 -/* 00664 809779F4 44994000 */ mtc1 $t9, $f8 ## $f8 = 0.00 -/* 00668 809779F8 448F2000 */ mtc1 $t7, $f4 ## $f4 = 0.00 -/* 0066C 809779FC 44983000 */ mtc1 $t8, $f6 ## $f6 = 0.00 -/* 00670 80977A00 46804220 */ cvt.s.w $f8, $f8 -/* 00674 80977A04 46802320 */ cvt.s.w $f12, $f4 -/* 00678 80977A08 44064000 */ mfc1 $a2, $f8 -/* 0067C 80977A0C 0C034261 */ jal Matrix_Translate -/* 00680 80977A10 468033A0 */ cvt.s.w $f14, $f6 -/* 00684 80977A14 3C058097 */ lui $a1, %hi(D_80977D30) ## $a1 = 80970000 -/* 00688 80977A18 24A57D30 */ addiu $a1, $a1, %lo(D_80977D30) ## $a1 = 80977D30 -/* 0068C 80977A1C 8FA40080 */ lw $a0, 0x0080($sp) -/* 00690 80977A20 0C034695 */ jal Matrix_ToMtx -/* 00694 80977A24 240601DC */ addiu $a2, $zero, 0x01DC ## $a2 = 000001DC -/* 00698 80977A28 0C034221 */ jal Matrix_Pull -/* 0069C 80977A2C 00000000 */ nop -/* 006A0 80977A30 0C024F61 */ jal func_80093D84 -/* 006A4 80977A34 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 006A8 80977A38 8E0302D0 */ lw $v1, 0x02D0($s0) ## 000002D0 -/* 006AC 80977A3C 8FA90088 */ lw $t1, 0x0088($sp) -/* 006B0 80977A40 3C058016 */ lui $a1, %hi(gGameInfo) -/* 006B4 80977A44 246A0008 */ addiu $t2, $v1, 0x0008 ## $t2 = 00000008 -/* 006B8 80977A48 AE0A02D0 */ sw $t2, 0x02D0($s0) ## 000002D0 -/* 006BC 80977A4C 24A5FA90 */ addiu $a1, %lo(gGameInfo) -/* 006C0 80977A50 8CAB0000 */ lw $t3, 0x0000($a1) ## 8015FA90 -/* 006C4 80977A54 3C01FA00 */ lui $at, 0xFA00 ## $at = FA000000 -/* 006C8 80977A58 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 006CC 80977A5C 856C1496 */ lh $t4, 0x1496($t3) ## 00001496 -/* 006D0 80977A60 258D0080 */ addiu $t5, $t4, 0x0080 ## $t5 = 00000080 -/* 006D4 80977A64 31AE00FF */ andi $t6, $t5, 0x00FF ## $t6 = 00000080 -/* 006D8 80977A68 01C17825 */ or $t7, $t6, $at ## $t7 = FA000080 -/* 006DC 80977A6C AC6F0000 */ sw $t7, 0x0000($v1) ## 00000000 -/* 006E0 80977A70 8CA20000 */ lw $v0, 0x0000($a1) ## 8015FA90 -/* 006E4 80977A74 8458148A */ lh $t8, 0x148A($v0) ## 0000148A -/* 006E8 80977A78 844C1486 */ lh $t4, 0x1486($v0) ## 00001486 -/* 006EC 80977A7C 2719008C */ addiu $t9, $t8, 0x008C ## $t9 = 0000008C -/* 006F0 80977A80 332A00FF */ andi $t2, $t9, 0x00FF ## $t2 = 0000008C -/* 006F4 80977A84 84591488 */ lh $t9, 0x1488($v0) ## 00001488 -/* 006F8 80977A88 000A5A00 */ sll $t3, $t2, 8 -/* 006FC 80977A8C 258E008C */ addiu $t6, $t4, 0x008C ## $t6 = 0000008C -/* 00700 80977A90 000E7E00 */ sll $t7, $t6, 24 -/* 00704 80977A94 016FC025 */ or $t8, $t3, $t7 ## $t8 = FA000080 -/* 00708 80977A98 8D2B0170 */ lw $t3, 0x0170($t1) ## 00000170 -/* 0070C 80977A9C 272A0050 */ addiu $t2, $t9, 0x0050 ## $t2 = 000000DC -/* 00710 80977AA0 314C00FF */ andi $t4, $t2, 0x00FF ## $t4 = 000000DC -/* 00714 80977AA4 000C6C00 */ sll $t5, $t4, 16 -/* 00718 80977AA8 030D7025 */ or $t6, $t8, $t5 ## $t6 = FA000080 -/* 0071C 80977AAC 316F00FF */ andi $t7, $t3, 0x00FF ## $t7 = 00000000 -/* 00720 80977AB0 01CFC825 */ or $t9, $t6, $t7 ## $t9 = FA000080 -/* 00724 80977AB4 AC790004 */ sw $t9, 0x0004($v1) ## 00000004 -/* 00728 80977AB8 8E0302D0 */ lw $v1, 0x02D0($s0) ## 000002D0 -/* 0072C 80977ABC 3C0CFB00 */ lui $t4, 0xFB00 ## $t4 = FB000000 -/* 00730 80977AC0 246A0008 */ addiu $t2, $v1, 0x0008 ## $t2 = 00000008 -/* 00734 80977AC4 AE0A02D0 */ sw $t2, 0x02D0($s0) ## 000002D0 -/* 00738 80977AC8 AC6C0000 */ sw $t4, 0x0000($v1) ## 00000000 -/* 0073C 80977ACC 8CA20000 */ lw $v0, 0x0000($a1) ## 8015FA90 -/* 00740 80977AD0 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00744 80977AD4 84581492 */ lh $t8, 0x1492($v0) ## 00001492 -/* 00748 80977AD8 844F148E */ lh $t7, 0x148E($v0) ## 0000148E -/* 0074C 80977ADC 270D005F */ addiu $t5, $t8, 0x005F ## $t5 = FA0000DF -/* 00750 80977AE0 31AB00FF */ andi $t3, $t5, 0x00FF ## $t3 = 000000DF -/* 00754 80977AE4 844D1490 */ lh $t5, 0x1490($v0) ## 00001490 -/* 00758 80977AE8 000B7200 */ sll $t6, $t3, 8 -/* 0075C 80977AEC 25EA005A */ addiu $t2, $t7, 0x005A ## $t2 = 0000005A -/* 00760 80977AF0 000A6600 */ sll $t4, $t2, 24 -/* 00764 80977AF4 01CCC025 */ or $t8, $t6, $t4 ## $t8 = FB000080 -/* 00768 80977AF8 8D2E0174 */ lw $t6, 0x0174($t1) ## 00000174 -/* 0076C 80977AFC 25AB0032 */ addiu $t3, $t5, 0x0032 ## $t3 = FA000111 -/* 00770 80977B00 316F00FF */ andi $t7, $t3, 0x00FF ## $t7 = 00000011 -/* 00774 80977B04 000FCC00 */ sll $t9, $t7, 16 -/* 00778 80977B08 03195025 */ or $t2, $t8, $t9 ## $t2 = FB000080 -/* 0077C 80977B0C 31CC00FF */ andi $t4, $t6, 0x00FF ## $t4 = 00000080 -/* 00780 80977B10 014C6825 */ or $t5, $t2, $t4 ## $t5 = FB000080 -/* 00784 80977B14 AC6D0004 */ sw $t5, 0x0004($v1) ## 00000004 -/* 00788 80977B18 8E0302D0 */ lw $v1, 0x02D0($s0) ## 000002D0 -/* 0078C 80977B1C 3C0FDB06 */ lui $t7, 0xDB06 ## $t7 = DB060000 -/* 00790 80977B20 35EF0020 */ ori $t7, $t7, 0x0020 ## $t7 = DB060020 -/* 00794 80977B24 246B0008 */ addiu $t3, $v1, 0x0008 ## $t3 = 00000008 -/* 00798 80977B28 AE0B02D0 */ sw $t3, 0x02D0($s0) ## 000002D0 -/* 0079C 80977B2C 25220160 */ addiu $v0, $t1, 0x0160 ## $v0 = 00000160 -/* 007A0 80977B30 AC6F0000 */ sw $t7, 0x0000($v1) ## 00000000 -/* 007A4 80977B34 84470002 */ lh $a3, 0x0002($v0) ## 00000162 -/* 007A8 80977B38 84460000 */ lh $a2, 0x0000($v0) ## 00000160 -/* 007AC 80977B3C 240E0001 */ addiu $t6, $zero, 0x0001 ## $t6 = 00000001 -/* 007B0 80977B40 24190040 */ addiu $t9, $zero, 0x0040 ## $t9 = 00000040 -/* 007B4 80977B44 24180040 */ addiu $t8, $zero, 0x0040 ## $t8 = 00000040 -/* 007B8 80977B48 AFB80010 */ sw $t8, 0x0010($sp) -/* 007BC 80977B4C AFB90014 */ sw $t9, 0x0014($sp) -/* 007C0 80977B50 AFAE0018 */ sw $t6, 0x0018($sp) -/* 007C4 80977B54 844A0004 */ lh $t2, 0x0004($v0) ## 00000164 -/* 007C8 80977B58 240B0040 */ addiu $t3, $zero, 0x0040 ## $t3 = 00000040 -/* 007CC 80977B5C 240D0040 */ addiu $t5, $zero, 0x0040 ## $t5 = 00000040 -/* 007D0 80977B60 AFAA001C */ sw $t2, 0x001C($sp) -/* 007D4 80977B64 844C0006 */ lh $t4, 0x0006($v0) ## 00000166 -/* 007D8 80977B68 AFAB0028 */ sw $t3, 0x0028($sp) -/* 007DC 80977B6C AFAD0024 */ sw $t5, 0x0024($sp) -/* 007E0 80977B70 AFA30054 */ sw $v1, 0x0054($sp) -/* 007E4 80977B74 0C0253D0 */ jal Gfx_TwoTexScroll -/* 007E8 80977B78 AFAC0020 */ sw $t4, 0x0020($sp) -/* 007EC 80977B7C 8FA80054 */ lw $t0, 0x0054($sp) -/* 007F0 80977B80 3C18DA38 */ lui $t8, 0xDA38 ## $t8 = DA380000 -/* 007F4 80977B84 37180002 */ ori $t8, $t8, 0x0002 ## $t8 = DA380002 -/* 007F8 80977B88 AD020004 */ sw $v0, 0x0004($t0) ## 00000004 -/* 007FC 80977B8C 8E0302D0 */ lw $v1, 0x02D0($s0) ## 000002D0 -/* 00800 80977B90 3C0C0601 */ lui $t4, %hi(D_0600FAA0) ## $t4 = 06010000 -/* 00804 80977B94 258CFAA0 */ addiu $t4, $t4, %lo(D_0600FAA0) ## $t4 = 0600FAA0 -/* 00808 80977B98 246F0008 */ addiu $t7, $v1, 0x0008 ## $t7 = 00000008 -/* 0080C 80977B9C AE0F02D0 */ sw $t7, 0x02D0($s0) ## 000002D0 -/* 00810 80977BA0 AC780000 */ sw $t8, 0x0000($v1) ## 00000000 -/* 00814 80977BA4 8FB90080 */ lw $t9, 0x0080($sp) -/* 00818 80977BA8 3C0ADE00 */ lui $t2, 0xDE00 ## $t2 = DE000000 -/* 0081C 80977BAC 3C0BD838 */ lui $t3, 0xD838 ## $t3 = D8380000 -/* 00820 80977BB0 AC790004 */ sw $t9, 0x0004($v1) ## 00000004 -/* 00824 80977BB4 8E0302D0 */ lw $v1, 0x02D0($s0) ## 000002D0 -/* 00828 80977BB8 356B0002 */ ori $t3, $t3, 0x0002 ## $t3 = D8380002 -/* 0082C 80977BBC 240F0040 */ addiu $t7, $zero, 0x0040 ## $t7 = 00000040 -/* 00830 80977BC0 246E0008 */ addiu $t6, $v1, 0x0008 ## $t6 = 00000008 -/* 00834 80977BC4 AE0E02D0 */ sw $t6, 0x02D0($s0) ## 000002D0 -/* 00838 80977BC8 AC6C0004 */ sw $t4, 0x0004($v1) ## 00000004 -/* 0083C 80977BCC AC6A0000 */ sw $t2, 0x0000($v1) ## 00000000 -/* 00840 80977BD0 8E0302D0 */ lw $v1, 0x02D0($s0) ## 000002D0 -/* 00844 80977BD4 3C068097 */ lui $a2, %hi(D_80977D40) ## $a2 = 80970000 -/* 00848 80977BD8 24C67D40 */ addiu $a2, $a2, %lo(D_80977D40) ## $a2 = 80977D40 -/* 0084C 80977BDC 246D0008 */ addiu $t5, $v1, 0x0008 ## $t5 = 00000008 -/* 00850 80977BE0 AE0D02D0 */ sw $t5, 0x02D0($s0) ## 000002D0 -/* 00854 80977BE4 27A40060 */ addiu $a0, $sp, 0x0060 ## $a0 = FFFFFFD8 -/* 00858 80977BE8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 0085C 80977BEC 24070200 */ addiu $a3, $zero, 0x0200 ## $a3 = 00000200 -/* 00860 80977BF0 AC6F0004 */ sw $t7, 0x0004($v1) ## 00000004 -/* 00864 80977BF4 0C031AD5 */ jal Graph_CloseDisps -/* 00868 80977BF8 AC6B0000 */ sw $t3, 0x0000($v1) ## 00000000 -/* 0086C 80977BFC 8FBF003C */ lw $ra, 0x003C($sp) -/* 00870 80977C00 8FB00038 */ lw $s0, 0x0038($sp) -/* 00874 80977C04 27BD0088 */ addiu $sp, $sp, 0x0088 ## $sp = 00000000 -/* 00878 80977C08 03E00008 */ jr $ra -/* 0087C 80977C0C 00000000 */ nop diff --git a/data/overlays/actors/z_demo_ext.data.s b/data/overlays/actors/z_demo_ext.data.s deleted file mode 100644 index 714827ad8f..0000000000 --- a/data/overlays/actors/z_demo_ext.data.s +++ /dev/null @@ -1,26 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purpose registers - -.section .data - -.balign 16 - -glabel D_80977C70 - .word func_80977854 -.word func_80977874 -.word func_809778AC -glabel D_80977C7C - .word func_80977944 -.word func_80977950 -glabel Demo_Ext_InitVars - .word 0x01180400, 0x00000010, 0x005A0000, 0x00000184 -.word DemoExt_Init -.word DemoExt_Destroy -.word DemoExt_Update -.word DemoExt_Draw -.word 0x00000000, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_demo_ext.reloc.s b/data/overlays/actors/z_demo_ext.reloc.s deleted file mode 100644 index b847d7b18a..0000000000 --- a/data/overlays/actors/z_demo_ext.reloc.s +++ /dev/null @@ -1,13 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purpose registers - -.section .rodata - -.balign 16 - -glabel D_80977D90 - .incbin "baserom/ovl_Demo_Ext", 0xA00, 0x000000B0 diff --git a/spec b/spec index 0f1f789f7c..f4f1a209eb 100644 --- a/spec +++ b/spec @@ -1489,8 +1489,7 @@ endseg beginseg name "ovl_Demo_Ext" include "build/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.o" - include "build/data/overlays/actors/z_demo_ext.data.o" - include "build/data/overlays/actors/z_demo_ext.reloc.o" + include "build/src/overlays/actors/ovl_Demo_Ext/ovl_Demo_Ext_reloc.o" endseg beginseg 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 f8996b1b9a..b648a96756 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -1,17 +1,241 @@ +/* + * File: z_demo_ext.c + * Overlay: Demo_Ext + * Description: Magic Vortex in Silver Gauntlets Cutscene + */ + #include "z_demo_ext.h" +#include "vt.h" #define FLAGS 0x00000010 #define THIS ((DemoExt*)thisx) +typedef enum { + /* 0x00 */ EXT_WAIT, + /* 0x01 */ EXT_MAINTAIN, + /* 0x02 */ EXT_DISPELL +} DemoExtAction; + +typedef enum { + /* 0x00 */ EXT_DRAW_NOTHING, + /* 0x01 */ EXT_DRAW_VORTEX +} DemoExtDrawMode; + void DemoExt_Init(Actor* thisx, GlobalContext* globalCtx); void DemoExt_Destroy(Actor* thisx, GlobalContext* globalCtx); void DemoExt_Update(Actor* thisx, GlobalContext* globalCtx); void DemoExt_Draw(Actor* thisx, GlobalContext* globalCtx); -extern UNK_TYPE D_0600FAA0; +extern Gfx D_0600FAA0[]; + +void DemoExt_Destroy(Actor* thisx, GlobalContext* globalCtx) { +} + +void DemoExt_Init(Actor* thisx, GlobalContext* globalCtx) { + DemoExt* this = THIS; + + this->scrollIncr[0] = 25; + this->scrollIncr[1] = 40; + this->scrollIncr[2] = 5; + this->scrollIncr[3] = 30; + this->primAlpha = kREG(28) + 255; + this->envAlpha = kREG(32) + 255; + this->scale.x = kREG(19) + 400.0f; + this->scale.y = kREG(20) + 100.0f; + this->scale.z = kREG(21) + 400.0f; +} + +void DemoExt_PlayVortexSFX(DemoExt* this) { + if (this->alphaTimer <= (kREG(35) + 40.0f) - 15.0f) { + Audio_PlaySoundGeneral(NA_SE_EV_FANTOM_WARP_L - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); + } +} + +CsCmdActorAction* DemoExt_GetNpcAction(GlobalContext* globalCtx, s32 npcActionIndex) { + if (globalCtx->csCtx.state != 0) { + return globalCtx->csCtx.npcActions[npcActionIndex]; + } + return NULL; +} + +void DemoExt_SetupWait(DemoExt* this) { + this->action = EXT_WAIT; + this->drawMode = EXT_DRAW_NOTHING; +} + +void DemoExt_SetupMaintainVortex(DemoExt* this, GlobalContext* globalCtx) { + CsCmdActorAction* npcAction = DemoExt_GetNpcAction(globalCtx, 5); + + if (npcAction != NULL) { + this->actor.posRot.pos.x = npcAction->startPos.x; + this->actor.posRot.pos.y = npcAction->startPos.y; + this->actor.posRot.pos.z = npcAction->startPos.z; + this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + } + this->action = EXT_MAINTAIN; + this->drawMode = EXT_DRAW_VORTEX; +} + +void DemoExt_SetupDispellVortex(DemoExt* this) { + this->action = EXT_DISPELL; + this->drawMode = EXT_DRAW_VORTEX; +} + +void DemoExt_FinishClosing(DemoExt* this) { + this->alphaTimer += 1.0f; + if ((kREG(35) + 40.0f) <= this->alphaTimer) { + Actor_Kill(&this->actor); + } +} + +void DemoExt_CheckCsMode(DemoExt* this, GlobalContext* globalCtx) { + CsCmdActorAction* csCmdNPCAction = DemoExt_GetNpcAction(globalCtx, 5); + s32 csAction; + s32 previousCsAction; + + if (csCmdNPCAction != NULL) { + csAction = csCmdNPCAction->action; + previousCsAction = this->previousCsAction; + + if (csAction != previousCsAction) { + switch (csAction) { + case 1: + DemoExt_SetupWait(this); + break; + case 2: + DemoExt_SetupMaintainVortex(this, globalCtx); + break; + case 3: + DemoExt_SetupDispellVortex(this); + break; + default: + // Demo_Ext_Check_DemoMode: there is no such action! + osSyncPrintf("Demo_Ext_Check_DemoMode:そんな動作は無い!!!!!!!!\n"); + break; + } + this->previousCsAction = csAction; + } + } +} + +void DemoExt_SetScrollAndRotation(DemoExt* this) { + s16* scrollIncr = this->scrollIncr; + s16* curScroll = this->curScroll; + s32 i; + + for (i = 3; i != 0; i--) { + curScroll[i] += scrollIncr[i]; + } + this->rotationPitch += (s16)(kREG(34) + 1000); +} + +void DemoExt_SetColorsAndScales(DemoExt* this) { + Vec3f* scale = &this->scale; + f32 shrinkFactor; + + shrinkFactor = ((kREG(35) + 40.0f) - this->alphaTimer) / (kREG(35) + 40.0f); + if (shrinkFactor < 0.0f) { + shrinkFactor = 0.0f; + } + + this->primAlpha = (u32)(kREG(28) + 255) * shrinkFactor; + this->envAlpha = (u32)(kREG(32) + 255) * shrinkFactor; + scale->x = (kREG(19) + 400.0f) * shrinkFactor; + scale->y = (kREG(20) + 100.0f) * shrinkFactor; + scale->z = (kREG(21) + 400.0f) * shrinkFactor; +} + +void DemoExt_Wait(DemoExt* this, GlobalContext* globalCtx) { + DemoExt_CheckCsMode(this, globalCtx); +} + +void DemoExt_MaintainVortex(DemoExt* this, GlobalContext* globalCtx) { + DemoExt_PlayVortexSFX(this); + DemoExt_SetScrollAndRotation(this); + DemoExt_CheckCsMode(this, globalCtx); +} + +void DemoExt_DispellVortex(DemoExt* this, GlobalContext* globalCtx) { + DemoExt_PlayVortexSFX(this); + DemoExt_SetScrollAndRotation(this); + DemoExt_SetColorsAndScales(this); + DemoExt_FinishClosing(this); +} + +static DemoExtActionFunc sActionFuncs[] = { + DemoExt_Wait, + DemoExt_MaintainVortex, + DemoExt_DispellVortex, +}; + +void DemoExt_Update(Actor* thisx, GlobalContext* globalCtx) { + DemoExt* this = THIS; + + if ((this->action < EXT_WAIT) || (this->action > EXT_DISPELL) || sActionFuncs[this->action] == NULL) { + // Main mode is abnormal! + osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + } else { + sActionFuncs[this->action](this, globalCtx); + } +} + +void DemoExt_DrawNothing(Actor* thisx, GlobalContext* globalCtx) { +} + +void DemoExt_DrawVortex(Actor* thisx, GlobalContext* globalCtx) { + DemoExt* this = THIS; + Mtx* mtx; + GraphicsContext* gfxCtx; + s16* curScroll; + Vec3f* scale; + + scale = &this->scale; + gfxCtx = globalCtx->state.gfxCtx; + mtx = Graph_Alloc(gfxCtx, sizeof(Mtx)); + + OPEN_DISPS(gfxCtx, "../z_demo_ext.c", 460); + Matrix_Push(); + Matrix_Scale(scale->x, scale->y, scale->z, MTXMODE_APPLY); + Matrix_RotateRPY((s16)(kREG(16) + 0x4000), this->rotationPitch, kREG(18), MTXMODE_APPLY); + Matrix_Translate(kREG(22), kREG(23), kREG(24), MTXMODE_APPLY); + Matrix_ToMtx(mtx, "../z_demo_ext.c", 476); + Matrix_Pull(); + func_80093D84(gfxCtx); + + gDPSetPrimColor(POLY_XLU_DISP++, 0, kREG(33) + 128, kREG(25) + 140, kREG(26) + 80, kREG(27) + 140, this->primAlpha); + gDPSetEnvColor(POLY_XLU_DISP++, kREG(29) + 90, kREG(30) + 50, kREG(31) + 95, this->envAlpha); + + curScroll = this->curScroll; + gSPSegment( + POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScroll(gfxCtx, 0, curScroll[0], curScroll[1], 0x40, 0x40, 1, curScroll[2], curScroll[3], 0x40, 0x40)); + + gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, D_0600FAA0); + gSPPopMatrix(POLY_XLU_DISP++, G_MTX_MODELVIEW); + + CLOSE_DISPS(gfxCtx, "../z_demo_ext.c", 512); +} + +static DemoExtDrawFunc sDrawFuncs[] = { + DemoExt_DrawNothing, + DemoExt_DrawVortex, +}; + +void DemoExt_Draw(Actor* thisx, GlobalContext* globalCtx) { + DemoExt* this = THIS; + + if ((this->drawMode < EXT_DRAW_NOTHING) || (this->drawMode > EXT_DRAW_VORTEX) || + sDrawFuncs[this->drawMode] == NULL) { + // Draw mode is abnormal! + osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + } else { + sDrawFuncs[this->drawMode](thisx, globalCtx); + } +} -/* const ActorInit Demo_Ext_InitVars = { ACTOR_DEMO_EXT, ACTORTYPE_NPC, @@ -23,39 +247,3 @@ const ActorInit Demo_Ext_InitVars = { (ActorFunc)DemoExt_Update, (ActorFunc)DemoExt_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Destroy.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Init.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977450.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774D8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809774FC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977508.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977590.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809775A4.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977610.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809776D0.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_8097771C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977854.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977874.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_809778AC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Update.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977944.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/func_80977950.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Ext/DemoExt_Draw.s") 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 034b20bfca..5be8c89e11 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h @@ -6,9 +6,21 @@ struct DemoExt; +typedef void (*DemoExtActionFunc)(struct DemoExt*, GlobalContext*); +typedef void (*DemoExtDrawFunc)(Actor*, GlobalContext*); + typedef struct DemoExt { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x38]; + /* 0x014C */ s32 action; + /* 0x014C */ s32 drawMode; + /* 0x0154 */ s32 previousCsAction; + /* 0x015E */ s16 scrollIncr[4]; + /* 0x0160 */ s16 curScroll[4]; + /* 0x0168 */ s16 rotationPitch; + /* 0x016C */ f32 alphaTimer; + /* 0x0170 */ s32 primAlpha; + /* 0x0174 */ s32 envAlpha; + /* 0x0178 */ Vec3f scale; } DemoExt; // size = 0x0184 extern const ActorInit Demo_Ext_InitVars;