From 5ae79b7f868deb896c6f6efdd6ff78eee0820e97 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Thu, 5 Nov 2020 19:30:17 -0500 Subject: [PATCH] Various decomp --- .../code_10400_len_d30/func_80035D20.s | 8 -- .../code_111f0_len_860/func_80035E00.s | 13 ---- .../code_111f0_len_860/func_80035E24.s | 16 ---- .../code_111f0_len_860/func_80035E54.s | 42 ----------- .../code_111f0_len_860/func_80035EEC.s | 46 ++++++------ .../code_111f0_len_860/func_8003617C.s | 56 +++++++------- .../code_111f0_len_860/func_8003646C.s | 34 ++++----- .../code_11a50_len_7a0/func_80036DE0.s | 8 -- asm/nonmatchings/code_25f00_len_940/alLink.s | 13 ---- .../code_25f00_len_940/alUnlink.s | 19 ----- .../code_362a0_len_2f70/func_8005DDF0.s | 12 --- .../code_42e0_len_1f60/add_vec2D_polar.s | 42 ----------- .../code_42e0_len_1f60/dma_copy.s | 45 ----------- .../code_42e0_len_1f60/func_800297D4.s | 42 ----------- .../code_42e0_len_1f60/func_80029994.s | 33 -------- .../get_player_normal_pitch.s | 38 ---------- .../code_6240_len_c00/get_spirits_rescued.s | 75 ------------------- .../code_8230_len_1ae0/func_8002E754.s | 37 --------- .../code_8230_len_1ae0/func_8002E7CC.s | 28 ------- .../code_8230_len_1ae0/get_cam_viewport.s | 24 ------ .../code_8230_len_1ae0/nuSiMgrStop.s | 12 --- .../create_cameras_a.s | 0 .../create_cameras_b.s | 0 .../func_8002D160.s | 0 .../func_8002E82C.s | 0 .../get_screen_coords.s | 0 .../initialize_next_camera.s | 0 .../render_frame.s | 0 .../set_cam_viewport.s | 0 .../update_cameras.s | 0 .../nusys/nuSiMgr}/nuSiMgrInit.s | 0 .../nusys/nuSiMgr}/nuSiMgrRestart.s | 0 .../nusys/nuSiMgr}/nuSiMgrThread.s | 0 .../nusys/nuSiMgr}/nuSiSendMesg.s | 0 include/common_structs.h | 3 +- include/functions.h | 2 +- include/macros.h | 2 + include/variables.h | 2 + src/code_10400_len_d30.c | 3 +- src/code_109660_len_1270.c | 2 +- src/code_111f0_len_860.c | 29 ++++++- src/code_11a50_len_7a0.c | 3 +- src/code_1a1f0_len_5390.c | 7 +- src/code_1b40_len_20b0.c | 2 - src/code_20ec0_len_5040.c | 22 +++--- src/code_25f00_len_940.c | 20 ++++- src/code_362a0_len_2f70.c | 4 +- src/code_42e0_len_1f60.c | 75 +++++++++++++++++-- src/code_6240_len_c00.c | 23 +++++- src/code_8230_len_1ae0.c | 36 --------- src/code_8560.c | 54 +++++++++++++ src/code_ef070_len_3400.c | 40 +++++----- src/os/nusys/nuSiMgr.c | 14 ++++ src/world/common/GetCamVfov.inc.c | 2 +- .../GetCurrentCameraYawClamped180.inc.c | 2 +- src/world/common/SetCamVfov.inc.c | 2 +- src/world/common/SetCamera0MoveFlag1.inc.c | 2 +- src/world/common/SomeXYZFuncTodoRename.inc.c | 2 +- src/world/common/UnkCameraFunc.inc.c | 2 +- src/world/common/UnsetCamera0MoveFlag1.inc.c | 2 +- src/world/script_api/7E2AA0.c | 4 +- tools/splat.yaml | 3 +- undefined_syms.txt | 3 +- 63 files changed, 333 insertions(+), 677 deletions(-) delete mode 100644 asm/nonmatchings/code_10400_len_d30/func_80035D20.s delete mode 100644 asm/nonmatchings/code_111f0_len_860/func_80035E00.s delete mode 100644 asm/nonmatchings/code_111f0_len_860/func_80035E24.s delete mode 100644 asm/nonmatchings/code_111f0_len_860/func_80035E54.s delete mode 100644 asm/nonmatchings/code_11a50_len_7a0/func_80036DE0.s delete mode 100644 asm/nonmatchings/code_25f00_len_940/alLink.s delete mode 100644 asm/nonmatchings/code_25f00_len_940/alUnlink.s delete mode 100644 asm/nonmatchings/code_362a0_len_2f70/func_8005DDF0.s delete mode 100644 asm/nonmatchings/code_42e0_len_1f60/add_vec2D_polar.s delete mode 100644 asm/nonmatchings/code_42e0_len_1f60/dma_copy.s delete mode 100644 asm/nonmatchings/code_42e0_len_1f60/func_800297D4.s delete mode 100644 asm/nonmatchings/code_42e0_len_1f60/func_80029994.s delete mode 100644 asm/nonmatchings/code_42e0_len_1f60/get_player_normal_pitch.s delete mode 100644 asm/nonmatchings/code_6240_len_c00/get_spirits_rescued.s delete mode 100644 asm/nonmatchings/code_8230_len_1ae0/func_8002E754.s delete mode 100644 asm/nonmatchings/code_8230_len_1ae0/func_8002E7CC.s delete mode 100644 asm/nonmatchings/code_8230_len_1ae0/get_cam_viewport.s delete mode 100644 asm/nonmatchings/code_8230_len_1ae0/nuSiMgrStop.s rename asm/nonmatchings/{code_8230_len_1ae0 => code_8560}/create_cameras_a.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => code_8560}/create_cameras_b.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => code_8560}/func_8002D160.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => code_8560}/func_8002E82C.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => code_8560}/get_screen_coords.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => code_8560}/initialize_next_camera.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => code_8560}/render_frame.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => code_8560}/set_cam_viewport.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => code_8560}/update_cameras.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => os/nusys/nuSiMgr}/nuSiMgrInit.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => os/nusys/nuSiMgr}/nuSiMgrRestart.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => os/nusys/nuSiMgr}/nuSiMgrThread.s (100%) rename asm/nonmatchings/{code_8230_len_1ae0 => os/nusys/nuSiMgr}/nuSiSendMesg.s (100%) delete mode 100644 src/code_8230_len_1ae0.c create mode 100644 src/code_8560.c create mode 100644 src/os/nusys/nuSiMgr.c diff --git a/asm/nonmatchings/code_10400_len_d30/func_80035D20.s b/asm/nonmatchings/code_10400_len_d30/func_80035D20.s deleted file mode 100644 index 0dadbfa02b..0000000000 --- a/asm/nonmatchings/code_10400_len_d30/func_80035D20.s +++ /dev/null @@ -1,8 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80035D20 -/* 11120 80035D20 03E00008 */ jr $ra -/* 11124 80035D24 00000000 */ nop -/* 11128 80035D28 00000000 */ nop -/* 1112C 80035D2C 00000000 */ nop diff --git a/asm/nonmatchings/code_111f0_len_860/func_80035E00.s b/asm/nonmatchings/code_111f0_len_860/func_80035E00.s deleted file mode 100644 index 2413b52106..0000000000 --- a/asm/nonmatchings/code_111f0_len_860/func_80035E00.s +++ /dev/null @@ -1,13 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80035E00 -/* 11200 80035E00 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 11204 80035E04 AFBF0010 */ sw $ra, 0x10($sp) -/* 11208 80035E08 3C01800A */ lui $at, 0x800a -/* 1120C 80035E0C A4200948 */ sh $zero, 0x948($at) -/* 11210 80035E10 0C00D795 */ jal func_80035E54 -/* 11214 80035E14 00000000 */ nop -/* 11218 80035E18 8FBF0010 */ lw $ra, 0x10($sp) -/* 1121C 80035E1C 03E00008 */ jr $ra -/* 11220 80035E20 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_111f0_len_860/func_80035E24.s b/asm/nonmatchings/code_111f0_len_860/func_80035E24.s deleted file mode 100644 index f5e706ad4e..0000000000 --- a/asm/nonmatchings/code_111f0_len_860/func_80035E24.s +++ /dev/null @@ -1,16 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80035E24 -/* 11224 80035E24 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 11228 80035E28 24020001 */ addiu $v0, $zero, 1 -/* 1122C 80035E2C AFBF0010 */ sw $ra, 0x10($sp) -/* 11230 80035E30 3C01800A */ lui $at, 0x800a -/* 11234 80035E34 A4220948 */ sh $v0, 0x948($at) -/* 11238 80035E38 0C04E0A8 */ jal set_map_transition_effect -/* 1123C 80035E3C 24040008 */ addiu $a0, $zero, 8 -/* 11240 80035E40 0C00D795 */ jal func_80035E54 -/* 11244 80035E44 00000000 */ nop -/* 11248 80035E48 8FBF0010 */ lw $ra, 0x10($sp) -/* 1124C 80035E4C 03E00008 */ jr $ra -/* 11250 80035E50 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_111f0_len_860/func_80035E54.s b/asm/nonmatchings/code_111f0_len_860/func_80035E54.s deleted file mode 100644 index caf9e1c4d0..0000000000 --- a/asm/nonmatchings/code_111f0_len_860/func_80035E54.s +++ /dev/null @@ -1,42 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80035E54 -/* 11254 80035E54 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 11258 80035E58 24020004 */ addiu $v0, $zero, 4 -/* 1125C 80035E5C AFB10014 */ sw $s1, 0x14($sp) -/* 11260 80035E60 3C118007 */ lui $s1, %hi(gGameStatusPtr) -/* 11264 80035E64 2631419C */ addiu $s1, $s1, %lo(gGameStatusPtr) -/* 11268 80035E68 AFB00010 */ sw $s0, 0x10($sp) -/* 1126C 80035E6C 3C10800A */ lui $s0, %hi(D_800A0940) -/* 11270 80035E70 26100940 */ addiu $s0, $s0, %lo(D_800A0940) -/* 11274 80035E74 AFBF0018 */ sw $ra, 0x18($sp) -/* 11278 80035E78 3C01800A */ lui $at, %hi(D_800A0944) -/* 1127C 80035E7C A4200944 */ sh $zero, %lo(D_800A0944)($at) -/* 11280 80035E80 3C01800A */ lui $at, 0x800a -/* 11284 80035E84 A4220946 */ sh $v0, 0x946($at) -/* 11288 80035E88 8E230000 */ lw $v1, ($s1) -/* 1128C 80035E8C 240200FF */ addiu $v0, $zero, 0xff -/* 11290 80035E90 A6020000 */ sh $v0, ($s0) -/* 11294 80035E94 0C018030 */ jal nuContRmbForceStopEnd -/* 11298 80035E98 AC600094 */ sw $zero, 0x94($v1) -/* 1129C 80035E9C 0C04E0AB */ jal func_801382AC -/* 112A0 80035EA0 0200202D */ daddu $a0, $s0, $zero -/* 112A4 80035EA4 0000202D */ daddu $a0, $zero, $zero -/* 112A8 80035EA8 3C05F5DE */ lui $a1, 0xf5de -/* 112AC 80035EAC 3C03800A */ lui $v1, %hi(D_8009A650) -/* 112B0 80035EB0 2463A650 */ addiu $v1, $v1, %lo(D_8009A650) -/* 112B4 80035EB4 8C620000 */ lw $v0, ($v1) -/* 112B8 80035EB8 8E260000 */ lw $a2, ($s1) -/* 112BC 80035EBC 34420008 */ ori $v0, $v0, 8 -/* 112C0 80035EC0 AC620000 */ sw $v0, ($v1) -/* 112C4 80035EC4 80C600A9 */ lb $a2, 0xa9($a2) -/* 112C8 80035EC8 0C0B2026 */ jal set_variable -/* 112CC 80035ECC 34A50181 */ ori $a1, $a1, 0x181 -/* 112D0 80035ED0 8FBF0018 */ lw $ra, 0x18($sp) -/* 112D4 80035ED4 8FB10014 */ lw $s1, 0x14($sp) -/* 112D8 80035ED8 8FB00010 */ lw $s0, 0x10($sp) -/* 112DC 80035EDC 3C01800A */ lui $at, %hi(D_8009A5D8) -/* 112E0 80035EE0 AC20A5D8 */ sw $zero, %lo(D_8009A5D8)($at) -/* 112E4 80035EE4 03E00008 */ jr $ra -/* 112E8 80035EE8 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_111f0_len_860/func_80035EEC.s b/asm/nonmatchings/code_111f0_len_860/func_80035EEC.s index 768937747e..0d594eb640 100644 --- a/asm/nonmatchings/code_111f0_len_860/func_80035EEC.s +++ b/asm/nonmatchings/code_111f0_len_860/func_80035EEC.s @@ -14,14 +14,14 @@ glabel func_80035EEC /* 11310 80035F10 50400005 */ beql $v0, $zero, .L80035F28 /* 11314 80035F14 24020002 */ addiu $v0, $zero, 2 /* 11318 80035F18 10600007 */ beqz $v1, .L80035F38 -/* 1131C 80035F1C 00000000 */ nop +/* 1131C 80035F1C 00000000 */ nop /* 11320 80035F20 0800D83B */ j .L800360EC -/* 11324 80035F24 00000000 */ nop +/* 11324 80035F24 00000000 */ nop .L80035F28: /* 11328 80035F28 10620055 */ beq $v1, $v0, .L80036080 -/* 1132C 80035F2C 00000000 */ nop +/* 1132C 80035F2C 00000000 */ nop /* 11330 80035F30 0800D83B */ j .L800360EC -/* 11334 80035F34 00000000 */ nop +/* 11334 80035F34 00000000 */ nop .L80035F38: /* 11338 80035F38 3C04800A */ lui $a0, 0x800a /* 1133C 80035F3C 24840946 */ addiu $a0, $a0, 0x946 @@ -50,7 +50,7 @@ glabel func_80035EEC /* 11394 80035F94 8445008C */ lh $a1, 0x8c($v0) .L80035F98: /* 11398 80035F98 0C0169BD */ jal load_map_by_IDs -/* 1139C 80035F9C 00000000 */ nop +/* 1139C 80035F9C 00000000 */ nop /* 113A0 80035FA0 3C108007 */ lui $s0, %hi(gGameStatusPtr) /* 113A4 80035FA4 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr) /* 113A8 80035FA8 8E020000 */ lw $v0, ($s0) @@ -61,12 +61,12 @@ glabel func_80035EEC /* 113BC 80035FBC 8E020000 */ lw $v0, ($s0) /* 113C0 80035FC0 80420071 */ lb $v0, 0x71($v0) /* 113C4 80035FC4 14400003 */ bnez $v0, .L80035FD4 -/* 113C8 80035FC8 00000000 */ nop +/* 113C8 80035FC8 00000000 */ nop /* 113CC 80035FCC 0C03805E */ jal disable_player_input -/* 113D0 80035FD0 00000000 */ nop +/* 113D0 80035FD0 00000000 */ nop .L80035FD4: /* 113D4 80035FD4 0C00B500 */ jal update_cameras -/* 113D8 80035FD8 00000000 */ nop +/* 113D8 80035FD8 00000000 */ nop /* 113DC 80035FDC 3C02800A */ lui $v0, %hi(D_800A0944) /* 113E0 80035FE0 24420944 */ addiu $v0, $v0, %lo(D_800A0944) /* 113E4 80035FE4 94430000 */ lhu $v1, ($v0) @@ -78,13 +78,13 @@ glabel func_80035EEC /* 113FC 80035FFC A4430000 */ sh $v1, ($v0) .L80036000: /* 11400 80036000 0C00F949 */ jal func_8003E524 -/* 11404 80036004 00000000 */ nop +/* 11404 80036004 00000000 */ nop /* 11408 80036008 0C00E64C */ jal update_npcs -/* 1140C 8003600C 00000000 */ nop +/* 1140C 8003600C 00000000 */ nop /* 11410 80036010 0C037DD0 */ jal update_player -/* 11414 80036014 00000000 */ nop +/* 11414 80036014 00000000 */ nop /* 11418 80036018 0C00B500 */ jal update_cameras -/* 1141C 8003601C 00000000 */ nop +/* 1141C 8003601C 00000000 */ nop /* 11420 80036020 3C04800A */ lui $a0, 0x800a /* 11424 80036024 24840946 */ addiu $a0, $a0, 0x946 /* 11428 80036028 84820000 */ lh $v0, ($a0) @@ -100,7 +100,7 @@ glabel func_80035EEC /* 11448 80036048 0C0B1059 */ jal does_script_exist /* 1144C 8003604C 8C44006C */ lw $a0, 0x6c($v0) /* 11450 80036050 14400026 */ bnez $v0, .L800360EC -/* 11454 80036054 00000000 */ nop +/* 11454 80036054 00000000 */ nop /* 11458 80036058 3C05800A */ lui $a1, %hi(D_8009A650) /* 1145C 8003605C 24A5A650 */ addiu $a1, $a1, %lo(D_8009A650) /* 11460 80036060 2404FFF7 */ addiu $a0, $zero, -9 @@ -113,27 +113,27 @@ glabel func_80035EEC /* 1147C 8003607C A6030000 */ sh $v1, ($s0) .L80036080: /* 11480 80036080 0C00E64C */ jal update_npcs -/* 11484 80036084 00000000 */ nop +/* 11484 80036084 00000000 */ nop /* 11488 80036088 0C037DD0 */ jal update_player -/* 1148C 8003608C 00000000 */ nop +/* 1148C 8003608C 00000000 */ nop /* 11490 80036090 0C016754 */ jal func_80059D50 -/* 11494 80036094 00000000 */ nop +/* 11494 80036094 00000000 */ nop /* 11498 80036098 0C00B500 */ jal update_cameras -/* 1149C 8003609C 00000000 */ nop -/* 114A0 800360A0 3C04800A */ lui $a0, %hi(D_800A0940) -/* 114A4 800360A4 24840940 */ addiu $a0, $a0, %lo(D_800A0940) +/* 1149C 8003609C 00000000 */ nop +/* 114A0 800360A0 3C04800A */ lui $a0, %hi(gMapTransitionAlpha) +/* 114A4 800360A4 24840940 */ addiu $a0, $a0, %lo(gMapTransitionAlpha) /* 114A8 800360A8 0C04E175 */ jal func_801385D4 -/* 114AC 800360AC 00000000 */ nop +/* 114AC 800360AC 00000000 */ nop /* 114B0 800360B0 00021400 */ sll $v0, $v0, 0x10 /* 114B4 800360B4 1040000D */ beqz $v0, .L800360EC -/* 114B8 800360B8 00000000 */ nop +/* 114B8 800360B8 00000000 */ nop /* 114BC 800360BC 3C028007 */ lui $v0, %hi(gGameStatusPtr) /* 114C0 800360C0 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) /* 114C4 800360C4 80420071 */ lb $v0, 0x71($v0) /* 114C8 800360C8 14400003 */ bnez $v0, .L800360D8 -/* 114CC 800360CC 00000000 */ nop +/* 114CC 800360CC 00000000 */ nop /* 114D0 800360D0 0C038069 */ jal enable_player_input -/* 114D4 800360D4 00000000 */ nop +/* 114D4 800360D4 00000000 */ nop .L800360D8: /* 114D8 800360D8 3C05BF80 */ lui $a1, 0xbf80 /* 114DC 800360DC 0C04DF62 */ jal func_80137D88 diff --git a/asm/nonmatchings/code_111f0_len_860/func_8003617C.s b/asm/nonmatchings/code_111f0_len_860/func_8003617C.s index 96fdfeee8a..196c5bdf03 100644 --- a/asm/nonmatchings/code_111f0_len_860/func_8003617C.s +++ b/asm/nonmatchings/code_111f0_len_860/func_8003617C.s @@ -15,22 +15,22 @@ glabel func_8003617C /* 115A4 800361A4 00220821 */ addu $at, $at, $v0 /* 115A8 800361A8 8C228320 */ lw $v0, -0x7ce0($at) /* 115AC 800361AC 00400008 */ jr $v0 -/* 115B0 800361B0 00000000 */ nop +/* 115B0 800361B0 00000000 */ nop /* 115B4 800361B4 0C00E64C */ jal update_npcs -/* 115B8 800361B8 00000000 */ nop +/* 115B8 800361B8 00000000 */ nop /* 115BC 800361BC 0C037DD0 */ jal update_player -/* 115C0 800361C0 00000000 */ nop +/* 115C0 800361C0 00000000 */ nop /* 115C4 800361C4 0C016754 */ jal func_80059D50 -/* 115C8 800361C8 00000000 */ nop +/* 115C8 800361C8 00000000 */ nop /* 115CC 800361CC 0C00B500 */ jal update_cameras -/* 115D0 800361D0 00000000 */ nop -/* 115D4 800361D4 3C04800A */ lui $a0, %hi(D_800A0940) -/* 115D8 800361D8 24840940 */ addiu $a0, $a0, %lo(D_800A0940) +/* 115D0 800361D0 00000000 */ nop +/* 115D4 800361D4 3C04800A */ lui $a0, %hi(gMapTransitionAlpha) +/* 115D8 800361D8 24840940 */ addiu $a0, $a0, %lo(gMapTransitionAlpha) /* 115DC 800361DC 0C04E0AB */ jal func_801382AC -/* 115E0 800361E0 00000000 */ nop +/* 115E0 800361E0 00000000 */ nop /* 115E4 800361E4 00021400 */ sll $v0, $v0, 0x10 /* 115E8 800361E8 1040007F */ beqz $v0, .L800363E8 -/* 115EC 800361EC 00000000 */ nop +/* 115EC 800361EC 00000000 */ nop /* 115F0 800361F0 3C03800A */ lui $v1, %hi(D_800A0944) /* 115F4 800361F4 24630944 */ addiu $v1, $v1, %lo(D_800A0944) /* 115F8 800361F8 94620000 */ lhu $v0, ($v1) @@ -57,7 +57,7 @@ glabel func_8003617C /* 1164C 8003624C 8E020000 */ lw $v0, ($s0) /* 11650 80036250 80420071 */ lb $v0, 0x71($v0) /* 11654 80036254 10400003 */ beqz $v0, .L80036264 -/* 11658 80036258 00000000 */ nop +/* 11658 80036258 00000000 */ nop /* 1165C 8003625C 0C00CD3C */ jal set_game_mode /* 11660 80036260 24040011 */ addiu $a0, $zero, 0x11 .L80036264: @@ -82,16 +82,16 @@ glabel func_8003617C /* 116A8 800362A8 0C009C22 */ jal func_80027088 /* 116AC 800362AC 0000202D */ daddu $a0, $zero, $zero /* 116B0 800362B0 0C018030 */ jal nuContRmbForceStopEnd -/* 116B4 800362B4 00000000 */ nop +/* 116B4 800362B4 00000000 */ nop /* 116B8 800362B8 8E020000 */ lw $v0, ($s0) /* 116BC 800362BC 80420071 */ lb $v0, 0x71($v0) /* 116C0 800362C0 14400003 */ bnez $v0, .L800362D0 -/* 116C4 800362C4 00000000 */ nop +/* 116C4 800362C4 00000000 */ nop /* 116C8 800362C8 0C03805E */ jal disable_player_input -/* 116CC 800362CC 00000000 */ nop +/* 116CC 800362CC 00000000 */ nop .L800362D0: /* 116D0 800362D0 0C00B500 */ jal update_cameras -/* 116D4 800362D4 00000000 */ nop +/* 116D4 800362D4 00000000 */ nop /* 116D8 800362D8 3C02800A */ lui $v0, %hi(D_800A0944) /* 116DC 800362DC 24420944 */ addiu $v0, $v0, %lo(D_800A0944) /* 116E0 800362E0 94430000 */ lhu $v1, ($v0) @@ -101,13 +101,13 @@ glabel func_8003617C /* 116F0 800362F0 0800D8FA */ j .L800363E8 /* 116F4 800362F4 A4430000 */ sh $v1, ($v0) /* 116F8 800362F8 0C00F949 */ jal func_8003E524 -/* 116FC 800362FC 00000000 */ nop +/* 116FC 800362FC 00000000 */ nop /* 11700 80036300 0C00E64C */ jal update_npcs -/* 11704 80036304 00000000 */ nop +/* 11704 80036304 00000000 */ nop /* 11708 80036308 0C037DD0 */ jal update_player -/* 1170C 8003630C 00000000 */ nop +/* 1170C 8003630C 00000000 */ nop /* 11710 80036310 0C00B500 */ jal update_cameras -/* 11714 80036314 00000000 */ nop +/* 11714 80036314 00000000 */ nop /* 11718 80036318 3C04800A */ lui $a0, 0x800a /* 1171C 8003631C 24840946 */ addiu $a0, $a0, 0x946 /* 11720 80036320 84820000 */ lh $v0, ($a0) @@ -135,27 +135,27 @@ glabel func_8003617C /* 11774 80036374 0800D8FA */ j .L800363E8 /* 11778 80036378 A4C30000 */ sh $v1, ($a2) /* 1177C 8003637C 0C00E64C */ jal update_npcs -/* 11780 80036380 00000000 */ nop +/* 11780 80036380 00000000 */ nop /* 11784 80036384 0C037DD0 */ jal update_player -/* 11788 80036388 00000000 */ nop +/* 11788 80036388 00000000 */ nop /* 1178C 8003638C 0C016754 */ jal func_80059D50 -/* 11790 80036390 00000000 */ nop +/* 11790 80036390 00000000 */ nop /* 11794 80036394 0C00B500 */ jal update_cameras -/* 11798 80036398 00000000 */ nop -/* 1179C 8003639C 3C04800A */ lui $a0, %hi(D_800A0940) -/* 117A0 800363A0 24840940 */ addiu $a0, $a0, %lo(D_800A0940) +/* 11798 80036398 00000000 */ nop +/* 1179C 8003639C 3C04800A */ lui $a0, %hi(gMapTransitionAlpha) +/* 117A0 800363A0 24840940 */ addiu $a0, $a0, %lo(gMapTransitionAlpha) /* 117A4 800363A4 0C04E175 */ jal func_801385D4 -/* 117A8 800363A8 00000000 */ nop +/* 117A8 800363A8 00000000 */ nop /* 117AC 800363AC 00021400 */ sll $v0, $v0, 0x10 /* 117B0 800363B0 1040000D */ beqz $v0, .L800363E8 -/* 117B4 800363B4 00000000 */ nop +/* 117B4 800363B4 00000000 */ nop /* 117B8 800363B8 3C028007 */ lui $v0, %hi(gGameStatusPtr) /* 117BC 800363BC 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) /* 117C0 800363C0 80420071 */ lb $v0, 0x71($v0) /* 117C4 800363C4 14400003 */ bnez $v0, .L800363D4 -/* 117C8 800363C8 00000000 */ nop +/* 117C8 800363C8 00000000 */ nop /* 117CC 800363CC 0C038069 */ jal enable_player_input -/* 117D0 800363D0 00000000 */ nop +/* 117D0 800363D0 00000000 */ nop .L800363D4: /* 117D4 800363D4 3C05BF80 */ lui $a1, 0xbf80 /* 117D8 800363D8 0C04DF62 */ jal func_80137D88 diff --git a/asm/nonmatchings/code_111f0_len_860/func_8003646C.s b/asm/nonmatchings/code_111f0_len_860/func_8003646C.s index 735fb35f3a..05e815a902 100644 --- a/asm/nonmatchings/code_111f0_len_860/func_8003646C.s +++ b/asm/nonmatchings/code_111f0_len_860/func_8003646C.s @@ -15,17 +15,17 @@ glabel func_8003646C /* 11894 80036494 10400005 */ beqz $v0, .L800364AC /* 11898 80036498 24020001 */ addiu $v0, $zero, 1 /* 1189C 8003649C 1062000A */ beq $v1, $v0, .L800364C8 -/* 118A0 800364A0 00000000 */ nop +/* 118A0 800364A0 00000000 */ nop /* 118A4 800364A4 0800D984 */ j .L80036610 -/* 118A8 800364A8 00000000 */ nop +/* 118A8 800364A8 00000000 */ nop .L800364AC: /* 118AC 800364AC 24020003 */ addiu $v0, $zero, 3 /* 118B0 800364B0 1062002A */ beq $v1, $v0, .L8003655C /* 118B4 800364B4 24020004 */ addiu $v0, $zero, 4 /* 118B8 800364B8 1062003C */ beq $v1, $v0, .L800365AC -/* 118BC 800364BC 00000000 */ nop +/* 118BC 800364BC 00000000 */ nop /* 118C0 800364C0 0800D984 */ j .L80036610 -/* 118C4 800364C4 00000000 */ nop +/* 118C4 800364C4 00000000 */ nop .L800364C8: /* 118C8 800364C8 3C03800A */ lui $v1, %hi(D_8009A650) /* 118CC 800364CC 2463A650 */ addiu $v1, $v1, %lo(D_8009A650) @@ -61,7 +61,7 @@ glabel func_8003646C /* 1193C 8003653C 0C0169BD */ jal load_map_by_IDs /* 11940 80036540 0000302D */ daddu $a2, $zero, $zero /* 11944 80036544 0C018030 */ jal nuContRmbForceStopEnd -/* 11948 80036548 00000000 */ nop +/* 11948 80036548 00000000 */ nop /* 1194C 8003654C 96020000 */ lhu $v0, ($s0) /* 11950 80036550 24420001 */ addiu $v0, $v0, 1 .L80036554: @@ -69,15 +69,15 @@ glabel func_8003646C /* 11958 80036558 A6020000 */ sh $v0, ($s0) .L8003655C: /* 1195C 8003655C 0C00F949 */ jal func_8003E524 -/* 11960 80036560 00000000 */ nop +/* 11960 80036560 00000000 */ nop /* 11964 80036564 0C00E64C */ jal update_npcs -/* 11968 80036568 00000000 */ nop +/* 11968 80036568 00000000 */ nop /* 1196C 8003656C 3C028007 */ lui $v0, %hi(gGameStatusPtr) /* 11970 80036570 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) /* 11974 80036574 0C0B1059 */ jal does_script_exist /* 11978 80036578 8C44006C */ lw $a0, 0x6c($v0) /* 1197C 8003657C 1440002C */ bnez $v0, .L80036630 -/* 11980 80036580 00000000 */ nop +/* 11980 80036580 00000000 */ nop /* 11984 80036584 3C05800A */ lui $a1, %hi(D_8009A650) /* 11988 80036588 24A5A650 */ addiu $a1, $a1, %lo(D_8009A650) /* 1198C 8003658C 2404FFF7 */ addiu $a0, $zero, -9 @@ -89,8 +89,8 @@ glabel func_8003646C /* 119A4 800365A4 0800D984 */ j .L80036610 /* 119A8 800365A8 A6030000 */ sh $v1, ($s0) .L800365AC: -/* 119AC 800365AC 3C06800A */ lui $a2, %hi(D_800A0940) -/* 119B0 800365B0 24C60940 */ addiu $a2, $a2, %lo(D_800A0940) +/* 119AC 800365AC 3C06800A */ lui $a2, %hi(gMapTransitionAlpha) +/* 119B0 800365B0 24C60940 */ addiu $a2, $a2, %lo(gMapTransitionAlpha) /* 119B4 800365B4 94C20000 */ lhu $v0, ($a2) /* 119B8 800365B8 3C03800A */ lui $v1, %hi(D_800A0942) /* 119BC 800365BC 94630942 */ lhu $v1, %lo(D_800A0942)($v1) @@ -108,18 +108,18 @@ glabel func_8003646C /* 119EC 800365EC 24040004 */ addiu $a0, $zero, 4 .L800365F0: /* 119F0 800365F0 0C00E64C */ jal update_npcs -/* 119F4 800365F4 00000000 */ nop +/* 119F4 800365F4 00000000 */ nop /* 119F8 800365F8 0C037DD0 */ jal update_player -/* 119FC 800365FC 00000000 */ nop +/* 119FC 800365FC 00000000 */ nop /* 11A00 80036600 0C016754 */ jal func_80059D50 -/* 11A04 80036604 00000000 */ nop +/* 11A04 80036604 00000000 */ nop /* 11A08 80036608 0C00B500 */ jal update_cameras -/* 11A0C 8003660C 00000000 */ nop +/* 11A0C 8003660C 00000000 */ nop .L80036610: -/* 11A10 80036610 3C02800A */ lui $v0, %hi(D_800A0940) -/* 11A14 80036614 84420940 */ lh $v0, %lo(D_800A0940)($v0) +/* 11A10 80036610 3C02800A */ lui $v0, %hi(gMapTransitionAlpha) +/* 11A14 80036614 84420940 */ lh $v0, %lo(gMapTransitionAlpha)($v0) /* 11A18 80036618 44820000 */ mtc1 $v0, $f0 -/* 11A1C 8003661C 00000000 */ nop +/* 11A1C 8003661C 00000000 */ nop /* 11A20 80036620 46800020 */ cvt.s.w $f0, $f0 /* 11A24 80036624 44050000 */ mfc1 $a1, $f0 /* 11A28 80036628 0C04DF62 */ jal func_80137D88 diff --git a/asm/nonmatchings/code_11a50_len_7a0/func_80036DE0.s b/asm/nonmatchings/code_11a50_len_7a0/func_80036DE0.s deleted file mode 100644 index 9a9ce016a9..0000000000 --- a/asm/nonmatchings/code_11a50_len_7a0/func_80036DE0.s +++ /dev/null @@ -1,8 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80036DE0 -/* 121E0 80036DE0 03E00008 */ jr $ra -/* 121E4 80036DE4 00000000 */ nop -/* 121E8 80036DE8 00000000 */ nop -/* 121EC 80036DEC 00000000 */ nop diff --git a/asm/nonmatchings/code_25f00_len_940/alLink.s b/asm/nonmatchings/code_25f00_len_940/alLink.s deleted file mode 100644 index 93d0b1dbd8..0000000000 --- a/asm/nonmatchings/code_25f00_len_940/alLink.s +++ /dev/null @@ -1,13 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel alLink -/* 267EC 8004B3EC 8CA20000 */ lw $v0, ($a1) -/* 267F0 8004B3F0 AC850004 */ sw $a1, 4($a0) -/* 267F4 8004B3F4 AC820000 */ sw $v0, ($a0) -/* 267F8 8004B3F8 8CA20000 */ lw $v0, ($a1) -/* 267FC 8004B3FC 54400001 */ bnel $v0, $zero, .L8004B404 -/* 26800 8004B400 AC440004 */ sw $a0, 4($v0) -.L8004B404: -/* 26804 8004B404 03E00008 */ jr $ra -/* 26808 8004B408 ACA40000 */ sw $a0, ($a1) diff --git a/asm/nonmatchings/code_25f00_len_940/alUnlink.s b/asm/nonmatchings/code_25f00_len_940/alUnlink.s deleted file mode 100644 index 53ce08c44f..0000000000 --- a/asm/nonmatchings/code_25f00_len_940/alUnlink.s +++ /dev/null @@ -1,19 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel alUnlink -/* 2680C 8004B40C 8C830000 */ lw $v1, ($a0) -/* 26810 8004B410 10600003 */ beqz $v1, .L8004B420 -/* 26814 8004B414 00000000 */ nop -/* 26818 8004B418 8C820004 */ lw $v0, 4($a0) -/* 2681C 8004B41C AC620004 */ sw $v0, 4($v1) -.L8004B420: -/* 26820 8004B420 8C830004 */ lw $v1, 4($a0) -/* 26824 8004B424 10600003 */ beqz $v1, .L8004B434 -/* 26828 8004B428 00000000 */ nop -/* 2682C 8004B42C 8C820000 */ lw $v0, ($a0) -/* 26830 8004B430 AC620000 */ sw $v0, ($v1) -.L8004B434: -/* 26834 8004B434 03E00008 */ jr $ra -/* 26838 8004B438 00000000 */ nop -/* 2683C 8004B43C 00000000 */ nop diff --git a/asm/nonmatchings/code_362a0_len_2f70/func_8005DDF0.s b/asm/nonmatchings/code_362a0_len_2f70/func_8005DDF0.s deleted file mode 100644 index 9569fa17a3..0000000000 --- a/asm/nonmatchings/code_362a0_len_2f70/func_8005DDF0.s +++ /dev/null @@ -1,12 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8005DDF0 -/* 391F0 8005DDF0 3C02800B */ lui $v0, %hi(gCurrentEncounter+0x8) -/* 391F4 8005DDF4 80420F18 */ lb $v0, %lo(gCurrentEncounter+0x8)($v0) -/* 391F8 8005DDF8 00021027 */ nor $v0, $zero, $v0 -/* 391FC 8005DDFC 03E00008 */ jr $ra -/* 39200 8005DE00 0002102B */ sltu $v0, $zero, $v0 -/* 39204 8005DE04 00000000 */ nop -/* 39208 8005DE08 00000000 */ nop -/* 3920C 8005DE0C 00000000 */ nop diff --git a/asm/nonmatchings/code_42e0_len_1f60/add_vec2D_polar.s b/asm/nonmatchings/code_42e0_len_1f60/add_vec2D_polar.s deleted file mode 100644 index 12d27d31b8..0000000000 --- a/asm/nonmatchings/code_42e0_len_1f60/add_vec2D_polar.s +++ /dev/null @@ -1,42 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel add_vec2D_polar -/* 539C 80029F9C 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 53A0 80029FA0 AFB00018 */ sw $s0, 0x18($sp) -/* 53A4 80029FA4 0080802D */ daddu $s0, $a0, $zero -/* 53A8 80029FA8 AFB1001C */ sw $s1, 0x1c($sp) -/* 53AC 80029FAC 00A0882D */ daddu $s1, $a1, $zero -/* 53B0 80029FB0 3C0140C9 */ lui $at, 0x40c9 -/* 53B4 80029FB4 34210FD0 */ ori $at, $at, 0xfd0 -/* 53B8 80029FB8 44810000 */ mtc1 $at, $f0 -/* 53BC 80029FBC 44872000 */ mtc1 $a3, $f4 -/* 53C0 80029FC0 27A50010 */ addiu $a1, $sp, 0x10 -/* 53C4 80029FC4 F7B40028 */ sdc1 $f20, 0x28($sp) -/* 53C8 80029FC8 46002002 */ mul.s $f0, $f4, $f0 -/* 53CC 80029FCC 00000000 */ nop -/* 53D0 80029FD0 4486A000 */ mtc1 $a2, $f20 -/* 53D4 80029FD4 3C0143B4 */ lui $at, 0x43b4 -/* 53D8 80029FD8 44816000 */ mtc1 $at, $f12 -/* 53DC 80029FDC 27A60014 */ addiu $a2, $sp, 0x14 -/* 53E0 80029FE0 AFBF0020 */ sw $ra, 0x20($sp) -/* 53E4 80029FE4 0C00A82D */ jal sin_cos_rad -/* 53E8 80029FE8 460C0303 */ div.s $f12, $f0, $f12 -/* 53EC 80029FEC C7A20010 */ lwc1 $f2, 0x10($sp) -/* 53F0 80029FF0 4602A082 */ mul.s $f2, $f20, $f2 -/* 53F4 80029FF4 00000000 */ nop -/* 53F8 80029FF8 C6000000 */ lwc1 $f0, ($s0) -/* 53FC 80029FFC 46020000 */ add.s $f0, $f0, $f2 -/* 5400 8002A000 E6000000 */ swc1 $f0, ($s0) -/* 5404 8002A004 C7A00014 */ lwc1 $f0, 0x14($sp) -/* 5408 8002A008 4600A502 */ mul.s $f20, $f20, $f0 -/* 540C 8002A00C 00000000 */ nop -/* 5410 8002A010 C6200000 */ lwc1 $f0, ($s1) -/* 5414 8002A014 46140001 */ sub.s $f0, $f0, $f20 -/* 5418 8002A018 E6200000 */ swc1 $f0, ($s1) -/* 541C 8002A01C 8FBF0020 */ lw $ra, 0x20($sp) -/* 5420 8002A020 8FB1001C */ lw $s1, 0x1c($sp) -/* 5424 8002A024 8FB00018 */ lw $s0, 0x18($sp) -/* 5428 8002A028 D7B40028 */ ldc1 $f20, 0x28($sp) -/* 542C 8002A02C 03E00008 */ jr $ra -/* 5430 8002A030 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/asm/nonmatchings/code_42e0_len_1f60/dma_copy.s b/asm/nonmatchings/code_42e0_len_1f60/dma_copy.s deleted file mode 100644 index 5b659c3a66..0000000000 --- a/asm/nonmatchings/code_42e0_len_1f60/dma_copy.s +++ /dev/null @@ -1,45 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel dma_copy -/* 4B3C 8002973C 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 4B40 80029740 AFB20018 */ sw $s2, 0x18($sp) -/* 4B44 80029744 0080902D */ daddu $s2, $a0, $zero -/* 4B48 80029748 AFB3001C */ sw $s3, 0x1c($sp) -/* 4B4C 8002974C 00C0982D */ daddu $s3, $a2, $zero -/* 4B50 80029750 0260202D */ daddu $a0, $s3, $zero -/* 4B54 80029754 AFB10014 */ sw $s1, 0x14($sp) -/* 4B58 80029758 00B28823 */ subu $s1, $a1, $s2 -/* 4B5C 8002975C 0220282D */ daddu $a1, $s1, $zero -/* 4B60 80029760 AFBF0020 */ sw $ra, 0x20($sp) -/* 4B64 80029764 0C0185F4 */ jal osInvalICache -/* 4B68 80029768 AFB00010 */ sw $s0, 0x10($sp) -/* 4B6C 8002976C 24022000 */ addiu $v0, $zero, 0x2000 -/* 4B70 80029770 0051102B */ sltu $v0, $v0, $s1 -/* 4B74 80029774 1040000A */ beqz $v0, .L800297A0 -/* 4B78 80029778 0000802D */ daddu $s0, $zero, $zero -/* 4B7C 8002977C 02502021 */ addu $a0, $s2, $s0 -.L80029780: -/* 4B80 80029780 02702821 */ addu $a1, $s3, $s0 -/* 4B84 80029784 0C017D24 */ jal nuPiReadRom -/* 4B88 80029788 24062000 */ addiu $a2, $zero, 0x2000 -/* 4B8C 8002978C 26102000 */ addiu $s0, $s0, 0x2000 -/* 4B90 80029790 26022000 */ addiu $v0, $s0, 0x2000 -/* 4B94 80029794 0051102B */ sltu $v0, $v0, $s1 -/* 4B98 80029798 1440FFF9 */ bnez $v0, .L80029780 -/* 4B9C 8002979C 02502021 */ addu $a0, $s2, $s0 -.L800297A0: -/* 4BA0 800297A0 12110004 */ beq $s0, $s1, .L800297B4 -/* 4BA4 800297A4 02502021 */ addu $a0, $s2, $s0 -/* 4BA8 800297A8 02702821 */ addu $a1, $s3, $s0 -/* 4BAC 800297AC 0C017D24 */ jal nuPiReadRom -/* 4BB0 800297B0 02303023 */ subu $a2, $s1, $s0 -.L800297B4: -/* 4BB4 800297B4 0220102D */ daddu $v0, $s1, $zero -/* 4BB8 800297B8 8FBF0020 */ lw $ra, 0x20($sp) -/* 4BBC 800297BC 8FB3001C */ lw $s3, 0x1c($sp) -/* 4BC0 800297C0 8FB20018 */ lw $s2, 0x18($sp) -/* 4BC4 800297C4 8FB10014 */ lw $s1, 0x14($sp) -/* 4BC8 800297C8 8FB00010 */ lw $s0, 0x10($sp) -/* 4BCC 800297CC 03E00008 */ jr $ra -/* 4BD0 800297D0 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_42e0_len_1f60/func_800297D4.s b/asm/nonmatchings/code_42e0_len_1f60/func_800297D4.s deleted file mode 100644 index 303d45572d..0000000000 --- a/asm/nonmatchings/code_42e0_len_1f60/func_800297D4.s +++ /dev/null @@ -1,42 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_800297D4 -/* 4BD4 800297D4 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 4BD8 800297D8 AFB20018 */ sw $s2, 0x18($sp) -/* 4BDC 800297DC 0080902D */ daddu $s2, $a0, $zero -/* 4BE0 800297E0 AFB00010 */ sw $s0, 0x10($sp) -/* 4BE4 800297E4 0000802D */ daddu $s0, $zero, $zero -/* 4BE8 800297E8 AFB3001C */ sw $s3, 0x1c($sp) -/* 4BEC 800297EC 00C0982D */ daddu $s3, $a2, $zero -/* 4BF0 800297F0 AFB10014 */ sw $s1, 0x14($sp) -/* 4BF4 800297F4 00B28823 */ subu $s1, $a1, $s2 -/* 4BF8 800297F8 24022000 */ addiu $v0, $zero, 0x2000 -/* 4BFC 800297FC 0051102B */ sltu $v0, $v0, $s1 -/* 4C00 80029800 1040000A */ beqz $v0, .L8002982C -/* 4C04 80029804 AFBF0020 */ sw $ra, 0x20($sp) -/* 4C08 80029808 02502021 */ addu $a0, $s2, $s0 -.L8002980C: -/* 4C0C 8002980C 02702821 */ addu $a1, $s3, $s0 -/* 4C10 80029810 0C00A618 */ jal func_80029860 -/* 4C14 80029814 24062000 */ addiu $a2, $zero, 0x2000 -/* 4C18 80029818 26102000 */ addiu $s0, $s0, 0x2000 -/* 4C1C 8002981C 26022000 */ addiu $v0, $s0, 0x2000 -/* 4C20 80029820 0051102B */ sltu $v0, $v0, $s1 -/* 4C24 80029824 1440FFF9 */ bnez $v0, .L8002980C -/* 4C28 80029828 02502021 */ addu $a0, $s2, $s0 -.L8002982C: -/* 4C2C 8002982C 12110004 */ beq $s0, $s1, .L80029840 -/* 4C30 80029830 02502021 */ addu $a0, $s2, $s0 -/* 4C34 80029834 02702821 */ addu $a1, $s3, $s0 -/* 4C38 80029838 0C00A618 */ jal func_80029860 -/* 4C3C 8002983C 02303023 */ subu $a2, $s1, $s0 -.L80029840: -/* 4C40 80029840 0220102D */ daddu $v0, $s1, $zero -/* 4C44 80029844 8FBF0020 */ lw $ra, 0x20($sp) -/* 4C48 80029848 8FB3001C */ lw $s3, 0x1c($sp) -/* 4C4C 8002984C 8FB20018 */ lw $s2, 0x18($sp) -/* 4C50 80029850 8FB10014 */ lw $s1, 0x14($sp) -/* 4C54 80029854 8FB00010 */ lw $s0, 0x10($sp) -/* 4C58 80029858 03E00008 */ jr $ra -/* 4C5C 8002985C 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_42e0_len_1f60/func_80029994.s b/asm/nonmatchings/code_42e0_len_1f60/func_80029994.s deleted file mode 100644 index fd745df08d..0000000000 --- a/asm/nonmatchings/code_42e0_len_1f60/func_80029994.s +++ /dev/null @@ -1,33 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80029994 -/* 4D94 80029994 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 4D98 80029998 AFB00010 */ sw $s0, 0x10($sp) -/* 4D9C 8002999C 2410FFFF */ addiu $s0, $zero, -1 -/* 4DA0 800299A0 AFB10014 */ sw $s1, 0x14($sp) -/* 4DA4 800299A4 24910001 */ addiu $s1, $a0, 1 -/* 4DA8 800299A8 16200002 */ bnez $s1, .L800299B4 -/* 4DAC 800299AC 0211001B */ divu $zero, $s0, $s1 -/* 4DB0 800299B0 0007000D */ break 7 -.L800299B4: -/* 4DB4 800299B4 00008012 */ mflo $s0 -/* 4DB8 800299B8 16000002 */ bnez $s0, .L800299C4 -/* 4DBC 800299BC AFBF0018 */ sw $ra, 0x18($sp) -/* 4DC0 800299C0 24100001 */ addiu $s0, $zero, 1 -.L800299C4: -/* 4DC4 800299C4 0C00A640 */ jal _advance_rng -/* 4DC8 800299C8 00000000 */ nop -/* 4DCC 800299CC 16000002 */ bnez $s0, .L800299D8 -/* 4DD0 800299D0 0050001B */ divu $zero, $v0, $s0 -/* 4DD4 800299D4 0007000D */ break 7 -.L800299D8: -/* 4DD8 800299D8 00001812 */ mflo $v1 -/* 4DDC 800299DC 0071102B */ sltu $v0, $v1, $s1 -/* 4DE0 800299E0 1040FFF8 */ beqz $v0, .L800299C4 -/* 4DE4 800299E4 0060102D */ daddu $v0, $v1, $zero -/* 4DE8 800299E8 8FBF0018 */ lw $ra, 0x18($sp) -/* 4DEC 800299EC 8FB10014 */ lw $s1, 0x14($sp) -/* 4DF0 800299F0 8FB00010 */ lw $s0, 0x10($sp) -/* 4DF4 800299F4 03E00008 */ jr $ra -/* 4DF8 800299F8 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_42e0_len_1f60/get_player_normal_pitch.s b/asm/nonmatchings/code_42e0_len_1f60/get_player_normal_pitch.s deleted file mode 100644 index 0feb0b6e61..0000000000 --- a/asm/nonmatchings/code_42e0_len_1f60/get_player_normal_pitch.s +++ /dev/null @@ -1,38 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel get_player_normal_pitch -/* 5250 80029E50 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 5254 80029E54 AFB00010 */ sw $s0, 0x10($sp) -/* 5258 80029E58 3C108007 */ lui $s0, %hi(gGameStatusPtr) -/* 525C 80029E5C 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr) -/* 5260 80029E60 AFBF0014 */ sw $ra, 0x14($sp) -/* 5264 80029E64 8E020000 */ lw $v0, ($s0) -/* 5268 80029E68 C4420128 */ lwc1 $f2, 0x128($v0) -/* 526C 80029E6C 46021082 */ mul.s $f2, $f2, $f2 -/* 5270 80029E70 00000000 */ nop -/* 5274 80029E74 C4400130 */ lwc1 $f0, 0x130($v0) -/* 5278 80029E78 46000002 */ mul.s $f0, $f0, $f0 -/* 527C 80029E7C 00000000 */ nop -/* 5280 80029E80 46001300 */ add.s $f12, $f2, $f0 -/* 5284 80029E84 46006104 */ sqrt.s $f4, $f12 -/* 5288 80029E88 46042032 */ c.eq.s $f4, $f4 -/* 528C 80029E8C 00000000 */ nop -/* 5290 80029E90 45010005 */ bc1t .L80029EA8 -/* 5294 80029E94 00000000 */ nop -/* 5298 80029E98 0C0187BC */ jal sqrtf -/* 529C 80029E9C 00000000 */ nop -/* 52A0 80029EA0 46000106 */ mov.s $f4, $f0 -/* 52A4 80029EA4 8E020000 */ lw $v0, ($s0) -.L80029EA8: -/* 52A8 80029EA8 44806000 */ mtc1 $zero, $f12 -/* 52AC 80029EAC C440012C */ lwc1 $f0, 0x12c($v0) -/* 52B0 80029EB0 44062000 */ mfc1 $a2, $f4 -/* 52B4 80029EB4 46000007 */ neg.s $f0, $f0 -/* 52B8 80029EB8 44070000 */ mfc1 $a3, $f0 -/* 52BC 80029EBC 0C00A720 */ jal atan2 -/* 52C0 80029EC0 46006386 */ mov.s $f14, $f12 -/* 52C4 80029EC4 8FBF0014 */ lw $ra, 0x14($sp) -/* 52C8 80029EC8 8FB00010 */ lw $s0, 0x10($sp) -/* 52CC 80029ECC 03E00008 */ jr $ra -/* 52D0 80029ED0 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_6240_len_c00/get_spirits_rescued.s b/asm/nonmatchings/code_6240_len_c00/get_spirits_rescued.s deleted file mode 100644 index b368d7827b..0000000000 --- a/asm/nonmatchings/code_6240_len_c00/get_spirits_rescued.s +++ /dev/null @@ -1,75 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel get_spirits_rescued -/* 6240 8002AE40 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 6244 8002AE44 0000202D */ daddu $a0, $zero, $zero -/* 6248 8002AE48 3C05F5DE */ lui $a1, 0xf5de -/* 624C 8002AE4C 34A50180 */ ori $a1, $a1, 0x180 -/* 6250 8002AE50 AFBF0018 */ sw $ra, 0x18($sp) -/* 6254 8002AE54 AFB10014 */ sw $s1, 0x14($sp) -/* 6258 8002AE58 0C0B1EAF */ jal get_variable -/* 625C 8002AE5C AFB00010 */ sw $s0, 0x10($sp) -/* 6260 8002AE60 24110007 */ addiu $s1, $zero, 7 -/* 6264 8002AE64 0000202D */ daddu $a0, $zero, $zero -/* 6268 8002AE68 2405FFB3 */ addiu $a1, $zero, -0x4d -/* 626C 8002AE6C 0C0B1EAF */ jal get_variable -/* 6270 8002AE70 0040802D */ daddu $s0, $v0, $zero -/* 6274 8002AE74 0202102A */ slt $v0, $s0, $v0 -/* 6278 8002AE78 10400003 */ beqz $v0, .L8002AE88 -/* 627C 8002AE7C 0000202D */ daddu $a0, $zero, $zero -/* 6280 8002AE80 0800ABCA */ j .L8002AF28 -/* 6284 8002AE84 0000882D */ daddu $s1, $zero, $zero -.L8002AE88: -/* 6288 8002AE88 0C0B1EAF */ jal get_variable -/* 628C 8002AE8C 2405FFC9 */ addiu $a1, $zero, -0x37 -/* 6290 8002AE90 0202102A */ slt $v0, $s0, $v0 -/* 6294 8002AE94 10400003 */ beqz $v0, .L8002AEA4 -/* 6298 8002AE98 0000202D */ daddu $a0, $zero, $zero -/* 629C 8002AE9C 0800ABCA */ j .L8002AF28 -/* 62A0 8002AEA0 24110001 */ addiu $s1, $zero, 1 -.L8002AEA4: -/* 62A4 8002AEA4 0C0B1EAF */ jal get_variable -/* 62A8 8002AEA8 2405FFF1 */ addiu $a1, $zero, -0xf -/* 62AC 8002AEAC 0202102A */ slt $v0, $s0, $v0 -/* 62B0 8002AEB0 10400003 */ beqz $v0, .L8002AEC0 -/* 62B4 8002AEB4 0000202D */ daddu $a0, $zero, $zero -/* 62B8 8002AEB8 0800ABCA */ j .L8002AF28 -/* 62BC 8002AEBC 24110002 */ addiu $s1, $zero, 2 -.L8002AEC0: -/* 62C0 8002AEC0 0C0B1EAF */ jal get_variable -/* 62C4 8002AEC4 24050005 */ addiu $a1, $zero, 5 -/* 62C8 8002AEC8 0202102A */ slt $v0, $s0, $v0 -/* 62CC 8002AECC 10400003 */ beqz $v0, .L8002AEDC -/* 62D0 8002AED0 0000202D */ daddu $a0, $zero, $zero -/* 62D4 8002AED4 0800ABCA */ j .L8002AF28 -/* 62D8 8002AED8 24110003 */ addiu $s1, $zero, 3 -.L8002AEDC: -/* 62DC 8002AEDC 0C0B1EAF */ jal get_variable -/* 62E0 8002AEE0 24050025 */ addiu $a1, $zero, 0x25 -/* 62E4 8002AEE4 0202102A */ slt $v0, $s0, $v0 -/* 62E8 8002AEE8 10400003 */ beqz $v0, .L8002AEF8 -/* 62EC 8002AEEC 0000202D */ daddu $a0, $zero, $zero -/* 62F0 8002AEF0 0800ABCA */ j .L8002AF28 -/* 62F4 8002AEF4 24110004 */ addiu $s1, $zero, 4 -.L8002AEF8: -/* 62F8 8002AEF8 0C0B1EAF */ jal get_variable -/* 62FC 8002AEFC 24050039 */ addiu $a1, $zero, 0x39 -/* 6300 8002AF00 0202102A */ slt $v0, $s0, $v0 -/* 6304 8002AF04 10400003 */ beqz $v0, .L8002AF14 -/* 6308 8002AF08 0000202D */ daddu $a0, $zero, $zero -/* 630C 8002AF0C 0800ABCA */ j .L8002AF28 -/* 6310 8002AF10 24110005 */ addiu $s1, $zero, 5 -.L8002AF14: -/* 6314 8002AF14 0C0B1EAF */ jal get_variable -/* 6318 8002AF18 24050057 */ addiu $a1, $zero, 0x57 -/* 631C 8002AF1C 0202102A */ slt $v0, $s0, $v0 -/* 6320 8002AF20 54400001 */ bnel $v0, $zero, .L8002AF28 -/* 6324 8002AF24 24110006 */ addiu $s1, $zero, 6 -.L8002AF28: -/* 6328 8002AF28 0220102D */ daddu $v0, $s1, $zero -/* 632C 8002AF2C 8FBF0018 */ lw $ra, 0x18($sp) -/* 6330 8002AF30 8FB10014 */ lw $s1, 0x14($sp) -/* 6334 8002AF34 8FB00010 */ lw $s0, 0x10($sp) -/* 6338 8002AF38 03E00008 */ jr $ra -/* 633C 8002AF3C 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_8230_len_1ae0/func_8002E754.s b/asm/nonmatchings/code_8230_len_1ae0/func_8002E754.s deleted file mode 100644 index e42d9ee109..0000000000 --- a/asm/nonmatchings/code_8230_len_1ae0/func_8002E754.s +++ /dev/null @@ -1,37 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8002E754 -/* 9B54 8002E754 00A0402D */ daddu $t0, $a1, $zero -/* 9B58 8002E758 3C05800B */ lui $a1, %hi(gCameras) -/* 9B5C 8002E75C 24A51D80 */ addiu $a1, $a1, %lo(gCameras) -/* 9B60 8002E760 00041080 */ sll $v0, $a0, 2 -/* 9B64 8002E764 00441021 */ addu $v0, $v0, $a0 -/* 9B68 8002E768 00021080 */ sll $v0, $v0, 2 -/* 9B6C 8002E76C 00441023 */ subu $v0, $v0, $a0 -/* 9B70 8002E770 000218C0 */ sll $v1, $v0, 3 -/* 9B74 8002E774 00431021 */ addu $v0, $v0, $v1 -/* 9B78 8002E778 000210C0 */ sll $v0, $v0, 3 -/* 9B7C 8002E77C 00451021 */ addu $v0, $v0, $a1 -/* 9B80 8002E780 8443000E */ lh $v1, 0xe($v0) -/* 9B84 8002E784 84450010 */ lh $a1, 0x10($v0) -/* 9B88 8002E788 8444000A */ lh $a0, 0xa($v0) -/* 9B8C 8002E78C 8442000C */ lh $v0, 0xc($v0) -/* 9B90 8002E790 00642021 */ addu $a0, $v1, $a0 -/* 9B94 8002E794 0103182A */ slt $v1, $t0, $v1 -/* 9B98 8002E798 14600004 */ bnez $v1, .L8002E7AC -/* 9B9C 8002E79C 00A23821 */ addu $a3, $a1, $v0 -/* 9BA0 8002E7A0 0088102A */ slt $v0, $a0, $t0 -/* 9BA4 8002E7A4 10400003 */ beqz $v0, .L8002E7B4 -/* 9BA8 8002E7A8 00C5102A */ slt $v0, $a2, $a1 -.L8002E7AC: -/* 9BAC 8002E7AC 03E00008 */ jr $ra -/* 9BB0 8002E7B0 24020001 */ addiu $v0, $zero, 1 -.L8002E7B4: -/* 9BB4 8002E7B4 10400003 */ beqz $v0, .L8002E7C4 -/* 9BB8 8002E7B8 00E6102A */ slt $v0, $a3, $a2 -/* 9BBC 8002E7BC 03E00008 */ jr $ra -/* 9BC0 8002E7C0 24020001 */ addiu $v0, $zero, 1 -.L8002E7C4: -/* 9BC4 8002E7C4 03E00008 */ jr $ra -/* 9BC8 8002E7C8 00000000 */ nop diff --git a/asm/nonmatchings/code_8230_len_1ae0/func_8002E7CC.s b/asm/nonmatchings/code_8230_len_1ae0/func_8002E7CC.s deleted file mode 100644 index 1017038cc7..0000000000 --- a/asm/nonmatchings/code_8230_len_1ae0/func_8002E7CC.s +++ /dev/null @@ -1,28 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8002E7CC -/* 9BCC 8002E7CC 3C08800B */ lui $t0, %hi(gCameras) -/* 9BD0 8002E7D0 25081D80 */ addiu $t0, $t0, %lo(gCameras) -/* 9BD4 8002E7D4 00041080 */ sll $v0, $a0, 2 -/* 9BD8 8002E7D8 00441021 */ addu $v0, $v0, $a0 -/* 9BDC 8002E7DC 00021080 */ sll $v0, $v0, 2 -/* 9BE0 8002E7E0 00441023 */ subu $v0, $v0, $a0 -/* 9BE4 8002E7E4 000218C0 */ sll $v1, $v0, 3 -/* 9BE8 8002E7E8 00431021 */ addu $v0, $v0, $v1 -/* 9BEC 8002E7EC 000210C0 */ sll $v0, $v0, 3 -/* 9BF0 8002E7F0 00481021 */ addu $v0, $v0, $t0 -/* 9BF4 8002E7F4 8443000E */ lh $v1, 0xe($v0) -/* 9BF8 8002E7F8 8FA80010 */ lw $t0, 0x10($sp) -/* 9BFC 8002E7FC ACA30000 */ sw $v1, ($a1) -/* 9C00 8002E800 84430010 */ lh $v1, 0x10($v0) -/* 9C04 8002E804 ACC30000 */ sw $v1, ($a2) -/* 9C08 8002E808 8443000E */ lh $v1, 0xe($v0) -/* 9C0C 8002E80C 8444000A */ lh $a0, 0xa($v0) -/* 9C10 8002E810 00641821 */ addu $v1, $v1, $a0 -/* 9C14 8002E814 ACE30000 */ sw $v1, ($a3) -/* 9C18 8002E818 84430010 */ lh $v1, 0x10($v0) -/* 9C1C 8002E81C 8442000C */ lh $v0, 0xc($v0) -/* 9C20 8002E820 00621821 */ addu $v1, $v1, $v0 -/* 9C24 8002E824 03E00008 */ jr $ra -/* 9C28 8002E828 AD030000 */ sw $v1, ($t0) diff --git a/asm/nonmatchings/code_8230_len_1ae0/get_cam_viewport.s b/asm/nonmatchings/code_8230_len_1ae0/get_cam_viewport.s deleted file mode 100644 index 8da908a67a..0000000000 --- a/asm/nonmatchings/code_8230_len_1ae0/get_cam_viewport.s +++ /dev/null @@ -1,24 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel get_cam_viewport -/* 98E8 8002E4E8 3C08800B */ lui $t0, %hi(gCameras) -/* 98EC 8002E4EC 25081D80 */ addiu $t0, $t0, %lo(gCameras) -/* 98F0 8002E4F0 00041080 */ sll $v0, $a0, 2 -/* 98F4 8002E4F4 00441021 */ addu $v0, $v0, $a0 -/* 98F8 8002E4F8 00021080 */ sll $v0, $v0, 2 -/* 98FC 8002E4FC 00441023 */ subu $v0, $v0, $a0 -/* 9900 8002E500 000218C0 */ sll $v1, $v0, 3 -/* 9904 8002E504 00431021 */ addu $v0, $v0, $v1 -/* 9908 8002E508 000210C0 */ sll $v0, $v0, 3 -/* 990C 8002E50C 00481021 */ addu $v0, $v0, $t0 -/* 9910 8002E510 9443000A */ lhu $v1, 0xa($v0) -/* 9914 8002E514 8FA40010 */ lw $a0, 0x10($sp) -/* 9918 8002E518 A4E30000 */ sh $v1, ($a3) -/* 991C 8002E51C 9443000C */ lhu $v1, 0xc($v0) -/* 9920 8002E520 A4830000 */ sh $v1, ($a0) -/* 9924 8002E524 9443000E */ lhu $v1, 0xe($v0) -/* 9928 8002E528 A4A30000 */ sh $v1, ($a1) -/* 992C 8002E52C 94420010 */ lhu $v0, 0x10($v0) -/* 9930 8002E530 03E00008 */ jr $ra -/* 9934 8002E534 A4C20000 */ sh $v0, ($a2) diff --git a/asm/nonmatchings/code_8230_len_1ae0/nuSiMgrStop.s b/asm/nonmatchings/code_8230_len_1ae0/nuSiMgrStop.s deleted file mode 100644 index 88572c773b..0000000000 --- a/asm/nonmatchings/code_8230_len_1ae0/nuSiMgrStop.s +++ /dev/null @@ -1,12 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel nuSiMgrStop -/* 838C 8002CF8C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 8390 8002CF90 24047F00 */ addiu $a0, $zero, 0x7f00 -/* 8394 8002CF94 AFBF0010 */ sw $ra, 0x10($sp) -/* 8398 8002CF98 0C00B3CA */ jal nuSiSendMesg -/* 839C 8002CF9C 0000282D */ daddu $a1, $zero, $zero -/* 83A0 8002CFA0 8FBF0010 */ lw $ra, 0x10($sp) -/* 83A4 8002CFA4 03E00008 */ jr $ra -/* 83A8 8002CFA8 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_8230_len_1ae0/create_cameras_a.s b/asm/nonmatchings/code_8560/create_cameras_a.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/create_cameras_a.s rename to asm/nonmatchings/code_8560/create_cameras_a.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/create_cameras_b.s b/asm/nonmatchings/code_8560/create_cameras_b.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/create_cameras_b.s rename to asm/nonmatchings/code_8560/create_cameras_b.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/func_8002D160.s b/asm/nonmatchings/code_8560/func_8002D160.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/func_8002D160.s rename to asm/nonmatchings/code_8560/func_8002D160.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/func_8002E82C.s b/asm/nonmatchings/code_8560/func_8002E82C.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/func_8002E82C.s rename to asm/nonmatchings/code_8560/func_8002E82C.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/get_screen_coords.s b/asm/nonmatchings/code_8560/get_screen_coords.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/get_screen_coords.s rename to asm/nonmatchings/code_8560/get_screen_coords.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/initialize_next_camera.s b/asm/nonmatchings/code_8560/initialize_next_camera.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/initialize_next_camera.s rename to asm/nonmatchings/code_8560/initialize_next_camera.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/render_frame.s b/asm/nonmatchings/code_8560/render_frame.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/render_frame.s rename to asm/nonmatchings/code_8560/render_frame.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/set_cam_viewport.s b/asm/nonmatchings/code_8560/set_cam_viewport.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/set_cam_viewport.s rename to asm/nonmatchings/code_8560/set_cam_viewport.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/update_cameras.s b/asm/nonmatchings/code_8560/update_cameras.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/update_cameras.s rename to asm/nonmatchings/code_8560/update_cameras.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/nuSiMgrInit.s b/asm/nonmatchings/os/nusys/nuSiMgr/nuSiMgrInit.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/nuSiMgrInit.s rename to asm/nonmatchings/os/nusys/nuSiMgr/nuSiMgrInit.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/nuSiMgrRestart.s b/asm/nonmatchings/os/nusys/nuSiMgr/nuSiMgrRestart.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/nuSiMgrRestart.s rename to asm/nonmatchings/os/nusys/nuSiMgr/nuSiMgrRestart.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/nuSiMgrThread.s b/asm/nonmatchings/os/nusys/nuSiMgr/nuSiMgrThread.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/nuSiMgrThread.s rename to asm/nonmatchings/os/nusys/nuSiMgr/nuSiMgrThread.s diff --git a/asm/nonmatchings/code_8230_len_1ae0/nuSiSendMesg.s b/asm/nonmatchings/os/nusys/nuSiMgr/nuSiSendMesg.s similarity index 100% rename from asm/nonmatchings/code_8230_len_1ae0/nuSiSendMesg.s rename to asm/nonmatchings/os/nusys/nuSiMgr/nuSiSendMesg.s diff --git a/include/common_structs.h b/include/common_structs.h index 774fdf1b22..d7adbb290d 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -1447,7 +1447,8 @@ typedef struct EncounterStatus { /* 0x04 */ u8 eFirstStrike; /* 0 = none, 1 = player, 2 = enemy */ /* 0x05 */ s8 hitType; /* 1 = none/enemy, 2 = jump */ /* 0x06 */ s8 hitTier; /* 0 = normal, 1 = super, 2 = ultra */ - /* 0x07 */ char unk_07[2]; + /* 0x07 */ char unk_07; + /* 0x08 */ s8 unk_08; /* 0x09 */ s8 battleOutcome; /* 0 = won, 1 = lost */ /* 0x0A */ char unk_0A; /* 0x0B */ s8 merleeCoinBonus; /* triple coins when != 0 */ diff --git a/include/functions.h b/include/functions.h index ef868510b0..ce4d9e1a7d 100644 --- a/include/functions.h +++ b/include/functions.h @@ -9,7 +9,7 @@ void osCleanupThread(void); s32 heap_malloc(s32 size); HeapNode* _heap_create(void* addr, s32 size); -void dma_copy(void* romStart, void* romEnd, void* vramDest); +s32 dma_copy(s32 romStart, s32 romEnd, void* vramDest); s32 get_global_byte(s32 index); s32 get_global_flag(s32 index); diff --git a/include/macros.h b/include/macros.h index b573bb2fd8..9c633e9a76 100644 --- a/include/macros.h +++ b/include/macros.h @@ -20,6 +20,8 @@ #define GAME_STATUS (*gGameStatusPtr) #define PLAYER_STATUS (&gPlayerStatus) #define PLAYER_DATA (&gPlayerData) +#define CAM(id) (&gCameras[id]) +#define CURRENT_CAM (&gCameras[gCurrentCameraID]) #define MAX_MAPVARS 16 #define MAX_MAPFLAGS 3 diff --git a/include/variables.h b/include/variables.h index 3e9bef61e0..ef0f80e341 100644 --- a/include/variables.h +++ b/include/variables.h @@ -96,6 +96,8 @@ extern TriggerList* gCurrentTriggerListPtr; extern u16 gMapTransitionAlpha; extern s16 D_800A0942; extern s16 D_800A0944; +extern s16 D_800A0946; +extern s16 D_800A0948; extern s16 D_800A0954; extern s16 D_800A0956; extern s16 D_800A0958; diff --git a/src/code_10400_len_d30.c b/src/code_10400_len_d30.c index b001494f79..86fe3df05c 100644 --- a/src/code_10400_len_d30.c +++ b/src/code_10400_len_d30.c @@ -25,4 +25,5 @@ INCLUDE_ASM(s32, "code_10400_len_d30", func_80035B40); void func_80035D18(void) { } -INCLUDE_ASM(s32, "code_10400_len_d30", func_80035D20); +void func_80035D20(void) { +} diff --git a/src/code_109660_len_1270.c b/src/code_109660_len_1270.c index 54cd26fbcd..4cea538933 100644 --- a/src/code_109660_len_1270.c +++ b/src/code_109660_len_1270.c @@ -30,7 +30,7 @@ void player_enter_blue_pipe(Entity* bluePipe) { PlayerStatus* playerStatus = &gPlayerStatus; Trigger* pipeTrigger = bluePipe->trigger; - playerStatus->targetYaw = gCameras[gCurrentCameraID].currentYaw + 180.0f; + playerStatus->targetYaw = CURRENT_CAM->currentYaw + 180.0f; pipeTrigger->params1 = 0x19; playerStatus->renderMode = 0xD; diff --git a/src/code_111f0_len_860.c b/src/code_111f0_len_860.c index edfea5e2c3..2f7df3d282 100644 --- a/src/code_111f0_len_860.c +++ b/src/code_111f0_len_860.c @@ -1,16 +1,39 @@ #include "common.h" +void func_80035E54(void); + void func_80035DF0(s16 arg0) { s16* tempPtr = &D_800A0942; *tempPtr = arg0; } -INCLUDE_ASM(s32, "code_111f0_len_860", func_80035E00); +void func_80035E00(void) { + D_800A0948 = 0; + func_80035E54(); +} -INCLUDE_ASM(s32, "code_111f0_len_860", func_80035E24); +void func_80035E24(void) { + D_800A0948 = 1; + set_map_transition_effect(8); + func_80035E54(); +} -INCLUDE_ASM(s32, "code_111f0_len_860", func_80035E54); +void func_80035E54(void) { + u16 *mapTransitonAlpha; + GameStatus** gameStatus = gGameStatusPtr; // :/ + + D_800A0944 = 0; + D_800A0946 = 4; + (*gameStatus)->exitAngle = 0.0f; + mapTransitonAlpha = &gMapTransitionAlpha; + *mapTransitonAlpha = 0xFF; + nuContRmbForceStopEnd(); + func_801382AC(mapTransitonAlpha); + D_8009A650[0] |= 8; + set_variable(0, SI_SAVE_VAR(1), (*gameStatus)->unk_A9); + D_8009A5D8 = 0; +} INCLUDE_ASM(s32, "code_111f0_len_860", func_80035EEC); diff --git a/src/code_11a50_len_7a0.c b/src/code_11a50_len_7a0.c index 85ae72db81..c4089d4516 100644 --- a/src/code_11a50_len_7a0.c +++ b/src/code_11a50_len_7a0.c @@ -89,4 +89,5 @@ INCLUDE_ASM(s32, "code_11a50_len_7a0", begin_state_intro); INCLUDE_ASM(s32, "code_11a50_len_7a0", step_intro); -INCLUDE_ASM(s32, "code_11a50_len_7a0", func_80036DE0); +void func_80036DE0(void) { +} diff --git a/src/code_1a1f0_len_5390.c b/src/code_1a1f0_len_5390.c index 44bcc7e2d9..f474f7218a 100644 --- a/src/code_1a1f0_len_5390.c +++ b/src/code_1a1f0_len_5390.c @@ -83,10 +83,9 @@ INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F0C4); INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F384); ApiStatus GetCamLookAtObjVector(ScriptInstance* script, s32 isInitialCall) { - // Almost certainly a CURRENT_CAM macro - script->varTable[0] = (&gCameras[gCurrentCameraID])->lookAt_obj[0]; - script->varTable[1] = (&gCameras[gCurrentCameraID])->lookAt_obj[1]; - script->varTable[2] = (&gCameras[gCurrentCameraID])->lookAt_obj[2]; + script->varTable[0] = CURRENT_CAM->lookAt_obj[0]; + script->varTable[1] = CURRENT_CAM->lookAt_obj[1]; + script->varTable[2] = CURRENT_CAM->lookAt_obj[2]; return ApiStatus_DONE2; } diff --git a/src/code_1b40_len_20b0.c b/src/code_1b40_len_20b0.c index 6222269339..eeca8f6708 100644 --- a/src/code_1b40_len_20b0.c +++ b/src/code_1b40_len_20b0.c @@ -32,8 +32,6 @@ extern int D_802EB3D0[]; extern u8 D_80074021; extern s32 D_8009A5D8; -void dma_copy(void*, void*, void*); - INCLUDE_ASM(s32, "code_1b40_len_20b0", step_game_loop); INCLUDE_ASM(s32, "code_1b40_len_20b0", func_800269EC); diff --git a/src/code_20ec0_len_5040.c b/src/code_20ec0_len_5040.c index 1ddc2eac5b..3204272827 100644 --- a/src/code_20ec0_len_5040.c +++ b/src/code_20ec0_len_5040.c @@ -1,4 +1,5 @@ #include "common.h" +#include "map.h" INCLUDE_ASM(s32, "code_20ec0_len_5040", func_80045AC0); @@ -102,23 +103,24 @@ INCLUDE_ASM(s32, "code_20ec0_len_5040", spawn_drops); #ifdef NON_MATCHING s32 get_coin_drop_amount(Enemy* enemy) { - EncounterStatus* currentEncounter; + EncounterStatus* currentEncounter = &gCurrentEncounter; + s16* dropTables = enemy->dropTables; + s32 t1; + s32 t2; s32 amt; - s32 diff; - s32 a; s32 max; s32 min; - currentEncounter = &gCurrentEncounter; + t1 = dropTables[89]; + t2 = dropTables[90]; - min = enemy->dropTables[89]; - max = enemy->dropTables[90]; - a = min; + min = t1; + max = t2; if (max < min) { - min = max; - max = a; + min = t2; + max = t1; } diff = max - min; @@ -207,7 +209,7 @@ INCLUDE_ASM(s32, "code_20ec0_len_5040", func_8004A124); INCLUDE_ASM(s32, "code_20ec0_len_5040", func_8004A3E8); -INCLUDE_ASM(s32, "code_20ec0_len_5040", DoBasicAI); +INCLUDE_ASM(s32, "code_20ec0_len_5040", DoBasicAI, ScriptInstance* script, s32 isInitialCall); INCLUDE_ASM(s32, "code_20ec0_len_5040", func_8004A6F0); diff --git a/src/code_25f00_len_940.c b/src/code_25f00_len_940.c index ed6722ee5a..1f53464778 100644 --- a/src/code_25f00_len_940.c +++ b/src/code_25f00_len_940.c @@ -14,6 +14,22 @@ INCLUDE_ASM(s32, "code_25f00_len_940", nuAuCleanDMABuffers); INCLUDE_ASM(s32, "code_25f00_len_940", func_8004B328); -INCLUDE_ASM(void, "code_25f00_len_940", alLink, ALLink* element, ALLink* after); +void alLink(ALLink *element, ALLink *after) { + element->next = after->next; + element->prev = after; -INCLUDE_ASM(void, "code_25f00_len_940", alUnlink, ALLink* element); + if (after->next != NULL) { + after->next->prev = element; + } + after->next = element; +} + +void alUnlink(ALLink *element) { + if (element->next != NULL) { + element->next->prev = element->prev; + } + + if (element->prev != NULL) { + element->prev->next = element->next; + } +} diff --git a/src/code_362a0_len_2f70.c b/src/code_362a0_len_2f70.c index 6b72b6841b..a4cc41e4a8 100644 --- a/src/code_362a0_len_2f70.c +++ b/src/code_362a0_len_2f70.c @@ -50,4 +50,6 @@ INCLUDE_ASM(s32, "code_362a0_len_2f70", func_8005DB00); INCLUDE_ASM(s32, "code_362a0_len_2f70", func_8005DD54); -INCLUDE_ASM(s32, "code_362a0_len_2f70", func_8005DDF0); +s32 func_8005DDF0(void) { + return ~gCurrentEncounter.unk_08 != 0; +} diff --git a/src/code_42e0_len_1f60.c b/src/code_42e0_len_1f60.c index 5a96a65017..2b73eea13a 100644 --- a/src/code_42e0_len_1f60.c +++ b/src/code_42e0_len_1f60.c @@ -1,5 +1,10 @@ #include "common.h" +void sin_cos_rad(f32 rad, f32* outSinTheta, f32* outCosTheta); +void func_80029860(s32 romStart, s32 vramDest, s32 length); + +#define ROM_CHUNK_SIZE 0x2000 + void poll_rumble(void) { // TODO: replace with defines nuContRmbCheck(0); @@ -53,11 +58,39 @@ void copy_matrix(Matrix4f* src, Matrix4f* dest) { bcopy(src, dest, sizeof(Matrix4f)); } -INCLUDE_ASM(void, "code_42e0_len_1f60", dma_copy, void* romStart, void* romEnd, void* vramDest); +s32 dma_copy(s32 romStart, s32 romEnd, void* vramDest) { + u32 length = romEnd - romStart; + s32 i; -INCLUDE_ASM(s32, "code_42e0_len_1f60", func_800297D4); + osInvalICache(vramDest, length); -INCLUDE_ASM(s32, "code_42e0_len_1f60", func_80029860); + for (i = 0; i + ROM_CHUNK_SIZE < length; i += ROM_CHUNK_SIZE) { + nuPiReadRom(romStart + i, vramDest + i, ROM_CHUNK_SIZE); + } + + if (i != length) { + nuPiReadRom(romStart + i, vramDest + i, length - i); + } + + return length; +} + +s32 func_800297D4(s32 romStart, s32 romEnd, void* vramDest) { + u32 length = romEnd - romStart; + s32 i; + + for (i = 0; i + ROM_CHUNK_SIZE < length; i += ROM_CHUNK_SIZE) { + func_80029860(romStart + i, vramDest + i, ROM_CHUNK_SIZE); + } + + if (i != length) { + func_80029860(romStart + i, vramDest + i, length - i); + } + + return length; +} + +INCLUDE_ASM(void, "code_42e0_len_1f60", func_80029860, s32 romStart, s32 vramDest, s32 length); s32 _advance_rng(void) { s32* rngVal = &gRandSeed; @@ -69,7 +102,22 @@ s32 _advance_rng(void) { INCLUDE_ASM(s32, "code_42e0_len_1f60", func_80029934); -INCLUDE_ASM(s32, "code_42e0_len_1f60", func_80029994); +s32 func_80029994(s32 arg0) { + u32 div = -1; + s32 plusOne = arg0 + 1; + u32 result; + + div /= plusOne; + if (div == 0) { + div = 1; + } + + do { + result = _advance_rng() / div; + } while (result >= plusOne); + + return result; +} INCLUDE_ASM(s32, "code_42e0_len_1f60", rand_int, s32 arg0); @@ -109,7 +157,13 @@ f32 get_player_normal_yaw(void) { return atan2(0, 0, GAME_STATUS->playerTraceNormal.x, GAME_STATUS->playerTraceNormal.z); } -INCLUDE_ASM(s32, "code_42e0_len_1f60", get_player_normal_pitch); +f32 get_player_normal_pitch(void) { + f32 traceNormalX = GAME_STATUS->playerTraceNormal.x; + f32 traceNormalZ = GAME_STATUS->playerTraceNormal.z; + f32 sqrt = sqrtf(SQ(traceNormalX) + SQ(traceNormalZ)); + + return atan2(0.0f, 0.0f, sqrt, -GAME_STATUS->playerTraceNormal.y); +} f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by) { f32 xDiff = bx - ax; @@ -126,11 +180,18 @@ f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz) { return sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff)); } -INCLUDE_ASM(void, "code_42e0_len_1f60", add_vec2D_polar, f32* x, f32* y, f32 r, f32 theta); +void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta) { + f32 sinTheta; + f32 cosTheta; + + sin_cos_rad((theta * 6.28318f) / 360.0f, &sinTheta, &cosTheta); + *x += r * sinTheta; + *y -= r * cosTheta; +} INCLUDE_ASM(s32, "code_42e0_len_1f60", _wrap_trig_lookup_value); -INCLUDE_ASM(s32, "code_42e0_len_1f60", sin_cos_rad); +INCLUDE_ASM(void, "code_42e0_len_1f60", sin_cos_rad, f32 rad, f32* outSinTheta, f32* outCosTheta); INCLUDE_ASM(f32, "code_42e0_len_1f60", sin_rad, f32 angle); diff --git a/src/code_6240_len_c00.c b/src/code_6240_len_c00.c index 9ba42f8425..7677ba7ffc 100644 --- a/src/code_6240_len_c00.c +++ b/src/code_6240_len_c00.c @@ -2,7 +2,28 @@ void fio_serialize_state(void); -INCLUDE_ASM(s32, "code_6240_len_c00", get_spirits_rescued); +s32 get_spirits_rescued(void) { + s32 storyProgress = get_variable(NULL, SI_SAVE_VAR(0)); + s32 ret = 7; + + if (storyProgress < get_variable(NULL, -0x4D)) { + ret = 0; + } else if (storyProgress < get_variable(NULL, -0x37)) { + ret = 1; + } else if (storyProgress < get_variable(NULL, -0xF)) { + ret = 2; + } else if (storyProgress < get_variable(NULL, 5)) { + ret = 3; + } else if (storyProgress < get_variable(NULL, 0x25)) { + ret = 4; + } else if (storyProgress < get_variable(NULL, 0x39)) { + ret = 5; + } else if (storyProgress < get_variable(NULL, 0x57)) { + ret = 6; + } + + return ret; +} INCLUDE_ASM(s32, "code_6240_len_c00", fio_calc_header_checksum); diff --git a/src/code_8230_len_1ae0.c b/src/code_8230_len_1ae0.c deleted file mode 100644 index 825e9f2f8f..0000000000 --- a/src/code_8230_len_1ae0.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "common.h" - -INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiMgrInit); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiSendMesg); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiMgrStop); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiMgrRestart); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiMgrThread); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", func_8002D160); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", update_cameras); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", render_frame); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", create_cameras_a); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", create_cameras_b); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", initialize_next_camera); - -INCLUDE_ASM(void, "code_8230_len_1ae0", set_cam_viewport, s16 id, s16 x, s16 y, s16 width, s16 height); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", get_cam_viewport); - -INCLUDE_ASM(void, "code_8230_len_1ae0", get_screen_coords, Cam camID, f32 x, f32 y, f32 z, f32* outX, f32* outY, - f32* outZ); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", func_8002E754); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", func_8002E7CC); - -INCLUDE_ASM(s32, "code_8230_len_1ae0", func_8002E82C); diff --git a/src/code_8560.c b/src/code_8560.c new file mode 100644 index 0000000000..86802d68be --- /dev/null +++ b/src/code_8560.c @@ -0,0 +1,54 @@ +#include "common.h" + +INCLUDE_ASM(s32, "code_8560", func_8002D160); + +INCLUDE_ASM(s32, "code_8560", update_cameras); + +INCLUDE_ASM(s32, "code_8560", render_frame); + +INCLUDE_ASM(s32, "code_8560", create_cameras_a); + +INCLUDE_ASM(s32, "code_8560", create_cameras_b); + +INCLUDE_ASM(s32, "code_8560", initialize_next_camera); + +INCLUDE_ASM(void, "code_8560", set_cam_viewport, s16 id, s16 x, s16 y, s16 width, s16 height); + +void get_cam_viewport(s32 camID, u16* x, u16* y, u16* width, u16* height) { + *width = CAM(camID)->viewportW; + *height = CAM(camID)->viewportH; + *x = CAM(camID)->viewportStartX; + *y = CAM(camID)->viewportStartY; +} + +INCLUDE_ASM(void, "code_8560", get_screen_coords, Cam camID, f32 x, f32 y, f32 z, f32* outX, f32* outY, + f32* outZ); + +s32 func_8002E754(s32 camID, s32 x, s32 y) { + s32 startX = CAM(camID)->viewportStartX; + s32 startY = CAM(camID)->viewportStartY; + s32 endX = startX + CAM(camID)->viewportW; + s32 endY = startY + CAM(camID)->viewportH; + + if (x < startX) { + return TRUE; + } else if (x > endX) { + return TRUE; + } else if (y < startY) { + return TRUE; + } else if (y > endY) { + return TRUE; + } else { + return FALSE; + } +} + + +void func_8002E7CC(s32 camID, s32* x, s32* y, s32* width, s32* height) { + *x = CAM(camID)->viewportStartX; + *y = CAM(camID)->viewportStartY; + *width = CAM(camID)->viewportStartX + CAM(camID)->viewportW; + *height = CAM(camID)->viewportStartY + CAM(camID)->viewportH; +} + +INCLUDE_ASM(s32, "code_8560", func_8002E82C); diff --git a/src/code_ef070_len_3400.c b/src/code_ef070_len_3400.c index 5dd77070b5..26d910974b 100644 --- a/src/code_ef070_len_3400.c +++ b/src/code_ef070_len_3400.c @@ -6,9 +6,9 @@ ApiStatus SetCamEnabled(ScriptInstance* script, s32 isInitialCall) { s32 enabled = get_variable(script, *args++); if (!enabled) { - (&gCameras[id])->flags |= 0x2; + CAM(id)->flags |= 0x2; } else { - (&gCameras[id])->flags &= ~0x2; + CAM(id)->flags &= ~0x2; } return ApiStatus_DONE2; } @@ -19,9 +19,9 @@ ApiStatus SetCamFlag80(ScriptInstance* script, s32 isInitialCall) { s32 enabled = get_variable(script, *args++); if (!enabled) { - (&gCameras[id])->flags |= 0x80; + CAM(id)->flags |= 0x80; } else { - (&gCameras[id])->flags &= ~0x80; + CAM(id)->flags &= ~0x80; } return ApiStatus_DONE2; } @@ -68,25 +68,25 @@ ApiStatus func_802CA988(ScriptInstance* script, s32 isInitialCall) { Bytecode outVar4 = *ptrReadPos++; f32 temp1, temp2, temp3; - (&gCameras[id])->mode = 2; - (&gCameras[id])->unk_06 = 0; - (&gCameras[id])->unk_1C = -round((&gCameras[id])->currentPitch); - (&gCameras[id])->unk_1E = -(&gCameras[id])->currentBlendedYawNegated; + CAM(id)->mode = 2; + CAM(id)->unk_06 = 0; + CAM(id)->unk_1C = -round(CAM(id)->currentPitch); + CAM(id)->unk_1E = -CAM(id)->currentBlendedYawNegated; - temp1 = (&gCameras[id])->lookAt_obj[0] - (&gCameras[id])->lookAt_eye[0]; - temp2 = (&gCameras[id])->lookAt_obj[1] - (&gCameras[id])->lookAt_eye[1]; - temp3 = (&gCameras[id])->lookAt_obj[2] - (&gCameras[id])->lookAt_eye[2]; + temp1 = CAM(id)->lookAt_obj[0] - CAM(id)->lookAt_eye[0]; + temp2 = CAM(id)->lookAt_obj[1] - CAM(id)->lookAt_eye[1]; + temp3 = CAM(id)->lookAt_obj[2] - CAM(id)->lookAt_eye[2]; - (&gCameras[id])->unk_20 = round(sqrtf((temp1 * temp1) + (temp2 * temp2) + (temp3 * temp3))); - (&gCameras[id])->unk_22 = 0; - (&gCameras[id])->unk_54 = (&gCameras[id])->lookAt_obj[0]; - (&gCameras[id])->unk_58 = (&gCameras[id])->lookAt_obj[1]; - (&gCameras[id])->unk_5C = (&gCameras[id])->lookAt_obj[2]; + CAM(id)->unk_20 = round(sqrtf((temp1 * temp1) + (temp2 * temp2) + (temp3 * temp3))); + CAM(id)->unk_22 = 0; + CAM(id)->unk_54 = CAM(id)->lookAt_obj[0]; + CAM(id)->unk_58 = CAM(id)->lookAt_obj[1]; + CAM(id)->unk_5C = CAM(id)->lookAt_obj[2]; - set_variable(script, outVar1, (&gCameras[id])->unk_1C); - set_variable(script, outVar2, (&gCameras[id])->unk_1E); - set_variable(script, outVar3, (&gCameras[id])->unk_20); - set_variable(script, outVar4, (&gCameras[id])->unk_22); + set_variable(script, outVar1, CAM(id)->unk_1C); + set_variable(script, outVar2, CAM(id)->unk_1E); + set_variable(script, outVar3, CAM(id)->unk_20); + set_variable(script, outVar4, CAM(id)->unk_22); return ApiStatus_DONE2; } */ diff --git a/src/os/nusys/nuSiMgr.c b/src/os/nusys/nuSiMgr.c new file mode 100644 index 0000000000..1cf642b005 --- /dev/null +++ b/src/os/nusys/nuSiMgr.c @@ -0,0 +1,14 @@ +#include "common.h" +#include "nu/nusys.h" + +INCLUDE_ASM(u8, "os/nusys/nuSiMgr", nuSiMgrInit); + +INCLUDE_ASM(s32, "os/nusys/nuSiMgr", nuSiSendMesg, NUScMsg mesg, void* dataPtr); + +void nuSiMgrStop(void) { + nuSiSendMesg(NU_SI_STOP_MGR_MSG, NULL); +} + +INCLUDE_ASM(void, "os/nusys/nuSiMgr", nuSiMgrRestart); + +INCLUDE_ASM(s32, "os/nusys/nuSiMgr", nuSiMgrThread); diff --git a/src/world/common/GetCamVfov.inc.c b/src/world/common/GetCamVfov.inc.c index 38c40d234d..189aec9524 100644 --- a/src/world/common/GetCamVfov.inc.c +++ b/src/world/common/GetCamVfov.inc.c @@ -5,6 +5,6 @@ static ApiStatus GetCamVfov(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 cameraID = get_variable(script, *args++); - set_variable(script, *args++, SI_FIXED(gCameras[cameraID].vfov)); + set_variable(script, *args++, SI_FIXED(CAM(cameraID)->vfov)); return ApiStatus_DONE2; } diff --git a/src/world/common/GetCurrentCameraYawClamped180.inc.c b/src/world/common/GetCurrentCameraYawClamped180.inc.c index 7f03988ce8..875676b643 100644 --- a/src/world/common/GetCurrentCameraYawClamped180.inc.c +++ b/src/world/common/GetCurrentCameraYawClamped180.inc.c @@ -1,7 +1,7 @@ #include "common.h" static ApiStatus GetCurrentCameraYawClamped180(ScriptInstance* script, s32 isInitialCall) { - Camera* currentCamera = &gCameras[gCurrentCameraID]; + Camera* currentCamera = CURRENT_CAM; script->varTable[0] = clamp_angle(currentCamera->currentYaw + 180.0f); return ApiStatus_DONE2; diff --git a/src/world/common/SetCamVfov.inc.c b/src/world/common/SetCamVfov.inc.c index c05aec5e1a..cd6695777f 100644 --- a/src/world/common/SetCamVfov.inc.c +++ b/src/world/common/SetCamVfov.inc.c @@ -5,6 +5,6 @@ static ApiStatus SetCamVfov(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 cameraID = get_variable(script, *args++); - gCameras[cameraID].vfov = get_float_variable(script, *args++); + CAM(cameraID)->vfov = get_float_variable(script, *args++); return ApiStatus_DONE2; } diff --git a/src/world/common/SetCamera0MoveFlag1.inc.c b/src/world/common/SetCamera0MoveFlag1.inc.c index 2f4cb9fd5e..8dbea03617 100644 --- a/src/world/common/SetCamera0MoveFlag1.inc.c +++ b/src/world/common/SetCamera0MoveFlag1.inc.c @@ -1,7 +1,7 @@ #include "common.h" static ApiStatus SetCamera0MoveFlag1(ScriptInstance* script, s32 isInitialCall) { - Camera* camera = &gCameras[0]; + Camera* camera = CAM(0); camera->moveFlags |= 1; return ApiStatus_DONE2; diff --git a/src/world/common/SomeXYZFuncTodoRename.inc.c b/src/world/common/SomeXYZFuncTodoRename.inc.c index 80021fb84f..82399c7bc9 100644 --- a/src/world/common/SomeXYZFuncTodoRename.inc.c +++ b/src/world/common/SomeXYZFuncTodoRename.inc.c @@ -11,7 +11,7 @@ static ApiStatus SomeXYZFuncTodoRename(ScriptInstance* script, s32 isInitialStat f32 z = (f32)get_variable(script, zVar); f32 cameraYaw; - cameraYaw = gCameras[gCurrentCameraID].currentYaw; + cameraYaw = CURRENT_CAM->currentYaw; if (playerStatus->spriteFacingAngle == 0.0f) { cameraYaw -= 100.0f; diff --git a/src/world/common/UnkCameraFunc.inc.c b/src/world/common/UnkCameraFunc.inc.c index e20d04f1cd..0980bec2ab 100644 --- a/src/world/common/UnkCameraFunc.inc.c +++ b/src/world/common/UnkCameraFunc.inc.c @@ -7,7 +7,7 @@ static ApiStatus UnkCameraFunc(ScriptInstance* script, s32 isInitialCall) { s32 var2 = get_variable(script, *args++); Bytecode out1 = *args++; Bytecode out2 = *args++; - s32 cameraYaw = gCameras[gCurrentCameraID].currentYaw; + s32 cameraYaw = CURRENT_CAM->currentYaw; s32 outVal1 = get_variable(script, SI_ARRAY(1)) - (var2 * cos_deg(cameraYaw)); s32 outVal2 = get_variable(script, SI_ARRAY(3)) - (var2 * sin_deg(cameraYaw)); diff --git a/src/world/common/UnsetCamera0MoveFlag1.inc.c b/src/world/common/UnsetCamera0MoveFlag1.inc.c index e5ae2007c7..33e6c9f573 100644 --- a/src/world/common/UnsetCamera0MoveFlag1.inc.c +++ b/src/world/common/UnsetCamera0MoveFlag1.inc.c @@ -1,7 +1,7 @@ #include "common.h" static ApiStatus UnsetCamera0MoveFlag1(ScriptInstance* script, s32 isInitialCall) { - Camera* camera = &gCameras[0]; + Camera* camera = CAM(0); camera->moveFlags &= ~1; return ApiStatus_DONE2; diff --git a/src/world/script_api/7E2AA0.c b/src/world/script_api/7E2AA0.c index 0b3b7469f3..551578f737 100644 --- a/src/world/script_api/7E2AA0.c +++ b/src/world/script_api/7E2AA0.c @@ -70,8 +70,8 @@ ApiStatus func_80282594(ScriptInstance* script, s32 isInitialCall) { f32 temp_f0; temp_f0 = get_float_variable(script, *script->ptrReadPos); - camera = &gCameras[0]; - camera2 = &gCameras[0]; + camera = CAM(0); + camera2 = CAM(0); if (temp_f0 >= 0.0f) { D_80286540 = camera->moveSpeed; diff --git a/tools/splat.yaml b/tools/splat.yaml index 5312fdce50..05f6c75512 100644 --- a/tools/splat.yaml +++ b/tools/splat.yaml @@ -35,7 +35,8 @@ segments: - [0x6e40, "c", "code_6e40_len_500"] - [0x7340, "c", "code_7340_len_b00"] - [0x7e40, "c", "os/code_7e40_len_3f0"] - - [0x8230, "c", "code_8230_len_1ae0"] + - [0x8230, "c", "os/nusys/nuSiMgr"] + - [0x8560, "c"] - [0x9d10, "c", "code_9d10_len_1080"] - [0xad90, "c", "code_ad90_len_2880"] - [0xd610, "c", "code_d610_len_1330"] diff --git a/undefined_syms.txt b/undefined_syms.txt index a5f039153f..96ea163fdd 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -26,9 +26,10 @@ gWorldMapFlags = 0x802DBC70; gBattleMapFlags = 0x802DBD34; gMapTransitionAlpha = 0x800A0940; -D_800A0940 = 0x800A0940; D_800A0942 = 0x800A0942; D_800A0944 = 0x800A0944; +D_800A0946 = 0x800A0946; +D_800A0948 = 0x800A0948; D_800A0954 = 0x800A0954; D_800A0956 = 0x800A0956; D_800A0958 = 0x800A0958;