From e6da18503fbe55f4bb178ab3ec84e910c000728d Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Tue, 27 Feb 2024 19:23:28 +0000 Subject: [PATCH 01/14] document D_802946E0 (#1176) * document D_802946E0 * silly me * make not static * whoops again --- src/battle/1A5830.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/battle/1A5830.c b/src/battle/1A5830.c index 538528d8ff..64010e6243 100644 --- a/src/battle/1A5830.c +++ b/src/battle/1A5830.c @@ -4,8 +4,6 @@ #include "hud_element.h" #include "sprite.h" -s32 D_802946E0[] = { 100, 100, 100, 110, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130 }; - s32 has_enchanted_part(Actor* actor) { ActorPart* partIt = actor->partsTable; s32 ret = FALSE; @@ -2701,6 +2699,15 @@ API_CALLABLE(RemoveActor) { return ApiStatus_DONE2; } +/// Star Point multiplier, indexed by actor count. +/// +10% multiplier for three actors +/// +30% multiplier for four or more actors +s32 StarPointMultiplier[] = { + 100, 100, 100, + 110, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, +}; + API_CALLABLE(DropStarPoints) { BattleStatus* battleStatus = &gBattleStatus; PlayerData* playerData = &gPlayerData; @@ -2730,7 +2737,7 @@ API_CALLABLE(DropStarPoints) { ntd = 0.0f; if (!(enemyLevel < playerLevel)) { - ntd = ((enemyLevel - playerLevel) * 0.5f) * D_802946E0[battleStatus->initialEnemyCount]; + ntd = ((enemyLevel - playerLevel) * 0.5f) * StarPointMultiplier[battleStatus->initialEnemyCount]; ntd = (ntd + 50.0f) / 100.0f; } numToDrop = ntd; From e303e2a04b2f5ef1dfe62dedc6db6a0ea6407bc9 Mon Sep 17 00:00:00 2001 From: Rainchus Date: Tue, 5 Mar 2024 01:01:17 -0600 Subject: [PATCH 02/14] Suggest possible bgm name if it is not found (#1178) * suggest possible bgm name if it is not found * remove pointless () * run black * ...run updated black --- tools/splat_ext/pm_sbn.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/splat_ext/pm_sbn.py b/tools/splat_ext/pm_sbn.py index 5c20c091e8..9cd7a8f600 100644 --- a/tools/splat_ext/pm_sbn.py +++ b/tools/splat_ext/pm_sbn.py @@ -275,10 +275,18 @@ def write(self, path: Path): f.write("\n") def lookup_file_id(self, filename: str) -> int: + suggestion = "" for id, sbn_file in enumerate(self.files): if sbn_file.file_name() == filename: return id - raise Exception(f"File not found: {filename} - is it in the file_id_map?") + elif sbn_file.file_name().split("_")[0] == filename.split("_")[0]: + suggestion = sbn_file.file_name() + if suggestion == "": + raise Exception(f"File not found: {filename} - is it in the file_id_map?") + else: + raise Exception( + f"File not found: {filename} - is it in the file_id_map? (Did you mean to name the file: {suggestion}?)" + ) def __str__(self) -> str: s = "SBN(\n" From 8d5b066b7dbb8ba36d866d6aab2c7586d52b61c0 Mon Sep 17 00:00:00 2001 From: AltoXorg <56553686+Alto1772@users.noreply.github.com> Date: Tue, 5 Mar 2024 18:54:53 +0800 Subject: [PATCH 03/14] `SHIFT_BSS` be gone (#1173) * merge asm in src all versions * main: refactor and eliminate SHIFT_BSS * engine1 static BSS * engine2 * folder move * fix shift build * cleanup msg & msg_draw * wtf? * un-static-ized * . * remove unnecess. rodata pad * populate dangling common syms --- include/PR/controller.h | 4 + include/PR/os_message.h | 6 +- include/PR/osint.h | 3 + include/common.h | 2 + include/common_structs.h | 7 + include/macros.h | 10 +- include/model.h | 5 + include/npc.h | 9 +- include/nu/nualsgi.h | 12 +- include/nu/nusys.h | 3 + src/111f0_len_860.c | 10 +- src/77480.c | 13 +- src/7B440.c | 19 +- src/7BB60.c | 10 +- src/7E9D0.c | 19 +- src/891b0_len_fb0.c | 4 +- src/8a160_len_700.c | 2 +- src/8a860_len_3f30.c | 80 +- src/animator.c | 40 +- src/audio.h | 4 + src/audio/25f00_len_940.c | 38 +- src/audio/28910_len_5090.c | 3 +- src/audio/2e230_len_2190.c | 14 +- src/audio/31650.c | 12 +- src/audio/ambience.c | 2 +- src/audio/e0b30_len_b80.c | 11 +- src/audio/sfx.c | 12 +- src/audio/sfx_player.c | 3 +- src/background.c | 8 +- src/background_gfx.c | 2 - src/battle/battle.c | 32 +- src/battle/battle.h | 4 + src/battle/battle_bss.c | 25 + {ver/us/asm => src/boot}/entry_point.s | 0 ver/us/asm/boot.s => src/boot/ipl3_boot.s | 0 src/bss/engine1_post_bss.c | 19 + src/bss/engine1_pre_bss.c | 38 + src/bss/engine2_post_bss.c | 39 + src/bss/engine2_pre_bss.c | 56 + src/bss/main_post_bss.c | 88 ++ src/bss/main_pre_bss.c | 89 ++ src/cam_main.c | 12 +- src/cam_mode_zone_interp.c | 12 +- src/collision.c | 35 +- src/crash_screen.c | 2 +- src/curtains.c | 12 +- src/draw_box.c | 2 +- src/effects.c | 4 +- src/encounter.c | 31 +- src/entity.c | 62 +- src/entity_model.c | 27 +- src/evt/player_api.c | 4 +- src/fio.c | 13 +- src/game_modes.c | 2 +- src/game_states.c | 3 +- src/hud_element.c | 37 +- src/imgfx.c | 22 +- src/input.c | 11 +- src/inventory.c | 5 +- src/item_entity.c | 45 +- src/main.c | 96 +- src/main_loop.c | 11 +- src/model.c | 112 +- src/msg.c | 81 +- src/msg_draw.c | 41 +- src/npc.c | 10 +- src/npc_collision.c | 12 +- {ver/us/asm => src}/os/__osDisableInt.s | 0 {ver/us/asm => src}/os/__osGetCause.s | 0 {ver/us/asm => src}/os/__osGetSR.s | 0 {ver/us/asm => src}/os/__osProbeTLB.s | 5 + {ver/us/asm => src}/os/__osRestoreInt.s | 0 {ver/us/asm => src}/os/__osSetCompare.s | 0 {ver/us/asm => src}/os/__osSetWatchLo.s | 0 {ver/us/asm => src}/os/bcmp.s | 0 {ver/us/asm => src}/os/bcopy.s | 0 {ver/us/asm => src}/os/bzero.s | 0 src/os/cartrominit.c | 2 +- src/os/contpfs.c | 2 +- src/os/controller.c | 2 +- {ver/us/asm => src}/os/decode_yay0.s | 0 {ver/us/asm => src}/os/exceptasm.s | 246 ++++- src/os/flashinit.c | 8 +- {ver/us/asm => src}/os/guMtxCat.s | 0 {ver/us/asm => src}/os/guMtxCatF.s | 0 {ver/us/asm => src}/os/guMtxF2L.s | 0 {ver/us/asm => src}/os/guMtxIdent.s | 0 {ver/us/asm => src}/os/guMtxIdentF.s | 0 {ver/us/asm => src}/os/guMtxL2F.s | 4 + {ver/us/asm => src}/os/guNormalize.s | 0 {ver/us/asm => src}/os/guScale.s | 14 +- {ver/us/asm => src}/os/guScaleF.s | 0 {ver/us/asm => src}/os/guTranslate.s | 14 + {ver/us/asm => src}/os/guTranslateF.s | 2 + src/os/motor.c | 6 +- src/os/nusys/nuboot.c | 10 +- src/os/nusys/nucontmgr.c | 15 +- src/os/nusys/nucontrmbmgr.c | 5 +- src/os/nusys/nugfxtaskmgr.c | 27 +- src/os/nusys/nugfxthread.c | 7 +- src/os/nusys/nupiinit.c | 5 +- src/os/nusys/nusched.c | 10 +- src/os/nusys/nusimgr.c | 10 +- src/os/osFlash.c | 12 +- {ver/us/asm => src}/os/osGetCount.s | 0 {ver/us/asm => src}/os/osInvalDCache.s | 4 + {ver/us/asm => src}/os/osInvalICache.s | 4 + {ver/us/asm => src}/os/osMapTLB.s | 0 {ver/us/asm => src}/os/osMapTLBRdb.s | 0 {ver/us/asm => src}/os/osSetIntMask.s | 82 +- {ver/us/asm => src}/os/osUnmapTLB.s | 0 {ver/us/asm => src}/os/osUnmapTLBAll.s | 0 {ver/us/asm => src}/os/osWritebackDCache.s | 4 + {ver/us/asm => src}/os/osWritebackDCacheAll.s | 0 {ver/ique/asm => src}/os/padding.s | 0 {ver/jp/asm => src}/os/padding_alt.s | 0 {ver/ique/asm => src}/os/parameters.s | 5 +- src/os/piacs.c | 5 +- src/os/pimgr.c | 20 +- src/os/seteventmesg.c | 2 + {ver/us/asm => src}/os/setfpccsr.s | 0 {ver/us/asm => src}/os/setsr.s | 0 src/os/siacs.c | 5 +- {ver/ique/asm => src}/os/skapi.s | 0 src/os/sptask.c | 2 +- src/os/vi.c | 2 +- src/os/vimgr.c | 16 +- src/screen_overlays.c | 12 +- src/sprite_shading.c | 15 +- src/state_battle.c | 6 +- src/state_file_select.c | 6 +- src/state_intro.c | 18 +- src/state_logos.c | 8 +- src/state_pause.c | 8 +- src/state_title_screen.c | 16 +- src/status_icons.c | 6 +- src/trigger.c | 8 +- src/windows.c | 2 +- src/worker.c | 6 +- src/world/actions.c | 21 + src/world/menus.c | 3 +- src/world/partners.c | 57 +- src/world/world.c | 18 +- tools/build/configure.py | 17 +- ver/ique/asm/bss.s | 931 ----------------- ver/ique/asm/bss2.s | 114 -- ver/ique/asm/bss2_2.s | 225 ---- ver/ique/asm/bss3.s | 685 ------------ ver/ique/asm/entry_point.s | 38 - ver/ique/asm/os/bcmp.s | 90 -- ver/ique/asm/os/bcopy.s | 232 ----- ver/ique/asm/os/bzero.s | 59 -- ver/ique/asm/os/decode_yay0.s | 63 -- ver/ique/asm/os/exceptasm.s | 842 --------------- ver/ique/asm/os/getcause.s | 17 - ver/ique/asm/os/getsr.s | 17 - ver/ique/asm/os/guMtxCatF.s | 78 -- ver/ique/asm/os/guMtxF2L.s | 45 - ver/ique/asm/os/guMtxIdent.s | 37 - ver/ique/asm/os/guMtxIdentF.s | 36 - ver/ique/asm/os/guMtxL2F.s | 45 - ver/ique/asm/os/guNormalize.s | 36 - ver/ique/asm/os/guScale.s | 52 - ver/ique/asm/os/guScaleF.s | 36 - ver/ique/asm/os/guTranslate.s | 68 -- ver/ique/asm/os/guTranslateF.s | 32 - ver/ique/asm/os/interrupt.s | 53 - ver/ique/asm/os/maptlb.s | 67 -- ver/ique/asm/os/maptlbrdb.s | 37 - ver/ique/asm/os/osInvalDCache.s | 63 -- ver/ique/asm/os/osInvalICache.s | 50 - ver/ique/asm/os/osWritebackDCache.s | 50 - ver/ique/asm/os/osWritebackDCacheAll.s | 27 - ver/ique/asm/os/probetlb.s | 65 -- ver/ique/asm/os/setfpccsr.s | 16 - ver/ique/asm/os/setintmask.s | 127 --- ver/ique/asm/os/setsr.s | 17 - ver/ique/asm/os/setwatchlo.s | 17 - ver/ique/asm/os/unmaptlb.s | 29 - ver/ique/asm/os/unmaptlball.s | 34 - ver/ique/splat.yaml | 35 +- ver/jp/asm/bss2.s | 114 -- ver/jp/asm/bss2_2.s | 225 ---- ver/jp/asm/bss3.s | 682 ------------ ver/jp/asm/entry_point.s | 38 - ver/jp/asm/main.bss.s | 770 -------------- ver/jp/asm/os/__osDisableInt.s | 42 - ver/jp/asm/os/__osGetCause.s | 17 - ver/jp/asm/os/__osGetSR.s | 17 - ver/jp/asm/os/__osProbeTLB.s | 65 -- ver/jp/asm/os/__osRestoreInt.s | 21 - ver/jp/asm/os/__osSetCompare.s | 17 - ver/jp/asm/os/__osSetWatchLo.s | 17 - ver/jp/asm/os/bcmp.s | 90 -- ver/jp/asm/os/bcopy.s | 232 ----- ver/jp/asm/os/bzero.s | 59 -- ver/jp/asm/os/decode_yay0.s | 63 -- ver/jp/asm/os/exceptasm.s | 746 -------------- ver/jp/asm/os/guMtxCatF.s | 78 -- ver/jp/asm/os/guMtxF2L.s | 45 - ver/jp/asm/os/guMtxIdent.s | 37 - ver/jp/asm/os/guMtxIdentF.s | 36 - ver/jp/asm/os/guMtxL2F.s | 45 - ver/jp/asm/os/guNormalize.s | 36 - ver/jp/asm/os/guScale.s | 60 -- ver/jp/asm/os/guScaleF.s | 36 - ver/jp/asm/os/guTranslate.s | 68 -- ver/jp/asm/os/guTranslateF.s | 36 - ver/jp/asm/os/osGetCount.s | 17 - ver/jp/asm/os/osInvalDCache.s | 62 -- ver/jp/asm/os/osInvalICache.s | 49 - ver/jp/asm/os/osMapTLB.s | 67 -- ver/jp/asm/os/osMapTLBRdb.s | 37 - ver/jp/asm/os/osSetIntMask.s | 122 --- ver/jp/asm/os/osUnmapTLB.s | 29 - ver/jp/asm/os/osUnmapTLBAll.s | 34 - ver/jp/asm/os/osWritebackDCache.s | 49 - ver/jp/asm/os/osWritebackDCacheAll.s | 26 - ver/jp/asm/os/padding.s | 16 - ver/jp/asm/os/parameters.s | 37 - ver/jp/asm/os/setfpccsr.s | 16 - ver/jp/asm/os/setsr.s | 17 - ver/jp/splat.yaml | 17 +- ver/jp/undefined_syms.txt | 15 +- ver/pal/asm/bss2.s | 114 -- ver/pal/asm/bss2_2.s | 225 ---- ver/pal/asm/bss3.s | 688 ------------- ver/pal/splat.yaml | 8 +- ver/us/asm/bss.s | 974 ------------------ ver/us/asm/bss2.s | 114 -- ver/us/asm/bss2_2.s | 225 ---- ver/us/asm/bss3.s | 685 ------------ ver/us/asm/os/padding.s | 10 - ver/us/asm/os/parameters.s | 37 - ver/us/splat.yaml | 16 +- 235 files changed, 1525 insertions(+), 12583 deletions(-) create mode 100644 src/battle/battle_bss.c rename {ver/us/asm => src/boot}/entry_point.s (100%) rename ver/us/asm/boot.s => src/boot/ipl3_boot.s (100%) create mode 100644 src/bss/engine1_post_bss.c create mode 100644 src/bss/engine1_pre_bss.c create mode 100644 src/bss/engine2_post_bss.c create mode 100644 src/bss/engine2_pre_bss.c create mode 100644 src/bss/main_post_bss.c create mode 100644 src/bss/main_pre_bss.c rename {ver/us/asm => src}/os/__osDisableInt.s (100%) rename {ver/us/asm => src}/os/__osGetCause.s (100%) rename {ver/us/asm => src}/os/__osGetSR.s (100%) rename {ver/us/asm => src}/os/__osProbeTLB.s (93%) rename {ver/us/asm => src}/os/__osRestoreInt.s (100%) rename {ver/us/asm => src}/os/__osSetCompare.s (100%) rename {ver/us/asm => src}/os/__osSetWatchLo.s (100%) rename {ver/us/asm => src}/os/bcmp.s (100%) rename {ver/us/asm => src}/os/bcopy.s (100%) rename {ver/us/asm => src}/os/bzero.s (100%) rename {ver/us/asm => src}/os/decode_yay0.s (100%) rename {ver/us/asm => src}/os/exceptasm.s (77%) rename {ver/us/asm => src}/os/guMtxCat.s (100%) rename {ver/us/asm => src}/os/guMtxCatF.s (100%) rename {ver/us/asm => src}/os/guMtxF2L.s (100%) rename {ver/us/asm => src}/os/guMtxIdent.s (100%) rename {ver/us/asm => src}/os/guMtxIdentF.s (100%) rename {ver/us/asm => src}/os/guMtxL2F.s (97%) rename {ver/us/asm => src}/os/guNormalize.s (100%) rename {ver/us/asm => src}/os/guScale.s (94%) rename {ver/us/asm => src}/os/guScaleF.s (100%) rename {ver/us/asm => src}/os/guTranslate.s (91%) rename {ver/us/asm => src}/os/guTranslateF.s (96%) rename {ver/us/asm => src}/os/osGetCount.s (100%) rename {ver/us/asm => src}/os/osInvalDCache.s (96%) rename {ver/us/asm => src}/os/osInvalICache.s (95%) rename {ver/us/asm => src}/os/osMapTLB.s (100%) rename {ver/us/asm => src}/os/osMapTLBRdb.s (100%) rename {ver/us/asm => src}/os/osSetIntMask.s (61%) rename {ver/us/asm => src}/os/osUnmapTLB.s (100%) rename {ver/us/asm => src}/os/osUnmapTLBAll.s (100%) rename {ver/us/asm => src}/os/osWritebackDCache.s (95%) rename {ver/us/asm => src}/os/osWritebackDCacheAll.s (100%) rename {ver/ique/asm => src}/os/padding.s (100%) rename {ver/jp/asm => src}/os/padding_alt.s (100%) rename {ver/ique/asm => src}/os/parameters.s (97%) rename {ver/us/asm => src}/os/setfpccsr.s (100%) rename {ver/us/asm => src}/os/setsr.s (100%) rename {ver/ique/asm => src}/os/skapi.s (100%) delete mode 100644 ver/ique/asm/bss.s delete mode 100644 ver/ique/asm/bss2.s delete mode 100644 ver/ique/asm/bss2_2.s delete mode 100644 ver/ique/asm/bss3.s delete mode 100644 ver/ique/asm/entry_point.s delete mode 100644 ver/ique/asm/os/bcmp.s delete mode 100644 ver/ique/asm/os/bcopy.s delete mode 100644 ver/ique/asm/os/bzero.s delete mode 100644 ver/ique/asm/os/decode_yay0.s delete mode 100644 ver/ique/asm/os/exceptasm.s delete mode 100644 ver/ique/asm/os/getcause.s delete mode 100644 ver/ique/asm/os/getsr.s delete mode 100644 ver/ique/asm/os/guMtxCatF.s delete mode 100644 ver/ique/asm/os/guMtxF2L.s delete mode 100644 ver/ique/asm/os/guMtxIdent.s delete mode 100644 ver/ique/asm/os/guMtxIdentF.s delete mode 100644 ver/ique/asm/os/guMtxL2F.s delete mode 100644 ver/ique/asm/os/guNormalize.s delete mode 100644 ver/ique/asm/os/guScale.s delete mode 100644 ver/ique/asm/os/guScaleF.s delete mode 100644 ver/ique/asm/os/guTranslate.s delete mode 100644 ver/ique/asm/os/guTranslateF.s delete mode 100644 ver/ique/asm/os/interrupt.s delete mode 100644 ver/ique/asm/os/maptlb.s delete mode 100644 ver/ique/asm/os/maptlbrdb.s delete mode 100644 ver/ique/asm/os/osInvalDCache.s delete mode 100644 ver/ique/asm/os/osInvalICache.s delete mode 100644 ver/ique/asm/os/osWritebackDCache.s delete mode 100644 ver/ique/asm/os/osWritebackDCacheAll.s delete mode 100644 ver/ique/asm/os/probetlb.s delete mode 100644 ver/ique/asm/os/setfpccsr.s delete mode 100644 ver/ique/asm/os/setintmask.s delete mode 100644 ver/ique/asm/os/setsr.s delete mode 100644 ver/ique/asm/os/setwatchlo.s delete mode 100644 ver/ique/asm/os/unmaptlb.s delete mode 100644 ver/ique/asm/os/unmaptlball.s delete mode 100644 ver/jp/asm/bss2.s delete mode 100644 ver/jp/asm/bss2_2.s delete mode 100644 ver/jp/asm/bss3.s delete mode 100644 ver/jp/asm/entry_point.s delete mode 100644 ver/jp/asm/main.bss.s delete mode 100644 ver/jp/asm/os/__osDisableInt.s delete mode 100644 ver/jp/asm/os/__osGetCause.s delete mode 100644 ver/jp/asm/os/__osGetSR.s delete mode 100644 ver/jp/asm/os/__osProbeTLB.s delete mode 100644 ver/jp/asm/os/__osRestoreInt.s delete mode 100644 ver/jp/asm/os/__osSetCompare.s delete mode 100644 ver/jp/asm/os/__osSetWatchLo.s delete mode 100644 ver/jp/asm/os/bcmp.s delete mode 100644 ver/jp/asm/os/bcopy.s delete mode 100644 ver/jp/asm/os/bzero.s delete mode 100644 ver/jp/asm/os/decode_yay0.s delete mode 100644 ver/jp/asm/os/exceptasm.s delete mode 100644 ver/jp/asm/os/guMtxCatF.s delete mode 100644 ver/jp/asm/os/guMtxF2L.s delete mode 100644 ver/jp/asm/os/guMtxIdent.s delete mode 100644 ver/jp/asm/os/guMtxIdentF.s delete mode 100644 ver/jp/asm/os/guMtxL2F.s delete mode 100644 ver/jp/asm/os/guNormalize.s delete mode 100644 ver/jp/asm/os/guScale.s delete mode 100644 ver/jp/asm/os/guScaleF.s delete mode 100644 ver/jp/asm/os/guTranslate.s delete mode 100644 ver/jp/asm/os/guTranslateF.s delete mode 100644 ver/jp/asm/os/osGetCount.s delete mode 100644 ver/jp/asm/os/osInvalDCache.s delete mode 100644 ver/jp/asm/os/osInvalICache.s delete mode 100644 ver/jp/asm/os/osMapTLB.s delete mode 100644 ver/jp/asm/os/osMapTLBRdb.s delete mode 100644 ver/jp/asm/os/osSetIntMask.s delete mode 100644 ver/jp/asm/os/osUnmapTLB.s delete mode 100644 ver/jp/asm/os/osUnmapTLBAll.s delete mode 100644 ver/jp/asm/os/osWritebackDCache.s delete mode 100644 ver/jp/asm/os/osWritebackDCacheAll.s delete mode 100644 ver/jp/asm/os/padding.s delete mode 100644 ver/jp/asm/os/parameters.s delete mode 100644 ver/jp/asm/os/setfpccsr.s delete mode 100644 ver/jp/asm/os/setsr.s delete mode 100644 ver/pal/asm/bss2.s delete mode 100644 ver/pal/asm/bss2_2.s delete mode 100644 ver/pal/asm/bss3.s delete mode 100644 ver/us/asm/bss.s delete mode 100644 ver/us/asm/bss2.s delete mode 100644 ver/us/asm/bss2_2.s delete mode 100644 ver/us/asm/bss3.s delete mode 100644 ver/us/asm/os/padding.s delete mode 100644 ver/us/asm/os/parameters.s diff --git a/include/PR/controller.h b/include/PR/controller.h index 2bc266e8c9..a5ac113191 100644 --- a/include/PR/controller.h +++ b/include/PR/controller.h @@ -218,6 +218,8 @@ u8 __osContAddressCrc(u16 addr); u8 __osContDataCrc(u8 *data); s32 __osPfsGetStatus(OSMesgQueue *queue, int channel); +#ifndef NO_EXTERN_VARIABLES + extern u8 __osContLastCmd; extern OSTimer __osEepromTimer; extern OSMesg __osEepromTimerMsg; @@ -227,6 +229,8 @@ extern OSPifRam __osContPifRam; extern OSPifRam __osPfsPifRam; extern u8 __osMaxControllers; +#endif + //some version of this almost certainly existed since there's plenty of times where it's used right before a return 0 #define ERRCK(fn) \ ret = fn; \ diff --git a/include/PR/os_message.h b/include/PR/os_message.h index a442e7feff..2dffe4e2db 100644 --- a/include/PR/os_message.h +++ b/include/PR/os_message.h @@ -76,7 +76,11 @@ typedef struct OSMesgQueue_s { /* Events */ #ifdef _FINALROM -#define OS_NUM_EVENTS 15 +# ifndef BBPLAYER +# define OS_NUM_EVENTS 15 +# else +# define OS_NUM_EVENTS 32 +# endif #else #define OS_NUM_EVENTS 23 #endif diff --git a/include/PR/osint.h b/include/PR/osint.h index a5d4407f5e..6ae86f48ed 100644 --- a/include/PR/osint.h +++ b/include/PR/osint.h @@ -26,6 +26,8 @@ extern void __osTimerInterrupt(void); extern u32 __osProbeTLB(void *); extern int __osSpDeviceBusy(void); +#ifndef NO_EXTERN_VARIABLES + extern OSThread *__osRunningThread; extern OSThread *__osActiveQueue; extern OSThread *__osFaultedThread; @@ -41,6 +43,7 @@ extern u32 __osShutdown; extern __OSEventState __osEventStateTab[OS_NUM_EVENTS]; +#endif //not sure if this should be here extern s32 osViClock; diff --git a/include/common.h b/include/common.h index 12986500b8..5adf4ec031 100644 --- a/include/common.h +++ b/include/common.h @@ -6,7 +6,9 @@ #include "types.h" #include "common_structs.h" #include "functions.h" +#ifndef NO_EXTERN_VARIABLES #include "variables.h" +#endif #include "macros.h" #include "enums.h" #include "evt.h" diff --git a/include/common_structs.h b/include/common_structs.h index 22a123f5dd..5ec023cadb 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -2514,6 +2514,13 @@ typedef struct PartnerDMAData { /* 0x10 */ s32 y; } PartnerDMAData; // size = 0x14 +typedef struct UseItemStruct { + /* 0x00 */ u8* dmaStart; + /* 0x04 */ u8* dmaEnd; + /* 0x08 */ EvtScript* main; + /* 0x0C */ s32 unk_0C; +} UseItemStruct; + typedef struct MsgVoice { /* 0x00 */ s32 voiceA; /* 0x04 */ s32 voiceB; diff --git a/include/macros.h b/include/macros.h index f2d6c2a234..a46cf02bd5 100644 --- a/include/macros.h +++ b/include/macros.h @@ -18,7 +18,7 @@ #define MATCHING_BSS(size) static BSS u8 padding_bss[size]; #endif -#define BSS __attribute__ ((section (".bss"))) +#define BSS __attribute__ ((nocommon, section (".bss"))) #define TRANSPARENT_UNION __attribute__ ((__transparent_union__)) #else #define SHIFT_BSS static @@ -26,13 +26,15 @@ #define TRANSPARENT_UNION #endif +#define ALIGNED(x) __attribute__((aligned(x))) + #ifndef BBPLAYER -# define ALIGNED(x) __attribute__((aligned(x))) +# define OSALIGNED(x) ALIGNED(x) #else -# define ALIGNED(x) +# define OSALIGNED(x) #endif -#define BBALIGNED(x) __attribute__((aligned(x))) +# define BBALIGNED(x) ALIGNED(x) #define ALIGN16(val) (((val) + 0xF) & ~0xF) #define ALIGN8(val) (((val) + 0x7) & ~0x7) diff --git a/include/model.h b/include/model.h index 2d73094f43..1213e426eb 100644 --- a/include/model.h +++ b/include/model.h @@ -185,9 +185,14 @@ typedef struct ShapeFile { } ShapeFile; // size = variable typedef ModelTreeInfo ModelTreeInfoList[0x200]; + +#ifndef NO_EXTERN_VARIABLES + extern ModelTreeInfoList* gCurrentModelTreeNodeInfo; extern ModelList* gCurrentModels; +#endif + void mdl_set_depth_tint_params(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd); void mdl_set_remap_tint_params(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); void mdl_get_remap_tint_params(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB); diff --git a/include/npc.h b/include/npc.h index 94ceb3cf06..c860816ecd 100644 --- a/include/npc.h +++ b/include/npc.h @@ -416,12 +416,15 @@ typedef struct EncounterStatus { /* 0x0A8 */ FieldStatus unusedAttack2; /* 0x0AC */ FieldStatus unusedAttack3; /* 0x0B0 */ s32 defeatFlags[60][12]; - /* 0xFB0 */ s16 recentMaps[2]; - /* 0xFB4 */ char unk_FB4[4]; -} EncounterStatus; // size = 0xFB8 + /* 0xBF0 */ s16 recentMaps[2]; +} EncounterStatus; // size = 0xBF4 + +#ifndef NO_EXTERN_VARIABLES extern EncounterStatus gCurrentEncounter; +#endif + s32 basic_ai_check_player_dist(EnemyDetectVolume* arg0, Enemy* arg1, f32 arg2, f32 arg3, s8 arg4); /// The default Npc::onUpdate and Npc::onRender callback. diff --git a/include/nu/nualsgi.h b/include/nu/nualsgi.h index 7da6e1b342..8604ebfc7d 100644 --- a/include/nu/nualsgi.h +++ b/include/nu/nualsgi.h @@ -186,6 +186,8 @@ typedef struct st_SndState { typedef void (*NUAuPreNMIFunc)(NUScMsg,u32); /* PRENMI callback function */ typedef void (*NUAuMgrFunc)(void); /* Acmd callback function */ +#ifndef NO_EXTERN_VARIABLES + /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* extern variables */ @@ -194,11 +196,15 @@ typedef void (*NUAuMgrFunc)(void); /* Acmd callback function */ /*--------------------------------------*/ /* audio variables */ /*--------------------------------------*/ + +// NOTE: some variables have been commented out due to +// being declared static which affects bss reordering + extern u64* nuAuMgrStack; extern NUScTask nuAuTask; /* Audio task buffer*/ extern s16* nuAuBuffer_ptr[]; /* Audio buffer */ extern NUScClient nuAuClient; -extern OSThread nuAuMgrThread; +//extern OSThread nuAuMgrThread; extern u32 nuAuFrameCounter; /* Frame counter */ extern ALHeap nuAuHeap; /* Heap structure */ extern NUAuSeqPlayer nuAuSeqPlayer[]; @@ -219,7 +225,7 @@ extern OSMesgQueue nuAuMesgQ; /* Audio Manager queue */ extern ALGlobals nuAuGlobal; extern s16 nuAuDmaBufNum; extern s16 nuAuDmaBufSize; -extern NUDMAState nuAuDmaState; +//extern NUDMAState nuAuDmaState; extern NUDMABuffer* nuAuDmaBuf; extern Acmd* nuAuCmdListBuf; /* pointer of command list */ extern u32 nuAuAcmdLen; @@ -240,6 +246,8 @@ extern u32 nuAuDebAcmdLenMax; /* Maximum length of the audio command list */ extern s16 nuAuFrameSampleSize; /* Number of samples created at one time */ extern s16 nuAuExtraSampleSize; /* Number of extra samples */ +#endif + /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* Global Function */ diff --git a/include/nu/nusys.h b/include/nu/nusys.h index 54dea96f6f..95711811ea 100644 --- a/include/nu/nusys.h +++ b/include/nu/nusys.h @@ -652,6 +652,8 @@ typedef struct st_DebConWindow { u16 text[NU_DEB_CON_TEXT_SIZE]; /* Character buffer*/ } NUDebConWindow; +#ifndef NO_EXTERN_VARIABLES + /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* extern variables */ @@ -752,6 +754,7 @@ extern u32 nuDebTaskPerfInterval; extern volatile u32 nuDebTaskPerfCnt; extern volatile u32 nuDebTaskPerfEnd; +#endif /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ diff --git a/src/111f0_len_860.c b/src/111f0_len_860.c index dbe80037c0..398134d272 100644 --- a/src/111f0_len_860.c +++ b/src/111f0_len_860.c @@ -2,11 +2,11 @@ #include "nu/nusys.h" #include "game_modes.h" -SHIFT_BSS s16 gMapTransitionAlpha; -SHIFT_BSS s16 gMapTransitionFadeRate; -SHIFT_BSS s16 gMapTransitionState; -SHIFT_BSS s16 gMapTransitionStateTime; -SHIFT_BSS s16 gLoadedFromFileSelect; +BSS s16 gMapTransitionAlpha; +BSS s16 gMapTransitionFadeRate; +BSS s16 gMapTransitionState; +BSS s16 gMapTransitionStateTime; +BSS s16 gLoadedFromFileSelect; void set_map_change_fade_rate(s16 fadeRate) { gMapTransitionFadeRate = fadeRate; diff --git a/src/77480.c b/src/77480.c index b32aa70ba4..87ef4de087 100644 --- a/src/77480.c +++ b/src/77480.c @@ -28,11 +28,14 @@ extern Addr inspect_icon_ROM_START; extern Addr inspect_icon_ROM_END; #endif -SHIFT_BSS UNK_FUN_PTR(ISpyNotificationCallback); -SHIFT_BSS UNK_FUN_PTR(PulseStoneNotificationCallback); -SHIFT_BSS UNK_FUN_PTR(TalkNotificationCallback); -SHIFT_BSS UNK_FUN_PTR(InteractNotificationCallback); -SHIFT_BSS s32 D_8010C950; +UNK_FUN_PTR(ISpyNotificationCallback); +UNK_FUN_PTR(PulseStoneNotificationCallback); +UNK_FUN_PTR(TalkNotificationCallback); +UNK_FUN_PTR(InteractNotificationCallback); +s32 D_8010C950; + +PlayerStatus gPlayerStatus; +PlayerData gPlayerData; extern f32 D_800F7B48; extern s32 D_800F7B4C; diff --git a/src/7B440.c b/src/7B440.c index ad3784b34f..bbfd6b76c7 100644 --- a/src/7B440.c +++ b/src/7B440.c @@ -1,14 +1,15 @@ #include "common.h" -SHIFT_BSS s32 PeachDisguiseNpcIndex; -SHIFT_BSS Entity* TweesterTouchingPartner; -SHIFT_BSS Entity* TweesterTouchingPlayer; -SHIFT_BSS s32 PrevPlayerDirection; -SHIFT_BSS s32 PlayerRunStateTime; -SHIFT_BSS f32 PlayerNormalYaw; -SHIFT_BSS f32 PlayerNormalPitch; -SHIFT_BSS PlayerSpinState gPlayerSpinState; -SHIFT_BSS s32 PlayerYInterpUpdateDelay; +s32 PeachDisguiseNpcIndex; +Entity* TweesterTouchingPartner; +Entity* TweesterTouchingPlayer; +s32 PrevPlayerDirection; +s32 PlayerRunStateTime; +f32 PlayerNormalYaw; +f32 PlayerNormalPitch; +PlayerSpinState gPlayerSpinState; + +BSS s32 PlayerYInterpUpdateDelay; void update_player_input(void) { PlayerStatus* playerStatus = &gPlayerStatus; diff --git a/src/7BB60.c b/src/7BB60.c index 1302703353..08fd6f0708 100644 --- a/src/7BB60.c +++ b/src/7BB60.c @@ -2,11 +2,11 @@ #include "world/partners.h" #include "sprite/player.h" -SHIFT_BSS CollisionStatus gCollisionStatus; -SHIFT_BSS f32 D_8010C928; -SHIFT_BSS f32 JumpedOnSwitchX; -SHIFT_BSS f32 JumpedOnSwitchZ; -SHIFT_BSS f32 D_8010C984; +CollisionStatus gCollisionStatus; +f32 D_8010C928; +f32 JumpedOnSwitchX; +f32 JumpedOnSwitchZ; +f32 D_8010C984; extern f32 GravityParamsStartJump[]; diff --git a/src/7E9D0.c b/src/7E9D0.c index ad57865ec7..69769441f3 100644 --- a/src/7E9D0.c +++ b/src/7E9D0.c @@ -13,15 +13,16 @@ #define PLAYER_ACTION_VRAM_DEF (void*) 0x802B6000 #endif -SHIFT_BSS void* D_8010C924; -SHIFT_BSS s32 D_8010C92C; -SHIFT_BSS s32 D_8010C964; -SHIFT_BSS s32 gSpinHistoryBufferPos; -SHIFT_BSS s16 D_8010C9B0; -SHIFT_BSS s32 gSpinHistoryPosY[5]; -SHIFT_BSS s32 gSpinHistoryPosX[5]; -SHIFT_BSS s32 gSpinHistoryPosZ[5]; -SHIFT_BSS s16 gSpinHistoryPosAngle[5]; +void* D_8010C924; +s32 D_8010C92C; +s32 D_8010C964; +s32 gSpinHistoryBufferPos; +s32 gSpinHistoryPosY[5]; +s32 gSpinHistoryPosX[5]; +s32 gSpinHistoryPosZ[5]; +s16 gSpinHistoryPosAngle[5]; + +BSS s16 D_8010C9B0; void func_800E5520(void) { D_8010C9B0 = 0; diff --git a/src/891b0_len_fb0.c b/src/891b0_len_fb0.c index e69cc7f4eb..d6eeb497b6 100644 --- a/src/891b0_len_fb0.c +++ b/src/891b0_len_fb0.c @@ -26,8 +26,8 @@ s32 D_801094A8 = 0; s16 D_801094AC = 4; s16 D_801094AE = 4; -SHIFT_BSS s32 D_8010CFF0; -SHIFT_BSS s32 D_8010CFF4; +BSS s32 D_8010CFF0; +BSS s32 D_8010CFF4; void func_800EFD00(void) { } diff --git a/src/8a160_len_700.c b/src/8a160_len_700.c index 42d2ef45bc..325de32812 100644 --- a/src/8a160_len_700.c +++ b/src/8a160_len_700.c @@ -45,7 +45,7 @@ typedef struct Unk8a160Outer { /* 0x00 */ Unk8a160 subs[57]; // one base + 56 others? } Unk8a160Outer; -SHIFT_BSS Unk8a160Outer D_8010D000[1]; +BSS Unk8a160Outer D_8010D000[1]; void func_800F0CB0(s32 arg0, f32 x, f32 y, f32 scale) { Unk8a160Outer* outer = &D_8010D000[arg0]; diff --git a/src/8a860_len_3f30.c b/src/8a860_len_3f30.c index b6d3ae99ae..659a8feffa 100644 --- a/src/8a860_len_3f30.c +++ b/src/8a860_len_3f30.c @@ -79,46 +79,46 @@ s16 PopupContentScissorWidths[] = { }; #endif -SHIFT_BSS s32 gPopupState; -SHIFT_BSS s32 D_8010D644; -SHIFT_BSS s32 PopupMenu_SelectedIndex; -SHIFT_BSS s32 PopupMenu_PrevSelectedIndex; -SHIFT_BSS s32 PopupMenu_Alpha; -SHIFT_BSS s8 PopupMenu_FirstDisplayIndex; -SHIFT_BSS s8 PopupMenu_LastDisplayIndex; -SHIFT_BSS s8 PopupMenu_DisplayedEntryCount; -SHIFT_BSS s16 D_8010D658; -SHIFT_BSS s16 D_8010D65A; -SHIFT_BSS s32 PopupMenu_EmptybarHEID; -SHIFT_BSS s32 PopupMenu_TitleIconHEID; -SHIFT_BSS s32 PopupMenu_TimesHEID; -SHIFT_BSS s32 PopupMenu_PartnerLevelHEID; -SHIFT_BSS s32 PopupMenu_CursorHEID; -SHIFT_BSS s32 PopupMenu_UpArrowHEID; -SHIFT_BSS s32 PopupMenu_DownArrowHEID; -SHIFT_BSS s32 PopupMenu_EntryIconHEID; -SHIFT_BSS s16 D_8010D67C; -SHIFT_BSS s16 D_8010D67E; -SHIFT_BSS s16 D_8010D680; -SHIFT_BSS s16 D_8010D682; -SHIFT_BSS s16 D_8010D684; -SHIFT_BSS s16 D_8010D686; -SHIFT_BSS s16 PopupMenu_StarPieceCounterPosX; -SHIFT_BSS s16 PopupMenu_StarPieceCounterPosY; -SHIFT_BSS s16 D_8010D68C; -SHIFT_BSS s8 PopupNotBattle; -SHIFT_BSS s8 PopupMenu_MaxDisplayableEntryCount; -SHIFT_BSS s8 D_8010D690; -SHIFT_BSS s8 D_8010D691; -SHIFT_BSS s8 D_8010D692; -SHIFT_BSS s8 D_8010D693; -SHIFT_BSS s32 gPopupWorker; -SHIFT_BSS s8 PopupNotDipping; -SHIFT_BSS s8 PopupDipMode; -SHIFT_BSS s8 PopupMenu_WasStatusBarIgnoringChanges; -SHIFT_BSS PopupMenu* gPopupMenu; -SHIFT_BSS MessagePrintState* D_8010D6A0; -SHIFT_BSS s32 D_8010D6A4; +BSS s32 gPopupState; +BSS s32 D_8010D644; +BSS s32 PopupMenu_SelectedIndex; +BSS s32 PopupMenu_PrevSelectedIndex; +BSS s32 PopupMenu_Alpha; +BSS s8 PopupMenu_FirstDisplayIndex; +BSS s8 PopupMenu_LastDisplayIndex; +BSS s8 PopupMenu_DisplayedEntryCount; +BSS s16 D_8010D658; +BSS s16 D_8010D65A; +BSS s32 PopupMenu_EmptybarHEID; +BSS s32 PopupMenu_TitleIconHEID; +BSS s32 PopupMenu_TimesHEID; +BSS s32 PopupMenu_PartnerLevelHEID; +BSS s32 PopupMenu_CursorHEID; +BSS s32 PopupMenu_UpArrowHEID; +BSS s32 PopupMenu_DownArrowHEID; +BSS s32 PopupMenu_EntryIconHEID; +BSS s16 D_8010D67C; +BSS s16 D_8010D67E; +BSS s16 D_8010D680; +BSS s16 D_8010D682; +BSS s16 D_8010D684; +BSS s16 D_8010D686; +BSS s16 PopupMenu_StarPieceCounterPosX; +BSS s16 PopupMenu_StarPieceCounterPosY; +BSS s16 D_8010D68C; +BSS s8 PopupNotBattle; +BSS s8 PopupMenu_MaxDisplayableEntryCount; +BSS s8 D_8010D690; +BSS s8 D_8010D691; +BSS s8 D_8010D692; +BSS s8 D_8010D693; +BSS s32 gPopupWorker; +BSS s8 PopupNotDipping; +BSS s8 PopupDipMode; +BSS s8 PopupMenu_WasStatusBarIgnoringChanges; +BSS PopupMenu* gPopupMenu; +BSS MessagePrintState* D_8010D6A0; +BSS s32 D_8010D6A4; s8 status_bar_is_ignoring_changes(void); diff --git a/src/animator.c b/src/animator.c index ee802894e4..5f58c25ea7 100644 --- a/src/animator.c +++ b/src/animator.c @@ -9,25 +9,27 @@ typedef struct DisplayListBufferHandle { typedef DisplayListBufferHandle AnimatedMeshVertexCopyList[0x60]; -SHIFT_BSS AnimatedMeshList* gCurrentAnimMeshListPtr; -SHIFT_BSS s32 gAnimCount; -SHIFT_BSS AnimatedMeshVertexCopyList D_801533C0; -SHIFT_BSS AnimatedMeshVertexCopyList D_801536C0; -SHIFT_BSS AnimatedMeshList D_801539C0; -SHIFT_BSS AnimatedMeshList D_80153A00; -SHIFT_BSS s32 gAnimModelFogEnabled; -SHIFT_BSS s32 gAnimModelFogR; -SHIFT_BSS s32 gAnimModelFogG; -SHIFT_BSS s32 gAnimModelFogB; -SHIFT_BSS s32 gAnimModelFogA; -SHIFT_BSS s32 gAnimModelFogStart; -SHIFT_BSS s32 gAnimModelFogEnd; -SHIFT_BSS s32 gAnimVtxSegment; -SHIFT_BSS Matrix4f gAnimRotMtx; -SHIFT_BSS Matrix4f gAnimScaleMtx; -SHIFT_BSS Matrix4f gAnimTranslateMtx; -SHIFT_BSS Matrix4f gAnimRotScaleMtx; -SHIFT_BSS StaticAnimatorNode** gAnimTreeRoot; +s32 gAnimCount; + +BSS AnimatedMeshVertexCopyList D_801533C0; +BSS AnimatedMeshVertexCopyList D_801536C0; +BSS AnimatedMeshList D_801539C0; +BSS AnimatedMeshList D_80153A00; +BSS AnimatedMeshList* gCurrentAnimMeshListPtr; +BSS s32 gAnimModelFogEnabled; +BSS s32 gAnimModelFogR; +BSS s32 gAnimModelFogG; +BSS s32 gAnimModelFogB; +BSS s32 gAnimModelFogA; +BSS s32 gAnimModelFogStart; +BSS s32 gAnimModelFogEnd; +BSS s32 gAnimVtxSegment; +BSS s32 D_80153A64; +BSS Matrix4f gAnimRotMtx; +BSS Matrix4f gAnimScaleMtx; +BSS Matrix4f gAnimTranslateMtx; +BSS Matrix4f gAnimRotScaleMtx; +BSS StaticAnimatorNode** gAnimTreeRoot; extern Gfx Gfx_RM1_SURFACE_OPA[]; extern Gfx Gfx_RM1_DECAL_OPA[]; diff --git a/src/audio.h b/src/audio.h index 33d1c94a11..451fd378f8 100644 --- a/src/audio.h +++ b/src/audio.h @@ -1186,6 +1186,8 @@ typedef struct ALConfig { /* 0x14 */ ALHeap* heap; } ALConfig; // size = 0x18; +#ifndef NO_EXTERN_VARIABLES + extern volatile u8 AuSynUseStereo; extern u16 DummyInstrumentPredictor[32]; extern u8 DummyInstrumentBase[190]; @@ -1212,6 +1214,8 @@ extern AmbienceManager* gAuAmbienceManager; extern SoundManager* gSoundManager; extern BGMPlayer* gBGMPlayerA; +#endif + #include "audio/private.h" #endif diff --git a/src/audio/25f00_len_940.c b/src/audio/25f00_len_940.c index 94b21a81f2..08934734b3 100644 --- a/src/audio/25f00_len_940.c +++ b/src/audio/25f00_len_940.c @@ -12,22 +12,28 @@ u32 nuAuFrameCounter = 0; u8 nuAuTaskStop = NU_AU_TASK_RUN; u8 volatile AuSynUseStereo = TRUE; -SHIFT_BSS NUDMAState nuAuDmaState; -SHIFT_BSS Acmd* AlCmdListBuffers[3]; -SHIFT_BSS NUScTask nuAuTasks[3]; -SHIFT_BSS u8* D_800A3628[3]; -SHIFT_BSS s32 AlFrameSize; -SHIFT_BSS s32 AlMinFrameSize; -SHIFT_BSS OSMesgQueue nuAuDmaMesgQ; -SHIFT_BSS OSMesg nuAuDmaMesgBuf[50]; -SHIFT_BSS OSIoMesg nuAuDmaIOMesgBuf[50]; -SHIFT_BSS NUDMABuffer nuAuDmaBufList[50]; -SHIFT_BSS AuSynDriver auSynDriver; -SHIFT_BSS u8 rspbootUcodeBuffer[0x100] ALIGNED(16); -SHIFT_BSS u64 AuStack[NU_AU_STACK_SIZE / sizeof(u64)]; -SHIFT_BSS u16 AuInitialGlobalVolume; -SHIFT_BSS OSThread nuAuMgrThread; -SHIFT_BSS ALHeap nuAuHeap; +BSS u16 AuInitialGlobalVolume; +BSS OSThread nuAuMgrThread; +BSS char D_800A1108[0x408]; +BSS u64 AuStack[NU_AU_STACK_SIZE / sizeof(u64)]; +BSS Acmd* AlCmdListBuffers[3]; +BSS NUScTask nuAuTasks[3]; +BSS u8* D_800A3628[3]; +BSS s32 AlFrameSize; +BSS s32 AlMinFrameSize; +BSS s32 D_800A363C; +BSS OSMesgQueue nuAuDmaMesgQ; +BSS OSMesg nuAuDmaMesgBuf[50]; +BSS OSIoMesg nuAuDmaIOMesgBuf[50]; +BSS NUDMAState nuAuDmaState; +BSS s32 D_800A3BDC; +BSS NUDMABuffer nuAuDmaBufList[50]; + +ALHeap nuAuHeap; +AuSynDriver auSynDriver; +#if !VERSION_IQUE +u8 rspbootUcodeBuffer[0x100] ALIGNED(16); +#endif extern u64 n_aspMain_text_bin[]; extern u64 n_aspMain_data_bin[]; diff --git a/src/audio/28910_len_5090.c b/src/audio/28910_len_5090.c index b56c8ca37b..352d42d09e 100644 --- a/src/audio/28910_len_5090.c +++ b/src/audio/28910_len_5090.c @@ -1,10 +1,11 @@ #include "audio.h" +BSS void (*CurrentSeqCmdHandler)(BGMPlayer*, BGMPlayerTrack*); + extern u8 EnvelopeReleaseDefaultFast[]; extern u8 BgmDivisors[8]; extern u8 D_80078558[40]; -extern void (*CurrentSeqCmdHandler)(BGMPlayer*, BGMPlayerTrack*); extern void (*SefCmdHandlers[])(SoundManager*, SoundPlayer*); extern void (*SeqCmdHandlers[])(BGMPlayer*, BGMPlayerTrack*); extern u8 SeqCmdArgCounts[]; diff --git a/src/audio/2e230_len_2190.c b/src/audio/2e230_len_2190.c index 146c847bf9..df29e804e0 100644 --- a/src/audio/2e230_len_2190.c +++ b/src/audio/2e230_len_2190.c @@ -1,13 +1,13 @@ #include "audio.h" #include "ld_addrs.h" -SHIFT_BSS AuCallback BeginSoundUpdateCallback; -SHIFT_BSS BGMPlayer* gBGMPlayerA; -SHIFT_BSS BGMPlayer* gBGMPlayerB; -SHIFT_BSS BGMPlayer* gBGMPlayerC; -SHIFT_BSS SoundManager* gSoundManager; -SHIFT_BSS AuGlobals* gSoundGlobals; -SHIFT_BSS AmbienceManager* gAuAmbienceManager; +AuCallback BeginSoundUpdateCallback; +BGMPlayer* gBGMPlayerA; +BGMPlayer* gBGMPlayerB; +BGMPlayer* gBGMPlayerC; +SoundManager* gSoundManager; +AuGlobals* gSoundGlobals; +AmbienceManager* gAuAmbienceManager; // data extern u16 D_80078530[9]; diff --git a/src/audio/31650.c b/src/audio/31650.c index 6dfaadc2ec..9387d2301b 100644 --- a/src/audio/31650.c +++ b/src/audio/31650.c @@ -4,12 +4,12 @@ static s16 _getVol(s16 arg0, s32 arg1, s16 arg2, u16 arg3); -SHIFT_BSS s16* AuDelayBufferMain; -SHIFT_BSS s16* AuDelayBufferAux; -SHIFT_BSS s32 AuDelayCounter; -SHIFT_BSS u8 AuDelayedVoiceGroup; -SHIFT_BSS s16 AuDelayedChannel; -SHIFT_BSS s32 AuDelayCount; +BSS s16* AuDelayBufferMain; +BSS s16* AuDelayBufferAux; +BSS s32 AuDelayCounter; +BSS u8 AuDelayedVoiceGroup; +BSS s16 AuDelayedChannel; +BSS s32 AuDelayCount; AuSynDriver* gActiveSynDriverPtr = NULL; AuSynDriver* gSynDriverPtr = NULL; diff --git a/src/audio/ambience.c b/src/audio/ambience.c index b28810918c..9743aaa48c 100644 --- a/src/audio/ambience.c +++ b/src/audio/ambience.c @@ -23,7 +23,7 @@ AmbientSoundSettings DefaultAmbientSoundData = { .unkC = -1 }; -SHIFT_BSS AmbientSoundSettings AmbientSoundData; +AmbientSoundSettings AmbientSoundData; void reset_ambient_sounds(void) { AmbientSoundData = DefaultAmbientSoundData; diff --git a/src/audio/e0b30_len_b80.c b/src/audio/e0b30_len_b80.c index 58da9278be..3ce47958dc 100644 --- a/src/audio/e0b30_len_b80.c +++ b/src/audio/e0b30_len_b80.c @@ -4,11 +4,12 @@ void bgm_update_volume(void); void bgm_set_target_volume(s16 volume); -SHIFT_BSS s16 MusicDefaultVolume; -SHIFT_BSS s16 MusicMaxVolume; -SHIFT_BSS s16 MusicCurrentVolume; -SHIFT_BSS s16 MusicTargetVolume; -SHIFT_BSS MusicSettings gMusicSettings[2]; +BSS s16 MusicDefaultVolume; +BSS s16 MusicTargetVolume; +BSS s16 MusicMaxVolume; +BSS s16 MusicCurrentVolume; + +MusicSettings gMusicSettings[2]; MusicSettings BlankMusicSettings = { .flags = 0, diff --git a/src/audio/sfx.c b/src/audio/sfx.c index 43c10d3d36..b69af7da1d 100644 --- a/src/audio/sfx.c +++ b/src/audio/sfx.c @@ -3,8 +3,8 @@ #define MAX_SOUND_INSTANCES 10 -SHIFT_BSS u16 gCurrentDoorSounds; -SHIFT_BSS u16 gCurrentRoomDoorSounds; +u16 gCurrentDoorSounds; +u16 gCurrentRoomDoorSounds; #define SOUND_LOOP_IDX(soundID) (soundID & 0xFFFF) @@ -209,10 +209,10 @@ s32 OpenCloseSounds[][2] = { { SOUND_CREAKY_WINDOW_OPEN, SOUND_CREAKY_WINDOW_CLOSE }, }; -SHIFT_BSS SoundInstance wEnvSounds[MAX_SOUND_INSTANCES]; -SHIFT_BSS SoundInstance bEnvSounds[MAX_SOUND_INSTANCES]; -SHIFT_BSS SoundInstance* gCurrentEnvSounds; -SHIFT_BSS s32 SfxReverbMode; +BSS SoundInstance wEnvSounds[MAX_SOUND_INSTANCES]; +BSS SoundInstance bEnvSounds[MAX_SOUND_INSTANCES]; +BSS SoundInstance* gCurrentEnvSounds; +BSS s32 SfxReverbMode; void sfx_compute_spatialized_sound_params_full(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags) { s32 screenX, screenY, screenZ; diff --git a/src/audio/sfx_player.c b/src/audio/sfx_player.c index 12b6532fb3..697a8a0526 100644 --- a/src/audio/sfx_player.c +++ b/src/audio/sfx_player.c @@ -418,8 +418,7 @@ f32 AlTuneScaling[] = { extern s32* AU_FX_CUSTOM_PARAMS[0]; // points to 80078290 -SHIFT_BSS void (*CurrentSeqCmdHandler)(BGMPlayer*, BGMPlayerTrack*); -SHIFT_BSS void (*CurrentSefCmdHandler)(SoundManager*, SoundPlayer*); +void (*CurrentSefCmdHandler)(SoundManager*, SoundPlayer*); void au_sfx_init(SoundManager* manager, u8 priority, u8 busId, AuGlobals* globals, u8 minVoiceIdx) { u32 i; diff --git a/src/background.c b/src/background.c index 953c95252e..1ee98bea97 100644 --- a/src/background.c +++ b/src/background.c @@ -8,8 +8,12 @@ s8 gBackroundWaveEnabled = FALSE; s16 gBackroundTextureYOffset = 0; f32 gBackroundWavePhase = 0.0f; -SHIFT_BSS PAL_BIN gBackgroundPalette[256]; -SHIFT_BSS f32 gBackroundLastScrollValue; +BSS PAL_BIN gBackgroundPalette[256]; +BSS f32 gBackroundLastScrollValue; +BSS s32 D_801595A4[3]; +#if !VERSION_PAL +BSS s32 D_801595AC; +#endif void load_map_bg(char* optAssetName) { if (optAssetName != NULL) { diff --git a/src/background_gfx.c b/src/background_gfx.c index 7843472b36..5b277ef9d9 100644 --- a/src/background_gfx.c +++ b/src/background_gfx.c @@ -30,8 +30,6 @@ Gfx D_80074230[] = { gsSPEndDisplayList(), }; -//extern s32 timeFreezeMode; // TODO bss - void gfx_init_state(void) { gSPSegment(gMainGfxPos++, 0x00, 0x0); gSPDisplayList(gMainGfxPos++, OS_K0_TO_PHYSICAL(D_80074230)); diff --git a/src/battle/battle.c b/src/battle/battle.c index 342ac34ede..c89080cfb3 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -6,22 +6,22 @@ #include "sprite.h" #include "game_modes.h" -SHIFT_BSS s32 D_800DC060; -SHIFT_BSS StageListRow* gCurrentStagePtr; -SHIFT_BSS s32 gBattleState; -SHIFT_BSS BattleStatus gBattleStatus; -SHIFT_BSS s32 gLastDrawBattleState; -SHIFT_BSS s32 D_800DC4D4; -SHIFT_BSS s32 gDefeatedBattleSubstate; -SHIFT_BSS s32 gBattleSubState; -SHIFT_BSS s32 D_800DC4E0; -SHIFT_BSS s32 gDefeatedBattleState; -SHIFT_BSS s32 gCurrentBattleID; -SHIFT_BSS s32 gCurrentStageID; -SHIFT_BSS s32 D_800DC4F0; -SHIFT_BSS Battle* gOverrideBattlePtr; -SHIFT_BSS s32 D_800DC4F8; -SHIFT_BSS Battle* gCurrentBattlePtr; +extern s32 D_800DC060; +extern StageListRow* gCurrentStagePtr; +extern s32 gBattleState; +extern BattleStatus gBattleStatus; +extern s32 gLastDrawBattleState; +extern s32 D_800DC4D4; +extern s32 gDefeatedBattleSubstate; +extern s32 gBattleSubState; +extern s32 D_800DC4E0; +extern s32 gDefeatedBattleState; +extern s32 gCurrentBattleID; +extern s32 gCurrentStageID; +extern s32 D_800DC4F0; +extern Battle* gOverrideBattlePtr; +extern s32 D_800DC4F8; +extern Battle* gCurrentBattlePtr; // standard battle area table entry #define BTL_AREA(id, jpName) { \ diff --git a/src/battle/battle.h b/src/battle/battle.h index 916f5887c3..0c3b7ff677 100644 --- a/src/battle/battle.h +++ b/src/battle/battle.h @@ -254,10 +254,14 @@ typedef struct PlayerCelebrationAnimOptions { /* 0x04 */ s32 options[80]; } PlayerCelebrationAnimOptions; // size = 0x8 +#ifndef NO_EXTERN_VARIABLES + extern Battle* gCurrentBattlePtr; extern ActorOffsets bActorOffsets[]; +#endif + void func_80072BCC(s32 arg0); void load_demo_battle(u32 index); Actor* create_actor(Formation formation); diff --git a/src/battle/battle_bss.c b/src/battle/battle_bss.c new file mode 100644 index 0000000000..be125fb51d --- /dev/null +++ b/src/battle/battle_bss.c @@ -0,0 +1,25 @@ +#define NO_EXTERN_VARIABLES +#include "common.h" +#include "battle/battle.h" + +// +// battle.c bss symbols +// + +BSS s32 D_800DC060; +BSS StageListRow* gCurrentStagePtr; +BSS s32 gBattleState; +BSS s32 D_800DC06C; +BSS BattleStatus gBattleStatus; +BSS s32 gLastDrawBattleState; +BSS s32 D_800DC4D4; +BSS s32 gDefeatedBattleSubstate; +BSS s32 gBattleSubState; +BSS s32 D_800DC4E0; +BSS s32 gDefeatedBattleState; +BSS s32 gCurrentBattleID; +BSS s32 gCurrentStageID; +BSS s32 D_800DC4F0; +BSS Battle* gOverrideBattlePtr; +BSS s32 D_800DC4F8; +BSS Battle* gCurrentBattlePtr; diff --git a/ver/us/asm/entry_point.s b/src/boot/entry_point.s similarity index 100% rename from ver/us/asm/entry_point.s rename to src/boot/entry_point.s diff --git a/ver/us/asm/boot.s b/src/boot/ipl3_boot.s similarity index 100% rename from ver/us/asm/boot.s rename to src/boot/ipl3_boot.s diff --git a/src/bss/engine1_post_bss.c b/src/bss/engine1_post_bss.c new file mode 100644 index 0000000000..bbd6eb8011 --- /dev/null +++ b/src/bss/engine1_post_bss.c @@ -0,0 +1,19 @@ +#define NO_EXTERN_VARIABLES +#include "common.h" +// DON'T DARE to put include headers here containing extern declarations... +// This will ruin the ordering of bss symbols below if you care about matching. + +#ifndef SHIFT + +BSS PartnerStatus gPartnerStatus; +BSS s32 gSpinHistoryPosY[6]; +BSS s32 gSpinHistoryPosX[6]; +BSS s32 gSpinHistoryPosZ[6]; +BSS StatusBar gStatusBar; +BSS PlayerStatus gPlayerStatus; +BSS PlayerSpinState gPlayerSpinState; +BSS s32 D_8010F284[3]; +BSS PlayerData gPlayerData; +BSS s16 gSpinHistoryPosAngle[5]; + +#endif diff --git a/src/bss/engine1_pre_bss.c b/src/bss/engine1_pre_bss.c new file mode 100644 index 0000000000..15274228d1 --- /dev/null +++ b/src/bss/engine1_pre_bss.c @@ -0,0 +1,38 @@ +#define NO_EXTERN_VARIABLES +#include "common.h" +// DON'T DARE to put include headers here containing extern declarations... +// This will ruin the ordering of bss symbols below if you care about matching. + +#ifndef SHIFT + +BSS UNK_FUN_PTR(PulseStoneNotificationCallback); +BSS void* D_8010C924; +BSS f32 D_8010C928; +BSS s32 D_8010C92C; +BSS Npc* wPartnerNpc; +BSS Entity* TweesterTouchingPlayer; +BSS f32 PlayerNormalYaw; +BSS UNK_FUN_PTR(ISpyNotificationCallback); +BSS UNK_FUN_PTR(TalkNotificationCallback); +BSS s32 gSpinHistoryBufferPos; +BSS s32 D_8010C948; +BSS s32 NpcHitQueryBehindRightY; +BSS s32 D_8010C950; +BSS Entity* TweesterTouchingPartner; +BSS UNK_FUN_PTR(InteractNotificationCallback); +BSS s32 PrevPlayerDirection; +BSS f32 JumpedOnSwitchX; +BSS s32 D_8010C964; +BSS s32 NpcHitQueryBehindCollider; +BSS s32 PeachDisguiseNpcIndex; +BSS s32 NpcHitQueryAheadY; +BSS s32 NpcHitQueryBehindLeftY; +BSS s32 NpcHitQueryColliderID; +BSS f32 JumpedOnSwitchZ; +BSS s32 PlayerRunStateTime; +BSS f32 D_8010C984; +BSS s32 D_8010C988; +BSS s32 NpcHitQueryAheadCollider; +BSS f32 PlayerNormalPitch; + +#endif diff --git a/src/bss/engine2_post_bss.c b/src/bss/engine2_post_bss.c new file mode 100644 index 0000000000..6de7124c47 --- /dev/null +++ b/src/bss/engine2_post_bss.c @@ -0,0 +1,39 @@ +#define NO_EXTERN_VARIABLES +#include "common.h" +#include "model.h" +#include "overlay.h" +// DON'T DARE to put include headers here containing extern declarations... +// This will ruin the ordering of bss symbols below if you care about matching. + +#ifndef SHIFT + +// from audio/ambience.c +typedef struct { + /* 0x0 */ s16 flags; + /* 0x2 */ s16 fadeState; + /* 0x4 */ s32 fadeTime; + /* 0x8 */ s32 soundID; + /* 0xC */ s32 unkC; +} AmbientSoundSettings; + +BSS MusicSettings gMusicSettings[2]; +BSS IMG_BIN D_80159B50[0x200]; +BSS Window gWindows[64]; +BSS CollisionStatus gCollisionStatus; +BSS HiddenPanelsData gCurrentHiddenPanels; +BSS s32 _PLS_NAME_ME[2]; +BSS TextureHandle TextureHandles[128]; +BSS ScreenOverlay ScreenOverlays[2]; +BSS AmbientSoundSettings AmbientSoundData; +BSS s32 CreateEntityVarArgBuffer[4]; +BSS PAL_BIN D_8015C7E0[0x10]; +#if VERSION_IQUE +BSS char D_8015C800[0x3C80]; +#elif VERSION_JP +BSS char D_8015C800[0x2880]; +#else +BSS char D_8015C800[0x7800]; +#endif +BSS DisplayContext D_80164000[2]; + +#endif diff --git a/src/bss/engine2_pre_bss.c b/src/bss/engine2_pre_bss.c new file mode 100644 index 0000000000..ed596a1162 --- /dev/null +++ b/src/bss/engine2_pre_bss.c @@ -0,0 +1,56 @@ +#define NO_EXTERN_VARIABLES +#include "common.h" +#include "model.h" +#include "hud_element.h" +// DON'T DARE to put include headers here containing extern declarations... +// This will ruin the ordering of bss symbols below if you care about matching. + +#ifndef SHIFT + +BSS SpriteShadingProfile* gAuxSpriteShadingProfile; +BSS s32 gHudElementsNumber; +BSS ModelCustomGfxBuilderList* gCurrentCustomModelGfxBuildersPtr; +BSS s32 D_801512BC; +BSS s32 entity_numEntities; +BSS s32 gEntityHeapBase; +BSS HudCacheEntry* gHudElementCacheTableRaster; +BSS ModelList* gCurrentModels; +BSS HudCacheEntry* gHudElementCacheTablePalette; +BSS s32 gAnimCount; +BSS s32 gMsgBGScrollAmtX; +BSS s32 D_801512DC; +BSS ModelTransformGroupList* gCurrentTransformGroups; +BSS u16 gMsgGlobalWaveCounter; +BSS ModelCustomGfxList* gCurrentCustomModelGfxPtr; +BSS s32 gLastCreatedEntityIndex; +BSS u8* gBackgroundTintModePtr; +BSS MessageImageData* gMsgVarImages[1]; +BSS s32 ItemEntitiesCreated; +BSS ModelNode** gCurrentModelTreeRoot; +BSS s32 gEntityHeapBottom; +BSS s32 D_80151304; +BSS u16 gCurrentRoomDoorSounds; +BSS s32 gMsgBGScrollAmtY; +BSS s32 gEntityHideMode; +BSS u8* gHudElementCacheBuffer; +BSS s32 gEntityModelCount; +BSS u8* D_8015131C; +BSS s32 D_80151320; +BSS s32 entity_numShadows; +BSS SpriteShadingProfile* gSpriteShadingProfile; +BSS s32 isAreaSpecificEntityDataLoaded; +BSS s32 entity_updateCounter; +BSS s16 gTriggerCount; +BSS Gfx* D_80151338; +BSS s32* gHudElementCacheSize; +BSS u16 gCurrentDoorSounds; +BSS s32 D_80151344; +#if VERSION_JP +BSS s32 D_80151348[4]; +#elif VERSION_PAL || VERSION_IQUE +BSS s32 D_80151348[8]; +#else +BSS s32 D_80151348[12]; +#endif + +#endif diff --git a/src/bss/main_post_bss.c b/src/bss/main_post_bss.c new file mode 100644 index 0000000000..2d1b7aed54 --- /dev/null +++ b/src/bss/main_post_bss.c @@ -0,0 +1,88 @@ +#define NO_EXTERN_VARIABLES +#include "common.h" +#include "PR/osint.h" +#include "PR/controller.h" +#include "nu/nusys.h" +#include "npc.h" +#include "effects.h" +#include "audio.h" +// DON'T DARE to put include headers here containing extern declarations... +// This will ruin the ordering of bss symbols below if you care about matching. + +#ifndef SHIFT + +// +// main segment COMMON/.scommon symbols +// + +#if VERSION_IQUE +BSS OSIoMesg __osFlashMsg OSALIGNED(8); +#endif +BSS char wMapTexName[0x18]; +BSS OSThread __osThreadSave; +BSS OSMesgQueue nuContWaitMesgQ; +BSS OSPifRam __osContPifRam BBALIGNED(16); +BSS EncounterStatus gCurrentEncounter; +BSS OSPiHandle __Dom2SpeedParam OSALIGNED(8); +BSS OSContStatus nuContStatus[NU_CONT_MAXCONTROLLERS]; +BSS OSThread D_800B1B90; +BSS NUContRmbCtl nuContRmbCtl[NU_CONT_MAXCONTROLLERS]; +#if VERSION_IQUE +BSS u32 __osFlashID[4] OSALIGNED(8); +#endif +BSS OSContPad nuContData[NU_CONT_MAXCONTROLLERS]; +BSS Camera gCameras[4] ALIGNED(16); +BSS unsigned char D_800B32E0[0x800] ALIGNED(16); +BSS unsigned char D_800B3AE0[0x800] ALIGNED(16); +BSS CollisionData gCollisionData; +BSS OSMesgQueue nuGfxMesgQ; +BSS OSPiHandle __CartRomHandle OSALIGNED(8); +BSS OSMesgQueue __osPiAccessQueue OSALIGNED(8); +BSS EffectInstance* gEffectInstances[96] ALIGNED(8); +BSS OSPiHandle __Dom1SpeedParam OSALIGNED(8); +BSS u8 nuBootStack[0x2000] ALIGNED(8); +BSS u64 nuMainStack[NU_SC_STACK_SIZE / sizeof(u64)]; +BSS u8 nuYieldBuf[NU_GFX_YIELD_BUF_SIZE]; +BSS AuSynDriver auSynDriver; +BSS s32 D_800B91D0[NU_GFX_RDP_OUTPUTBUFF_SIZE / sizeof(u32)] ALIGNED(16); +#if VERSION_IQUE +BSS OSPiHandle __osFlashHandler OSALIGNED(8); +#endif +BSS CollisionData gZoneCollisionData ALIGNED(8); +#if VERSION_JP || VERSION_IQUE +BSS char wMapHitName[0x14]; +#else +BSS char wMapHitName[0x18]; +#endif +BSS OSMesgQueue nuSiMgrMesgQ; +BSS OSTimer __osBaseTimer; +BSS char wMapShapeName[0x18]; +BSS ALHeap nuAuHeap; +#if VERSION_IQUE +BSS OSMesgQueue __osFlashMessageQ OSALIGNED(8); +#endif +BSS OSTimer __osEepromTimer; +BSS NUScTask nuGfxTask[NU_GFX_TASK_NUM]; +BSS SaveGlobals gSaveGlobals; +BSS char wMapBgName[0x14]; +BSS __OSInode __osPfsInodeCache OSALIGNED(8); +#if !VERSION_IQUE +BSS u8 rspbootUcodeBuffer[0x100] ALIGNED(16); +BSS char D_800D9880[0x700]; +#endif +BSS __OSEventState __osEventStateTab[OS_NUM_EVENTS]; +BSS OSPifRam __osPfsPifRam BBALIGNED(16); +BSS u64 D_800DA040[0x400 / sizeof(u64)]; +BSS NUSched nusched; +BSS OSMesgQueue __osEepromTimerQ OSALIGNED(8); +BSS OSPfs nuContPfs[NU_CONT_MAXCONTROLLERS]; +BSS OSMesgQueue nuSiMesgQ; +BSS OSMesgQueue D_800DAC90; +BSS OSMesgQueue __osSiAccessQueue OSALIGNED(8); +#ifdef BBPLAYER +BSS u8 __osBbFlashBuffer[0x80]; +#endif +BSS SaveData gCurrentSaveFile; +BSS OSMesgQueue nuContDataMutexQ; + +#endif diff --git a/src/bss/main_pre_bss.c b/src/bss/main_pre_bss.c new file mode 100644 index 0000000000..c52eb8f715 --- /dev/null +++ b/src/bss/main_pre_bss.c @@ -0,0 +1,89 @@ +#define NO_EXTERN_VARIABLES +#include "common.h" +#include "audio.h" +#include "model.h" +// DON'T DARE to put include headers here containing extern declarations... +// This will ruin the ordering of bss symbols below if you care about matching. + +#ifndef SHIFT + +// +// Main segment COMMON/.scommon symbols +// + +BSS u8 nuScPreNMIFlag; +BSS s32 D_8009A5B4; +BSS s32 D_8009A5B8; +BSS s32 D_8009A5BC; +#if VERSION_IQUE +BSS s32 __osFlashVersion; +#endif +BSS AuGlobals* gSoundGlobals; +BSS s32 D_8009A5C4; +BSS u32 __osBaseCounter; +BSS BGMPlayer* gBGMPlayerC; +BSS s32 gEncounterSubState; +#ifdef BBPLAYER +BSS u32 __osBbRCountWraps; +#endif +BSS void *CurrentSefCmdHandler; +BSS s32 timeFreezeMode; +#ifdef BBPLAYER +BSS u32 __osBbLastRCount; +#endif +BSS u16* nuGfxZBuffer; +BSS u32 nuContDataLockKey; +BSS u32 __osViIntrCount; +BSS AuCallback BeginSoundUpdateCallback; +BSS f32 D_8009A5EC; +BSS u32 nuGfxCfbCounter; +BSS ModelTreeInfoList* gCurrentModelTreeNodeInfo; +BSS u32 nuGfxDisplay; +BSS BGMPlayer* gBGMPlayerB; +BSS s32 gEncounterState; +BSS s16 gNpcCount; +BSS u8 __osMaxControllers; +#if VERSION_IQUE +BSS OSMesg __osFlashMsgBuf; +#endif +BSS OSTime __osCurrentTime; +BSS NUUcode* nuGfxUcode; +BSS u32 nuContNum; +#ifdef BBPLAYER +BSS u32 __osBbLastVCount; +#endif +BSS volatile u32 nuGfxTaskSpool; +BSS u8 __osContLastCmd; +BSS OSMesg __osEepromTimerMsg; +BSS s32 D_8009A624; +BSS AmbienceManager* gAuAmbienceManager; +BSS u32 __osTimerCounter; +BSS void (*nuIdleFunc)(void); +BSS s16 gCurrentCamID; +BSS OSPiHandle* nuPiCartHandle; +#ifdef BBPLAYER +BSS u32 __osBbVCountWraps; +#endif +BSS s8 D_8009A63C; +BSS SoundManager* gSoundManager; +BSS s32 D_8009A644; +BSS s32 D_8009A648; +BSS u16* nuGfxCfb_ptr; +BSS s32 gOverrideFlags; +BSS s8 HasPreBattleSongPushed; +BSS u16** nuGfxCfb; +BSS s32 D_8009A65C; +BSS u32 __osFinalrom; +BSS BGMPlayer* gBGMPlayerA; +BSS s16 gFirstStrikeMessagePos; +BSS Gfx* gMainGfxPos; +BSS s8 D_8009A670; +BSS DisplayContext* gDisplayContext; +BSS s32 D_8009A678; +BSS s32 D_8009A67C; +#if VERSION_IQUE +BSS s32 D_80099258[2]; +#endif +BSS u16* ResetFrameBufferArray; + +#endif diff --git a/src/cam_main.c b/src/cam_main.c index df9ac8dfcd..c56135aac4 100644 --- a/src/cam_main.c +++ b/src/cam_main.c @@ -8,12 +8,12 @@ void render_models(void); void execute_render_tasks(void); void render_item_entities(void); -SHIFT_BSS f32 D_8009A5EC; -SHIFT_BSS s16 gCurrentCamID; -SHIFT_BSS u16* nuGfxCfb_ptr; -SHIFT_BSS Gfx* gMainGfxPos; -SHIFT_BSS DisplayContext* gDisplayContext; -SHIFT_BSS Camera gCameras[4]; +f32 D_8009A5EC; +s16 gCurrentCamID; +u16* nuGfxCfb_ptr; +Gfx* gMainGfxPos; +DisplayContext* gDisplayContext; +Camera gCameras[4]; void update_cameras(void) { s32 i; diff --git a/src/cam_mode_zone_interp.c b/src/cam_mode_zone_interp.c index 90538af89f..0b390dd620 100644 --- a/src/cam_mode_zone_interp.c +++ b/src/cam_mode_zone_interp.c @@ -1,11 +1,11 @@ #include "common.h" -SHIFT_BSS CamConfiguration gCurrentCamConfiguration; -SHIFT_BSS f32 D_800A08DC; -SHIFT_BSS f32 D_800A08E0; -SHIFT_BSS f32 D_800A08E4; -SHIFT_BSS f32 D_800A08E8; -SHIFT_BSS f32 D_800A08EC; +BSS CamConfiguration gCurrentCamConfiguration; +BSS f32 D_800A08DC; +BSS f32 D_800A08E0; +BSS f32 D_800A08E4; +BSS f32 D_800A08E8; +BSS f32 D_800A08EC; void cam_interp_lookat_pos(Camera* camera, f32 arg1, f32 arg2, s16 arg3); void func_8003034C(Camera* camera); diff --git a/src/collision.c b/src/collision.c index bc4e86b88b..821104fb64 100644 --- a/src/collision.c +++ b/src/collision.c @@ -32,23 +32,24 @@ typedef struct HitAssetCollider { /* 0x08 */ s32 trianglesOffset; } HitAssetCollider; // size = 0x0C -SHIFT_BSS CollisionData gCollisionData; -SHIFT_BSS CollisionData gZoneCollisionData; -SHIFT_BSS f32 gCollisionRayStartX; -SHIFT_BSS f32 gCollisionRayStartY; -SHIFT_BSS f32 gCollisionRayStartZ; -SHIFT_BSS f32 gCollisionRayDirX; -SHIFT_BSS f32 gCollisionRayDirY; -SHIFT_BSS f32 gCollisionRayDirZ; -SHIFT_BSS f32 gCollisionPointX; -SHIFT_BSS f32 gCollisionPointY; -SHIFT_BSS f32 gCollisionPointZ; -SHIFT_BSS f32 gCollisionRayLength; -SHIFT_BSS f32 gCollisionNormalX; -SHIFT_BSS f32 gCollisionNormalY; -SHIFT_BSS f32 gCollisionNormalZ; -SHIFT_BSS ColliderBackupEntry* gCollisionDataBackup; -SHIFT_BSS ColliderBackupEntry* gCollisionDataZoneBackup; +CollisionData gCollisionData; +CollisionData gZoneCollisionData; + +BSS f32 gCollisionRayStartX; +BSS f32 gCollisionRayStartY; +BSS f32 gCollisionRayStartZ; +BSS f32 gCollisionRayDirX; +BSS f32 gCollisionRayDirY; +BSS f32 gCollisionRayDirZ; +BSS f32 gCollisionPointX; +BSS f32 gCollisionPointY; +BSS f32 gCollisionPointZ; +BSS f32 gCollisionRayLength; +BSS f32 gCollisionNormalX; +BSS f32 gCollisionNormalY; +BSS f32 gCollisionNormalZ; +BSS ColliderBackupEntry* gCollisionDataBackup; +BSS ColliderBackupEntry* gCollisionDataZoneBackup; extern Vec3s gEntityColliderFaces[]; extern Vec3f gEntityColliderNormals[]; diff --git a/src/crash_screen.c b/src/crash_screen.c index 6c6278d91f..55d04bb040 100644 --- a/src/crash_screen.c +++ b/src/crash_screen.c @@ -15,7 +15,7 @@ typedef struct { /* 0x9D2 */ u16 height; } CrashScreen; // size = 0x9D4 -SHIFT_BSS CrashScreen gCrashScreen; +BSS CrashScreen gCrashScreen; u8 gCrashScreencharToGlyph[128] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, diff --git a/src/curtains.c b/src/curtains.c index 34931dbfdc..8eceb13984 100644 --- a/src/curtains.c +++ b/src/curtains.c @@ -202,12 +202,12 @@ Gfx NoControllerGfx[] = { gsSPEndDisplayList(), }; -SHIFT_BSS Mtx D_8009BAA8[2]; -SHIFT_BSS f32 gCurtainScale; -SHIFT_BSS f32 gCurtainScaleGoal; -SHIFT_BSS f32 gCurtainFade; -SHIFT_BSS f32 gCurtainFadeGoal; -SHIFT_BSS UNK_FUN_PTR(gCurtainDrawCallback); +BSS f32 gCurtainScale; +BSS f32 gCurtainScaleGoal; +BSS f32 gCurtainFade; +BSS f32 gCurtainFadeGoal; +BSS UNK_FUN_PTR(gCurtainDrawCallback); +BSS Mtx D_8009BAA8[2]; void initialize_curtains(void) { gCurtainDrawCallback = NULL; diff --git a/src/draw_box.c b/src/draw_box.c index 141972cdcf..3602ab8363 100644 --- a/src/draw_box.c +++ b/src/draw_box.c @@ -13,7 +13,7 @@ typedef struct DefaultWindowStyle { } DefaultWindowStyle; // size = 0x0B #define BOX_QUAD_BUFFER_NUM 21 -SHIFT_BSS Vtx gBoxQuadBuffer[BOX_QUAD_BUFFER_NUM][16]; +BSS Vtx gBoxQuadBuffer[BOX_QUAD_BUFFER_NUM][16]; DefaultWindowStyle gBoxDefaultStyles[] = { { diff --git a/src/effects.c b/src/effects.c index 69b10fa969..900e55bbbe 100644 --- a/src/effects.c +++ b/src/effects.c @@ -5,8 +5,8 @@ typedef s32 TlbEntry[0x1000 / 4]; typedef TlbEntry TlbMappablePage[15]; -SHIFT_BSS EffectGraphics gEffectGraphicsData[15]; -SHIFT_BSS EffectInstance* gEffectInstances[96]; +BSS EffectGraphics gEffectGraphicsData[15]; +EffectInstance* gEffectInstances[96]; extern TlbMappablePage D_80197000; extern Addr D_801A6000; diff --git a/src/encounter.c b/src/encounter.c index 459f69985a..ef95f48633 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -168,21 +168,22 @@ EvtScript EnemyNpcDefeat = { End }; -SHIFT_BSS s32 gEncounterState; -SHIFT_BSS s32 gEncounterSubState; -SHIFT_BSS EncounterStatus gCurrentEncounter; -SHIFT_BSS s8 D_8009A63C; -SHIFT_BSS s8 HasPreBattleSongPushed; -SHIFT_BSS s16 gFirstStrikeMessagePos; -SHIFT_BSS s8 D_8009A670; -SHIFT_BSS s32 D_8009A678; -SHIFT_BSS s32 D_800A0BA0; -SHIFT_BSS f32 D_800A0BA4; -SHIFT_BSS Evt* D_800A0BB0; -SHIFT_BSS s32 D_800A0BB4; -SHIFT_BSS s16 D_800A0BB8; -SHIFT_BSS EffectInstance* WorldMerleeOrbEffect; -SHIFT_BSS EffectInstance* WorldMerleeWaveEffect; +s32 gEncounterState; +s32 gEncounterSubState; +EncounterStatus gCurrentEncounter; +s8 D_8009A63C; +s8 HasPreBattleSongPushed; +s16 gFirstStrikeMessagePos; +s8 D_8009A670; +s32 D_8009A678; + +BSS s32 D_800A0BA0; +BSS f32 D_800A0BA4; +BSS EffectInstance* WorldMerleeOrbEffect; +BSS EffectInstance* WorldMerleeWaveEffect; +BSS Evt* D_800A0BB0; +BSS s32 D_800A0BB4; +BSS s16 D_800A0BB8; void set_battle_formation(Battle*); void setup_status_bar_for_world(void); diff --git a/src/entity.c b/src/entity.c index 9ab7ee5867..5ba20bda6a 100644 --- a/src/entity.c +++ b/src/entity.c @@ -31,36 +31,38 @@ extern Addr entity_sbk_omo_ROM_START; s32 D_8014AFB0 = 255; -SHIFT_BSS s32 CreateEntityVarArgBuffer[4]; -SHIFT_BSS HiddenPanelsData gCurrentHiddenPanels; -SHIFT_BSS s32 gEntityHideMode; - -SHIFT_BSS s32 D_801516FC; -SHIFT_BSS s32 D_801512BC; -SHIFT_BSS s32 D_80151304; -SHIFT_BSS s32 D_80151344; -SHIFT_BSS s32 entity_numEntities; -SHIFT_BSS s32 gEntityHeapBase; -SHIFT_BSS s32 gLastCreatedEntityIndex; - -SHIFT_BSS s32 gEntityHeapBottom; -SHIFT_BSS s32 entity_numShadows; -SHIFT_BSS s32 isAreaSpecificEntityDataLoaded; -SHIFT_BSS s32 entity_updateCounter; - -SHIFT_BSS s32 wEntityDataLoadedSize; -SHIFT_BSS s32 bEntityDataLoadedSize; - -SHIFT_BSS EntityBlueprint* wEntityBlueprint[30]; -SHIFT_BSS EntityBlueprint* bEntityBlueprint[4]; - -SHIFT_BSS EntityList gWorldEntityList; -SHIFT_BSS EntityList gBattleEntityList; -SHIFT_BSS EntityList* gCurrentEntityListPtr; - -SHIFT_BSS ShadowList gWorldShadowList; -SHIFT_BSS ShadowList gBattleShadowList; -SHIFT_BSS ShadowList* gCurrentShadowListPtr; +s32 CreateEntityVarArgBuffer[4]; +HiddenPanelsData gCurrentHiddenPanels; +s32 gEntityHideMode; + +s32 D_801512BC; +s32 D_80151304; +s32 D_80151344; +s32 entity_numEntities; +s32 gEntityHeapBase; +s32 gLastCreatedEntityIndex; + +s32 gEntityHeapBottom; +s32 entity_numShadows; +s32 isAreaSpecificEntityDataLoaded; +s32 entity_updateCounter; + +BSS EntityList gWorldEntityList; +BSS EntityList gBattleEntityList; +BSS EntityList* gCurrentEntityListPtr; +BSS s32 D_80151474; +BSS ShadowList gWorldShadowList; +BSS ShadowList gBattleShadowList; +BSS ShadowList* gCurrentShadowListPtr; + +BSS s32 wEntityDataLoadedSize; +BSS s32 bEntityDataLoadedSize; +BSS s32 D_80151664; + +BSS EntityBlueprint* wEntityBlueprint[MAX_ENTITIES + 2]; +BSS EntityBlueprint* bEntityBlueprint[4]; +BSS s32 D_801516F8; +BSS s32 D_801516FC; extern Addr BattleEntityHeapBottom; // todo ??? diff --git a/src/entity_model.c b/src/entity_model.c index 6b5cf22928..e38ba822e1 100644 --- a/src/entity_model.c +++ b/src/entity_model.c @@ -7,19 +7,20 @@ EntityModelScript D_8014C260 = { }; Lights1 D_8014C268 = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0); -SHIFT_BSS EntityModelList gWorldEntityModelList; -SHIFT_BSS EntityModelList gBattleEntityModelList; -SHIFT_BSS EntityModelList* gCurrentEntityModelList; -SHIFT_BSS s32 gEntityModelCount; - -SHIFT_BSS s32 D_80154374; -SHIFT_BSS s32 entity_fog_enabled; -SHIFT_BSS s32 entity_fog_red; -SHIFT_BSS s32 entity_fog_green; -SHIFT_BSS s32 entity_fog_blue; -SHIFT_BSS s32 entity_fog_alpha; -SHIFT_BSS s32 entity_fog_dist_min; -SHIFT_BSS s32 entity_fog_dist_max; +s32 gEntityModelCount; + +BSS EntityModelList gWorldEntityModelList; +BSS EntityModelList gBattleEntityModelList; +BSS EntityModelList* gCurrentEntityModelList; + +BSS s32 D_80154374; +BSS s32 entity_fog_enabled; +BSS s32 entity_fog_red; +BSS s32 entity_fog_green; +BSS s32 entity_fog_blue; +BSS s32 entity_fog_alpha; +BSS s32 entity_fog_dist_min; +BSS s32 entity_fog_dist_max; extern Gfx Gfx_RM1_SURFACE_OPA[]; extern Gfx Gfx_RM1_DECAL_OPA[]; diff --git a/src/evt/player_api.c b/src/evt/player_api.c index 2c7c27eb54..28e179a55d 100644 --- a/src/evt/player_api.c +++ b/src/evt/player_api.c @@ -4,8 +4,8 @@ #include "world/partners.h" #include "sprite/player.h" -SHIFT_BSS PlayerStatus gPlayerStatus; -SHIFT_BSS PlayerData gPlayerData; +extern PlayerStatus gPlayerStatus; +extern PlayerData gPlayerData; extern Npc playerNpcData; extern u16 PlayerImgFXFlags; diff --git a/src/fio.c b/src/fio.c index 8fdde87ec8..f383dd7eb5 100644 --- a/src/fio.c +++ b/src/fio.c @@ -10,12 +10,13 @@ typedef struct SaveInfo { #define GLOBALS_PAGE_1 6 #define GLOBALS_PAGE_2 7 -SHIFT_BSS SaveData FetchSaveBuffer; -SHIFT_BSS SaveInfo LogicalSaveInfo[4]; // 4 save slots presented to the player -SHIFT_BSS SaveInfo PhysicalSaveInfo[6]; // 6 saves as represented on the EEPROM -SHIFT_BSS s32 NextAvailablePhysicalSave; -SHIFT_BSS SaveGlobals gSaveGlobals; -SHIFT_BSS SaveData gCurrentSaveFile; +BSS SaveData FetchSaveBuffer; +BSS SaveInfo LogicalSaveInfo[4]; // 4 save slots presented to the player +BSS SaveInfo PhysicalSaveInfo[6]; // 6 saves as represented on the EEPROM +BSS s32 NextAvailablePhysicalSave; + +SaveGlobals gSaveGlobals; +SaveData gCurrentSaveFile; char MagicSaveString[] = "Mario Story 006"; diff --git a/src/game_modes.c b/src/game_modes.c index db9fa8e8ad..7fa75046ac 100644 --- a/src/game_modes.c +++ b/src/game_modes.c @@ -256,7 +256,7 @@ GameMode* gameModeMap[] = { [GAME_MODE_DEMO] (GameMode*) &GameModeDemo, }; -SHIFT_BSS s16 CurGameMode; +BSS s16 CurGameMode; void set_game_mode(s16 mode) { CurGameMode = mode; diff --git a/src/game_states.c b/src/game_states.c index 84413b496a..bb480eacf6 100644 --- a/src/game_states.c +++ b/src/game_states.c @@ -1,7 +1,8 @@ #include "common.h" #include "game_modes.h" -SHIFT_BSS GameMode gMainGameMode[2]; +BSS GameMode gMainGameMode[2]; +BSS s32 D_80151730[4]; // unused? or probably a part of GameMode? void mode_default_nop(void) { } diff --git a/src/hud_element.c b/src/hud_element.c index ee0ab4dfb7..2d263e5be0 100644 --- a/src/hud_element.c +++ b/src/hud_element.c @@ -100,23 +100,26 @@ Vtx D_8014F0C8[] = { Lights1 HudElementLights = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0); -SHIFT_BSS s32 gHudElementsNumber; -SHIFT_BSS s32 D_80159180; -SHIFT_BSS HudElementList* gHudElements; -SHIFT_BSS HudElementList gHudElementsWorld; -SHIFT_BSS HudElementList gHudElementsBattle; -SHIFT_BSS s32* gHudElementCacheSize; -SHIFT_BSS s32 gHudElementCacheSizeWorld; -SHIFT_BSS s32 gHudElementCacheSizeBattle; -SHIFT_BSS HudCacheEntry* gHudElementCacheTableRaster; -SHIFT_BSS HudCacheEntry* gHudElementCacheTablePalette; -SHIFT_BSS HudCacheEntry gHudElementCacheTableRasterWorld[192]; -SHIFT_BSS HudCacheEntry gHudElementCacheTablePaletteWorld[192]; -SHIFT_BSS HudCacheEntry gHudElementCacheTableRasterBattle[192]; -SHIFT_BSS HudCacheEntry gHudElementCacheTablePaletteBattle[192]; -SHIFT_BSS u8* gHudElementCacheBufferWorld; -SHIFT_BSS u8* gHudElementCacheBufferBattle; -SHIFT_BSS u8* gHudElementCacheBuffer; +s32 gHudElementsNumber; +HudCacheEntry* gHudElementCacheTableRaster; +HudCacheEntry* gHudElementCacheTablePalette; +s32* gHudElementCacheSize; +u8* gHudElementCacheBuffer; + +BSS HudElementList gHudElementsWorld; +BSS HudElementList gHudElementsBattle; +BSS HudElementList* gHudElements; +BSS u8* gHudElementCacheBufferWorld; +BSS s32 gHudElementCacheSizeWorld; +BSS s32 D_8015796C; +BSS HudCacheEntry gHudElementCacheTableRasterWorld[192]; +BSS HudCacheEntry gHudElementCacheTablePaletteWorld[192]; +BSS u8* gHudElementCacheBufferBattle; +BSS s32 gHudElementCacheSizeBattle; +BSS s32 D_80158578[2]; +BSS HudCacheEntry gHudElementCacheTableRasterBattle[192]; +BSS HudCacheEntry gHudElementCacheTablePaletteBattle[192]; +BSS s32 D_80159180; void func_801413F8(void); diff --git a/src/imgfx.c b/src/imgfx.c index cd5f7b045e..64bab44e8f 100644 --- a/src/imgfx.c +++ b/src/imgfx.c @@ -113,16 +113,18 @@ typedef ImgFXState ImgFXInstanceList[MAX_IMGFX_INSTANCES]; extern HeapNode heap_spriteHead; -SHIFT_BSS ImgFXWorkingTexture ImgFXCurrentTexture; -SHIFT_BSS Vtx* ImgFXVtxBuffers[2]; -SHIFT_BSS Vtx* imgfx_vtxBuf; -SHIFT_BSS ImgFXInstanceList* ImgFXInstances; -SHIFT_BSS s8 D_80156958[2]; -SHIFT_BSS s32 D_80156960[2]; -SHIFT_BSS s32 D_80156968[2]; -SHIFT_BSS s8 D_80156970; -SHIFT_BSS ImgFXAnimHeader ImgFXAnimHeaders[MAX_IMGFX_INSTANCES]; -SHIFT_BSS ImgFXCacheEntry ImgFXDataCache[8]; +BSS ImgFXWorkingTexture ImgFXCurrentTexture; +BSS Vtx* ImgFXVtxBuffers[2]; +BSS Vtx* imgfx_vtxBuf; +BSS ImgFXInstanceList* ImgFXInstances; +BSS s8 D_80156958[2]; +BSS s32 D_8015695C; +BSS s32 D_80156960[2]; +BSS s32 D_80156968[2]; +BSS s8 D_80156970; +BSS s32 D_80156974[3]; +BSS ImgFXAnimHeader ImgFXAnimHeaders[MAX_IMGFX_INSTANCES]; +BSS ImgFXCacheEntry ImgFXDataCache[8]; // Data ImgFXWorkingTexture* ImgFXCurrentTexturePtr = &ImgFXCurrentTexture; diff --git a/src/input.c b/src/input.c index 07e5396301..2886b480e7 100644 --- a/src/input.c +++ b/src/input.c @@ -1,11 +1,12 @@ #include "common.h" #include "nu/nusys.h" -SHIFT_BSS OSContPad D_8009A5B8; -SHIFT_BSS s16 D_8009A6A0; -SHIFT_BSS s16 D_8009A6A2; -SHIFT_BSS s16 D_8009A6A4; -SHIFT_BSS s16 D_8009A6A6; +OSContPad D_8009A5B8; +BSS s16 D_8009A6A0; +BSS s16 D_8009A6A2; +BSS s16 D_8009A6A4; +BSS s16 D_8009A6A6; +BSS s32 D_8009A6A8; // unused void func_800287F0(void) { gGameStatusPtr->curButtons[0] = 0; diff --git a/src/inventory.c b/src/inventory.c index b3cde7f314..49819b56f2 100644 --- a/src/inventory.c +++ b/src/inventory.c @@ -11,11 +11,8 @@ enum BlinkModes { BSS b16 D_8010CD10; BSS b16 D_8010CD12; -BSS char D_8010CD14[0xA]; -BSS s32 D_8010CD20; -BSS char D_8010CD24[0xC]; -SHIFT_BSS StatusBar gStatusBar; +StatusBar gStatusBar; extern HudScript* TimesHudScript; extern HudScript* SPIncrementHudScripts[]; diff --git a/src/item_entity.c b/src/item_entity.c index e69371135f..6f2ce3c859 100644 --- a/src/item_entity.c +++ b/src/item_entity.c @@ -25,29 +25,32 @@ extern HudCacheEntry* gHudElementCacheTablePalette; extern u8* gHudElementCacheBuffer; extern s32* gHudElementCacheSize; -SHIFT_BSS s32 ItemEntitiesCreated; -SHIFT_BSS s32 UnusedItemPhysicsScriptID; -SHIFT_BSS s32 ItemEntityAlternatingSpawn; -SHIFT_BSS s32 ItemEntityRenderGroup; -SHIFT_BSS s16 CoinSparkleCenterX; -SHIFT_BSS s16 CoinSparkleCenterY; -SHIFT_BSS s16 CoinSparkleCenterZ; -SHIFT_BSS ItemEntity* WorldItemEntities[MAX_ITEM_ENTITIES]; -SHIFT_BSS ItemEntity* BattleItemEntities[MAX_ITEM_ENTITIES]; -SHIFT_BSS ItemEntity** gCurrentItemEntities; -SHIFT_BSS s16 isPickingUpItem; -SHIFT_BSS s16 ItemSpawnWithinPlayerPickupDelay; +s32 ItemEntitiesCreated; + +BSS s32 UnusedItemPhysicsScriptID; +BSS s32 ItemEntityAlternatingSpawn; +BSS s32 ItemEntityRenderGroup; +BSS s16 CoinSparkleCenterX; +BSS s16 CoinSparkleCenterY; +BSS s16 CoinSparkleCenterZ; +BSS s32 pad_ItemEntity[3]; +BSS ItemEntity* WorldItemEntities[MAX_ITEM_ENTITIES]; +BSS ItemEntity* BattleItemEntities[MAX_ITEM_ENTITIES]; +BSS ItemEntity** gCurrentItemEntities; +BSS s16 isPickingUpItem; +BSS s16 ItemSpawnWithinPlayerPickupDelay; #if !VERSION_JP -SHIFT_BSS s16 D_801565A8; +BSS s16 D_801565A8; +BSS s32 D_801565AC; #endif -SHIFT_BSS PopupMenu ItemPickupMenu; -SHIFT_BSS s32 ItemPickupIconID; -SHIFT_BSS s32 ItemPickupStateDelay; -SHIFT_BSS s32 ThrowAwayMenuIdx; -SHIFT_BSS s32 ThrowAwayItemID; -SHIFT_BSS EffectInstance* ItemPickupGotOutline; -SHIFT_BSS MessagePrintState* GotItemTutorialPrinter; -SHIFT_BSS b32 GotItemTutorialClosed; +BSS PopupMenu ItemPickupMenu; +BSS s32 ItemPickupIconID; +BSS s32 ItemPickupStateDelay; +BSS s32 ThrowAwayMenuIdx; +BSS s32 ThrowAwayItemID; +BSS EffectInstance* ItemPickupGotOutline; +BSS MessagePrintState* GotItemTutorialPrinter; +BSS b32 GotItemTutorialClosed; void item_entity_update(ItemEntity*); void appendGfx_item_entity(void*); diff --git a/src/main.c b/src/main.c index 972d05c34b..d623211f86 100644 --- a/src/main.c +++ b/src/main.c @@ -1,94 +1,14 @@ #include "common.h" #include "nu/nusys.h" -// -// Start of libultra BSS -// - -#include "PR/controller.h" -#include "PR/osint.h" -SHIFT_BSS OSPifRam __osEepPifRam; -SHIFT_BSS __OSEventState __osEventStateTab[OS_NUM_EVENTS]; -SHIFT_BSS OSPifRam __MotorDataBuf[MAXCONTROLLERS]; -SHIFT_BSS u16 retrace; -SHIFT_BSS OSThread viThread; -SHIFT_BSS unsigned char viThreadStack[OS_VIM_STACKSIZE] ALIGNED(16); -SHIFT_BSS char piThreadStack[OS_PIM_STACKSIZE] ALIGNED(16); -SHIFT_BSS OSMesgQueue viEventQueue; -SHIFT_BSS OSMesg viEventBuf[5] ALIGNED(8); -SHIFT_BSS OSIoMesg viRetraceMsg ALIGNED(8); -SHIFT_BSS OSIoMesg viCounterMsg ALIGNED(8); -SHIFT_BSS OSTask tmp_task; -SHIFT_BSS OSMesg piAccessBuf[1] ALIGNED(16); -SHIFT_BSS OSMesgQueue __osPiAccessQueue; -SHIFT_BSS OSThread piThread; -SHIFT_BSS OSMesgQueue piEventQueue; -SHIFT_BSS OSMesg piEventBuf[1]; -SHIFT_BSS OSContStatus nuContStatus[5]; // ??? enough space for 5, but it makes no sense -SHIFT_BSS OSMesgQueue nuSiMesgQ; -SHIFT_BSS u32 nuContDataLockKey; -SHIFT_BSS OSMesg nuContWaitMesgBuf; -SHIFT_BSS OSMesg nuContDataMutexBuf; -SHIFT_BSS OSMesgQueue nuContDataMutexQ ALIGNED(16); -SHIFT_BSS OSMesgQueue nuContWaitMesgQ; -SHIFT_BSS OSContPad nuContData[4]; -SHIFT_BSS u32 nuContNum; -SHIFT_BSS volatile u32 nuGfxTaskSpool; -SHIFT_BSS OSMesgQueue nuGfxMesgQ; -SHIFT_BSS char GfxStack[NU_GFX_STACK_SIZE] ALIGNED(16); -SHIFT_BSS OSThread D_800B1B90; -SHIFT_BSS OSMesg nuGfxMesgBuf[NU_GFX_MESGS]; -SHIFT_BSS OSPiHandle* nuPiCartHandle; -SHIFT_BSS NUContRmbCtl nuContRmbCtl[4]; -SHIFT_BSS OSPfs nuContPfs[4]; -SHIFT_BSS NUUcode* nuGfxUcode; -SHIFT_BSS OSMesgQueue D_800AC5D0; -SHIFT_BSS OSMesg D_800AC5E8[NU_PI_MESG_NUM]; -SHIFT_BSS u32 nuGfxDisplay; -SHIFT_BSS u32 nuGfxCfbCounter; -SHIFT_BSS NUSched nusched; -SHIFT_BSS u8 nuScPreNMIFlag; -SHIFT_BSS u64 nuScStack[NU_SC_STACK_SIZE / sizeof(u64)]; -SHIFT_BSS u64 nuScAudioStack[NU_SC_STACK_SIZE / sizeof(u64)]; -SHIFT_BSS u64 nuScGraphicsStack[NU_SC_STACK_SIZE / sizeof(u64)]; -SHIFT_BSS NUIdleFunc nuIdleFunc; -SHIFT_BSS OSMesgQueue nuSiMgrMesgQ; -SHIFT_BSS OSMesg nuSiMesgBuf[8]; -SHIFT_BSS OSThread siMgrThread; -SHIFT_BSS u64 siMgrStack[NU_SI_STACK_SIZE/sizeof(u64)]; -SHIFT_BSS OSMesg D_8009E6D0[NU_GFX_TASKMGR_MESGS]; -SHIFT_BSS OSMesgQueue D_800DAC90; -SHIFT_BSS NUScTask* nuGfxTask_ptr; -SHIFT_BSS s16 taskDoneMsg; -SHIFT_BSS s16 swapBufMsg; -SHIFT_BSS OSThread GfxTaskMgrThread; -SHIFT_BSS NUScTask nuGfxTask[NU_GFX_TASK_NUM]; -SHIFT_BSS u64 D_800DA040[0x400 / sizeof(u64)]; -SHIFT_BSS s32 D_800B91D0[NU_GFX_RDP_OUTPUTBUFF_SIZE / sizeof(u32)]; -SHIFT_BSS u64 GfxTaskMgrStack[NU_GFX_TASKMGR_STACK_SIZE / sizeof(u64)]; -SHIFT_BSS u8 nuYieldBuf[0xC10] ALIGNED(16); -SHIFT_BSS OSMesg siAccessBuf[1] ALIGNED(8); -SHIFT_BSS OSMesgQueue __osSiAccessQueue; -SHIFT_BSS OSThread __osThreadSave; - -// boot.s -SHIFT_BSS u8 nuBootStack[0x2000] ALIGNED(8); - -//osFlash.c (IDO) -SHIFT_BSS u32 __osFlashID[4]; -SHIFT_BSS OSIoMesg __osFlashMsg; -SHIFT_BSS OSMesgQueue __osFlashMessageQ; -SHIFT_BSS OSPiHandle __osFlashHandler; -SHIFT_BSS OSMesg __osFlashMsgBuf; -SHIFT_BSS s32 __osFlashVersion; - -// -// End of libultra BSS -// +// TODO move these somewhere else... +u8 nuYieldBuf[NU_GFX_YIELD_BUF_SIZE]; +OSThread __osThreadSave; +u8 nuBootStack[0x2000] ALIGNED(8); // used in effects/gfx/flame.c -SHIFT_BSS unsigned char D_800B32E0[0x800] ALIGNED(16); -SHIFT_BSS unsigned char D_800B3AE0[0x800] ALIGNED(16); +unsigned char D_800B32E0[0x800] ALIGNED(16); +unsigned char D_800B3AE0[0x800] ALIGNED(16); s16 D_80074010 = 8; // might be an array, could be size 1-8 @@ -120,8 +40,8 @@ extern IMG_BIN ResetTilesImg[]; #define shim_load_engine_data_obfuscated load_engine_data #endif -SHIFT_BSS u16* ResetFrameBufferArray; -SHIFT_BSS u16* nuGfxZBuffer; +u16* ResetFrameBufferArray; +u16* nuGfxZBuffer; void boot_main(void* data) { #if VERSION_JP diff --git a/src/main_loop.c b/src/main_loop.c index 3ad3c51faf..b231f69ee3 100644 --- a/src/main_loop.c +++ b/src/main_loop.c @@ -6,11 +6,12 @@ #include "overlay.h" #include "game_modes.h" -SHIFT_BSS s32 gOverrideFlags; -SHIFT_BSS s32 timeFreezeMode; -SHIFT_BSS u16** nuGfxCfb; -SHIFT_BSS s16 SoftResetDelay; -SHIFT_BSS DisplayContext D_80164000[2]; +s32 gOverrideFlags; +s32 timeFreezeMode; +u16** nuGfxCfb; +BSS s16 SoftResetDelay; + +DisplayContext D_80164000[2]; s8 gGameStepDelayAmount = 1; s8 gGameStepDelayCount = 5; diff --git a/src/model.c b/src/model.c index ef5b1065b7..d88b52a475 100644 --- a/src/model.c +++ b/src/model.c @@ -94,9 +94,9 @@ enum { #define WORLD_TEXTURE_MEMORY_SIZE 0x20000 #define BATTLE_TEXTURE_MEMORY_SIZE 0x8000 -SHIFT_BSS u8* gBackgroundTintModePtr; // NOTE: the type for this u8 is TintMode, as shown in SetModelTintMode -SHIFT_BSS ModelList* gCurrentModels; -SHIFT_BSS ModelTreeInfoList* gCurrentModelTreeNodeInfo; +u8* gBackgroundTintModePtr; // NOTE: the type for this u8 is TintMode, as shown in SetModelTintMode +ModelList* gCurrentModels; +ModelTreeInfoList* gCurrentModelTreeNodeInfo; extern Addr TextureHeap; @@ -1298,56 +1298,60 @@ s32 RenderTaskBasePriorities[] = { b8 D_8014C248 = FALSE; // possibly a 'warm-up done' flag for boot. never read. -SHIFT_BSS ModelCustomGfxBuilderList* gCurrentCustomModelGfxBuildersPtr; -SHIFT_BSS ModelNode** gCurrentModelTreeRoot; -SHIFT_BSS ModelTransformGroupList* gCurrentTransformGroups; -SHIFT_BSS ModelCustomGfxList* gCurrentCustomModelGfxPtr; - -SHIFT_BSS TextureHeader gCurrentTextureHeader ALIGNED(16); - -SHIFT_BSS ModelList wModelList; -SHIFT_BSS ModelList bModelList; - -SHIFT_BSS ModelTransformGroupList wTransformGroups; -SHIFT_BSS ModelTransformGroupList bTransformGroups; - -SHIFT_BSS ModelCustomGfxList wCustomModelGfx; -SHIFT_BSS ModelCustomGfxList bCustomModelGfx; - -SHIFT_BSS ModelCustomGfxBuilderList wCustomModelGfxBuilders; -SHIFT_BSS ModelCustomGfxBuilderList bCustomModelGfxBuilders; -SHIFT_BSS ModelLocalVertexCopyList wModelLocalVtxBuffers; -SHIFT_BSS ModelLocalVertexCopyList bModelLocalVtxBuffers; -SHIFT_BSS ModelLocalVertexCopyList* gCurrentModelLocalVtxBuffers; - -SHIFT_BSS ModelNode* wModelTreeRoot; -SHIFT_BSS ModelNode* bModelTreeRoot; -SHIFT_BSS ModelTreeInfoList wModelTreeNodeInfo; -SHIFT_BSS ModelTreeInfoList bModelTreeNodeInfo; - -SHIFT_BSS s8 wBackgroundTintMode; -SHIFT_BSS s8 bBackgroundTintMode; -SHIFT_BSS s32 TreeIterPos; -SHIFT_BSS FogSettings wFogSettings; -SHIFT_BSS FogSettings bFogSettings; -SHIFT_BSS FogSettings* gFogSettings; -SHIFT_BSS s32 texPannerMainU[MAX_TEX_PANNERS]; -SHIFT_BSS s32 texPannerMainV[MAX_TEX_PANNERS]; -SHIFT_BSS s32 texPannerAuxU[MAX_TEX_PANNERS]; -SHIFT_BSS s32 texPannerAuxV[MAX_TEX_PANNERS]; -SHIFT_BSS void* TextureHeapPos; -SHIFT_BSS u16 mtg_IterIdx; -SHIFT_BSS ModelNode* mtg_FoundModelNode; -SHIFT_BSS u16 mtg_MinChild; -SHIFT_BSS u16 mtg_MaxChild; -SHIFT_BSS u16 mtg_SearchModelID; -SHIFT_BSS RenderTask* RenderTaskLists[3]; -SHIFT_BSS s32 RenderTaskListIdx; -SHIFT_BSS s32 RenderTaskCount; - -SHIFT_BSS TextureHandle TextureHandles[128]; - -SHIFT_BSS u16 DepthCopyBuffer[16]; +ModelCustomGfxBuilderList* gCurrentCustomModelGfxBuildersPtr; +ModelNode** gCurrentModelTreeRoot; +ModelTransformGroupList* gCurrentTransformGroups; +ModelCustomGfxList* gCurrentCustomModelGfxPtr; + +BSS TextureHeader gCurrentTextureHeader ALIGNED(16); + +BSS ModelList wModelList; +BSS ModelList bModelList; + +BSS ModelTransformGroupList wTransformGroups; +BSS ModelTransformGroupList bTransformGroups; + +BSS ModelCustomGfxList wCustomModelGfx; +BSS ModelCustomGfxList bCustomModelGfx; + +BSS ModelCustomGfxBuilderList wCustomModelGfxBuilders; +BSS ModelCustomGfxBuilderList bCustomModelGfxBuilders; +BSS ModelLocalVertexCopyList wModelLocalVtxBuffers; +BSS ModelLocalVertexCopyList bModelLocalVtxBuffers; +BSS ModelLocalVertexCopyList* gCurrentModelLocalVtxBuffers; + +BSS ModelNode* wModelTreeRoot; +BSS ModelNode* bModelTreeRoot; +BSS s32 D_8015221C; +BSS ModelTreeInfoList wModelTreeNodeInfo; +BSS ModelTreeInfoList bModelTreeNodeInfo; + +BSS s8 wBackgroundTintMode; +BSS s8 bBackgroundTintMode; +BSS s8 D_80153222; +BSS s8 D_80153223; +BSS s32 TreeIterPos; +BSS FogSettings wFogSettings; +BSS s32 D_80153244; +BSS FogSettings bFogSettings; +BSS FogSettings* gFogSettings; +BSS s32 texPannerMainU[MAX_TEX_PANNERS]; +BSS s32 texPannerMainV[MAX_TEX_PANNERS]; +BSS s32 texPannerAuxU[MAX_TEX_PANNERS]; +BSS s32 texPannerAuxV[MAX_TEX_PANNERS]; +BSS void* TextureHeapPos; +BSS u16 mtg_IterIdx; +BSS u16 mtg_SearchModelID; +BSS ModelNode* mtg_FoundModelNode; +BSS u16 mtg_MinChild; +BSS u16 mtg_MaxChild; +BSS s32 D_80153378[2]; +BSS u16 DepthCopyBuffer[16]; +BSS RenderTask* RenderTaskLists[3]; +BSS s32 RenderTaskListIdx; +BSS s32 RenderTaskCount; + +TextureHandle TextureHandles[128]; extern Addr BattleEntityHeapBottom; // todo ??? @@ -1360,8 +1364,6 @@ void load_model_transforms(ModelNode* model, ModelNode* parent, Matrix4f mdlTxMt s32 is_identity_fixed_mtx(Mtx* mtx); void build_custom_gfx(void); -MATCHING_BSS(0x3A0); - void appendGfx_model(void* data) { Model* model = data; s32 mtxPushMode; diff --git a/src/msg.c b/src/msg.c index 1e027a30e0..d6be4901e6 100644 --- a/src/msg.c +++ b/src/msg.c @@ -55,12 +55,11 @@ void* D_PAL_8014AE50[] = { s16 gNextMessageBuffer = 0; -//TODO Vtx -ALIGNED(8) s32 gRewindArrowQuad[] = { - 0xFFF00009, 0x00000000, 0x00000000, 0xFFFFFFFF, - 0x00100009, 0x00000000, 0x04000000, 0xFFFFFFFF, - 0xFFF0FFF7, 0x00000000, 0x00000240, 0xFFFFFFFF, - 0x0010FFF7, 0x00000000, 0x04000240, 0xFFFFFFFF, +Vtx gRewindArrowQuad[] = { + { .v = { .ob = { 0xFFF0, 0x0009, 0x0000 }, .tc = { 0x0000, 0x0000 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}}, + { .v = { .ob = { 0x0010, 0x0009, 0x0000 }, .tc = { 0x0400, 0x0000 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}}, + { .v = { .ob = { 0xFFF0, 0xFFF7, 0x0000 }, .tc = { 0x0000, 0x0240 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}}, + { .v = { .ob = { 0x0010, 0xFFF7, 0x0000 }, .tc = { 0x0400, 0x0240 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}}, }; Gfx D_8014C2D8[] = { @@ -80,58 +79,37 @@ Gfx D_8014C2D8[] = { gsSPEndDisplayList(), }; -SHIFT_BSS s32 gMsgBGScrollAmtX; -SHIFT_BSS u16 gMsgGlobalWaveCounter; -SHIFT_BSS MessageImageDataList gMsgVarImages; -SHIFT_BSS s32 gMsgBGScrollAmtY; -SHIFT_BSS u8* D_8015131C; -SHIFT_BSS Gfx* D_80151338; -SHIFT_BSS char gMessageBuffers[2][1024]; -SHIFT_BSS u8 gMessageMsgVars[3][32]; -SHIFT_BSS s16 D_80155C98; -SHIFT_BSS Mtx gMessageWindowProjMatrix[2]; -SHIFT_BSS MessageDrawState D_80155D20; -SHIFT_BSS MessageDrawState* msg_drawState; -SHIFT_BSS IMG_BIN D_80159B50[0x200]; -SHIFT_BSS PAL_BIN D_8015C7E0[0x10]; -SHIFT_BSS MessagePrintState gMessagePrinters[3]; -#if VERSION_IQUE -SHIFT_BSS IMG_BIN D_801544A0[120][128]; +s32 gMsgBGScrollAmtX; +u16 gMsgGlobalWaveCounter; +MessageImageDataList gMsgVarImages; +s32 gMsgBGScrollAmtY; +u8* D_8015131C; +Gfx* D_80151338; + +static char gMessageBuffers[2][1024]; +static MessagePrintState gMessagePrinters[3]; +#if VERSION_JP +static s32 D_80155C38; #endif +static u8 gMessageMsgVars[3][32]; +static s16 D_80155C98; +static Mtx gMessageWindowProjMatrix[2]; + +IMG_BIN D_80159B50[0x200]; +PAL_BIN D_8015C7E0[0x10]; extern s16 MsgStyleVerticalLineOffsets[]; -extern IMG_BIN ui_msg_bubble_left_png[]; -extern IMG_BIN ui_msg_bubble_mid_png[]; -extern IMG_BIN ui_msg_bubble_right_png[]; -extern IMG_BIN ui_msg_arrow_png[]; -extern unsigned char ui_msg_palettes[16][32]; -extern IMG_BIN ui_msg_sign_corner_topleft_png[]; -extern IMG_BIN ui_msg_sign_corner_topright_png[]; -extern IMG_BIN ui_msg_sign_corner_bottomleft_png[]; -extern IMG_BIN ui_msg_sign_corner_bottomright_png[]; -extern IMG_BIN ui_msg_lamppost_corner_bottomright_png[]; -extern IMG_BIN ui_msg_sign_side_top_png[]; -extern IMG_BIN ui_msg_sign_side_left_png[]; -extern IMG_BIN ui_msg_sign_side_right_png[]; -extern IMG_BIN ui_msg_sign_side_bottom_png[]; -extern IMG_BIN ui_msg_sign_fill_png[]; -extern PAL_BIN ui_msg_sign_pal[]; -extern PAL_BIN ui_msg_lamppost_pal[]; -extern IMG_BIN ui_msg_background_png[]; extern IMG_BIN ui_msg_rewind_arrow_png[]; extern PAL_BIN ui_msg_rewind_arrow_pal[]; extern IMG_BIN ui_msg_star_png[]; extern IMG_BIN ui_msg_star_silhouette_png[]; -extern IMG_BIN D_802ED550[]; -extern PAL_BIN D_802ED670[]; extern IMG_BIN MsgCharImgTitle[]; extern IMG_BIN MsgCharImgNormal[]; extern MessageCharset* MsgCharsets[5]; extern IMG_BIN MsgCharImgSubtitle[]; extern PAL_BIN D_802F4560[80][8]; - #if VERSION_JP extern IMG_BIN MsgCharImgKana[]; extern IMG_BIN MsgCharImgLatin[]; @@ -139,8 +117,6 @@ extern IMG_BIN MsgCharImgMenuKana[]; extern IMG_BIN MsgCharImgMenuLatin[]; #endif -extern s32 gMessageBoxFrameParts[2][16]; - extern IMG_BIN ui_point_right_png[]; extern PAL_BIN ui_point_right_pal[]; @@ -206,15 +182,6 @@ void msg_draw_rewind_arrow(s32); void msg_draw_choice_pointer(MessagePrintState* printer); void draw_message_window(MessagePrintState* printer); void appendGfx_message(MessagePrintState*, s16, s16, u16, u16, u16, u8); -void appendGfx_msg_prim_rect(u8 r, u8 g, u8 b, u8 a, u16 ulX, u16 ulY, u16 lrX, u16 lrY); -void msg_reset_gfx_state(void); -void msg_draw_char(MessagePrintState* printer, MessageDrawState* drawState, s32 charIndex, s32 palette, s32 posX, - s32 posY); -void msg_draw_prim_rect(u8 r, u8 g, u8 b, u8 a, u16 posX, u16 posY, u16 sizeX, u16 sizeY); -void msg_draw_speech_arrow(MessagePrintState* printer); -void msg_draw_frame(s32 posX, s32 posY, s32 sizeX, s32 sizeY, s32 style, s32 palette, s32 fading, s32 bgAlpha, s32 frameAlpha); -void msg_draw_speech_bubble(MessagePrintState* printer, s16 posX, s16 posY, s16 straightWidth, s16 curveWidth, - s16 height, f32 scaleX, f32 scaleY, u8 opacity, s32 arg9); void clear_character_set(void) { D_80155C98 = -1; @@ -2001,10 +1968,6 @@ void get_msg_properties(s32 msgID, s32* height, s32* width, s32* maxLineChars, s } } -#if !VERSION_JP -static const f32 padding = 0.0f; -#endif - s32 get_msg_width(s32 msgID, u16 charset) { s32 width; diff --git a/src/msg_draw.c b/src/msg_draw.c index b36df2b671..f70c12e2eb 100644 --- a/src/msg_draw.c +++ b/src/msg_draw.c @@ -24,12 +24,7 @@ extern IMG_BIN ui_msg_sign_fill_png[]; extern PAL_BIN ui_msg_sign_pal[]; extern PAL_BIN ui_msg_lamppost_pal[]; extern IMG_BIN ui_msg_background_png[]; -extern IMG_BIN ui_msg_rewind_arrow_png[]; -extern PAL_BIN ui_msg_rewind_arrow_pal[]; -extern IMG_BIN ui_msg_star_png[]; -extern IMG_BIN ui_msg_star_silhouette_png[]; -// .bss typedef MessageImageData* MessageImageDataList[1]; extern s32 gMsgBGScrollAmtX; @@ -38,30 +33,23 @@ extern MessageImageDataList gMsgVarImages; extern s32 gMsgBGScrollAmtY; extern u8* D_8015131C; extern Gfx* D_80151338; -extern char gMessageBuffers[2][1024]; -extern u8 gMessageMsgVars[3][32]; -extern s16 D_80155C98; -extern Mtx gMessageWindowProjMatrix[2]; -extern MessageDrawState D_80155D20; -extern MessageDrawState* msg_drawState; extern IMG_BIN D_80159B50[0x200]; extern PAL_BIN D_8015C7E0[0x10]; -extern MessagePrintState gMessagePrinters[3]; -#if VERSION_IQUE -extern IMG_BIN D_801544A0[120][128]; -#endif +#if !VERSION_JP extern s16 MsgStyleVerticalLineOffsets[]; +#endif -extern IMG_BIN D_802ED550[]; -extern PAL_BIN D_802ED670[]; -extern IMG_BIN MsgCharImgTitle[]; -extern IMG_BIN MsgCharImgNormal[]; extern MessageCharset* MsgCharsets[5]; -extern IMG_BIN MsgCharImgSubtitle[]; extern PAL_BIN D_802F4560[80][8]; extern s32 gMessageBoxFrameParts[2][16]; +#if VERSION_IQUE +static IMG_BIN D_801544A0[120][128]; +#endif +static MessageDrawState D_80155D20; +static MessageDrawState* msg_drawState; + Vtx gMsgSpeechBoxLQuad[4] = { { .v = { .ob = {1, 0, 0}, .tc = {0, 0}, .cn = {255, 255, 248, 255} } }, { .v = { .ob = {0x20, 0, 0}, .tc = {0x400, 0}, .cn = {255, 255, 248, 255} } }, @@ -120,21 +108,8 @@ u8 D_8014C580[] = { 50, 80, 100, 105, 100, 0, 0, 0 }; u8 D_8014C588[] = { 105, 100, 77, 57, 40, 27, 16, 8, 3, 0, 0, 0}; #if VERSION_IQUE u32 D_8014AD24 = 2; -#else -u8 D_8014C594[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; #endif -s32 draw_image_with_clipping(IMG_PTR raster, s32 width, s32 height, s32 fmt, s32 bitDepth, s16 posX, s16 posY, u16 clipULx, - u16 clipULy, u16 clipLRx, u16 clipRLy); - -s32 _update_message(MessagePrintState* printer); -void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2); -void initialize_printer(MessagePrintState* printer, s32 arg1, s32 arg2); -MessagePrintState* _msg_get_printer_for_msg(s32 msgID, s32* donePrintingWriteback, s32 arg2); -void msg_update_rewind_arrow(s32); -void msg_draw_rewind_arrow(s32); -void msg_draw_choice_pointer(MessagePrintState* printer); -void draw_message_window(MessagePrintState* printer); void appendGfx_message(MessagePrintState*, s16, s16, u16, u16, u16, u8); void appendGfx_msg_prim_rect(u8 r, u8 g, u8 b, u8 a, u16 ulX, u16 ulY, u16 lrX, u16 lrY); void msg_reset_gfx_state(void); diff --git a/src/npc.c b/src/npc.c index f99c5d528e..e09e22f5bd 100644 --- a/src/npc.c +++ b/src/npc.c @@ -6,11 +6,11 @@ #include "world/partners.h" #include "sprite/npc/WorldWatt.h" -SHIFT_BSS s16 gNpcCount; -SHIFT_BSS NpcList gWorldNpcList; -SHIFT_BSS NpcList gBattleNpcList; -SHIFT_BSS NpcList* gCurrentNpcListPtr; -SHIFT_BSS b8 gNpcPlayerCollisionsEnabled; +s16 gNpcCount; +static NpcList gWorldNpcList; +static NpcList gBattleNpcList; +static NpcList* gCurrentNpcListPtr; +static b8 gNpcPlayerCollisionsEnabled; #define PAL_ANIM_END 0xFF diff --git a/src/npc_collision.c b/src/npc_collision.c index 38cb2d4123..08d13e5639 100644 --- a/src/npc_collision.c +++ b/src/npc_collision.c @@ -1,11 +1,11 @@ #include "common.h" -SHIFT_BSS s32 NpcHitQueryBehindRightY; -SHIFT_BSS s32 NpcHitQueryBehindCollider; -SHIFT_BSS s32 NpcHitQueryAheadCollider; -SHIFT_BSS s32 NpcHitQueryAheadY; -SHIFT_BSS s32 NpcHitQueryBehindLeftY; -SHIFT_BSS s32 NpcHitQueryColliderID; +s32 NpcHitQueryBehindRightY; +s32 NpcHitQueryBehindCollider; +s32 NpcHitQueryAheadCollider; +s32 NpcHitQueryAheadY; +s32 NpcHitQueryBehindLeftY; +s32 NpcHitQueryColliderID; PlayerStatus* gPlayerStatusPtr = &gPlayerStatus; // maybe wPlayerStatus diff --git a/ver/us/asm/os/__osDisableInt.s b/src/os/__osDisableInt.s similarity index 100% rename from ver/us/asm/os/__osDisableInt.s rename to src/os/__osDisableInt.s diff --git a/ver/us/asm/os/__osGetCause.s b/src/os/__osGetCause.s similarity index 100% rename from ver/us/asm/os/__osGetCause.s rename to src/os/__osGetCause.s diff --git a/ver/us/asm/os/__osGetSR.s b/src/os/__osGetSR.s similarity index 100% rename from ver/us/asm/os/__osGetSR.s rename to src/os/__osGetSR.s diff --git a/ver/us/asm/os/__osProbeTLB.s b/src/os/__osProbeTLB.s similarity index 93% rename from ver/us/asm/os/__osProbeTLB.s rename to src/os/__osProbeTLB.s index 1e7a2df984..5138a93710 100644 --- a/ver/us/asm/os/__osProbeTLB.s +++ b/src/os/__osProbeTLB.s @@ -10,7 +10,12 @@ glabel __osProbeTLB /* 41C60 80066860 40085000 */ mfc0 $t0, $10 /* 41C64 80066864 310900FF */ andi $t1, $t0, 0xff +#ifdef BBPLAYER +/* 40228 80064E28 3C01FFFF */ lui $at, (0xFFFFE000 >> 16) +/* 4022C 80064E2C 3421E000 */ ori $at, $at, (0xFFFFE000 & 0xFFFF) +#else /* 41C68 80066868 2401E000 */ addiu $at, $zero, -0x2000 +#endif /* 41C6C 8006686C 00815024 */ and $t2, $a0, $at /* 41C70 80066870 012A4825 */ or $t1, $t1, $t2 /* 41C74 80066874 40895000 */ mtc0 $t1, $10 diff --git a/ver/us/asm/os/__osRestoreInt.s b/src/os/__osRestoreInt.s similarity index 100% rename from ver/us/asm/os/__osRestoreInt.s rename to src/os/__osRestoreInt.s diff --git a/ver/us/asm/os/__osSetCompare.s b/src/os/__osSetCompare.s similarity index 100% rename from ver/us/asm/os/__osSetCompare.s rename to src/os/__osSetCompare.s diff --git a/ver/us/asm/os/__osSetWatchLo.s b/src/os/__osSetWatchLo.s similarity index 100% rename from ver/us/asm/os/__osSetWatchLo.s rename to src/os/__osSetWatchLo.s diff --git a/ver/us/asm/os/bcmp.s b/src/os/bcmp.s similarity index 100% rename from ver/us/asm/os/bcmp.s rename to src/os/bcmp.s diff --git a/ver/us/asm/os/bcopy.s b/src/os/bcopy.s similarity index 100% rename from ver/us/asm/os/bcopy.s rename to src/os/bcopy.s diff --git a/ver/us/asm/os/bzero.s b/src/os/bzero.s similarity index 100% rename from ver/us/asm/os/bzero.s rename to src/os/bzero.s diff --git a/src/os/cartrominit.c b/src/os/cartrominit.c index 7862cfe280..5953b227f4 100644 --- a/src/os/cartrominit.c +++ b/src/os/cartrominit.c @@ -4,7 +4,7 @@ #include "PR/rcp.h" #include "PR/piint.h" -OSPiHandle __CartRomHandle ALIGNED(8); +OSPiHandle __CartRomHandle OSALIGNED(8); OSPiHandle *osCartRomInit(void) { u32 value; diff --git a/src/os/contpfs.c b/src/os/contpfs.c index 419839c35d..d4ba9b4769 100644 --- a/src/os/contpfs.c +++ b/src/os/contpfs.c @@ -3,7 +3,7 @@ #include "PR/controller.h" #include "PR/rmon.h" -__OSInode __osPfsInodeCache ALIGNED(8); +__OSInode __osPfsInodeCache OSALIGNED(8); s32 __osPfsInodeCacheChannel = -1; u8 __osPfsInodeCacheBank = 250; diff --git a/src/os/controller.c b/src/os/controller.c index 281065281c..a6d226599e 100644 --- a/src/os/controller.c +++ b/src/os/controller.c @@ -12,7 +12,7 @@ u8 __osContLastCmd; u8 __osMaxControllers; OSTimer __osEepromTimer; -OSMesgQueue __osEepromTimerQ ALIGNED(8); +OSMesgQueue __osEepromTimerQ OSALIGNED(8); OSMesg __osEepromTimerMsg; s32 __osContinitialized = 0; diff --git a/ver/us/asm/os/decode_yay0.s b/src/os/decode_yay0.s similarity index 100% rename from ver/us/asm/os/decode_yay0.s rename to src/os/decode_yay0.s diff --git a/ver/us/asm/os/exceptasm.s b/src/os/exceptasm.s similarity index 77% rename from ver/us/asm/os/exceptasm.s rename to src/os/exceptasm.s index 2ebe0216ff..5012a01e94 100644 --- a/ver/us/asm/os/exceptasm.s +++ b/src/os/exceptasm.s @@ -81,13 +81,21 @@ __osPiIntTable: glabel __osExceptionPreamble /* 45DF0 8006A9F0 3C1A8007 */ lui $k0, %hi(__osException) +#ifdef BBPLAYER +/* 41634 80066234 675A6240 */ daddiu $k0, $k0, %lo(__osException) # handwritten instruction +#else /* 45DF4 8006A9F4 275AAA00 */ addiu $k0, $k0, %lo(__osException) +#endif /* 45DF8 8006A9F8 03400008 */ jr $k0 /* 45DFC 8006A9FC 00000000 */ nop glabel __osException /* 45E00 8006AA00 3C1A800B */ lui $k0, %hi(__osThreadSave) +#ifdef BBPLAYER +/* 41644 80066244 675AF740 */ daddiu $k0, $k0, %lo(__osThreadSave) # handwritten instruction +#else /* 45E04 8006AA04 275A0D08 */ addiu $k0, $k0, %lo(__osThreadSave) +#endif /* 45E08 8006AA08 FF410020 */ sd $at, 0x20($k0) /* 45E0C 8006AA0C 401B6000 */ mfc0 $k1, $12 /* 45E10 8006AA10 AF5B0118 */ sw $k1, 0x118($k0) @@ -101,7 +109,11 @@ glabel __osException /* 45E30 8006AA30 40086800 */ mfc0 $t0, $13 glabel func_8006AA34 +#ifdef BBPLAYER +/* 41674 80066274 0340402D */ daddu $t0, $k0, $zero +#else /* 45E34 8006AA34 03404021 */ addu $t0, $k0, $zero +#endif /* 45E38 8006AA38 3C1A8009 */ lui $k0, %hi(__osRunningThread) /* 45E3C 8006AA3C 8F5A4660 */ lw $k0, %lo(__osRunningThread)($k0) /* 45E40 8006AA40 DD090020 */ ld $t1, 0x20($t0) @@ -148,9 +160,16 @@ glabel func_8006AA34 /* 45EE4 8006AAE4 11200013 */ beqz $t1, .L8006AB34 /* 45EE8 8006AAE8 00000000 */ nop /* 45EEC 8006AAEC 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) +#ifdef BBPLAYER +/* 41730 80066330 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) +/* 41734 80066334 8D080000 */ lw $t0, 0x0($t0) +/* 41738 80066338 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) +/* 4173C 8006633C 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) +#else /* 45EF0 8006AAF0 25085900 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) /* 45EF4 8006AAF4 8D080000 */ lw $t0, ($t0) /* 45EF8 8006AAF8 2401FFFF */ addiu $at, $zero, -1 +#endif /* 45EFC 8006AAFC 01015026 */ xor $t2, $t0, $at /* 45F00 8006AB00 314AFF00 */ andi $t2, $t2, 0xff00 /* 45F04 8006AB04 012A6025 */ or $t4, $t1, $t2 @@ -171,10 +190,18 @@ glabel func_8006AA34 /* 45F3C 8006AB3C 1120000B */ beqz $t1, .L8006AB6C /* 45F40 8006AB40 00000000 */ nop /* 45F44 8006AB44 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) +#ifdef BBPLAYER +/* 4178C 8006638C 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) +/* 41790 80066390 8D080000 */ lw $t0, 0x0($t0) +/* 41794 80066394 00084402 */ srl $t0, $t0, 16 +/* 41798 80066398 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) +/* 4179C 8006639C 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) +#else /* 45F48 8006AB48 25085900 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) /* 45F4C 8006AB4C 8D080000 */ lw $t0, ($t0) /* 45F50 8006AB50 00084402 */ srl $t0, $t0, 0x10 /* 45F54 8006AB54 2401FFFF */ addiu $at, $zero, -1 +#endif /* 45F58 8006AB58 01014026 */ xor $t0, $t0, $at /* 45F5C 8006AB5C 3108003F */ andi $t0, $t0, 0x3f /* 45F60 8006AB60 8F4C0128 */ lw $t4, 0x128($k0) @@ -221,6 +248,25 @@ glabel func_8006AA34 /* 45FFC 8006ABFC 240A0000 */ addiu $t2, $zero, 0 /* 46000 8006AC00 152A00D2 */ bne $t1, $t2, .L8006AF4C /* 46004 8006AC04 00000000 */ nop +#ifdef BBPLAYER +/* 41850 80066450 3C098009 */ lui $t1, %hi(__osShutdown) +/* 41854 80066454 652945AC */ daddiu $t1, $t1, %lo(__osShutdown) +/* 41858 80066458 8D2A0000 */ lw $t2, 0x0($t1) +/* 4185C 8006645C 1140000C */ beqz $t2, .LIQUE_80066490 +/* 41860 80066460 00000000 */ nop +/* 41864 80066464 3C098009 */ lui $t1, %hi(__osShutdownTime) +/* 41868 80066468 652945B0 */ daddiu $t1, $t1, %lo(__osShutdownTime) +/* 4186C 8006646C 8D290000 */ lw $t1, 0x0($t1) +/* 41870 80066470 400A4800 */ mfc0 $t2, $9 # handwritten instruction +/* 41874 80066474 01495023 */ subu $t2, $t2, $t1 +/* 41878 80066478 3C090500 */ lui $t1, (0x5000000 >> 16) +/* 4187C 8006647C 012A482B */ sltu $t1, $t1, $t2 +/* 41880 80066480 11200003 */ beqz $t1, .LIQUE_80066490 +/* 41884 80066484 00000000 */ nop +/* 41888 80066488 0C019FEB */ jal skExit +/* 4188C 8006648C 00000000 */ nop +.LIQUE_80066490: +#endif /* 46008 8006AC08 03688024 */ and $s0, $k1, $t0 .L8006AC0C: /* 4600C 8006AC0C 3209FF00 */ andi $t1, $s0, 0xff00 @@ -231,10 +277,17 @@ glabel func_8006AA34 /* 46020 8006AC20 214A0010 */ addi $t2, $t2, 0x10 .L8006AC24: /* 46024 8006AC24 3C01800A */ lui $at, %hi(__osIntOffTable) +#ifdef BBPLAYER +/* 418B0 800664B0 002A082D */ daddu $at, $at, $t2 +/* 418B4 800664B4 902A88B0 */ lbu $t2, %lo(__osIntOffTable)($at) +/* 418B8 800664B8 3C01800A */ lui $at, %hi(__osIntTable) +/* 418BC 800664BC 002A082D */ daddu $at, $at, $t2 +#else /* 46028 8006AC28 002A0821 */ addu $at, $at, $t2 /* 4602C 8006AC2C 902A9D80 */ lbu $t2, %lo(__osIntOffTable)($at) /* 46030 8006AC30 3C01800A */ lui $at, %hi(__osIntTable) /* 46034 8006AC34 002A0821 */ addu $at, $at, $t2 +#endif /* 46038 8006AC38 8C2A9DA0 */ lw $t2, %lo(__osIntTable)($at) /* 4603C 8006AC3C 01400008 */ jr $t2 /* 46040 8006AC40 00000000 */ nop @@ -260,7 +313,11 @@ glabel func_8006AA34 /* 46080 8006AC80 2401F7FF */ addiu $at, $zero, -0x801 /* 46084 8006AC84 02018024 */ and $s0, $s0, $at /* 46088 8006AC88 3C098009 */ lui $t1, %hi(__osHwIntTable) +#ifdef BBPLAYER +/* 41914 80066514 652944F0 */ daddiu $t1, $t1, %lo(__osHwIntTable) +#else /* 4608C 8006AC8C 25295910 */ addiu $t1, $t1, %lo(__osHwIntTable) +#endif /* 46090 8006AC90 21290008 */ addi $t1, $t1, 8 /* 46094 8006AC94 8D2A0000 */ lw $t2, ($t1) /* 46098 8006AC98 11400007 */ beqz $t2, .L8006ACB8 @@ -272,15 +329,96 @@ glabel func_8006AA34 /* 460B0 8006ACB0 10000093 */ b .L8006AF00 /* 460B4 8006ACB4 00000000 */ nop .L8006ACB8: +#ifdef BBPLAYER +/* 41940 80066540 3C11A430 */ lui $s1, %hi(D_A4300038) +/* 41944 80066544 8E310038 */ lw $s1, %lo(D_A4300038)($s1) +/* 41948 80066548 32290040 */ andi $t1, $s1, 0x40 +/* 4194C 8006654C 11200007 */ beqz $t1, .LIQUE_8006656C +/* 41950 80066550 00000000 */ nop +/* 41954 80066554 32313F80 */ andi $s1, $s1, 0x3F80 +/* 41958 80066558 24090000 */ addiu $t1, $zero, 0x0 +/* 4195C 8006655C 3C01A460 */ lui $at, %hi(D_A4600048) +/* 41960 80066560 AC290048 */ sw $t1, %lo(D_A4600048)($at) +/* 41964 80066564 0C019A45 */ jal send_mesg +/* 41968 80066568 240400B8 */ addiu $a0, $zero, 0xB8 +.LIQUE_8006656C: +/* 4196C 8006656C 32292000 */ andi $t1, $s1, 0x2000 +/* 41970 80066570 11200007 */ beqz $t1, .LIQUE_80066590 +/* 41974 80066574 00000000 */ nop +/* 41978 80066578 32311FC0 */ andi $s1, $s1, 0x1FC0 +/* 4197C 8006657C 24092000 */ addiu $t1, $zero, 0x2000 +/* 41980 80066580 3C01A430 */ lui $at, %hi(D_A4300038) +/* 41984 80066584 AC290038 */ sw $t1, %lo(D_A4300038)($at) +/* 41988 80066588 0C019A45 */ jal send_mesg +/* 4198C 8006658C 240400F0 */ addiu $a0, $zero, 0xF0 +.LIQUE_80066590: +/* 41990 80066590 32290080 */ andi $t1, $s1, 0x80 +/* 41994 80066594 11200007 */ beqz $t1, .LIQUE_800665B4 +/* 41998 80066598 00000000 */ nop +/* 4199C 8006659C 32313F40 */ andi $s1, $s1, 0x3F40 +/* 419A0 800665A0 24094000 */ addiu $t1, $zero, 0x4000 +/* 419A4 800665A4 3C01A430 */ lui $at, %hi(D_A430003C) +/* 419A8 800665A8 AC29003C */ sw $t1, %lo(D_A430003C)($at) +/* 419AC 800665AC 0C019A45 */ jal send_mesg +/* 419B0 800665B0 240400C0 */ addiu $a0, $zero, 0xC0 +.LIQUE_800665B4: +/* 419B4 800665B4 32290100 */ andi $t1, $s1, 0x100 +/* 419B8 800665B8 11200007 */ beqz $t1, .LIQUE_800665D8 +/* 419BC 800665BC 00000000 */ nop +/* 419C0 800665C0 32313EC0 */ andi $s1, $s1, 0x3EC0 +/* 419C4 800665C4 3C090001 */ lui $t1, (0x10000 >> 16) +/* 419C8 800665C8 3C01A430 */ lui $at, %hi(D_A430003C) +/* 419CC 800665CC AC29003C */ sw $t1, %lo(D_A430003C)($at) +/* 419D0 800665D0 0C019A45 */ jal send_mesg +/* 419D4 800665D4 240400C8 */ addiu $a0, $zero, 0xC8 +.LIQUE_800665D8: +/* 419D8 800665D8 32290200 */ andi $t1, $s1, 0x200 +/* 419DC 800665DC 11200007 */ beqz $t1, .LIQUE_800665FC +/* 419E0 800665E0 00000000 */ nop +/* 419E4 800665E4 32313DC0 */ andi $s1, $s1, 0x3DC0 +/* 419E8 800665E8 3C090004 */ lui $t1, (0x40000 >> 16) +/* 419EC 800665EC 3C01A430 */ lui $at, %hi(D_A430003C) +/* 419F0 800665F0 AC29003C */ sw $t1, %lo(D_A430003C)($at) +/* 419F4 800665F4 0C019A45 */ jal send_mesg +/* 419F8 800665F8 240400D0 */ addiu $a0, $zero, 0xD0 +.LIQUE_800665FC: +/* 419FC 800665FC 32290400 */ andi $t1, $s1, 0x400 +/* 41A00 80066600 11200007 */ beqz $t1, .LIQUE_80066620 +/* 41A04 80066604 00000000 */ nop +/* 41A08 80066608 32313BC0 */ andi $s1, $s1, 0x3BC0 +/* 41A0C 8006660C 3C090010 */ lui $t1, (0x100000 >> 16) +/* 41A10 80066610 3C01A430 */ lui $at, %hi(D_A430003C) +/* 41A14 80066614 AC29003C */ sw $t1, %lo(D_A430003C)($at) +/* 41A18 80066618 0C019A45 */ jal send_mesg +/* 41A1C 8006661C 240400D8 */ addiu $a0, $zero, 0xD8 +.LIQUE_80066620: +/* 41A20 80066620 32290800 */ andi $t1, $s1, 0x800 +/* 41A24 80066624 11200007 */ beqz $t1, .LIQUE_80066644 +/* 41A28 80066628 00000000 */ nop +/* 41A2C 8006662C 323137C0 */ andi $s1, $s1, 0x37C0 +/* 41A30 80066630 3C090040 */ lui $t1, (0x400000 >> 16) +/* 41A34 80066634 3C01A430 */ lui $at, %hi(D_A430003C) +/* 41A38 80066638 AC29003C */ sw $t1, %lo(D_A430003C)($at) +/* 41A3C 8006663C 0C019A45 */ jal send_mesg +/* 41A40 80066640 240400E0 */ addiu $a0, $zero, 0xE0 +.LIQUE_80066644: +/* 41A44 80066644 1000FF93 */ b .L8006AC0C +/* 41A48 80066648 00000000 */ nop +#else /* 460B8 8006ACB8 0C01ABDF */ jal send_mesg /* 460BC 8006ACBC 24040010 */ addiu $a0, $zero, 0x10 /* 460C0 8006ACC0 1000FFD2 */ b .L8006AC0C /* 460C4 8006ACC4 00000000 */ nop +#endif .L8006ACC8_460C8: /* 460C8 8006ACC8 3C11A430 */ lui $s1, %hi(D_A4300008) /* 460CC 8006ACCC 8E310008 */ lw $s1, %lo(D_A4300008)($s1) /* 460D0 8006ACD0 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) +#ifdef BBPLAYER +/* 41A58 80066658 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) +#else /* 460D4 8006ACD4 25085900 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) +#endif /* 460D8 8006ACD8 8D080000 */ lw $t0, ($t0) /* 460DC 8006ACDC 00084402 */ srl $t0, $t0, 0x10 /* 460E0 8006ACE0 02288824 */ and $s1, $s1, $t0 @@ -350,13 +488,21 @@ glabel func_8006AA34 /* 461CC 8006ADCC 3C01A460 */ lui $at, %hi(D_A4600010) /* 461D0 8006ADD0 AC290010 */ sw $t1, %lo(D_A4600010)($at) /* 461D4 8006ADD4 3C098009 */ lui $t1, %hi(__osPiIntTable) +#ifdef BBPLAYER +/* 41B5C 8006675C 65294518 */ daddiu $t1, $t1, %lo(__osPiIntTable) +#else /* 461D8 8006ADD8 25295938 */ addiu $t1, $t1, %lo(__osPiIntTable) +#endif /* 461DC 8006ADDC 8D2A0000 */ lw $t2, ($t1) /* 461E0 8006ADE0 11400006 */ beqz $t2, .L8006ADFC /* 461E4 8006ADE4 00000000 */ nop /* 461E8 8006ADE8 8D3D0004 */ lw $sp, 4($t1) /* 461EC 8006ADEC 0140F809 */ jalr $t2 +#ifdef BBPLAYER +/* 41B74 80066774 0040202D */ daddu $a0, $v0, $zero +#else /* 461F0 8006ADF0 00402021 */ addu $a0, $v0, $zero +#endif /* 461F4 8006ADF4 14400003 */ bnez $v0, .L8006AE04 /* 461F8 8006ADF8 00000000 */ nop .L8006ADFC: @@ -385,7 +531,11 @@ glabel func_8006AA34 /* 46244 8006AE44 0361D824 */ and $k1, $k1, $at /* 46248 8006AE48 AF5B0118 */ sw $k1, 0x118($k0) /* 4624C 8006AE4C 3C098009 */ lui $t1, %hi(__osShutdown) +#ifdef BBPLAYER +/* 41BD4 800667D4 652945AC */ daddiu $t1, $t1, %lo(__osShutdown) +#else /* 46250 8006AE50 252958FC */ addiu $t1, $t1, %lo(__osShutdown) +#endif /* 46254 8006AE54 8D2A0000 */ lw $t2, ($t1) /* 46258 8006AE58 11400004 */ beqz $t2, .L8006AE6C /* 4625C 8006AE5C 00000000 */ nop @@ -395,6 +545,12 @@ glabel func_8006AA34 .L8006AE6C: /* 4626C 8006AE6C 240A0001 */ addiu $t2, $zero, 1 /* 46270 8006AE70 AD2A0000 */ sw $t2, ($t1) +#ifdef BBPLAYER +/* 41BF8 800667F8 400A4800 */ mfc0 $t2, $9 # handwritten instruction +/* 41BFC 800667FC 3C098009 */ lui $t1, %hi(__osShutdownTime) +/* 41C00 80066800 652945B0 */ daddiu $t1, $t1, %lo(__osShutdownTime) +/* 41C04 80066804 AD2A0000 */ sw $t2, 0x0($t1) +#endif /* 46274 8006AE74 0C01ABDF */ jal send_mesg /* 46278 8006AE78 24040070 */ addiu $a0, $zero, 0x70 /* 4627C 8006AE7C 2401EFFF */ addiu $at, $zero, -0x1001 @@ -442,15 +598,27 @@ glabel func_8006AA34 /* 46310 8006AF10 012B082A */ slt $at, $t1, $t3 /* 46314 8006AF14 10200007 */ beqz $at, .L8006AF34 /* 46318 8006AF18 00000000 */ nop +#ifdef BBPLAYER +/* 41CB0 800668B0 0340282D */ daddu $a1, $k0, $zero +/* 41CB4 800668B4 3C048009 */ lui $a0, %hi(__osRunQueue) +/* 41CB8 800668B8 64843278 */ daddiu $a0, $a0, %lo(__osRunQueue) +/* 41CBC 800668BC 0C019AC4 */ jal __osEnqueueThread +/* 41CC0 800668C0 00000000 */ nop +#else /* 4631C 8006AF1C 03402821 */ addu $a1, $k0, $zero /* 46320 8006AF20 3C048009 */ lui $a0, %hi(__osRunQueue) /* 46324 8006AF24 0C01AC5D */ jal __osEnqueueThread /* 46328 8006AF28 24844658 */ addiu $a0, $a0, %lo(__osRunQueue) +#endif /* 4632C 8006AF2C 0801AC75 */ j __osDispatchThread /* 46330 8006AF30 00000000 */ nop .L8006AF34: /* 46334 8006AF34 3C098009 */ lui $t1, %hi(__osRunQueue) +#ifdef BBPLAYER +/* 41CD0 800668D0 65293278 */ daddiu $t1, $t1, %lo(__osRunQueue) +#else /* 46338 8006AF38 25294658 */ addiu $t1, $t1, %lo(__osRunQueue) +#endif /* 4633C 8006AF3C 8D2A0000 */ lw $t2, ($t1) /* 46340 8006AF40 AF4A0000 */ sw $t2, ($k0) /* 46344 8006AF44 0801AC75 */ j __osDispatchThread @@ -470,9 +638,15 @@ glabel func_8006AA34 /* 46378 8006AF78 00000000 */ nop glabel send_mesg +#ifdef BBPLAYER +/* 41D14 80066914 03E0902D */ daddu $s2, $ra, $zero +/* 41D18 80066918 3C0A800E */ lui $t2, %hi(__osEventStateTab) +/* 41D1C 8006691C 654A825C */ daddiu $t2, $t2, %lo(__osEventStateTab) +#else /* 4637C 8006AF7C 03E09021 */ addu $s2, $ra, $zero /* 46380 8006AF80 3C0A800E */ lui $t2, %hi(__osEventStateTab) /* 46384 8006AF84 254A9F80 */ addiu $t2, $t2, %lo(__osEventStateTab) +#endif /* 46388 8006AF88 01445021 */ addu $t2, $t2, $a0 /* 4638C 8006AF8C 8D490000 */ lw $t1, ($t2) /* 46390 8006AF90 11200027 */ beqz $t1, .L8006B030 @@ -484,9 +658,14 @@ glabel send_mesg /* 463A8 8006AFA8 00000000 */ nop /* 463AC 8006AFAC 8D2D000C */ lw $t5, 0xc($t1) /* 463B0 8006AFB0 01AB6821 */ addu $t5, $t5, $t3 +#ifdef BBPLAYER +/* 41D4C 8006694C 15800002 */ bnez $t4, .L8006AFC4 +/* 41D50 80066950 01AC001A */ div $zero, $t5, $t4 +#else /* 463B4 8006AFB4 01AC001A */ div $zero, $t5, $t4 /* 463B8 8006AFB8 15800002 */ bnez $t4, .L8006AFC4 /* 463BC 8006AFBC 00000000 */ nop +#endif /* 463C0 8006AFC0 0007000D */ break 7 .L8006AFC4: /* 463C4 8006AFC4 2401FFFF */ addiu $at, $zero, -1 @@ -511,12 +690,22 @@ glabel send_mesg /* 4640C 8006B00C 11600008 */ beqz $t3, .L8006B030 /* 46410 8006B010 00000000 */ nop /* 46414 8006B014 0C01AC6F */ jal __osPopThread +#ifdef BBPLAYER +/* 41DAC 800669AC 0120202D */ daddu $a0, $t1, $zero +/* 41DB0 800669B0 0040502D */ daddu $t2, $v0, $zero +/* 41DB4 800669B4 0140282D */ daddu $a1, $t2, $zero +/* 41DB8 800669B8 3C048009 */ lui $a0, %hi(__osRunQueue) +/* 41DBC 800669BC 64843278 */ daddiu $a0, $a0, %lo(__osRunQueue) +/* 41DC0 800669C0 0C019AC4 */ jal __osEnqueueThread +/* 41DC4 800669C4 00000000 */ nop +#else /* 46418 8006B018 01202021 */ addu $a0, $t1, $zero /* 4641C 8006B01C 00405021 */ addu $t2, $v0, $zero /* 46420 8006B020 01402821 */ addu $a1, $t2, $zero /* 46424 8006B024 3C048009 */ lui $a0, %hi(__osRunQueue) /* 46428 8006B028 0C01AC5D */ jal __osEnqueueThread /* 4642C 8006B02C 24844658 */ addiu $a0, $a0, %lo(__osRunQueue) +#endif .L8006B030: /* 46430 8006B030 02400008 */ jr $s2 /* 46434 8006B034 00000000 */ nop @@ -559,7 +748,9 @@ glabel __osEnqueueAndYield /* 464B8 8006B0B8 1360000A */ beqz $k1, .L8006B0E4 /* 464BC 8006B0BC 00000000 */ nop /* 464C0 8006B0C0 445BF800 */ cfc1 $k1, $31 +#ifndef BBPLAYER /* 464C4 8006B0C4 00000000 */ nop +#endif /* 464C8 8006B0C8 ACBB012C */ sw $k1, 0x12c($a1) /* 464CC 8006B0CC F4B40180 */ sdc1 $f20, 0x180($a1) /* 464D0 8006B0D0 F4B60188 */ sdc1 $f22, 0x188($a1) @@ -573,9 +764,16 @@ glabel __osEnqueueAndYield /* 464EC 8006B0EC 1120000D */ beqz $t1, .L8006B124 /* 464F0 8006B0F0 00000000 */ nop /* 464F4 8006B0F4 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) +#ifdef BBPLAYER +/* 41E8C 80066A8C 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) +/* 41E90 80066A90 8D080000 */ lw $t0, 0x0($t0) +/* 41E94 80066A94 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) +/* 41E98 80066A98 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) +#else /* 464F8 8006B0F8 25085900 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) /* 464FC 8006B0FC 8D080000 */ lw $t0, ($t0) /* 46500 8006B100 2401FFFF */ addiu $at, $zero, -1 +#endif /* 46504 8006B104 01014026 */ xor $t0, $t0, $at /* 46508 8006B108 3108FF00 */ andi $t0, $t0, 0xff00 /* 4650C 8006B10C 01284825 */ or $t1, $t1, $t0 @@ -590,10 +788,18 @@ glabel __osEnqueueAndYield /* 4652C 8006B12C 1360000B */ beqz $k1, .L8006B15C /* 46530 8006B130 00000000 */ nop /* 46534 8006B134 3C1A8009 */ lui $k0, %hi(__OSGlobalIntMask) +#ifdef BBPLAYER +/* 41ED0 80066AD0 675A45B4 */ daddiu $k0, $k0, %lo(__OSGlobalIntMask) # handwritten instruction +/* 41ED4 80066AD4 8F5A0000 */ lw $k0, 0x0($k0) # handwritten instruction +/* 41ED8 80066AD8 001AD402 */ srl $k0, $k0, 16 +/* 41EDC 80066ADC 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) +/* 41EE0 80066AE0 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) +#else /* 46538 8006B138 275A5900 */ addiu $k0, $k0, %lo(__OSGlobalIntMask) /* 4653C 8006B13C 8F5A0000 */ lw $k0, ($k0) /* 46540 8006B140 001AD402 */ srl $k0, $k0, 0x10 /* 46544 8006B144 2401FFFF */ addiu $at, $zero, -1 +#endif /* 46548 8006B148 0341D026 */ xor $k0, $k0, $at /* 4654C 8006B14C 335A003F */ andi $k0, $k0, 0x3f /* 46550 8006B150 8CA80128 */ lw $t0, 0x128($a1) @@ -609,7 +815,11 @@ glabel __osEnqueueAndYield /* 46570 8006B170 00000000 */ nop glabel __osEnqueueThread +#ifdef BBPLAYER +/* 41F10 80066B10 0080C82D */ daddu $t9, $a0, $zero +#else /* 46574 8006B174 0080C821 */ addu $t9, $a0, $zero +#endif /* 46578 8006B178 8C980000 */ lw $t8, ($a0) /* 4657C 8006B17C 8CAF0004 */ lw $t7, 4($a1) /* 46580 8006B180 8F0E0004 */ lw $t6, 4($t8) @@ -617,7 +827,11 @@ glabel __osEnqueueThread /* 46588 8006B188 14200007 */ bnez $at, .L8006B1A8 /* 4658C 8006B18C 00000000 */ nop .L8006B190: +#ifdef BBPLAYER +/* 41F2C 80066B2C 0300C82D */ daddu $t9, $t8, $zero +#else /* 46590 8006B190 0300C821 */ addu $t9, $t8, $zero +#endif /* 46594 8006B194 8F180000 */ lw $t8, ($t8) /* 46598 8006B198 8F0E0004 */ lw $t6, 4($t8) /* 4659C 8006B19C 01CF082A */ slt $at, $t6, $t7 @@ -640,16 +854,29 @@ glabel __osPopThread glabel __osDispatchThread /* 465D4 8006B1D4 3C048009 */ lui $a0, %hi(__osRunQueue) +#ifdef BBPLAYER +/* 41F74 80066B74 64843278 */ daddiu $a0, $a0, %lo(__osRunQueue) +/* 41F78 80066B78 0C019AD6 */ jal __osPopThread +/* 41F7C 80066B7C 00000000 */ nop +#else /* 465D8 8006B1D8 0C01AC6F */ jal __osPopThread /* 465DC 8006B1DC 24844658 */ addiu $a0, $a0, %lo(__osRunQueue) +#endif /* 465E0 8006B1E0 3C018009 */ lui $at, %hi(__osRunningThread) /* 465E4 8006B1E4 AC224660 */ sw $v0, %lo(__osRunningThread)($at) /* 465E8 8006B1E8 24080004 */ addiu $t0, $zero, 4 /* 465EC 8006B1EC A4480010 */ sh $t0, 0x10($v0) +#ifdef BBPLAYER +/* 41F90 80066B90 0040D02D */ daddu $k0, $v0, $zero +/* 41F94 80066B94 8F5B0118 */ lw $k1, 0x118($k0) # handwritten instruction +/* 41F98 80066B98 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) +/* 41F9C 80066B9C 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) +#else /* 465F0 8006B1F0 0040D021 */ addu $k0, $v0, $zero /* 465F4 8006B1F4 8F5B0118 */ lw $k1, 0x118($k0) /* 465F8 8006B1F8 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) /* 465FC 8006B1FC 25085900 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) +#endif /* 46600 8006B200 8D080000 */ lw $t0, ($t0) /* 46604 8006B204 3108FF00 */ andi $t0, $t0, 0xff00 /* 46608 8006B208 3369FF00 */ andi $t1, $k1, 0xff00 @@ -718,13 +945,23 @@ glabel __osDispatchThread .L8006B304: /* 46704 8006B304 8F5B0128 */ lw $k1, 0x128($k0) /* 46708 8006B308 3C1A8009 */ lui $k0, %hi(__OSGlobalIntMask) +#ifdef BBPLAYER +/* 420AC 80066CAC 675A45B4 */ daddiu $k0, $k0, %lo(__OSGlobalIntMask) # handwritten instruction +/* 420B0 80066CB0 8F5A0000 */ lw $k0, 0x0($k0) # handwritten instruction +/* 420B4 80066CB4 001AD402 */ srl $k0, $k0, 16 +/* 420B8 80066CB8 037AD824 */ and $k1, $k1, $k0 +/* 420BC 80066CBC 001BD840 */ sll $k1, $k1, 1 +/* 420C0 80066CC0 3C1A800A */ lui $k0, %hi(__osRcpImTable) # handwritten instruction +/* 420C4 80066CC4 675A8900 */ daddiu $k0, $k0, %lo(__osRcpImTable) # handwritten instruction +#else /* 4670C 8006B30C 275A5900 */ addiu $k0, $k0, %lo(__OSGlobalIntMask) /* 46710 8006B310 8F5A0000 */ lw $k0, ($k0) /* 46714 8006B314 001AD402 */ srl $k0, $k0, 0x10 /* 46718 8006B318 037AD824 */ and $k1, $k1, $k0 /* 4671C 8006B31C 001BD840 */ sll $k1, $k1, 1 -/* 46720 8006B320 3C1A800A */ lui $k0, %hi(D_80099AA0) -/* 46724 8006B324 275A9AA0 */ addiu $k0, $k0, %lo(D_80099AA0) +/* 46720 8006B320 3C1A800A */ lui $k0, %hi(__osRcpImTable) +/* 46724 8006B324 275A9AA0 */ addiu $k0, $k0, %lo(__osRcpImTable) +#endif /* 46728 8006B328 037AD821 */ addu $k1, $k1, $k0 /* 4672C 8006B32C 977B0000 */ lhu $k1, ($k1) /* 46730 8006B330 3C1AA430 */ lui $k0, 0xa430 @@ -737,7 +974,12 @@ glabel __osDispatchThread /* 4674C 8006B34C 42000018 */ eret glabel __osCleanupThread +#ifdef BBPLAYER +/* 420F0 80066CF0 0C01AE38 */ jal osDestroyThread +/* 420F4 80066CF4 0000202D */ daddu $a0, $zero, $zero +#else /* 46750 8006B350 00002021 */ addu $a0, $zero, $zero /* 46754 8006B354 0C01B254 */ jal osDestroyThread +#endif /* 46758 8006B358 00000000 */ nop /* 4675C 8006B35C 00000000 */ nop diff --git a/src/os/flashinit.c b/src/os/flashinit.c index 1f466f4529..086631ec04 100644 --- a/src/os/flashinit.c +++ b/src/os/flashinit.c @@ -2,10 +2,10 @@ #include "PR/os_internal_flash.h" #include "macros.h" -u32 __osFlashID[4] ALIGNED(8); -OSIoMesg __osFlashMsg ALIGNED(8); -OSMesgQueue __osFlashMessageQ ALIGNED(8); -OSPiHandle __osFlashHandler ALIGNED(8); +u32 __osFlashID[4] OSALIGNED(8); +OSIoMesg __osFlashMsg OSALIGNED(8); +OSMesgQueue __osFlashMessageQ OSALIGNED(8); +OSPiHandle __osFlashHandler OSALIGNED(8); OSMesg __osFlashMsgBuf[1]; s32 __osFlashVersion; diff --git a/ver/us/asm/os/guMtxCat.s b/src/os/guMtxCat.s similarity index 100% rename from ver/us/asm/os/guMtxCat.s rename to src/os/guMtxCat.s diff --git a/ver/us/asm/os/guMtxCatF.s b/src/os/guMtxCatF.s similarity index 100% rename from ver/us/asm/os/guMtxCatF.s rename to src/os/guMtxCatF.s diff --git a/ver/us/asm/os/guMtxF2L.s b/src/os/guMtxF2L.s similarity index 100% rename from ver/us/asm/os/guMtxF2L.s rename to src/os/guMtxF2L.s diff --git a/ver/us/asm/os/guMtxIdent.s b/src/os/guMtxIdent.s similarity index 100% rename from ver/us/asm/os/guMtxIdent.s rename to src/os/guMtxIdent.s diff --git a/ver/us/asm/os/guMtxIdentF.s b/src/os/guMtxIdentF.s similarity index 100% rename from ver/us/asm/os/guMtxIdentF.s rename to src/os/guMtxIdentF.s diff --git a/ver/us/asm/os/guMtxL2F.s b/src/os/guMtxL2F.s similarity index 97% rename from ver/us/asm/os/guMtxL2F.s rename to src/os/guMtxL2F.s index 3d217b73e9..a7eed65e5b 100644 --- a/ver/us/asm/os/guMtxL2F.s +++ b/src/os/guMtxL2F.s @@ -22,11 +22,15 @@ glabel guMtxL2F /* 429A8 800675A8 312EFFFF */ andi $t6, $t1, 0xffff /* 429AC 800675AC 01AE7825 */ or $t7, $t5, $t6 /* 429B0 800675B0 448C2000 */ mtc1 $t4, $f4 +#ifndef BBPLAYER /* 429B4 800675B4 00000000 */ nop +#endif /* 429B8 800675B8 468021A0 */ cvt.s.w $f6, $f4 /* 429BC 800675BC 46003202 */ mul.s $f8, $f6, $f0 /* 429C0 800675C0 448F5000 */ mtc1 $t7, $f10 +#ifndef BBPLAYER /* 429C4 800675C4 00000000 */ nop +#endif /* 429C8 800675C8 46805420 */ cvt.s.w $f16, $f10 /* 429CC 800675CC 46008482 */ mul.s $f18, $f16, $f0 /* 429D0 800675D0 E4880000 */ swc1 $f8, ($a0) diff --git a/ver/us/asm/os/guNormalize.s b/src/os/guNormalize.s similarity index 100% rename from ver/us/asm/os/guNormalize.s rename to src/os/guNormalize.s diff --git a/ver/us/asm/os/guScale.s b/src/os/guScale.s similarity index 94% rename from ver/us/asm/os/guScale.s rename to src/os/guScale.s index 3cb3c4d01a..c43659dc5b 100644 --- a/ver/us/asm/os/guScale.s +++ b/src/os/guScale.s @@ -11,32 +11,44 @@ glabel guScale /* 42B00 80067700 3C014780 */ lui $at, 0x4780 /* 42B04 80067704 44812000 */ mtc1 $at, $f4 /* 42B08 80067708 44853000 */ mtc1 $a1, $f6 +#ifndef BBPLAYER /* 42B0C 8006770C 00000000 */ nop +#endif /* 42B10 80067710 46043202 */ mul.s $f8, $f6, $f4 /* 42B14 80067714 4600428D */ trunc.w.s $f10, $f8 /* 42B18 80067718 44095000 */ mfc1 $t1, $f10 +#ifndef BBPLAYER /* 42B1C 8006771C 00000000 */ nop +#endif /* 42B20 80067720 00095402 */ srl $t2, $t1, 0x10 /* 42B24 80067724 000A4400 */ sll $t0, $t2, 0x10 /* 42B28 80067728 AC880000 */ sw $t0, ($a0) /* 42B2C 8006772C 00095400 */ sll $t2, $t1, 0x10 /* 42B30 80067730 AC8A0020 */ sw $t2, 0x20($a0) /* 42B34 80067734 44863000 */ mtc1 $a2, $f6 +#ifndef BBPLAYER /* 42B38 80067738 00000000 */ nop +#endif /* 42B3C 8006773C 46043202 */ mul.s $f8, $f6, $f4 /* 42B40 80067740 4600428D */ trunc.w.s $f10, $f8 /* 42B44 80067744 44095000 */ mfc1 $t1, $f10 +#ifndef BBPLAYER /* 42B48 80067748 00000000 */ nop +#endif /* 42B4C 8006774C 00094402 */ srl $t0, $t1, 0x10 /* 42B50 80067750 AC880008 */ sw $t0, 8($a0) /* 42B54 80067754 312AFFFF */ andi $t2, $t1, 0xffff /* 42B58 80067758 AC8A0028 */ sw $t2, 0x28($a0) /* 42B5C 8006775C 44873000 */ mtc1 $a3, $f6 +#ifndef BBPLAYER /* 42B60 80067760 00000000 */ nop +#endif /* 42B64 80067764 46043202 */ mul.s $f8, $f6, $f4 /* 42B68 80067768 4600428D */ trunc.w.s $f10, $f8 /* 42B6C 8006776C 44095000 */ mfc1 $t1, $f10 +#ifndef BBPLAYER /* 42B70 80067770 00000000 */ nop +#endif /* 42B74 80067774 00095402 */ srl $t2, $t1, 0x10 /* 42B78 80067778 000A4400 */ sll $t0, $t2, 0x10 /* 42B7C 8006777C AC880014 */ sw $t0, 0x14($a0) @@ -54,5 +66,3 @@ glabel guScale /* 42BAC 800677AC AC800038 */ sw $zero, 0x38($a0) /* 42BB0 800677B0 03E00008 */ jr $ra /* 42BB4 800677B4 AC80003C */ sw $zero, 0x3c($a0) -/* 42BB8 800677B8 00000000 */ nop -/* 42BBC 800677BC 00000000 */ nop diff --git a/ver/us/asm/os/guScaleF.s b/src/os/guScaleF.s similarity index 100% rename from ver/us/asm/os/guScaleF.s rename to src/os/guScaleF.s diff --git a/ver/us/asm/os/guTranslate.s b/src/os/guTranslate.s similarity index 91% rename from ver/us/asm/os/guTranslate.s rename to src/os/guTranslate.s index ea346da219..74a963125e 100644 --- a/ver/us/asm/os/guTranslate.s +++ b/src/os/guTranslate.s @@ -11,12 +11,16 @@ glabel guTranslate /* 42C20 80067820 3C014780 */ lui $at, 0x4780 /* 42C24 80067824 44812000 */ mtc1 $at, $f4 /* 42C28 80067828 44853000 */ mtc1 $a1, $f6 +#ifndef BBPLAYER /* 42C2C 8006782C 00000000 */ nop +#endif /* 42C30 80067830 46043202 */ mul.s $f8, $f6, $f4 /* 42C34 80067834 4600428D */ trunc.w.s $f10, $f8 /* 42C38 80067838 44095000 */ mfc1 $t1, $f10 /* 42C3C 8006783C 44863000 */ mtc1 $a2, $f6 +#ifndef BBPLAYER /* 42C40 80067840 00000000 */ nop +#endif /* 42C44 80067844 46043202 */ mul.s $f8, $f6, $f4 /* 42C48 80067848 4600428D */ trunc.w.s $f10, $f8 /* 42C4C 8006784C 440B5000 */ mfc1 $t3, $f10 @@ -31,11 +35,15 @@ glabel guTranslate /* 42C70 80067870 010A4025 */ or $t0, $t0, $t2 /* 42C74 80067874 AC880038 */ sw $t0, 0x38($a0) /* 42C78 80067878 44873000 */ mtc1 $a3, $f6 +#ifndef BBPLAYER /* 42C7C 8006787C 00000000 */ nop +#endif /* 42C80 80067880 46043202 */ mul.s $f8, $f6, $f4 /* 42C84 80067884 4600428D */ trunc.w.s $f10, $f8 /* 42C88 80067888 44095000 */ mfc1 $t1, $f10 +#ifndef BBPLAYER /* 42C8C 8006788C 00000000 */ nop +#endif /* 42C90 80067890 00095402 */ srl $t2, $t1, 0x10 /* 42C94 80067894 000A4400 */ sll $t0, $t2, 0x10 /* 42C98 80067898 25080001 */ addiu $t0, $t0, 1 @@ -64,3 +72,9 @@ glabel guTranslate /* 42CF4 800678F4 AC880008 */ sw $t0, 8($a0) /* 42CF8 800678F8 00000000 */ nop /* 42CFC 800678FC 00000000 */ nop +#ifdef BBPLAYER // spontaneous padding?? +/* 41290 80065E90 00000000 */ nop +/* 41294 80065E94 00000000 */ nop +/* 41298 80065E98 00000000 */ nop +/* 4129C 80065E9C 00000000 */ nop +#endif diff --git a/ver/us/asm/os/guTranslateF.s b/src/os/guTranslateF.s similarity index 96% rename from ver/us/asm/os/guTranslateF.s rename to src/os/guTranslateF.s index d655be338a..679812b67e 100644 --- a/ver/us/asm/os/guTranslateF.s +++ b/src/os/guTranslateF.s @@ -28,7 +28,9 @@ glabel guTranslateF /* 42D44 80067944 AC88003C */ sw $t0, 0x3c($a0) /* 42D48 80067948 00000000 */ nop /* 42D4C 8006794C 00000000 */ nop +#ifndef BBPLAYER // spontaneous padding?? /* 42D50 80067950 00000000 */ nop /* 42D54 80067954 00000000 */ nop /* 42D58 80067958 00000000 */ nop /* 42D5C 8006795C 00000000 */ nop +#endif diff --git a/src/os/motor.c b/src/os/motor.c index 452c5ec7d0..488df2ab8b 100644 --- a/src/os/motor.c +++ b/src/os/motor.c @@ -4,11 +4,7 @@ #include "PR/siint.h" #ifndef BBPLAYER -/* -static OSPifRam __MotorDataBuf[MAXCONTROLLERS] ALIGNED(8); -*/ - -extern OSPifRam __MotorDataBuf[MAXCONTROLLERS]; +static OSPifRam __MotorDataBuf[MAXCONTROLLERS] OSALIGNED(8); #endif #define READFORMAT(ptr) ((__OSContRamReadFormat*)(ptr)) diff --git a/src/os/nusys/nuboot.c b/src/os/nusys/nuboot.c index 1e9f03c03c..8220035dbe 100644 --- a/src/os/nusys/nuboot.c +++ b/src/os/nusys/nuboot.c @@ -5,10 +5,12 @@ NOP_FIX -SHIFT_BSS u64 nuMainStack[NU_SC_STACK_SIZE / sizeof(u64)]; -SHIFT_BSS u64 IdleStack[NU_SC_STACK_SIZE / sizeof(u64)]; -SHIFT_BSS OSThread IdleThread; // idle thread, id 1 -SHIFT_BSS OSThread MainThread; // id 3 +u64 nuMainStack[NU_SC_STACK_SIZE / sizeof(u64)]; +static OSThread IdleThread; // idle thread, id 1 +static OSThread MainThread; // id 3 +static u64 IdleStack[NU_SC_STACK_SIZE / sizeof(u64)]; + +void (*nuIdleFunc)(void); void nuBoot(void) { osInitialize(); diff --git a/src/os/nusys/nucontmgr.c b/src/os/nusys/nucontmgr.c index 028694dd0f..176cefea6b 100644 --- a/src/os/nusys/nucontmgr.c +++ b/src/os/nusys/nucontmgr.c @@ -3,6 +3,17 @@ NOP_FIX +OSMesgQueue nuContWaitMesgQ; +static OSMesg nuContWaitMesgBuf; +OSMesgQueue nuContDataMutexQ; +static OSMesg nuContDataMutexBuf; +OSContStatus nuContStatus[NU_CONT_MAXCONTROLLERS]; +OSContPad nuContData[NU_CONT_MAXCONTROLLERS]; +u32 nuContNum; +u32 nuContDataLockKey; + +OSPfs nuContPfs[NU_CONT_MAXCONTROLLERS]; + static s32 contRetrace(NUSiCommonMesg* mesg); static s32 contRead(NUSiCommonMesg* mesg); static s32 contReadNW(NUSiCommonMesg* mesg); @@ -21,10 +32,6 @@ static s32 (*funcList[])(NUSiCommonMesg*) = { NUCallBackList nuContCallBack = { NULL, funcList, NU_SI_MAJOR_NO_CONT }; -extern OSMesg nuContWaitMesgBuf; -extern OSMesg nuContDataMutexBuf; -extern OSMesgQueue nuContDataMutexQ; - u8 nuContMgrInit(void) { s32 i; u8 pattern; diff --git a/src/os/nusys/nucontrmbmgr.c b/src/os/nusys/nucontrmbmgr.c index d57f9d42c2..c0b0169c53 100644 --- a/src/os/nusys/nucontrmbmgr.c +++ b/src/os/nusys/nucontrmbmgr.c @@ -1,6 +1,9 @@ #include "common.h" #include "nu/nusys.h" +NUContRmbCtl nuContRmbCtl[NU_CONT_MAXCONTROLLERS]; +u32 nuContRmbSearchTime = NU_CONT_RMB_AUTO_SEARCHTIME; + s32 contRmbRetrace(NUSiCommonMesg* mesg); s32 contRmbCheckMesg(NUSiCommonMesg* mesg); s32 contRmbStartMesg(NUSiCommonMesg* mesg); @@ -8,8 +11,6 @@ s32 contRmbStopMesg(NUSiCommonMesg* mesg); s32 contRmbForceStopMesg(NUSiCommonMesg* mesg); s32 contRmbForceStopEndMesg(NUSiCommonMesg* mesg); -u32 nuContRmbSearchTime = 300; - s32 (*D_80093CE4[])(NUSiCommonMesg*) = { contRmbRetrace, contRmbCheckMesg, contRmbStartMesg, contRmbStopMesg, contRmbForceStopMesg, contRmbForceStopEndMesg, NULL diff --git a/src/os/nusys/nugfxtaskmgr.c b/src/os/nusys/nugfxtaskmgr.c index d8b65eefe1..16e3284ed6 100644 --- a/src/os/nusys/nugfxtaskmgr.c +++ b/src/os/nusys/nugfxtaskmgr.c @@ -6,18 +6,25 @@ NUGfxSwapCfbFunc nuGfxSwapCfbFunc = NULL; NUGfxTaskEndFunc nuGfxTaskEndFunc = NULL; u16 beforeFlag = 0; -extern OSMesg D_8009E6D0[NU_GFX_TASKMGR_MESGS]; -extern OSMesgQueue D_800DAC90; -extern NUScTask* nuGfxTask_ptr; -extern s16 taskDoneMsg; -extern s16 swapBufMsg; -extern OSThread GfxTaskMgrThread; -extern NUScTask nuGfxTask[NU_GFX_TASK_NUM]; -extern s32 D_800DA040; -extern s32 D_800B91D0[NU_GFX_RDP_OUTPUTBUFF_SIZE / sizeof(u32)]; -extern u64 GfxTaskMgrStack[NU_GFX_TASKMGR_STACK_SIZE / sizeof(u64)]; +static NUScTask* nuGfxTask_ptr; +static s16 taskDoneMsg; +static s16 swapBufMsg; +static OSThread GfxTaskMgrThread; +static u64 GfxTaskMgrStack[NU_GFX_TASKMGR_STACK_SIZE / sizeof(u64)] ALIGNED(16); +static OSMesg D_8009E6D0[NU_GFX_TASKMGR_MESGS]; + +NUScTask nuGfxTask[NU_GFX_TASK_NUM]; +u64 D_800DA040[0x400 / sizeof(u64)]; +s32 D_800B91D0[NU_GFX_RDP_OUTPUTBUFF_SIZE / sizeof(u32)]; + extern u8 rspbootUcodeBuffer[]; +u32 nuGfxCfbCounter; +u32 nuGfxDisplay; +NUUcode* nuGfxUcode; +volatile u32 nuGfxTaskSpool; +OSMesgQueue D_800DAC90; + void nuGfxTaskMgr(void* data) { NUScTask* task; s16* msg; diff --git a/src/os/nusys/nugfxthread.c b/src/os/nusys/nugfxthread.c index bdd21a4860..dbc5dac5df 100644 --- a/src/os/nusys/nugfxthread.c +++ b/src/os/nusys/nugfxthread.c @@ -5,10 +5,11 @@ void gfxThread(void*); NUGfxFunc nuGfxFunc = NULL; NUGfxPreNMIFunc nuGfxPreNMIFunc = NULL; +OSMesgQueue nuGfxMesgQ; +static OSMesg nuGfxMesgBuf[NU_GFX_MESGS]; +static char GfxStack[NU_GFX_STACK_SIZE]; -extern char GfxStack[NU_GFX_STACK_SIZE]; -extern OSThread D_800B1B90; -extern OSMesg nuGfxMesgBuf[NU_GFX_MESGS]; +OSThread D_800B1B90; void nuGfxThreadStart(void) { osCreateThread(&D_800B1B90, 4, gfxThread, NULL, &GfxStack[NU_GFX_STACK_SIZE], NU_GFX_THREAD_PRI); diff --git a/src/os/nusys/nupiinit.c b/src/os/nusys/nupiinit.c index 93846f4db1..a95d5f3182 100644 --- a/src/os/nusys/nupiinit.c +++ b/src/os/nusys/nupiinit.c @@ -1,8 +1,9 @@ #include "common.h" #include "nu/nusys.h" -extern OSMesgQueue D_800AC5D0; -extern OSMesg D_800AC5E8[NU_PI_MESG_NUM]; +static OSMesgQueue D_800AC5D0; +static OSMesg D_800AC5E8[NU_PI_MESG_NUM]; +OSPiHandle* nuPiCartHandle; void nuPiInit(void) { osCreatePiManager(OS_PRIORITY_PIMGR, &D_800AC5D0, D_800AC5E8, NU_PI_MESG_NUM); diff --git a/src/os/nusys/nusched.c b/src/os/nusys/nusched.c index a93753d81f..991bafa235 100644 --- a/src/os/nusys/nusched.c +++ b/src/os/nusys/nusched.c @@ -3,11 +3,13 @@ NOP_FIX +NUSched nusched; NUScPreNMIFunc nuScPreNMIFunc = NULL; +u8 nuScPreNMIFlag; char nusys_version[] = "NuSystem2.05"; -u32 nuScRetraceCounter = (u32) nusys_version; // wtf? +u32 nuScRetraceCounter = (u32) nusys_version; void nuScEventHandler(void); void nuScExecuteAudio(void); @@ -15,9 +17,9 @@ void nuScExecuteGraphics(void); void nuScEventBroadcast(NUScMsg* msg); void nuScWaitTaskReady(NUScTask* task); -extern u64 nuScStack[NU_SC_STACK_SIZE / sizeof(u64)]; -extern u64 nuScAudioStack[NU_SC_STACK_SIZE / sizeof(u64)]; -extern u64 nuScGraphicsStack[NU_SC_STACK_SIZE / sizeof(u64)]; +static u64 nuScStack[NU_SC_STACK_SIZE / sizeof(u64)]; +static u64 nuScAudioStack[NU_SC_STACK_SIZE / sizeof(u64)]; +static u64 nuScGraphicsStack[NU_SC_STACK_SIZE / sizeof(u64)]; void nuScCreateScheduler(u8 videoMode, u8 numFields) { nusched.curGraphicsTask = NULL; diff --git a/src/os/nusys/nusimgr.c b/src/os/nusys/nusimgr.c index 616cd20b7e..c0244eace7 100644 --- a/src/os/nusys/nusimgr.c +++ b/src/os/nusys/nusimgr.c @@ -1,15 +1,15 @@ #include "common.h" #include "nu/nusys.h" +OSMesgQueue nuSiMesgQ; +static OSMesg nuSiMesgBuf[8]; +static OSThread siMgrThread; +static u64 siMgrStack[NU_SI_STACK_SIZE/sizeof(u64)]; +OSMesgQueue nuSiMgrMesgQ; NUCallBackList* nuSiCallBackList = NULL; -extern OSMesg nuSiMesgBuf[8]; -extern OSThread siMgrThread; - static void nuSiMgrThread(void* arg); -extern u64 siMgrStack[NU_SI_STACK_SIZE/sizeof(u64)]; - #if !VERSION_JP && !VERSION_IQUE u8 nuSiMgrInit(void) { u8 pattern; diff --git a/src/os/osFlash.c b/src/os/osFlash.c index 0e6ee1cc85..e22cdb076e 100644 --- a/src/os/osFlash.c +++ b/src/os/osFlash.c @@ -2,12 +2,12 @@ #include "PR/os_flash.h" // BSS -extern u32 __osFlashID[4]; -extern OSIoMesg __osFlashMsg; -extern OSMesgQueue __osFlashMessageQ; -extern OSPiHandle __osFlashHandler; -extern OSMesg __osFlashMsgBuf; -extern s32 __osFlashVersion; +u32 __osFlashID[4]; +OSIoMesg __osFlashMsg; +OSMesgQueue __osFlashMessageQ; +OSPiHandle __osFlashHandler; +OSMesg __osFlashMsgBuf; +s32 __osFlashVersion; OSPiHandle* osFlashReInit(u8 latency, u8 pulse, u8 page_size, u8 rel_duration, u32 start) { __osFlashHandler.baseAddress = PHYS_TO_K1(start); diff --git a/ver/us/asm/os/osGetCount.s b/src/os/osGetCount.s similarity index 100% rename from ver/us/asm/os/osGetCount.s rename to src/os/osGetCount.s diff --git a/ver/us/asm/os/osInvalDCache.s b/src/os/osInvalDCache.s similarity index 96% rename from ver/us/asm/os/osInvalDCache.s rename to src/os/osInvalDCache.s index ace5b3679c..6105c8ecb2 100644 --- a/ver/us/asm/os/osInvalDCache.s +++ b/src/os/osInvalDCache.s @@ -14,7 +14,11 @@ glabel osInvalDCache /* 3CB2C 8006172C 00AB082B */ sltu $at, $a1, $t3 /* 3CB30 80061730 1020001E */ beqz $at, .L800617AC /* 3CB34 80061734 00000000 */ nop +#ifdef BBPLAYER +/* 3B8E8 800604E8 0080402D */ daddu $t0, $a0, $zero +#else /* 3CB38 80061738 00804021 */ addu $t0, $a0, $zero +#endif /* 3CB3C 8006173C 00854821 */ addu $t1, $a0, $a1 /* 3CB40 80061740 0109082B */ sltu $at, $t0, $t1 /* 3CB44 80061744 10200017 */ beqz $at, .L800617A4 diff --git a/ver/us/asm/os/osInvalICache.s b/src/os/osInvalICache.s similarity index 95% rename from ver/us/asm/os/osInvalICache.s rename to src/os/osInvalICache.s index cdc52d4d6c..15f91b94ec 100644 --- a/ver/us/asm/os/osInvalICache.s +++ b/src/os/osInvalICache.s @@ -14,7 +14,11 @@ glabel osInvalICache /* 3CBDC 800617DC 00AB082B */ sltu $at, $a1, $t3 /* 3CBE0 800617E0 1020000F */ beqz $at, .L80061820 /* 3CBE4 800617E4 00000000 */ nop +#ifdef BBPLAYER +/* 3B998 80060598 0080402D */ daddu $t0, $a0, $zero +#else /* 3CBE8 800617E8 00804021 */ addu $t0, $a0, $zero +#endif /* 3CBEC 800617EC 00854821 */ addu $t1, $a0, $a1 /* 3CBF0 800617F0 0109082B */ sltu $at, $t0, $t1 /* 3CBF4 800617F4 10200008 */ beqz $at, .L80061818 diff --git a/ver/us/asm/os/osMapTLB.s b/src/os/osMapTLB.s similarity index 100% rename from ver/us/asm/os/osMapTLB.s rename to src/os/osMapTLB.s diff --git a/ver/us/asm/os/osMapTLBRdb.s b/src/os/osMapTLBRdb.s similarity index 100% rename from ver/us/asm/os/osMapTLBRdb.s rename to src/os/osMapTLBRdb.s diff --git a/ver/us/asm/os/osSetIntMask.s b/src/os/osSetIntMask.s similarity index 61% rename from ver/us/asm/os/osSetIntMask.s rename to src/os/osSetIntMask.s index 9bd7ce8b6c..eb16a00e65 100644 --- a/ver/us/asm/os/osSetIntMask.s +++ b/src/os/osSetIntMask.s @@ -7,8 +7,72 @@ .section .rodata -dlabel D_80099AA0 -.short 0x0555, 0x0556, 0x0559, 0x055A, 0x0565, 0x0566, 0x0569, 0x056A, 0x0595, 0x0596, 0x0599, 0x059A, 0x05A5, 0x05A6, 0x05A9, 0x05AA, 0x0655, 0x0656, 0x0659, 0x065A, 0x0665, 0x0666, 0x0669, 0x066A, 0x0695, 0x0696, 0x0699, 0x069A, 0x06A5, 0x06A6, 0x06A9, 0x06AA, 0x0955, 0x0956, 0x0959, 0x095A, 0x0965, 0x0966, 0x0969, 0x096A, 0x0995, 0x0996, 0x0999, 0x099A, 0x09A5, 0x09A6, 0x09A9, 0x09AA, 0x0A55, 0x0A56, 0x0A59, 0x0A5A, 0x0A65, 0x0A66, 0x0A69, 0x0A6A, 0x0A95, 0x0A96, 0x0A99, 0x0A9A, 0x0AA5, 0x0AA6, 0x0AA9, 0x0AAA +dlabel __osRcpImTable + .short 0x0555 + .short 0x0556 + .short 0x0559 + .short 0x055A + .short 0x0565 + .short 0x0566 + .short 0x0569 + .short 0x056A + .short 0x0595 + .short 0x0596 + .short 0x0599 + .short 0x059A + .short 0x05A5 + .short 0x05A6 + .short 0x05A9 + .short 0x05AA + .short 0x0655 + .short 0x0656 + .short 0x0659 + .short 0x065A + .short 0x0665 + .short 0x0666 + .short 0x0669 + .short 0x066A + .short 0x0695 + .short 0x0696 + .short 0x0699 + .short 0x069A + .short 0x06A5 + .short 0x06A6 + .short 0x06A9 + .short 0x06AA + .short 0x0955 + .short 0x0956 + .short 0x0959 + .short 0x095A + .short 0x0965 + .short 0x0966 + .short 0x0969 + .short 0x096A + .short 0x0995 + .short 0x0996 + .short 0x0999 + .short 0x099A + .short 0x09A5 + .short 0x09A6 + .short 0x09A9 + .short 0x09AA + .short 0x0A55 + .short 0x0A56 + .short 0x0A59 + .short 0x0A5A + .short 0x0A65 + .short 0x0A66 + .short 0x0A69 + .short 0x0A6A + .short 0x0A95 + .short 0x0A96 + .short 0x0A99 + .short 0x0A9A + .short 0x0AA5 + .short 0x0AA6 + .short 0x0AA9 + .short 0x0AAA +.size __osRcpImTable, . - __osRcpImTable .section .text, "ax" @@ -18,7 +82,12 @@ glabel osSetIntMask /* 3BD48 80060948 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) /* 3BD4C 8006094C 25085900 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) /* 3BD50 80060950 8D0B0000 */ lw $t3, ($t0) +#ifdef BBPLAYER +/* 421A4 80066DA4 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) +/* 421A8 80066DA8 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) +#else /* 3BD54 80060954 2401FFFF */ addiu $at, $zero, -1 +#endif /* 3BD58 80060958 01614026 */ xor $t0, $t3, $at /* 3BD5C 8006095C 3108FF00 */ andi $t0, $t0, 0xff00 /* 3BD60 80060960 00481025 */ or $v0, $v0, $t0 @@ -26,7 +95,12 @@ glabel osSetIntMask /* 3BD68 80060968 8D4A000C */ lw $t2, %lo(D_A430000C)($t2) /* 3BD6C 8006096C 11400005 */ beqz $t2, .L80060984 /* 3BD70 80060970 000B4C02 */ srl $t1, $t3, 0x10 +#ifdef BBPLAYER +/* 421C8 80066DC8 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) +/* 421CC 80066DCC 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) +#else /* 3BD74 80060974 2401FFFF */ addiu $at, $zero, -1 +#endif /* 3BD78 80060978 01214826 */ xor $t1, $t1, $at /* 3BD7C 8006097C 3129003F */ andi $t1, $t1, 0x3f /* 3BD80 80060980 01495025 */ or $t2, $t2, $t1 @@ -37,9 +111,9 @@ glabel osSetIntMask /* 3BD90 80060990 00814024 */ and $t0, $a0, $at /* 3BD94 80060994 010B4024 */ and $t0, $t0, $t3 /* 3BD98 80060998 000843C2 */ srl $t0, $t0, 0xf -/* 3BD9C 8006099C 3C0A800A */ lui $t2, %hi(D_80099AA0) +/* 3BD9C 8006099C 3C0A800A */ lui $t2, %hi(__osRcpImTable) /* 3BDA0 800609A0 01485021 */ addu $t2, $t2, $t0 -/* 3BDA4 800609A4 954A9AA0 */ lhu $t2, %lo(D_80099AA0)($t2) +/* 3BDA4 800609A4 954A9AA0 */ lhu $t2, %lo(__osRcpImTable)($t2) /* 3BDA8 800609A8 3C01A430 */ lui $at, %hi(D_A430000C) /* 3BDAC 800609AC AC2A000C */ sw $t2, %lo(D_A430000C)($at) /* 3BDB0 800609B0 3088FF01 */ andi $t0, $a0, 0xff01 diff --git a/ver/us/asm/os/osUnmapTLB.s b/src/os/osUnmapTLB.s similarity index 100% rename from ver/us/asm/os/osUnmapTLB.s rename to src/os/osUnmapTLB.s diff --git a/ver/us/asm/os/osUnmapTLBAll.s b/src/os/osUnmapTLBAll.s similarity index 100% rename from ver/us/asm/os/osUnmapTLBAll.s rename to src/os/osUnmapTLBAll.s diff --git a/ver/us/asm/os/osWritebackDCache.s b/src/os/osWritebackDCache.s similarity index 95% rename from ver/us/asm/os/osWritebackDCache.s rename to src/os/osWritebackDCache.s index c179717552..d73432af59 100644 --- a/ver/us/asm/os/osWritebackDCache.s +++ b/src/os/osWritebackDCache.s @@ -14,7 +14,11 @@ glabel osWritebackDCache /* 3CC5C 8006185C 00AB082B */ sltu $at, $a1, $t3 /* 3CC60 80061860 1020000F */ beqz $at, .L800618A0 /* 3CC64 80061864 00000000 */ nop +#ifdef BBPLAYER +/* 3BA18 80060618 0080402D */ daddu $t0, $a0, $zero +#else /* 3CC68 80061868 00804021 */ addu $t0, $a0, $zero +#endif /* 3CC6C 8006186C 00854821 */ addu $t1, $a0, $a1 /* 3CC70 80061870 0109082B */ sltu $at, $t0, $t1 /* 3CC74 80061874 10200008 */ beqz $at, .L80061898 diff --git a/ver/us/asm/os/osWritebackDCacheAll.s b/src/os/osWritebackDCacheAll.s similarity index 100% rename from ver/us/asm/os/osWritebackDCacheAll.s rename to src/os/osWritebackDCacheAll.s diff --git a/ver/ique/asm/os/padding.s b/src/os/padding.s similarity index 100% rename from ver/ique/asm/os/padding.s rename to src/os/padding.s diff --git a/ver/jp/asm/os/padding_alt.s b/src/os/padding_alt.s similarity index 100% rename from ver/jp/asm/os/padding_alt.s rename to src/os/padding_alt.s diff --git a/ver/ique/asm/os/parameters.s b/src/os/parameters.s similarity index 97% rename from ver/ique/asm/os/parameters.s rename to src/os/parameters.s index 9c6fbf3c30..c3d2e3b7b2 100644 --- a/ver/ique/asm/os/parameters.s +++ b/src/os/parameters.s @@ -34,7 +34,7 @@ osMemSize = 0x80000318 .globl osAppNMIBuffer osAppNMIBuffer = 0x8000031C - +#ifdef BBPLAYER .globl __osBbEepromAddress __osBbEepromAddress = 0x8000035c @@ -81,3 +81,6 @@ __osBbStateDirty = 0x800003b4 __osBbAuxDataLimit = 0x800003b8 .fill 0x70 +#else +.fill 0x60 +#endif diff --git a/src/os/piacs.c b/src/os/piacs.c index f0e079cdd6..d1c6e14f09 100644 --- a/src/os/piacs.c +++ b/src/os/piacs.c @@ -1,9 +1,10 @@ +#include "macros.h" #include "PR/os_internal.h" #define PI_Q_BUF_LEN 1 u32 __osPiAccessQueueEnabled = 0; -extern OSMesg piAccessBuf[PI_Q_BUF_LEN]; -extern OSMesgQueue __osPiAccessQueue; +static OSMesg piAccessBuf[PI_Q_BUF_LEN]; +OSMesgQueue __osPiAccessQueue OSALIGNED(8); void __osPiCreateAccessQueue(void) { __osPiAccessQueueEnabled = 1; diff --git a/src/os/pimgr.c b/src/os/pimgr.c index 813beb494e..ef97edec44 100644 --- a/src/os/pimgr.c +++ b/src/os/pimgr.c @@ -4,25 +4,17 @@ #include "PR/piint.h" #include "PR/rdb.h" -extern OSThread piThread; -extern char piThreadStack[OS_PIM_STACKSIZE]; +static OSThread piThread OSALIGNED(8); +static char piThreadStack[OS_PIM_STACKSIZE] OSALIGNED(16); -extern OSMesgQueue piEventQueue; -extern OSMesg piEventBuf[1]; - -/* -static OSThread piThread ALIGNED(8); -static char piThreadStack[OS_PIM_STACKSIZE] ALIGNED(16); - -static OSMesgQueue piEventQueue ALIGNED(8); +static OSMesgQueue piEventQueue OSALIGNED(8); static OSMesg piEventBuf[1]; -*/ OSDevMgr __osPiDevMgr = { 0 }; OSPiHandle* __osPiTable = NULL; -OSPiHandle __Dom1SpeedParam ALIGNED(8); -OSPiHandle __Dom2SpeedParam ALIGNED(8); -OSPiHandle* __osCurrentHandle[2] ALIGNED(8) = { &__Dom1SpeedParam, &__Dom2SpeedParam }; +OSPiHandle __Dom1SpeedParam OSALIGNED(8); +OSPiHandle __Dom2SpeedParam OSALIGNED(8); +OSPiHandle* __osCurrentHandle[2] OSALIGNED(8) = { &__Dom1SpeedParam, &__Dom2SpeedParam }; void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt) { u32 savedMask; diff --git a/src/os/seteventmesg.c b/src/os/seteventmesg.c index b0156d7308..c0a633b3b1 100644 --- a/src/os/seteventmesg.c +++ b/src/os/seteventmesg.c @@ -1,5 +1,7 @@ +#include "macros.h" #include +__OSEventState __osEventStateTab[OS_NUM_EVENTS] OSALIGNED(8); u32 __osPreNMI = 0; void osSetEventMesg(OSEvent event, OSMesgQueue *mq, OSMesg msg) { diff --git a/ver/us/asm/os/setfpccsr.s b/src/os/setfpccsr.s similarity index 100% rename from ver/us/asm/os/setfpccsr.s rename to src/os/setfpccsr.s diff --git a/ver/us/asm/os/setsr.s b/src/os/setsr.s similarity index 100% rename from ver/us/asm/os/setsr.s rename to src/os/setsr.s diff --git a/src/os/siacs.c b/src/os/siacs.c index e288f0cbff..d49970c81c 100644 --- a/src/os/siacs.c +++ b/src/os/siacs.c @@ -1,10 +1,11 @@ +#include "macros.h" #include #define SI_Q_BUF_LEN 1 u32 __osSiAccessQueueEnabled = 0; -extern OSMesg siAccessBuf[SI_Q_BUF_LEN]; -extern OSMesgQueue __osSiAccessQueue; +static OSMesg siAccessBuf[SI_Q_BUF_LEN] OSALIGNED(8); +OSMesgQueue __osSiAccessQueue OSALIGNED(8); void __osSiCreateAccessQueue(void) { __osSiAccessQueueEnabled = 1; diff --git a/ver/ique/asm/os/skapi.s b/src/os/skapi.s similarity index 100% rename from ver/ique/asm/os/skapi.s rename to src/os/skapi.s diff --git a/src/os/sptask.c b/src/os/sptask.c index 2862a87ec9..ed900e721e 100644 --- a/src/os/sptask.c +++ b/src/os/sptask.c @@ -9,7 +9,7 @@ ptr = (void *)osVirtualToPhysical(ptr); \ } -extern OSTask tmp_task; +static OSTask tmp_task; #if VERSION_IQUE static OSTask* _VirtualToPhysicalTask(OSTask* intp) { diff --git a/src/os/vi.c b/src/os/vi.c index 4b97c4ac5c..0006055a4e 100644 --- a/src/os/vi.c +++ b/src/os/vi.c @@ -7,7 +7,7 @@ #include "PR/rcp.h" #include "PR/viint.h" -static __OSViContext vi[2] ALIGNED(8) = {{0}, {0}}; +static __OSViContext vi[2] OSALIGNED(8) = {{0}, {0}}; __OSViContext *__osViCurr = &vi[0]; __OSViContext *__osViNext = &vi[1]; diff --git a/src/os/vimgr.c b/src/os/vimgr.c index 73f9e1809b..d04ae0a1c1 100644 --- a/src/os/vimgr.c +++ b/src/os/vimgr.c @@ -7,12 +7,12 @@ OSDevMgr __osViDevMgr = {0}; u32 __additional_scanline = 0; -extern OSThread viThread; -extern unsigned char viThreadStack[OS_VIM_STACKSIZE] ALIGNED(16); -extern OSMesgQueue viEventQueue; -extern OSMesg viEventBuf[5] ALIGNED(8); -extern OSIoMesg viRetraceMsg ALIGNED(8); -extern OSIoMesg viCounterMsg ALIGNED(8); +static OSThread viThread; +static unsigned char viThreadStack[OS_VIM_STACKSIZE] OSALIGNED(16); +static OSMesgQueue viEventQueue OSALIGNED(8); +static OSMesg viEventBuf[5] OSALIGNED(8); +static OSIoMesg viRetraceMsg OSALIGNED(8); +static OSIoMesg viCounterMsg OSALIGNED(8); static void viMgrMain(void *arg); @@ -64,13 +64,11 @@ void osCreateViManager(OSPri pri) { } } -extern u16 retrace; - static void viMgrMain(void *arg) { __OSViContext *vc; OSDevMgr *dm; OSIoMesg *mb; - //static u16 retrace; + static u16 retrace; s32 first; u32 count; diff --git a/src/screen_overlays.c b/src/screen_overlays.c index 5627d7ba17..797cb72323 100644 --- a/src/screen_overlays.c +++ b/src/screen_overlays.c @@ -2,12 +2,12 @@ #include "overlay.h" #include "include_asset.h" -SHIFT_BSS s32 screen_overlay_frontType; -SHIFT_BSS f32 screen_overlay_frontZoom; -SHIFT_BSS s32 screen_overlay_backType; -SHIFT_BSS f32 screen_overlay_backZoom; -SHIFT_BSS s32 D_80156910; -SHIFT_BSS ScreenOverlay ScreenOverlays[2]; +BSS s32 screen_overlay_frontType; +BSS f32 screen_overlay_frontZoom; +BSS s32 screen_overlay_backType; +BSS f32 screen_overlay_backZoom; +BSS s32 D_80156910; +ScreenOverlay ScreenOverlays[2]; ScreenTransition CurrentScreenTransition = TRANSITION_END_DEMO_SCENE_BLACK; diff --git a/src/sprite_shading.c b/src/sprite_shading.c index 4cf98bb499..6a826adac4 100644 --- a/src/sprite_shading.c +++ b/src/sprite_shading.c @@ -2,13 +2,14 @@ #include "sprite.h" #include "nu/nusys.h" -SHIFT_BSS SpriteShadingProfile* gSpriteShadingProfile; -SHIFT_BSS SpriteShadingProfile wSpriteShadingProfile; -SHIFT_BSS SpriteShadingProfile bSpriteShadingProfile; -SHIFT_BSS SpriteShadingProfile wSpriteShadingProfileAux; -SHIFT_BSS SpriteShadingProfile bSpriteShadingProfileAux; -SHIFT_BSS SpriteShadingProfile* gAuxSpriteShadingProfile; -SHIFT_BSS PAL_BIN SpriteShadingPalette[16]; +SpriteShadingProfile* gSpriteShadingProfile; +SpriteShadingProfile* gAuxSpriteShadingProfile; + +BSS SpriteShadingProfile wSpriteShadingProfile; +BSS SpriteShadingProfile bSpriteShadingProfile; +BSS SpriteShadingProfile wSpriteShadingProfileAux; +BSS SpriteShadingProfile bSpriteShadingProfileAux; +BSS PAL_BIN SpriteShadingPalette[16]; void appendGfx_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s32 alpha, f32 shadowX, f32 shadowY, f32 shadowZ, diff --git a/src/state_battle.c b/src/state_battle.c index c75fbd0807..d0c4d91402 100644 --- a/src/state_battle.c +++ b/src/state_battle.c @@ -19,9 +19,9 @@ s32 D_800778AC[] = { 0x00000000, 0xFFFFFF00, 0xFFFFFF00, 0x00000000, 0x00000000 }; -SHIFT_BSS s8 D_800A0900; -SHIFT_BSS s32 D_800A0904; -SHIFT_BSS s32 D_800A0908; +BSS s8 D_800A0900; +BSS s32 D_800A0904; +BSS s32 D_800A0908; #if defined(SHIFT) || VERSION_IQUE #define shim_battle_heap_create_obfuscated battle_heap_create diff --git a/src/state_file_select.c b/src/state_file_select.c index 0a6a82fcd5..010c9d3bfb 100644 --- a/src/state_file_select.c +++ b/src/state_file_select.c @@ -42,9 +42,9 @@ u8 IntroMessageIdx = 0; extern s32 D_80200000; extern ShapeFile gMapShapeData; -SHIFT_BSS s8 D_800A0930; -SHIFT_BSS s8 D_800A0931; -SHIFT_BSS s16 D_800A0932[1]; +BSS s8 D_800A0930; +BSS s8 D_800A0931; +static s16 D_800A0932[1]; // TODO any possible workaround to make this visible? void state_init_language_select(void) { D_800A0931 = 0; diff --git a/src/state_intro.c b/src/state_intro.c index a2de9ad898..427da19607 100644 --- a/src/state_intro.c +++ b/src/state_intro.c @@ -12,15 +12,15 @@ enum IntroStates { INTRO_ENABLE_DRAW_FRAME = 0x00000015, // unused }; -SHIFT_BSS s32 IntroEnableDrawFrameDelay; -SHIFT_BSS s16 IntroOverlayAlpha; -SHIFT_BSS s16 IntroFrontFadeAlpha; -SHIFT_BSS s16 IntroOverlayDelta; -SHIFT_BSS s16 IntroFadeColorR; -SHIFT_BSS s16 IntroFadeColorG; -SHIFT_BSS s16 IntroFadeColorB; -SHIFT_BSS s32 IntroOverlayType; -SHIFT_BSS s32 D_800A0964; // related to skipping the intro +BSS s32 IntroEnableDrawFrameDelay; +BSS s16 IntroOverlayAlpha; +BSS s16 IntroFrontFadeAlpha; +BSS s16 IntroOverlayDelta; +BSS s16 IntroFadeColorR; +BSS s16 IntroFadeColorG; +BSS s16 IntroFadeColorB; +BSS s32 IntroOverlayType; +BSS s32 D_800A0964; // related to skipping the intro void state_init_intro(void) { s8 viewportMode; diff --git a/src/state_logos.c b/src/state_logos.c index 6198540b54..f09e28e39e 100644 --- a/src/state_logos.c +++ b/src/state_logos.c @@ -57,10 +57,10 @@ Gfx D_80077908[] = { gsSPEndDisplayList(), }; -SHIFT_BSS u8* gLogosImages; -SHIFT_BSS u8* gLogosImage3; -SHIFT_BSS u8* gLogosImage1; -SHIFT_BSS u8* gLogosImage2; +BSS u8* gLogosImages; +BSS u8* gLogosImage3; +BSS u8* gLogosImage1; +BSS u8* gLogosImage2; void state_init_logos(void) { s8* romStart; diff --git a/src/state_pause.c b/src/state_pause.c index 7c0539c214..295f7ecd18 100644 --- a/src/state_pause.c +++ b/src/state_pause.c @@ -39,10 +39,10 @@ NUPiOverlaySegment D_8007795C = { .bssEnd = pause_BSS_END, }; -SHIFT_BSS s8 StepPauseDelay; -SHIFT_BSS s8 StepPauseState; -SHIFT_BSS s16 StepPauseAlpha; // effectively unused, always zero -SHIFT_BSS s32 SavedReverbMode; +BSS s8 StepPauseDelay; +BSS s8 StepPauseState; +BSS s16 StepPauseAlpha; // effectively unused, always zero +BSS s32 SavedReverbMode; void state_init_pause(void) { StepPauseState = 0; diff --git a/src/state_title_screen.c b/src/state_title_screen.c index 4d2b41dbd0..18459bce4a 100644 --- a/src/state_title_screen.c +++ b/src/state_title_screen.c @@ -98,15 +98,13 @@ typedef struct TitleDataStruct { #define COPYRIGHT_WIDTH 144 #endif -SHIFT_BSS s16 TitleScreen_AppearDelay; -SHIFT_BSS TitleDataStruct* TitleScreen_ImgList; -SHIFT_BSS s32* TitleScreen_ImgList_Logo; -SHIFT_BSS u8 (*TitleScreen_ImgList_Copyright)[COPYRIGHT_WIDTH]; -SHIFT_BSS s32* TitleScreen_ImgList_PressStart; -#if VERSION_JP -SHIFT_BSS s32* TitleScreen_ImgList_CopyrightPalette; -#endif -SHIFT_BSS s16 TitleScreen_TimeLeft; +BSS s16 TitleScreen_AppearDelay; +BSS TitleDataStruct* TitleScreen_ImgList; +BSS s32* TitleScreen_ImgList_Logo; +BSS u8 (*TitleScreen_ImgList_Copyright)[COPYRIGHT_WIDTH]; +BSS s32* TitleScreen_ImgList_PressStart; +BSS s32* TitleScreen_ImgList_CopyrightPalette; +BSS s16 TitleScreen_TimeLeft; void appendGfx_title_screen(void); void draw_title_screen_NOP(void); diff --git a/src/status_icons.c b/src/status_icons.c index a24b13e4a9..78b241af3b 100644 --- a/src/status_icons.c +++ b/src/status_icons.c @@ -80,9 +80,9 @@ s32 D_80078168[] = { MSG_Menus_Merlee_Exhausted, }; -SHIFT_BSS PopupMessage D_800A0BC0[32]; -SHIFT_BSS s32 D_800A0F40; -SHIFT_BSS HudStatusIcon* D_800A0F44; +BSS PopupMessage D_800A0BC0[32]; +BSS s32 D_800A0F40; +BSS HudStatusIcon* D_800A0F44; extern HudScript HES_Item_Present; extern HudScript HES_AsleepBegin; diff --git a/src/trigger.c b/src/trigger.c index 5499619aff..fbfaa1335d 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -1,9 +1,9 @@ #include "common.h" -SHIFT_BSS s16 gTriggerCount; -SHIFT_BSS TriggerList wTriggerList; -SHIFT_BSS TriggerList bTriggerList; -SHIFT_BSS TriggerList* gCurrentTriggerListPtr; +s16 gTriggerCount; +BSS TriggerList wTriggerList; +BSS TriggerList bTriggerList; +BSS TriggerList* gCurrentTriggerListPtr; void default_trigger_on_activate(Trigger* self) { self->flags |= TRIGGER_ACTIVATED; diff --git a/src/windows.c b/src/windows.c index 8ec77c6a80..119e1221e9 100644 --- a/src/windows.c +++ b/src/windows.c @@ -20,7 +20,7 @@ typedef struct WindowGroup { /* 0x01 */ u8 max; } WindowGroup; // size = 0x02 -SHIFT_BSS Window gWindows[64]; +Window gWindows[64]; WindowStyle gWindowStyles[64] = { { WINDOW_STYLE_3 }, { WINDOW_STYLE_3 }, { WINDOW_STYLE_11 }, { WINDOW_STYLE_12 }, diff --git a/src/worker.c b/src/worker.c index 74de70d890..357fae23ce 100644 --- a/src/worker.c +++ b/src/worker.c @@ -1,8 +1,8 @@ #include "common.h" -SHIFT_BSS WorkerList gWorldWorkerList; -SHIFT_BSS WorkerList gBattleWorkerList; -SHIFT_BSS WorkerList* gCurrentWorkerListPtr; +BSS WorkerList gWorldWorkerList; +BSS WorkerList gBattleWorkerList; +BSS WorkerList* gCurrentWorkerListPtr; void worker_delegate_do_nothing(void) { } diff --git a/src/world/actions.c b/src/world/actions.c index 9e7e68fa1f..c409103ae7 100644 --- a/src/world/actions.c +++ b/src/world/actions.c @@ -38,6 +38,7 @@ void action_update_use_tweester(void); void action_update_state_23(void); #if VERSION_JP // TODO remove once segments are split +extern Addr world_use_item_VRAM; extern Addr world_action_idle_ROM_START; extern Addr world_action_idle_ROM_END; extern Addr world_action_walk_ROM_START; @@ -223,3 +224,23 @@ Action PlayerActionsTable[] = { [ACTION_STATE_INVALID_25] { action_update_launch, ACTION_FILE(walk), FALSE }, [ACTION_STATE_USE_SPRING] { action_update_launch, ACTION_FILE(misc), TRUE }, }; + +extern UseItemStruct UseItemDmaArgs; + +BSS s32 D_8010CD20; + +s32 use_consumable(s32 invSlot) { + Evt* script; + + D_8010CD20 = invSlot; + invSlot = gPlayerData.invItems[invSlot]; + dma_copy(UseItemDmaArgs.dmaStart, UseItemDmaArgs.dmaEnd, world_use_item_VRAM); + script = start_script(UseItemDmaArgs.main, EVT_PRIORITY_1, 0); + script->varTable[10] = invSlot; + return script->id; +} + +void remove_consumable(void) { + gPlayerData.invItems[D_8010CD20] = ITEM_NONE; + sort_items(); +} diff --git a/src/world/menus.c b/src/world/menus.c index 3b1f33b515..ddd446a985 100644 --- a/src/world/menus.c +++ b/src/world/menus.c @@ -24,8 +24,7 @@ enum WorldMenuTypes { WORLD_MENU_PAUSE = 2, }; -BSS s16 SwappedWorldMenus; -BSS char D_8010C9C4[0x4]; +BSS s32 D_8010C9C4; BSS PopupMenu WorldPopupMenu; BSS s16 WorldMenuType; BSS s16 WorldMenuDelay; diff --git a/src/world/partners.c b/src/world/partners.c index 8a3ba6327c..90110a0ec6 100644 --- a/src/world/partners.c +++ b/src/world/partners.c @@ -39,29 +39,27 @@ #include "partner/twink.h" #include "sprite/npc/Twink.h" -extern s32 D_8010CD20; - -SHIFT_BSS PartnerStatus gPartnerStatus; -SHIFT_BSS Npc* wPartnerNpc; +PartnerStatus gPartnerStatus; +Npc* wPartnerNpc; BSS s32 PartnerCommandState; BSS PlayerPathElement gPlayerMoveHistory[40]; BSS s32 gPlayerMoveHistoryIndex; BSS s32 D_8010CFBC; -SHIFT_BSS f32 wPartnerTetherDistance; -SHIFT_BSS s32 D_8010CFC4; -SHIFT_BSS s16 wPartnerFollowState; -SHIFT_BSS s16 D_8010CFCA; -SHIFT_BSS s16 D_8010CFCC; -SHIFT_BSS s16 D_8010CFCE; -SHIFT_BSS s32 wPartnerNpcIndex; -SHIFT_BSS Evt* wPartnerCurrentScript; -SHIFT_BSS s32 wCurrentPartnerId; -SHIFT_BSS s32 wPartnerCurrentScriptID; -SHIFT_BSS s32 D_8010CFE0; -SHIFT_BSS s32 NextPartnerID; -SHIFT_BSS s32 NextPartnerCommand; -SHIFT_BSS WorldPartner* wPartner; +BSS f32 wPartnerTetherDistance; +BSS s32 D_8010CFC4; +BSS s16 wPartnerFollowState; +BSS s16 D_8010CFCA; +BSS s16 D_8010CFCC; +BSS s16 D_8010CFCE; +BSS s32 wPartnerNpcIndex; +BSS Evt* wPartnerCurrentScript; +BSS s32 wCurrentPartnerId; +BSS s32 wPartnerCurrentScriptID; +BSS s32 D_8010CFE0; +BSS s32 NextPartnerID; +BSS s32 NextPartnerCommand; +BSS WorldPartner* wPartner; extern HudScript HES_Partner0; extern HudScript HES_Goombario; @@ -160,13 +158,6 @@ void _use_partner_ability(void); void partner_flying_follow_player(Npc*); void partner_move_to_goal(Npc*, s32); -typedef struct UseItemStruct { - /* 0x00 */ u8* dmaStart; - /* 0x04 */ u8* dmaEnd; - /* 0x08 */ EvtScript* main; - /* 0x0C */ s32 unk_0C; -} UseItemStruct; - // Partner icons HudScript* wPartnerHudScripts[] = { &HES_Partner0, &HES_Goombario, &HES_Kooper, &HES_Bombette, @@ -515,22 +506,6 @@ PartnerAnimations gPartnerAnimations[] = { f32 D_800F84F8 = 0.0f; -s32 use_consumable(s32 invSlot) { - Evt* script; - - D_8010CD20 = invSlot; - invSlot = gPlayerData.invItems[invSlot]; - dma_copy(UseItemDmaArgs.dmaStart, UseItemDmaArgs.dmaEnd, world_use_item_VRAM); - script = start_script(UseItemDmaArgs.main, EVT_PRIORITY_1, 0); - script->varTable[10] = invSlot; - return script->id; -} - -void remove_consumable(void) { - gPlayerData.invItems[D_8010CD20] = ITEM_NONE; - sort_items(); -} - s32 func_800EA4B0(s32 collisionID) { s32 ret = TRUE; diff --git a/src/world/world.c b/src/world/world.c index c08016f7b0..d5b092893f 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -44,12 +44,18 @@ s32 pad_map_table[] = { 0, 0 }; #define ASSET_TABLE_HEADER_SIZE 0x20 #define ASSET_TABLE_FIRST_ENTRY (ASSET_TABLE_ROM_START + ASSET_TABLE_HEADER_SIZE) -SHIFT_BSS MapSettings gMapSettings; -SHIFT_BSS MapConfig* gMapConfig; -SHIFT_BSS char wMapHitName[0x18]; -SHIFT_BSS char wMapShapeName[0x18]; -SHIFT_BSS char wMapTexName[0x18]; -SHIFT_BSS char wMapBgName[0x18]; +BSS MapConfig* gMapConfig; +BSS s32 D_800A41E4; +BSS MapSettings gMapSettings; + +#if VERSION_JP || VERSION_IQUE +char wMapHitName[0x14]; +#else +char wMapHitName[0x18]; +#endif +char wMapShapeName[0x18]; +char wMapTexName[0x18]; +char wMapBgName[0x14]; typedef struct { /* 0x00 */ char name[16]; diff --git a/tools/build/configure.py b/tools/build/configure.py index 48e9c01287..9ce2b8564a 100755 --- a/tools/build/configure.py +++ b/tools/build/configure.py @@ -69,7 +69,7 @@ def write_ninja_rules( CPPFLAGS_272 = CPPFLAGS_COMMON + " -nostdinc" - CPPFLAGS_EGCS = CPPFLAGS_COMMON + " -D__USE_ISOC99 -DBBPLAYER -nostdinc" + CPPFLAGS_EGCS = CPPFLAGS_COMMON + " -D__USE_ISOC99 -nostdinc" CPPFLAGS = "-w " + CPPFLAGS_COMMON + " -nostdinc" @@ -643,6 +643,13 @@ def build( if isinstance(seg, splat.segtypes.n64.header.N64SegHeader): build(entry.object_path, entry.src_paths, "as") + elif isinstance(seg, splat.segtypes.common.hasm.CommonSegHasm): + cppflags = f"-DVERSION_{self.version.upper()}" + + if version == "ique" and seg.name.startswith("os/"): + cppflags += " -DBBPLAYER" + + build(entry.object_path, entry.src_paths, "as", variables={"cppflags": cppflags}) elif isinstance(seg, splat.segtypes.common.asm.CommonSegAsm) or ( isinstance(seg, splat.segtypes.common.data.CommonSegData) and not seg.type[0] == "." @@ -697,6 +704,14 @@ def build( if task == "cc_modern": cppflags += " -DMODERN_COMPILER" + if version == "ique": + if "nusys" in entry.src_paths[0].parts: + pass + elif "os" in entry.src_paths[0].parts: + cppflags += " -DBBPLAYER" + elif entry.src_paths[0].parts[-2] == "bss": + cppflags += " -DBBPLAYER" + encoding = "CP932" # similar to SHIFT-JIS, but includes backslash and tilde if version == "ique": encoding = "EUC-JP" diff --git a/ver/ique/asm/bss.s b/ver/ique/asm/bss.s deleted file mode 100644 index 63672b1346..0000000000 --- a/ver/ique/asm/bss.s +++ /dev/null @@ -1,931 +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 .bss - -dlabel nuScPreNMIFlag -.space 4 - -dlabel D_8009A5B4 -.space 4 - -dlabel D_8009A5B8 -.space 4 - -dlabel D_8009A5BC -.space 4 - -dlabel __osFlashVersion -.space 4 - -dlabel gSoundGlobals -.space 4 - -dlabel D_8009A5C4 -.space 4 - -dlabel __osBaseCounter -.space 4 - -dlabel gBGMPlayerC -.space 4 - -dlabel gEncounterSubState -.space 4 - -dlabel __osBbRCountWraps -.space 4 - -dlabel CurrentSefCmdHandler -.space 4 - -dlabel timeFreezeMode -.space 4 - -dlabel __osBbLastRCount -.space 4 - -dlabel nuGfxZBuffer -.space 4 - -dlabel nuContDataLockKey -.space 4 - -dlabel __osViIntrCount -.space 4 - -dlabel BeginSoundUpdateCallback -.space 4 - -dlabel D_8009A5EC -.space 4 - -dlabel nuGfxCfbCounter -.space 4 - -dlabel gCurrentModelTreeNodeInfo -.space 4 - -dlabel nuGfxDisplay -.space 4 - -dlabel gBGMPlayerB -.space 4 - -dlabel gEncounterState -.space 4 - -dlabel gNpcCount -.space 2 - -dlabel __osMaxControllers -.space 2 - -dlabel __osFlashMsgBuf -.space 4 - -dlabel __osCurrentTime -.space 8 - -dlabel nuGfxUcode -.space 4 - -dlabel nuContNum -.space 4 - -dlabel __osBbLastVCount -.space 4 - -dlabel nuGfxTaskSpool -.space 4 - -dlabel __osContLastCmd -.space 4 - -dlabel __osEepromTimerMsg -.space 4 - -dlabel D_8009A624 -.space 4 - -dlabel gAuAmbienceManager -.space 4 - -dlabel __osTimerCounter -.space 4 - -dlabel nuIdleFunc -.space 4 - -dlabel gCurrentCamID -.space 4 - -dlabel nuPiCartHandle -.space 4 - -dlabel __osBbVCountWraps -.space 4 - -dlabel D_8009A63C -.space 4 - -dlabel gSoundManager -.space 4 - -dlabel D_8009A644 -.space 8 - -dlabel nuGfxCfb_ptr -.space 4 - -dlabel gOverrideFlags -.space 4 - -dlabel HasPreBattleSongPushed -.space 4 - -dlabel nuGfxCfb -.space 4 - -dlabel D_8009A65C -.space 4 - -dlabel __osFinalrom -.space 4 - -dlabel gBGMPlayerA -.space 4 - -dlabel gFirstStrikeMessagePos -.space 4 - -dlabel gMainGfxPos -.space 4 - -dlabel D_8009A670 -.space 4 - -dlabel gDisplayContext -.space 4 - -dlabel D_8009A678 -.space 4 - -dlabel D_8009A67C -.space 4 - -.space 8 - -dlabel ResetFrameBufferArray -.space 4 - -dlabel D_8009A684 -.space 0x0000000c - -dlabel SoftResetDelay -.space 4 - -dlabel D_8009A694 -.space 0x0000000c - -dlabel D_8009A6A0 -.space 2 - -dlabel D_8009A6A2 -.space 2 - -dlabel D_8009A6A4 -.space 2 - -dlabel D_8009A6A6 -.space 2 - -dlabel D_8009A6A8 -.space 8 - -dlabel FetchSaveBuffer -.space 0x00001380 - -dlabel LogicalSaveInfo -.space 0x00000020 - -dlabel PhysicalSaveInfo -.space 0x00000030 - -dlabel NextAvailablePhysicalSave -.space 4 - -dlabel D_8009BA84 -.space 0x0000000c - -dlabel gCurtainScale -.space 4 - -dlabel gCurtainScaleGoal -.space 4 - -dlabel gCurtainFade -.space 4 - -dlabel gCurtainFadeGoal -.space 4 - -dlabel gCurtainDrawCallback -.space 4 - -dlabel D_8009BAA4 -.space 4 - -dlabel D_8009BAA8 -.space 0x00000080 - -dlabel D_8009BA28 -.space 8 - -dlabel gCrashScreen -.space 0x000009e0 - -dlabel nuGfxTask_ptr -.space 4 - -dlabel taskDoneMsg -.space 2 - -dlabel swapBufMsg -.space 2 - -dlabel GfxTaskMgrThread -.space 0x000001b0 - -.align 4 -dlabel GfxTaskMgrStack -.space 0x00002000 - -dlabel D_8009E6D0 -.space 0x00000020 - -dlabel gCurrentCamConfiguration -.space 0x0000001c - -dlabel D_800A08DC -.space 4 - -dlabel D_800A08E0 -.space 4 - -dlabel D_800A08E4 -.space 4 - -dlabel D_800A08E8 -.space 4 - -dlabel D_800A08EC -.space 4 - -dlabel CurGameMode -.space 4 - -dlabel D_800A08F4 -.space 0x0000000c - -dlabel D_800A0900 -.space 4 - -dlabel D_800A0904 -.space 4 - -dlabel D_800A0908 -.space 4 - -dlabel D_800A090C -.space 4 - -dlabel gLogosImages -.space 4 - -dlabel gLogosImage3 -.space 4 - -dlabel gLogosImage1 -.space 4 - -dlabel gLogosImage2 -.space 4 - -dlabel StepPauseDelay -.space 1 - -dlabel StepPauseState -.space 1 - -dlabel StepPauseAlpha -.space 2 - -dlabel SavedReverbMode -.space 4 - -dlabel D_800A0928 -.space 8 - -dlabel D_800A0930 -.space 1 - -dlabel D_800A0931 -.space 1 - -dlabel D_800A0932 -.space 2 - -dlabel D_800A0934 -.space 0x0000000c - -dlabel gMapTransitionAlpha -.space 2 - -dlabel gMapTransitionFadeRate -.space 2 - -dlabel gMapTransitionState -.space 2 - -dlabel gMapTransitionStateTime -.space 2 - -dlabel gLoadedFromFileSelect -.space 4 - -dlabel D_800A094C -.space 4 - -dlabel IntroEnableDrawFrameDelay -.space 4 - -dlabel IntroOverlayAlpha -.space 2 - -dlabel IntroFrontFadeAlpha -.space 2 - -dlabel IntroOverlayDelta -.space 2 - -dlabel IntroFadeColorR -.space 2 - -dlabel IntroFadeColorG -.space 2 - -dlabel IntroFadeColorB -.space 2 - -dlabel IntroOverlayType -.space 0x00000004 - -dlabel D_800A0964 -.space 4 - -dlabel D_800A0968 -.space 8 - -dlabel TitleScreen_AppearDelay -.space 4 - -dlabel TitleScreen_ImgList -.space 4 - -dlabel TitleScreen_ImgList_Logo -.space 4 - -dlabel TitleScreen_ImgList_Copyright -.space 4 - -dlabel TitleScreen_ImgList_PressStart -.space 4 - -dlabel D_800A0984 -.space 4 - -dlabel TitleScreen_TimeLeft -.space 4 - -dlabel D_800A098C -.space 4 - -dlabel gWorldNpcList -.space 0x00000100 - -dlabel gBattleNpcList -.space 0x00000100 - -dlabel gCurrentNpcListPtr -.space 4 - -dlabel gNpcPlayerCollisionsEnabled -.space 4 - -dlabel D_800A0B98 -.space 8 - -dlabel D_800A0BA0 -.space 4 - -dlabel D_800A0BA4 -.space 4 - -dlabel WorldMerleeOrbEffect -.space 4 - -dlabel WorldMerleeWaveEffect -.space 4 - -dlabel D_800A0BB0 -.space 4 - -dlabel D_800A0BB4 -.space 4 - -dlabel D_800A0BB8 -.space 4 - -dlabel D_800A0BBC -.space 4 - -dlabel D_800A0BC0 -.space 0x00000380 - -dlabel D_800A0F40 -.space 4 - -dlabel D_800A0F44 -.space 4 - -dlabel D_800A0F48 -.space 8 - -dlabel AuInitialGlobalVolume -.space 4 - -dlabel D_800A0F54 -.space 4 - -dlabel nuAuMgrThread -.space 0x000001b0 - -# TODO: figure out what this extra space is used for -.space 0x00000408 - -dlabel AuStack -.space 0x00002000 - -dlabel AlCmdListBuffers -.space 0x0000000c - -dlabel D_800A351C -.space 4 - -dlabel nuAuTasks -.space 0x00000108 - -dlabel D_800A3628 -.space 0x0000000c - -dlabel AlFrameSize -.space 4 - -dlabel AlMinFrameSize -.space 4 - -dlabel D_800A363C -.space 4 - -dlabel nuAuDmaMesgQ -.space 0x18 - -dlabel nuAuDmaMesgBuf -.space 0x000000c8 - -dlabel nuAuDmaIOMesgBuf -.space 0x000004b0 - -dlabel nuAuDmaState -.space 4 - -dlabel D_800A3BD4 -.space 4 - -dlabel D_800A3BD8 -.space 8 - -dlabel nuAuDmaBufList -.space 0x000003e8 - -dlabel D_800A3FC8 -.space 8 - -dlabel CurrentSeqCmdHandler -.space 4 - -dlabel D_800A3FD4 -.space 0x0000000c - -dlabel AuDelayBufferMain -.space 4 - -dlabel AuDelayBufferAux -.space 4 - -dlabel AuDelayCounter -.space 4 - -dlabel AuDelayedVoiceGroup -.space 2 - -dlabel AuDelayedChannel -.space 2 - -dlabel AuDelayCount -.space 4 - -dlabel D_800A3FF4 -.space 0x0000000c - -dlabel gEffectGraphicsData -.space 0x000001E0 - -dlabel gMapConfig -.space 4 - -dlabel D_800A41E4 -.space 4 - -dlabel gMapSettings -.space 0x40 - -.space 8 - -dlabel gCollisionRayStartX -.space 4 - -dlabel gCollisionRayStartY -.space 4 - -dlabel gCollisionRayStartZ -.space 4 - -dlabel gCollisionRayDirX -.space 4 - -dlabel gCollisionRayDirY -.space 4 - -dlabel gCollisionRayDirZ -.space 4 - -dlabel gCollisionPointX -.space 4 - -dlabel gCollisionPointY -.space 4 - -dlabel gCollisionPointZ -.space 4 - -dlabel gCollisionRayLength -.space 4 - -dlabel gCollisionNormalX -.space 4 - -dlabel gCollisionNormalY -.space 4 - -dlabel gCollisionNormalZ -.space 4 - -dlabel gCollisionDataBackup -.space 4 - -dlabel gCollisionDataZoneBackup -.space 4 - -dlabel D_800A426C -.space 4 - -dlabel IdleThread -.space 0x000001b0 - -dlabel MainThread -.space 0x000001b0 - -dlabel IdleStack -.space 0x00002000 - -dlabel nuScStack -.space 0x00002000 - -dlabel nuScAudioStack -.space 0x00002000 - -dlabel nuScGraphicsStack -.space 0x00002000 - -dlabel D_800AC5D0 -.space 4 - -dlabel D_800AC5D4 -.space 0x00000014 - -dlabel D_800AC5E8 -.space 0x000000c8 - -dlabel nuGfxMesgBuf -.space 0x00000020 - -dlabel GfxStack -.space 0x00002000 - -dlabel nuSiMesgBuf -.space 0x00000020 - -dlabel siMgrThread -.space 0x1b0 - -dlabel siMgrStack -.space 0x2000 - -dlabel nuContWaitMesgBuf -.space 4 - -dlabel nuContDataMutexBuf -.space 4 - -.align 4 -dlabel tmp_task -.space 0x00000040 - -dlabel siAccessBuf -.space 4 - -dlabel D_800AC6D8 -.space 8 - -.space 4 - -dlabel retrace -.space 4 - -.space 4 - -dlabel viThread -.space 0x1B0 - -dlabel viThreadStack -.space 0x1000 - -dlabel viEventQueue -.space 0x18 - -dlabel viEventBuf -.space 4 * 5 - -dlabel viRetraceMsg -.space 0x00000018 - -dlabel viCounterMsg -.space 0x00000018 - -.align 4 - -dlabel piThread -.space 0x1B0 - -dlabel piThreadStack -.space 0x1000 - -dlabel piEventQueue -.space 0x18 - -dlabel piEventBuf -.space 0x8 - -dlabel piAccessBuf -.space 0x8 - -.space 0x20 - -dlabel wMapTexName -.space 0x18 - -dlabel __osThreadSave -.space 0x1b0 - -dlabel nuContWaitMesgQ -.space 0x18 - -.align 4 -dlabel __osContPifRam -.space 0x40 - -dlabel gCurrentEncounter -.space 0x00000bf4 - -dlabel __Dom2SpeedParam -.space 0x74 - -dlabel nuContStatus -.space 0x4 * 4 - -dlabel D_800B1B90 -.space 0x000001b0 - -dlabel nuContRmbCtl -.space 0xA * 4 - -.space 2 - - .align 4 -dlabel nuContData -.space 6 * 4 - - .align 4 -dlabel gCameras -.space 0x00001560 - -dlabel D_800B32E0 -.space 0x800 - -dlabel D_800B3AE0 -.space 0x800 - -dlabel gCollisionData -.space 0x10 - -dlabel nuGfxMesgQ -.space 0x18 - -dlabel __CartRomHandle -.space 0x74 - -dlabel __osPiAccessQueue -.space 0x18 - - .align 3 -dlabel gEffectInstances -.space 4*96 - -dlabel __Dom1SpeedParam -.space 0x74 - - .align 4 -dlabel nuBootStack -.space 0x00002000 - -dlabel nuMainStack -.space 0x00002000 - -dlabel nuYieldBuf -.space 0x00000c10 - -dlabel auSynDriver -.space 0x00000030 - -dlabel D_800B91D0 -.space 0x00020000 - -dlabel __osFlashHandler -.space 0x00000074 - -.align 3 -dlabel gZoneCollisionData -.space 0x00000010 - -dlabel wMapHitName -.space 0x00000014 - -dlabel nuSiMgrMesgQ -.space 0x00000018 - - .align 3 -dlabel __osBaseTimer -.space 0x20 - -dlabel wMapShapeName -.space 0x00000018 - -dlabel nuAuHeap -.space 0x00000010 - -dlabel __osFlashMessageQ -.space 0x18 - -# TODO: figure out where this space comes from -.space 0x20 - -dlabel nuGfxTask -.space 0x58*10 - -dlabel gSaveGlobals -.space 0x80 - -dlabel wMapBgName -.space 0x00000014 - -dlabel __osPfsInodeCache -.space 0x00000100 - -dlabel __osEventStateTab -.space 0x00000100 - - .align 4 - -dlabel __osPfsPifRam -.space 0x0000003c - -.space 4 - -dlabel D_800DA040 -.space 0x00000400 - -dlabel nusched -.space 0x67e - - .align 3 - -dlabel __osEepromTimerQ -.space 0x00000018 - -dlabel nuContPfs -.space 0x68 * 4 - -dlabel nuSiMesgQ -.space 0x00000018 - -dlabel D_800DAC90 -.space 0x00000018 - -dlabel __osSiAccessQueue -.space 0x00000018 - -dlabel __osBbFlashBuffer -.space 0x80 - -dlabel gCurrentSaveFile -.space 0x00001380 - -dlabel nuContDataMutexQ -.space 0x00000020 - -dlabel D_800DC060 -.space 4 - -dlabel gCurrentStagePtr -.space 4 - -dlabel gBattleState -.space 4 - -dlabel D_800DC06C -.space 4 - -dlabel gBattleStatus -.space 0x00000460 - -dlabel gLastDrawBattleState -.space 4 - -dlabel D_800DC4D4 -.space 4 - -dlabel gDefeatedBattleSubstate -.space 4 - -dlabel gBattleSubState -.space 4 - -dlabel D_800DC4E0 -.space 4 - -dlabel gDefeatedBattleState -.space 4 - -dlabel gCurrentBattleID -.space 4 - -dlabel gCurrentStageID -.space 4 - -dlabel D_800DC4F0 -.space 4 - -dlabel gOverrideBattlePtr -.space 4 - -dlabel D_800DC4F8 -.space 4 - -dlabel gCurrentBattlePtr -.space 4 diff --git a/ver/ique/asm/bss2.s b/ver/ique/asm/bss2.s deleted file mode 100644 index fd1019a927..0000000000 --- a/ver/ique/asm/bss2.s +++ /dev/null @@ -1,114 +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 - -#ifndef SHIFT - -.section .bss - -dlabel PulseStoneNotificationCallback -.space 4 - -dlabel D_8010C924 -.space 4 - -dlabel D_8010C928 -.space 4 - -dlabel D_8010C92C -.space 4 - -dlabel wPartnerNpc -.space 4 - -dlabel TweesterTouchingPlayer -.space 4 - -dlabel PlayerNormalYaw -.space 4 - -dlabel ISpyNotificationCallback -.space 4 - -dlabel TalkNotificationCallback -.space 4 - -dlabel gSpinHistoryBufferPos -.space 4 - -dlabel D_8010C948 -.space 4 - -dlabel NpcHitQueryBehindRightY -.space 4 - -dlabel D_8010C950 -.space 4 - -dlabel TweesterTouchingPartner -.space 4 - -dlabel InteractNotificationCallback -.space 4 - -dlabel PrevPlayerDirection -.space 4 - -dlabel JumpedOnSwitchX -.space 4 - -dlabel D_8010C964 -.space 4 - -dlabel NpcHitQueryBehindCollider -.space 4 - -dlabel PeachDisguiseNpcIndex -.space 4 - -dlabel NpcHitQueryAheadY -.space 4 - -dlabel NpcHitQueryBehindLeftY -.space 4 - -dlabel NpcHitQueryColliderID -.space 4 - -dlabel JumpedOnSwitchZ -.space 4 - -dlabel PlayerRunStateTime -.space 4 - -dlabel D_8010C984 -.space 4 - -dlabel D_8010C988 -.space 4 - -dlabel NpcHitQueryAheadCollider -.space 4 - -dlabel PlayerNormalPitch -.space 4 - -dlabel D_8010C994 -.space 0x0000000c - -dlabel PlayerYInterpUpdateDelay -.space 4 - -dlabel D_8010C9A4 -.space 0x0000000c - -dlabel D_8010C9B0 -.space 4 - -dlabel D_8010C9B4 -.space 0x0000000c - -#endif diff --git a/ver/ique/asm/bss2_2.s b/ver/ique/asm/bss2_2.s deleted file mode 100644 index dd58463ae8..0000000000 --- a/ver/ique/asm/bss2_2.s +++ /dev/null @@ -1,225 +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 - -#ifndef SHIFT - -.section .bss - -dlabel wPartnerTetherDistance -.space 4 - -dlabel D_8010CFC4 -.space 4 - -dlabel wPartnerFollowState -.space 2 - -dlabel D_8010CFCA -.space 2 - -dlabel D_8010CFCC -.space 2 - -dlabel D_8010CFCE -.space 2 - -dlabel wPartnerNpcIndex -.space 4 - -dlabel wPartnerCurrentScript -.space 4 - -dlabel wCurrentPartnerId -.space 4 - -dlabel wPartnerCurrentScriptID -.space 4 - -dlabel D_8010CFE0 -.space 4 - -dlabel NextPartnerID -.space 4 - -dlabel NextPartnerCommand -.space 4 - -dlabel wPartner -.space 4 - -dlabel D_8010CFF0 -.space 4 - -dlabel D_8010CFF4 -.space 4 - -dlabel D_8010CFF8 -.space 8 - -dlabel D_8010D000 -.space 0x63C - -dlabel D_8010D63C -.space 0x4 - -dlabel gPopupState -.space 4 - -dlabel D_8010D644 -.space 4 - -dlabel PopupMenu_SelectedIndex -.space 4 - -dlabel PopupMenu_PrevSelectedIndex -.space 4 - -dlabel PopupMenu_Alpha -.space 4 - -dlabel PopupMenu_FirstDisplayIndex -.space 1 - -dlabel PopupMenu_LastDisplayIndex -.space 1 - -dlabel PopupMenu_DisplayedEntryCount -.space 2 - -dlabel D_8010D658 -.space 2 - -dlabel D_8010D65A -.space 2 - -dlabel PopupMenu_EmptybarHEID -.space 4 - -dlabel PopupMenu_TitleIconHEID -.space 4 - -dlabel PopupMenu_TimesHEID -.space 4 - -dlabel PopupMenu_PartnerLevelHEID -.space 4 - -dlabel PopupMenu_CursorHEID -.space 4 - -dlabel PopupMenu_UpArrowHEID -.space 4 - -dlabel PopupMenu_DownArrowHEID -.space 4 - -dlabel PopupMenu_EntryIconHEID -.space 4 - -dlabel D_8010D67C -.space 2 - -dlabel D_8010D67E -.space 2 - -dlabel D_8010D680 -.space 2 - -dlabel D_8010D682 -.space 2 - -dlabel D_8010D684 -.space 2 - -dlabel D_8010D686 -.space 2 - -dlabel PopupMenu_StarPieceCounterPosX -.space 2 - -dlabel PopupMenu_StarPieceCounterPosY -.space 2 - -dlabel D_8010D68C -.space 2 - -dlabel PopupNotBattle -.space 1 - -dlabel PopupMenu_MaxDisplayableEntryCount -.space 1 - -dlabel D_8010D690 -.space 1 - -dlabel D_8010D691 -.space 1 - -dlabel D_8010D692 -.space 1 - -dlabel D_8010D693 -.space 1 - -dlabel gPopupWorker -.space 4 - -dlabel PopupNotDipping -.space 1 - -dlabel PopupDipMode -.space 1 - -dlabel PopupMenu_WasStatusBarIgnoringChanges -.space 2 - -dlabel gPopupMenu -.space 4 - -dlabel D_8010D6A0 -.space 4 - -dlabel D_8010D6A4 -.space 4 - -dlabel D_8010D6A8 -.space 0x8 - -dlabel gBoxQuadBuffer -.space 0x1500 - -dlabel gPartnerStatus -.space 0x360 - -dlabel gSpinHistoryPosY -.space 0x18 - -dlabel gSpinHistoryPosX -.space 0x18 - -dlabel gSpinHistoryPosZ -.space 0x18 - -dlabel gStatusBar -.space 0x70 - -dlabel gPlayerStatus -.space 0x288 - -dlabel gPlayerSpinState -.space 0x34 - -dlabel D_8010F284 -.space 0xC - -dlabel gPlayerData -.space 0x428 - -dlabel gSpinHistoryPosAngle -.space 0x10 - -#endif diff --git a/ver/ique/asm/bss3.s b/ver/ique/asm/bss3.s deleted file mode 100644 index d4c003271e..0000000000 --- a/ver/ique/asm/bss3.s +++ /dev/null @@ -1,685 +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 .bss - -dlabel gAuxSpriteShadingProfile -.space 4 - -dlabel gHudElementsNumber -.space 4 - -dlabel gCurrentCustomModelGfxBuildersPtr -.space 4 - -dlabel D_801512BC -.space 4 - -dlabel entity_numEntities -.space 4 - -dlabel gEntityHeapBase -.space 4 - -dlabel gHudElementCacheTableRaster -.space 4 - -dlabel gCurrentModels -.space 4 - -dlabel gHudElementCacheTablePalette -.space 4 - -dlabel gAnimCount -.space 4 - -dlabel gMsgBGScrollAmtX -.space 4 - -dlabel D_801512DC -.space 4 - -dlabel gCurrentTransformGroups -.space 4 - -dlabel gMsgGlobalWaveCounter -.space 4 - -dlabel gCurrentCustomModelGfxPtr -.space 4 - -dlabel gLastCreatedEntityIndex -.space 4 - -dlabel gBackgroundTintModePtr -.space 4 - -dlabel gMsgVarImages -.space 4 - -dlabel ItemEntitiesCreated -.space 4 - -dlabel gCurrentModelTreeRoot -.space 4 - -dlabel gEntityHeapBottom -.space 4 - -dlabel D_80151304 -.space 4 - -dlabel gCurrentRoomDoorSounds -.space 4 - -dlabel gMsgBGScrollAmtY -.space 2 - -dlabel D_8015130E -.space 2 - -dlabel gEntityHideMode -.space 4 - -dlabel gHudElementCacheBuffer -.space 4 - -dlabel gEntityModelCount -.space 4 - -dlabel D_8015131C -.space 4 - -dlabel D_80151320 -.space 4 - -dlabel entity_numShadows -.space 4 - -dlabel gSpriteShadingProfile -.space 4 - -dlabel isAreaSpecificEntityDataLoaded -.space 4 - -dlabel entity_updateCounter -.space 4 - -dlabel gTriggerCount -.space 4 - -dlabel D_80151338 -.space 4 - -dlabel gHudElementCacheSize -.space 4 - -dlabel gCurrentDoorSounds -.space 4 - -dlabel D_80151344 -.space 4 - -dlabel D_80151348 -.space 0x00000028 - -dlabel gWorldEntityList -.space 0x00000078 - -dlabel gBattleEntityList -.space 0x00000078 - -dlabel gCurrentEntityListPtr -.space 4 - -dlabel D_80151474 -.space 4 - -dlabel gWorldShadowList -.space 0x000000f0 - -dlabel gBattleShadowList -.space 0x000000f0 - -dlabel gCurrentShadowListPtr -.space 4 - -dlabel wEntityDataLoadedSize -.space 4 - -dlabel bEntityDataLoadedSize -.space 4 - -dlabel D_80151664 -.space 4 - -dlabel wEntityBlueprint -.space 0x00000078 - -.space 8 - -dlabel bEntityBlueprint -.space 0x00000014 - -dlabel D_801516FC -.space 4 - -dlabel gMainGameMode -.space 0x00000040 - -dlabel gCurrentTextureHeader -.space 0x00000030 - -dlabel wModelList -.space 0x00000400 - -dlabel bModelList -.space 0x00000400 - -dlabel wTransformGroups -.space 0x00000010 - -dlabel bTransformGroups -.space 0x00000010 - -dlabel wCustomModelGfx -.space 0x00000080 - -dlabel bCustomModelGfx -.space 0x00000080 - -dlabel wCustomModelGfxBuilders -.space 0x00000080 - -dlabel bCustomModelGfxBuilders -.space 0x00000080 - -dlabel wModelLocalVtxBuffers -.space 0x00000040 - -dlabel bModelLocalVtxBuffers -.space 0x00000040 - -dlabel gCurrentModelLocalVtxBuffers -.space 4 - -dlabel wModelTreeRoot -.space 4 - -dlabel bModelTreeRoot -.space 4 - -dlabel D_8015221C -.space 4 - -dlabel wModelTreeNodeInfo -.space 0x00000800 - -dlabel bModelTreeNodeInfo -.space 0x00000800 - -dlabel wBackgroundTintMode -.space 1 - -dlabel bBackgroundTintMode -.space 1 - -dlabel D_80153222 -.space 1 - -dlabel D_80153223 -.space 1 - -dlabel TreeIterPos -.space 4 - -dlabel wFogSettings -.space 0x00000020 - -dlabel bFogSettings -.space 0x0000001c - -dlabel gFogSettings -.space 4 - -dlabel texPannerMainU -.space 0x00000040 - -dlabel texPannerMainV -.space 0x00000040 - -dlabel texPannerAuxU -.space 0x00000040 - -dlabel texPannerAuxV -.space 0x00000040 - -dlabel TextureHeapPos -.space 4 - -dlabel mtg_IterIdx -.space 2 - -dlabel mtg_SearchModelID -.space 2 - -dlabel mtg_FoundModelNode -.space 4 - -dlabel mtg_MinChild -.space 2 - -dlabel mtg_MaxChild -.space 2 - -dlabel D_80153378 -.space 8 - -dlabel DepthCopyBuffer -.space 0x00000020 - -dlabel RenderTaskLists -.space 0x0000000c - -dlabel RenderTaskListIdx -.space 4 - -dlabel RenderTaskCount -.space 0x00000010 - -dlabel D_801533C0 -.space 0x00000300 - -dlabel D_801536C0 -.space 0x00000300 - -dlabel D_801539C0 -.space 0x00000040 - -dlabel D_80153A00 -.space 0x00000040 - -dlabel gCurrentAnimMeshListPtr -.space 4 - -dlabel gAnimModelFogEnabled -.space 4 - -dlabel gAnimModelFogR -.space 4 - -dlabel gAnimModelFogG -.space 4 - -dlabel gAnimModelFogB -.space 4 - -dlabel gAnimModelFogA -.space 4 - -dlabel gAnimModelFogStart -.space 4 - -dlabel gAnimModelFogEnd -.space 4 - -dlabel gAnimVtxSegment -.space 4 - -dlabel D_80153A64 -.space 4 - -dlabel gAnimRotMtx -.space 0x00000040 - -dlabel gAnimScaleMtx -.space 0x00000040 - -dlabel gAnimTranslateMtx -.space 0x00000040 - -dlabel gAnimRotScaleMtx -.space 0x00000040 - -dlabel gAnimTreeRoot -.space 8 - -dlabel gWorldEntityModelList -.space 0x00000400 - -dlabel gBattleEntityModelList -.space 0x00000400 - -dlabel gCurrentEntityModelList -.space 4 - -dlabel D_80154374 -.space 4 - -dlabel entity_fog_enabled -.space 4 - -dlabel entity_fog_red -.space 4 - -dlabel entity_fog_green -.space 4 - -dlabel entity_fog_blue -.space 4 - -dlabel entity_fog_alpha -.space 4 - -dlabel entity_fog_dist_min -.space 4 - -dlabel entity_fog_dist_max -.space 4 - -######################## -.align 4 # file boundary -######################## - -dlabel gWorldWorkerList -.space 0x00000040 - -dlabel gBattleWorkerList -.space 0x00000040 - -dlabel gCurrentWorkerListPtr -.space 4 - -.align 4 # file boundary - -dlabel gMessageBuffers -.space 0x00000800 - -dlabel gMessagePrinters -.space 0x00001008 - -dlabel gMessageMsgVars -.space 0x00000060 - -dlabel D_80155C98 -.space 8 - -.align 4 - -dlabel gMessageWindowProjMatrix -.space 0x00000080 - -dlabel D_801544A0 -.space 120 * 128 - -dlabel D_80155D20 -.space 4 - -dlabel D_8015DD24 -.space 0x00000050 - -dlabel msg_drawState -.space 4 - -dlabel D_8015DD78 -.space 8 - -dlabel UnusedItemPhysicsScriptID -.space 4 - -dlabel ItemEntityAlternatingSpawn -.space 4 - -dlabel ItemEntityRenderGroup -.space 4 - -dlabel CoinSparkleCenterX -.space 2 - -dlabel CoinSparkleCenterY -.space 2 - -dlabel CoinSparkleCenterZ -.space 2 - -dlabel pad_ItemEntity -.space 0x000000E - -dlabel WorldItemEntities -.space 0x00000400 - -dlabel BattleItemEntities -.space 0x00000400 - -dlabel gCurrentItemEntities -.space 4 - -dlabel isPickingUpItem -.space 2 - -dlabel ItemSpawnWithinPlayerPickupDelay -.space 2 - -dlabel D_801565A8 -.space 4 - -dlabel D_801565AC -.space 4 - -dlabel ItemPickupMenu -.space 0x00000330 - -dlabel ItemPickupIconID -.space 4 - -dlabel ItemPickupStateDelay -.space 4 - -dlabel ThrowAwayMenuIdx -.space 4 - -dlabel ThrowAwayItemID -.space 4 - -dlabel ItemPickupGotOutline -.space 4 - -dlabel GotItemTutorialPrinter -.space 4 - -dlabel GotItemTutorialClosed -.space 4 - -dlabel D_801568FC -.space 4 - -dlabel screen_overlay_frontType -.space 4 - -dlabel screen_overlay_frontZoom -.space 4 - -dlabel screen_overlay_backType -.space 4 - -dlabel screen_overlay_backZoom -.space 4 - -dlabel D_80156910 -.space 0x00000010 - -dlabel ImgFXCurrentTexture -.space 0x00000028 - -dlabel ImgFXVtxBuffers -.space 8 - -dlabel imgfx_vtxBuf -.space 4 - -dlabel ImgFXInstances -.space 4 - -dlabel D_80156958 -.space 8 - -dlabel D_80156960 -.space 8 - -dlabel D_80156968 -.space 8 - -dlabel D_80156970 -.space 0x00000010 - -dlabel ImgFXAnimHeaders -.space 0x000005a0 - -dlabel ImgFXDataCache -.space 0x00000040 - -dlabel gHudElementsWorld -.space 0x00000500 - -dlabel gHudElementsBattle -.space 0x00000500 - -dlabel gHudElements -.space 4 - -dlabel gHudElementCacheBufferWorld -.space 4 - -dlabel gHudElementCacheSizeWorld -.space 4 - -dlabel D_8015796C -.space 4 - -dlabel gHudElementCacheTableRasterWorld -.space 0x00000600 - -dlabel gHudElementCacheTablePaletteWorld -.space 0x00000600 - -dlabel gHudElementCacheBufferBattle -.space 4 - -dlabel gHudElementCacheSizeBattle -.space 4 - -dlabel D_80158578 -.space 8 - -dlabel gHudElementCacheTableRasterBattle -.space 0x00000600 - -dlabel gHudElementCacheTablePaletteBattle -.space 0x00000600 - -dlabel D_80159180 -.space 0x00000010 - -dlabel wTriggerList -.space 0x00000100 - -dlabel bTriggerList -.space 0x00000100 - -dlabel gCurrentTriggerListPtr -.space 4 - -dlabel D_80159394 -.space 0x0000000c - -dlabel gBackgroundPalette -.space 0x00000200 - -dlabel gBackroundLastScrollValue -.space 0x00000020 - -dlabel wSpriteShadingProfile -.space 0x000000b0 - -dlabel bSpriteShadingProfile -.space 0x000000b0 - -dlabel wSpriteShadingProfileAux -.space 0x000000b0 - -dlabel bSpriteShadingProfileAux -.space 0x000000b0 - -dlabel SpriteShadingPalette -.space 0x00000020 - -dlabel wEnvSounds -.space 0x00000118 - -dlabel bEnvSounds -.space 0x00000118 - -dlabel gCurrentEnvSounds -.space 4 - -dlabel SfxReverbMode -.space 4 - -dlabel D_80159AD8 -.space 8 - -dlabel MusicDefaultVolume -.space 2 - -dlabel MusicTargetVolume -.space 2 - -dlabel MusicMaxVolume -.space 2 - -dlabel MusicCurrentVolume -.space 2 - -dlabel D_80159AE8 -.space 8 - -dlabel gMusicSettings -.space 0x00000060 - -dlabel D_80159B50 -.space 0x00000200 - -dlabel gWindows -.space 0x00000800 - -dlabel gCollisionStatus -.space 0x00000028 - -dlabel gCurrentHiddenPanels -.space 0x10 - -.space 8 - -dlabel TextureHandles -.space 0x00002200 - -dlabel ScreenOverlays -.space 0x00000030 - -dlabel AmbientSoundData -.space 0x00000010 - -dlabel CreateEntityVarArgBuffer -.space 0x00000010 - -dlabel D_8015C7E0 -.space 0x20 - -.space 0x3C80 - -dlabel D_80164000 -.space 0x1a230 * 2 diff --git a/ver/ique/asm/entry_point.s b/ver/ique/asm/entry_point.s deleted file mode 100644 index 8f5da3021c..0000000000 --- a/ver/ique/asm/entry_point.s +++ /dev/null @@ -1,38 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel func_IQUE_80025C00 -/* 1000 80025C00 3C08800A */ lui $t0, %hi(main_BSS_START) -/* 1004 80025C04 25089170 */ addiu $t0, $t0, %lo(main_BSS_START) -/* 1008 80025C08 3C090004 */ lui $t1, %hi(main_BSS_SIZE) -/* 100C 80025C0C 25291770 */ addiu $t1, $t1, %lo(main_BSS_SIZE) -.LIQUE_80025C10: -/* 1010 80025C10 AD000000 */ sw $zero, 0x0($t0) -/* 1014 80025C14 AD000004 */ sw $zero, 0x4($t0) -/* 1018 80025C18 21080008 */ addi $t0, $t0, 0x8 # handwritten instruction -/* 101C 80025C1C 2129FFF8 */ addi $t1, $t1, -0x8 # handwritten instruction -/* 1020 80025C20 1520FFFB */ bnez $t1, .LIQUE_80025C10 -/* 1024 80025C24 00000000 */ nop -/* 1028 80025C28 3C1D800B */ lui $sp, %hi(nuBootStack + 0x2000) -/* 102C 80025C2C 27BD4FE0 */ addiu $sp, $sp, %lo(nuBootStack + 0x2000) -/* 1030 80025C30 3C0A8006 */ lui $t2, %hi(nuBoot) -/* 1034 80025C34 254ADF60 */ addiu $t2, $t2, %lo(nuBoot) -/* 1038 80025C38 01400008 */ jr $t2 -/* 103C 80025C3C 00000000 */ nop -/* 1040 80025C40 00000000 */ nop -/* 1044 80025C44 00000000 */ nop -/* 1048 80025C48 00000000 */ nop -/* 104C 80025C4C 00000000 */ nop -/* 1050 80025C50 00000000 */ nop -/* 1054 80025C54 00000000 */ nop -/* 1058 80025C58 00000000 */ nop -/* 105C 80025C5C 00000000 */ nop diff --git a/ver/ique/asm/os/bcmp.s b/ver/ique/asm/os/bcmp.s deleted file mode 100644 index af6a954a28..0000000000 --- a/ver/ique/asm/os/bcmp.s +++ /dev/null @@ -1,90 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel bcmp -/* 45B70 8006A770 00851026 */ xor $v0, $a0, $a1 -/* 45B74 8006A774 28C10010 */ slti $at, $a2, 0x10 -/* 45B78 8006A778 14200034 */ bnez $at, .LIQUE_8006A84C -/* 45B7C 8006A77C 00000000 */ nop -/* 45B80 8006A780 30420003 */ andi $v0, $v0, 0x3 -/* 45B84 8006A784 14400018 */ bnez $v0, .LIQUE_8006A7E8 -/* 45B88 8006A788 0004C023 */ negu $t8, $a0 -/* 45B8C 8006A78C 33180003 */ andi $t8, $t8, 0x3 -/* 45B90 8006A790 13000007 */ beqz $t8, .LIQUE_8006A7B0 -/* 45B94 8006A794 00D83023 */ subu $a2, $a2, $t8 -/* 45B98 8006A798 00601021 */ addu $v0, $v1, $zero -/* 45B9C 8006A79C 88820000 */ lwl $v0, 0x0($a0) -/* 45BA0 8006A7A0 88A30000 */ lwl $v1, 0x0($a1) -/* 45BA4 8006A7A4 00982021 */ addu $a0, $a0, $t8 -/* 45BA8 8006A7A8 14430033 */ bne $v0, $v1, .LIQUE_8006A878 -/* 45BAC 8006A7AC 00B82821 */ addu $a1, $a1, $t8 -.LIQUE_8006A7B0: -/* 45BB0 8006A7B0 2401FFFC */ addiu $at, $zero, -0x4 -/* 45BB4 8006A7B4 00C13824 */ and $a3, $a2, $at -/* 45BB8 8006A7B8 10E00024 */ beqz $a3, .LIQUE_8006A84C -/* 45BBC 8006A7BC 00C73023 */ subu $a2, $a2, $a3 -/* 45BC0 8006A7C0 00E43821 */ addu $a3, $a3, $a0 -.LIQUE_8006A7C4: -/* 45BC4 8006A7C4 8C820000 */ lw $v0, 0x0($a0) -/* 45BC8 8006A7C8 8CA30000 */ lw $v1, 0x0($a1) -/* 45BCC 8006A7CC 24840004 */ addiu $a0, $a0, 0x4 -/* 45BD0 8006A7D0 14430029 */ bne $v0, $v1, .LIQUE_8006A878 -/* 45BD4 8006A7D4 24A50004 */ addiu $a1, $a1, 0x4 -/* 45BD8 8006A7D8 1487FFFA */ bne $a0, $a3, .LIQUE_8006A7C4 -/* 45BDC 8006A7DC 00000000 */ nop -/* 45BE0 8006A7E0 1000001A */ b .LIQUE_8006A84C -/* 45BE4 8006A7E4 00000000 */ nop -.LIQUE_8006A7E8: -/* 45BE8 8006A7E8 00053823 */ negu $a3, $a1 -/* 45BEC 8006A7EC 30E70003 */ andi $a3, $a3, 0x3 -/* 45BF0 8006A7F0 10E00009 */ beqz $a3, .LIQUE_8006A818 -/* 45BF4 8006A7F4 00C73023 */ subu $a2, $a2, $a3 -/* 45BF8 8006A7F8 00E43821 */ addu $a3, $a3, $a0 -.LIQUE_8006A7FC: -/* 45BFC 8006A7FC 90820000 */ lbu $v0, 0x0($a0) -/* 45C00 8006A800 90A30000 */ lbu $v1, 0x0($a1) -/* 45C04 8006A804 24840001 */ addiu $a0, $a0, 0x1 -/* 45C08 8006A808 1443001B */ bne $v0, $v1, .LIQUE_8006A878 -/* 45C0C 8006A80C 24A50001 */ addiu $a1, $a1, 0x1 -/* 45C10 8006A810 1487FFFA */ bne $a0, $a3, .LIQUE_8006A7FC -/* 45C14 8006A814 00000000 */ nop -.LIQUE_8006A818: -/* 45C18 8006A818 2401FFFC */ addiu $at, $zero, -0x4 -/* 45C1C 8006A81C 00C13824 */ and $a3, $a2, $at -/* 45C20 8006A820 10E0000A */ beqz $a3, .LIQUE_8006A84C -/* 45C24 8006A824 00C73023 */ subu $a2, $a2, $a3 -/* 45C28 8006A828 00E43821 */ addu $a3, $a3, $a0 -.LIQUE_8006A82C: -/* 45C2C 8006A82C 88820000 */ lwl $v0, 0x0($a0) -/* 45C30 8006A830 98820003 */ lwr $v0, 0x3($a0) -/* 45C34 8006A834 8CA30000 */ lw $v1, 0x0($a1) -/* 45C38 8006A838 24840004 */ addiu $a0, $a0, 0x4 -/* 45C3C 8006A83C 1443000E */ bne $v0, $v1, .LIQUE_8006A878 -/* 45C40 8006A840 24A50004 */ addiu $a1, $a1, 0x4 -/* 45C44 8006A844 1487FFF9 */ bne $a0, $a3, .LIQUE_8006A82C -/* 45C48 8006A848 00000000 */ nop -.LIQUE_8006A84C: -/* 45C4C 8006A84C 18C00008 */ blez $a2, .LIQUE_8006A870 -/* 45C50 8006A850 00C43821 */ addu $a3, $a2, $a0 -.LIQUE_8006A854: -/* 45C54 8006A854 90820000 */ lbu $v0, 0x0($a0) -/* 45C58 8006A858 90A30000 */ lbu $v1, 0x0($a1) -/* 45C5C 8006A85C 24840001 */ addiu $a0, $a0, 0x1 -/* 45C60 8006A860 14430005 */ bne $v0, $v1, .LIQUE_8006A878 -/* 45C64 8006A864 24A50001 */ addiu $a1, $a1, 0x1 -/* 45C68 8006A868 1487FFFA */ bne $a0, $a3, .LIQUE_8006A854 -/* 45C6C 8006A86C 00000000 */ nop -.LIQUE_8006A870: -/* 45C70 8006A870 03E00008 */ jr $ra -/* 45C74 8006A874 00001021 */ addu $v0, $zero, $zero -.LIQUE_8006A878: -/* 45C78 8006A878 03E00008 */ jr $ra -/* 45C7C 8006A87C 24020001 */ addiu $v0, $zero, 0x1 diff --git a/ver/ique/asm/os/bcopy.s b/ver/ique/asm/os/bcopy.s deleted file mode 100644 index df4489cbee..0000000000 --- a/ver/ique/asm/os/bcopy.s +++ /dev/null @@ -1,232 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel bcopy -/* 3DC10 80062810 10C0001B */ beqz $a2, .LIQUE_80062880 -/* 3DC14 80062814 00A03821 */ addu $a3, $a1, $zero -/* 3DC18 80062818 10850019 */ beq $a0, $a1, .LIQUE_80062880 -/* 3DC1C 8006281C 00000000 */ nop -/* 3DC20 80062820 00A4082A */ slt $at, $a1, $a0 -/* 3DC24 80062824 14200007 */ bnez $at, .LIQUE_80062844 -/* 3DC28 80062828 00000000 */ nop -/* 3DC2C 8006282C 00861020 */ add $v0, $a0, $a2 # handwritten instruction -/* 3DC30 80062830 00A2082A */ slt $at, $a1, $v0 -/* 3DC34 80062834 10200003 */ beqz $at, .LIQUE_80062844 -/* 3DC38 80062838 00000000 */ nop -/* 3DC3C 8006283C 1000005C */ b .LIQUE_800629B0 -/* 3DC40 80062840 00000000 */ nop -.LIQUE_80062844: -/* 3DC44 80062844 28C10010 */ slti $at, $a2, 0x10 -/* 3DC48 80062848 14200005 */ bnez $at, .LIQUE_80062860 -/* 3DC4C 8006284C 00000000 */ nop -/* 3DC50 80062850 30820003 */ andi $v0, $a0, 0x3 -/* 3DC54 80062854 30A30003 */ andi $v1, $a1, 0x3 -/* 3DC58 80062858 1043000B */ beq $v0, $v1, .LIQUE_80062888 -/* 3DC5C 8006285C 00000000 */ nop -.LIQUE_80062860: -/* 3DC60 80062860 10C00007 */ beqz $a2, .LIQUE_80062880 -/* 3DC64 80062864 00000000 */ nop -/* 3DC68 80062868 00861821 */ addu $v1, $a0, $a2 -.LIQUE_8006286C: -/* 3DC6C 8006286C 80820000 */ lb $v0, 0x0($a0) -/* 3DC70 80062870 24840001 */ addiu $a0, $a0, 0x1 -/* 3DC74 80062874 A0A20000 */ sb $v0, 0x0($a1) -/* 3DC78 80062878 1483FFFC */ bne $a0, $v1, .LIQUE_8006286C -/* 3DC7C 8006287C 24A50001 */ addiu $a1, $a1, 0x1 -.LIQUE_80062880: -/* 3DC80 80062880 03E00008 */ jr $ra -/* 3DC84 80062884 00E01021 */ addu $v0, $a3, $zero -.LIQUE_80062888: -/* 3DC88 80062888 1040001A */ beqz $v0, .LIQUE_800628F4 -/* 3DC8C 8006288C 00000000 */ nop -/* 3DC90 80062890 24010001 */ addiu $at, $zero, 0x1 -/* 3DC94 80062894 10410010 */ beq $v0, $at, .LIQUE_800628D8 -/* 3DC98 80062898 00000000 */ nop -/* 3DC9C 8006289C 24010002 */ addiu $at, $zero, 0x2 -/* 3DCA0 800628A0 10410007 */ beq $v0, $at, .LIQUE_800628C0 -/* 3DCA4 800628A4 00000000 */ nop -/* 3DCA8 800628A8 80820000 */ lb $v0, 0x0($a0) -/* 3DCAC 800628AC 24840001 */ addiu $a0, $a0, 0x1 -/* 3DCB0 800628B0 A0A20000 */ sb $v0, 0x0($a1) -/* 3DCB4 800628B4 24A50001 */ addiu $a1, $a1, 0x1 -/* 3DCB8 800628B8 1000000E */ b .LIQUE_800628F4 -/* 3DCBC 800628BC 24C6FFFF */ addiu $a2, $a2, -0x1 -.LIQUE_800628C0: -/* 3DCC0 800628C0 84820000 */ lh $v0, 0x0($a0) -/* 3DCC4 800628C4 24840002 */ addiu $a0, $a0, 0x2 -/* 3DCC8 800628C8 A4A20000 */ sh $v0, 0x0($a1) -/* 3DCCC 800628CC 24A50002 */ addiu $a1, $a1, 0x2 -/* 3DCD0 800628D0 10000008 */ b .LIQUE_800628F4 -/* 3DCD4 800628D4 24C6FFFE */ addiu $a2, $a2, -0x2 -.LIQUE_800628D8: -/* 3DCD8 800628D8 80820000 */ lb $v0, 0x0($a0) -/* 3DCDC 800628DC 84830001 */ lh $v1, 0x1($a0) -/* 3DCE0 800628E0 24840003 */ addiu $a0, $a0, 0x3 -/* 3DCE4 800628E4 A0A20000 */ sb $v0, 0x0($a1) -/* 3DCE8 800628E8 A4A30001 */ sh $v1, 0x1($a1) -/* 3DCEC 800628EC 24A50003 */ addiu $a1, $a1, 0x3 -/* 3DCF0 800628F0 24C6FFFD */ addiu $a2, $a2, -0x3 -.LIQUE_800628F4: -/* 3DCF4 800628F4 28C10020 */ slti $at, $a2, 0x20 -/* 3DCF8 800628F8 14200015 */ bnez $at, .LIQUE_80062950 -/* 3DCFC 800628FC 00000000 */ nop -/* 3DD00 80062900 8C820000 */ lw $v0, 0x0($a0) -/* 3DD04 80062904 8C830004 */ lw $v1, 0x4($a0) -/* 3DD08 80062908 8C880008 */ lw $t0, 0x8($a0) -/* 3DD0C 8006290C 8C89000C */ lw $t1, 0xC($a0) -/* 3DD10 80062910 8C8A0010 */ lw $t2, 0x10($a0) -/* 3DD14 80062914 8C8B0014 */ lw $t3, 0x14($a0) -/* 3DD18 80062918 8C8C0018 */ lw $t4, 0x18($a0) -/* 3DD1C 8006291C 8C8D001C */ lw $t5, 0x1C($a0) -/* 3DD20 80062920 24840020 */ addiu $a0, $a0, 0x20 -/* 3DD24 80062924 ACA20000 */ sw $v0, 0x0($a1) -/* 3DD28 80062928 ACA30004 */ sw $v1, 0x4($a1) -/* 3DD2C 8006292C ACA80008 */ sw $t0, 0x8($a1) -/* 3DD30 80062930 ACA9000C */ sw $t1, 0xC($a1) -/* 3DD34 80062934 ACAA0010 */ sw $t2, 0x10($a1) -/* 3DD38 80062938 ACAB0014 */ sw $t3, 0x14($a1) -/* 3DD3C 8006293C ACAC0018 */ sw $t4, 0x18($a1) -/* 3DD40 80062940 ACAD001C */ sw $t5, 0x1C($a1) -/* 3DD44 80062944 24A50020 */ addiu $a1, $a1, 0x20 -/* 3DD48 80062948 1000FFEA */ b .LIQUE_800628F4 -/* 3DD4C 8006294C 24C6FFE0 */ addiu $a2, $a2, -0x20 -.LIQUE_80062950: -/* 3DD50 80062950 28C10010 */ slti $at, $a2, 0x10 -/* 3DD54 80062954 1420000D */ bnez $at, .LIQUE_8006298C -/* 3DD58 80062958 00000000 */ nop -/* 3DD5C 8006295C 8C820000 */ lw $v0, 0x0($a0) -/* 3DD60 80062960 8C830004 */ lw $v1, 0x4($a0) -/* 3DD64 80062964 8C880008 */ lw $t0, 0x8($a0) -/* 3DD68 80062968 8C89000C */ lw $t1, 0xC($a0) -/* 3DD6C 8006296C 24840010 */ addiu $a0, $a0, 0x10 -/* 3DD70 80062970 ACA20000 */ sw $v0, 0x0($a1) -/* 3DD74 80062974 ACA30004 */ sw $v1, 0x4($a1) -/* 3DD78 80062978 ACA80008 */ sw $t0, 0x8($a1) -/* 3DD7C 8006297C ACA9000C */ sw $t1, 0xC($a1) -/* 3DD80 80062980 24A50010 */ addiu $a1, $a1, 0x10 -/* 3DD84 80062984 1000FFF2 */ b .LIQUE_80062950 -/* 3DD88 80062988 24C6FFF0 */ addiu $a2, $a2, -0x10 -.LIQUE_8006298C: -/* 3DD8C 8006298C 28C10004 */ slti $at, $a2, 0x4 -/* 3DD90 80062990 1420FFB3 */ bnez $at, .LIQUE_80062860 -/* 3DD94 80062994 00000000 */ nop -/* 3DD98 80062998 8C820000 */ lw $v0, 0x0($a0) -/* 3DD9C 8006299C 24840004 */ addiu $a0, $a0, 0x4 -/* 3DDA0 800629A0 ACA20000 */ sw $v0, 0x0($a1) -/* 3DDA4 800629A4 24A50004 */ addiu $a1, $a1, 0x4 -/* 3DDA8 800629A8 1000FFF8 */ b .LIQUE_8006298C -/* 3DDAC 800629AC 24C6FFFC */ addiu $a2, $a2, -0x4 -.LIQUE_800629B0: -/* 3DDB0 800629B0 00862020 */ add $a0, $a0, $a2 # handwritten instruction -/* 3DDB4 800629B4 00A62820 */ add $a1, $a1, $a2 # handwritten instruction -/* 3DDB8 800629B8 28C10010 */ slti $at, $a2, 0x10 -/* 3DDBC 800629BC 14200005 */ bnez $at, .LIQUE_800629D4 -/* 3DDC0 800629C0 00000000 */ nop -/* 3DDC4 800629C4 30820003 */ andi $v0, $a0, 0x3 -/* 3DDC8 800629C8 30A30003 */ andi $v1, $a1, 0x3 -/* 3DDCC 800629CC 1043000D */ beq $v0, $v1, .LIQUE_80062A04 -/* 3DDD0 800629D0 00000000 */ nop -.LIQUE_800629D4: -/* 3DDD4 800629D4 10C0FFAA */ beqz $a2, .LIQUE_80062880 -/* 3DDD8 800629D8 00000000 */ nop -/* 3DDDC 800629DC 2484FFFF */ addiu $a0, $a0, -0x1 -/* 3DDE0 800629E0 24A5FFFF */ addiu $a1, $a1, -0x1 -/* 3DDE4 800629E4 00861823 */ subu $v1, $a0, $a2 -.LIQUE_800629E8: -/* 3DDE8 800629E8 80820000 */ lb $v0, 0x0($a0) -/* 3DDEC 800629EC 2484FFFF */ addiu $a0, $a0, -0x1 -/* 3DDF0 800629F0 A0A20000 */ sb $v0, 0x0($a1) -/* 3DDF4 800629F4 1483FFFC */ bne $a0, $v1, .LIQUE_800629E8 -/* 3DDF8 800629F8 24A5FFFF */ addiu $a1, $a1, -0x1 -/* 3DDFC 800629FC 03E00008 */ jr $ra -/* 3DE00 80062A00 00E01021 */ addu $v0, $a3, $zero -.LIQUE_80062A04: -/* 3DE04 80062A04 1040001A */ beqz $v0, .LIQUE_80062A70 -/* 3DE08 80062A08 00000000 */ nop -/* 3DE0C 80062A0C 24010003 */ addiu $at, $zero, 0x3 -/* 3DE10 80062A10 10410010 */ beq $v0, $at, .LIQUE_80062A54 -/* 3DE14 80062A14 00000000 */ nop -/* 3DE18 80062A18 24010002 */ addiu $at, $zero, 0x2 -/* 3DE1C 80062A1C 10410007 */ beq $v0, $at, .LIQUE_80062A3C -/* 3DE20 80062A20 00000000 */ nop -/* 3DE24 80062A24 8082FFFF */ lb $v0, -0x1($a0) -/* 3DE28 80062A28 2484FFFF */ addiu $a0, $a0, -0x1 -/* 3DE2C 80062A2C A0A2FFFF */ sb $v0, -0x1($a1) -/* 3DE30 80062A30 24A5FFFF */ addiu $a1, $a1, -0x1 -/* 3DE34 80062A34 1000000E */ b .LIQUE_80062A70 -/* 3DE38 80062A38 24C6FFFF */ addiu $a2, $a2, -0x1 -.LIQUE_80062A3C: -/* 3DE3C 80062A3C 8482FFFE */ lh $v0, -0x2($a0) -/* 3DE40 80062A40 2484FFFE */ addiu $a0, $a0, -0x2 -/* 3DE44 80062A44 A4A2FFFE */ sh $v0, -0x2($a1) -/* 3DE48 80062A48 24A5FFFE */ addiu $a1, $a1, -0x2 -/* 3DE4C 80062A4C 10000008 */ b .LIQUE_80062A70 -/* 3DE50 80062A50 24C6FFFE */ addiu $a2, $a2, -0x2 -.LIQUE_80062A54: -/* 3DE54 80062A54 8082FFFF */ lb $v0, -0x1($a0) -/* 3DE58 80062A58 8483FFFD */ lh $v1, -0x3($a0) -/* 3DE5C 80062A5C 2484FFFD */ addiu $a0, $a0, -0x3 -/* 3DE60 80062A60 A0A2FFFF */ sb $v0, -0x1($a1) -/* 3DE64 80062A64 A4A3FFFD */ sh $v1, -0x3($a1) -/* 3DE68 80062A68 24A5FFFD */ addiu $a1, $a1, -0x3 -/* 3DE6C 80062A6C 24C6FFFD */ addiu $a2, $a2, -0x3 -.LIQUE_80062A70: -/* 3DE70 80062A70 28C10020 */ slti $at, $a2, 0x20 -/* 3DE74 80062A74 14200015 */ bnez $at, .LIQUE_80062ACC -/* 3DE78 80062A78 00000000 */ nop -/* 3DE7C 80062A7C 8C82FFFC */ lw $v0, -0x4($a0) -/* 3DE80 80062A80 8C83FFF8 */ lw $v1, -0x8($a0) -/* 3DE84 80062A84 8C88FFF4 */ lw $t0, -0xC($a0) -/* 3DE88 80062A88 8C89FFF0 */ lw $t1, -0x10($a0) -/* 3DE8C 80062A8C 8C8AFFEC */ lw $t2, -0x14($a0) -/* 3DE90 80062A90 8C8BFFE8 */ lw $t3, -0x18($a0) -/* 3DE94 80062A94 8C8CFFE4 */ lw $t4, -0x1C($a0) -/* 3DE98 80062A98 8C8DFFE0 */ lw $t5, -0x20($a0) -/* 3DE9C 80062A9C 2484FFE0 */ addiu $a0, $a0, -0x20 -/* 3DEA0 80062AA0 ACA2FFFC */ sw $v0, -0x4($a1) -/* 3DEA4 80062AA4 ACA3FFF8 */ sw $v1, -0x8($a1) -/* 3DEA8 80062AA8 ACA8FFF4 */ sw $t0, -0xC($a1) -/* 3DEAC 80062AAC ACA9FFF0 */ sw $t1, -0x10($a1) -/* 3DEB0 80062AB0 ACAAFFEC */ sw $t2, -0x14($a1) -/* 3DEB4 80062AB4 ACABFFE8 */ sw $t3, -0x18($a1) -/* 3DEB8 80062AB8 ACACFFE4 */ sw $t4, -0x1C($a1) -/* 3DEBC 80062ABC ACADFFE0 */ sw $t5, -0x20($a1) -/* 3DEC0 80062AC0 24A5FFE0 */ addiu $a1, $a1, -0x20 -/* 3DEC4 80062AC4 1000FFEA */ b .LIQUE_80062A70 -/* 3DEC8 80062AC8 24C6FFE0 */ addiu $a2, $a2, -0x20 -.LIQUE_80062ACC: -/* 3DECC 80062ACC 28C10010 */ slti $at, $a2, 0x10 -/* 3DED0 80062AD0 1420000D */ bnez $at, .LIQUE_80062B08 -/* 3DED4 80062AD4 00000000 */ nop -/* 3DED8 80062AD8 8C82FFFC */ lw $v0, -0x4($a0) -/* 3DEDC 80062ADC 8C83FFF8 */ lw $v1, -0x8($a0) -/* 3DEE0 80062AE0 8C88FFF4 */ lw $t0, -0xC($a0) -/* 3DEE4 80062AE4 8C89FFF0 */ lw $t1, -0x10($a0) -/* 3DEE8 80062AE8 2484FFF0 */ addiu $a0, $a0, -0x10 -/* 3DEEC 80062AEC ACA2FFFC */ sw $v0, -0x4($a1) -/* 3DEF0 80062AF0 ACA3FFF8 */ sw $v1, -0x8($a1) -/* 3DEF4 80062AF4 ACA8FFF4 */ sw $t0, -0xC($a1) -/* 3DEF8 80062AF8 ACA9FFF0 */ sw $t1, -0x10($a1) -/* 3DEFC 80062AFC 24A5FFF0 */ addiu $a1, $a1, -0x10 -/* 3DF00 80062B00 1000FFF2 */ b .LIQUE_80062ACC -/* 3DF04 80062B04 24C6FFF0 */ addiu $a2, $a2, -0x10 -.LIQUE_80062B08: -/* 3DF08 80062B08 28C10004 */ slti $at, $a2, 0x4 -/* 3DF0C 80062B0C 1420FFB1 */ bnez $at, .LIQUE_800629D4 -/* 3DF10 80062B10 00000000 */ nop -/* 3DF14 80062B14 8C82FFFC */ lw $v0, -0x4($a0) -/* 3DF18 80062B18 2484FFFC */ addiu $a0, $a0, -0x4 -/* 3DF1C 80062B1C ACA2FFFC */ sw $v0, -0x4($a1) -/* 3DF20 80062B20 24A5FFFC */ addiu $a1, $a1, -0x4 -/* 3DF24 80062B24 1000FFF8 */ b .LIQUE_80062B08 -/* 3DF28 80062B28 24C6FFFC */ addiu $a2, $a2, -0x4 -/* 3DF2C 80062B2C 00000000 */ nop diff --git a/ver/ique/asm/os/bzero.s b/ver/ique/asm/os/bzero.s deleted file mode 100644 index a3311c41e4..0000000000 --- a/ver/ique/asm/os/bzero.s +++ /dev/null @@ -1,59 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel bzero -/* 3DF30 80062B30 00041823 */ negu $v1, $a0 -/* 3DF34 80062B34 28A1000C */ slti $at, $a1, 0xC -/* 3DF38 80062B38 1420001D */ bnez $at, .LIQUE_80062BB0 -/* 3DF3C 80062B3C 00000000 */ nop -/* 3DF40 80062B40 30630003 */ andi $v1, $v1, 0x3 -/* 3DF44 80062B44 10600003 */ beqz $v1, .LIQUE_80062B54 -/* 3DF48 80062B48 00A32823 */ subu $a1, $a1, $v1 -/* 3DF4C 80062B4C A8800000 */ swl $zero, 0x0($a0) -/* 3DF50 80062B50 00832021 */ addu $a0, $a0, $v1 -.LIQUE_80062B54: -/* 3DF54 80062B54 2401FFE0 */ addiu $at, $zero, -0x20 -/* 3DF58 80062B58 00A13824 */ and $a3, $a1, $at -/* 3DF5C 80062B5C 10E0000C */ beqz $a3, .LIQUE_80062B90 -/* 3DF60 80062B60 00A72823 */ subu $a1, $a1, $a3 -/* 3DF64 80062B64 00E43821 */ addu $a3, $a3, $a0 -.LIQUE_80062B68: -/* 3DF68 80062B68 AC800000 */ sw $zero, 0x0($a0) -/* 3DF6C 80062B6C AC800004 */ sw $zero, 0x4($a0) -/* 3DF70 80062B70 AC800008 */ sw $zero, 0x8($a0) -/* 3DF74 80062B74 AC80000C */ sw $zero, 0xC($a0) -/* 3DF78 80062B78 24840020 */ addiu $a0, $a0, 0x20 -/* 3DF7C 80062B7C AC80FFF0 */ sw $zero, -0x10($a0) -/* 3DF80 80062B80 AC80FFF4 */ sw $zero, -0xC($a0) -/* 3DF84 80062B84 AC80FFF8 */ sw $zero, -0x8($a0) -/* 3DF88 80062B88 1487FFF7 */ bne $a0, $a3, .LIQUE_80062B68 -/* 3DF8C 80062B8C AC80FFFC */ sw $zero, -0x4($a0) -.LIQUE_80062B90: -/* 3DF90 80062B90 2401FFFC */ addiu $at, $zero, -0x4 -/* 3DF94 80062B94 00A13824 */ and $a3, $a1, $at -/* 3DF98 80062B98 10E00005 */ beqz $a3, .LIQUE_80062BB0 -/* 3DF9C 80062B9C 00A72823 */ subu $a1, $a1, $a3 -/* 3DFA0 80062BA0 00E43821 */ addu $a3, $a3, $a0 -.LIQUE_80062BA4: -/* 3DFA4 80062BA4 24840004 */ addiu $a0, $a0, 0x4 -/* 3DFA8 80062BA8 1487FFFE */ bne $a0, $a3, .LIQUE_80062BA4 -/* 3DFAC 80062BAC AC80FFFC */ sw $zero, -0x4($a0) -.LIQUE_80062BB0: -/* 3DFB0 80062BB0 18A00005 */ blez $a1, .LIQUE_80062BC8 -/* 3DFB4 80062BB4 00000000 */ nop -/* 3DFB8 80062BB8 00A42821 */ addu $a1, $a1, $a0 -.LIQUE_80062BBC: -/* 3DFBC 80062BBC 24840001 */ addiu $a0, $a0, 0x1 -/* 3DFC0 80062BC0 1485FFFE */ bne $a0, $a1, .LIQUE_80062BBC -/* 3DFC4 80062BC4 A080FFFF */ sb $zero, -0x1($a0) -.LIQUE_80062BC8: -/* 3DFC8 80062BC8 03E00008 */ jr $ra -/* 3DFCC 80062BCC 00000000 */ nop diff --git a/ver/ique/asm/os/decode_yay0.s b/ver/ique/asm/os/decode_yay0.s deleted file mode 100644 index 6ccf3dad5e..0000000000 --- a/ver/ique/asm/os/decode_yay0.s +++ /dev/null @@ -1,63 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel decode_yay0 -/* 49780 8006E380 8C980004 */ lw $t8, 0x4($a0) -/* 49784 8006E384 8C870008 */ lw $a3, 0x8($a0) -/* 49788 8006E388 8C99000C */ lw $t9, 0xC($a0) -/* 4978C 8006E38C 0000302D */ daddu $a2, $zero, $zero -/* 49790 8006E390 0305C020 */ add $t8, $t8, $a1 # handwritten instruction -/* 49794 8006E394 00E43820 */ add $a3, $a3, $a0 # handwritten instruction -/* 49798 8006E398 0324C820 */ add $t9, $t9, $a0 # handwritten instruction -/* 4979C 8006E39C 20840010 */ addi $a0, $a0, 0x10 # handwritten instruction -.LIQUE_8006E3A0: -/* 497A0 8006E3A0 14C00004 */ bnez $a2, .LIQUE_8006E3B4 -/* 497A4 8006E3A4 00000000 */ nop -/* 497A8 8006E3A8 8C880000 */ lw $t0, 0x0($a0) -/* 497AC 8006E3AC 24060020 */ addiu $a2, $zero, 0x20 -/* 497B0 8006E3B0 20840004 */ addi $a0, $a0, 0x4 # handwritten instruction -.LIQUE_8006E3B4: -/* 497B4 8006E3B4 0100482A */ slt $t1, $t0, $zero -/* 497B8 8006E3B8 11200006 */ beqz $t1, .LIQUE_8006E3D4 -/* 497BC 8006E3BC 00000000 */ nop -/* 497C0 8006E3C0 832A0000 */ lb $t2, 0x0($t9) -/* 497C4 8006E3C4 23390001 */ addi $t9, $t9, 0x1 # handwritten instruction -/* 497C8 8006E3C8 A0AA0000 */ sb $t2, 0x0($a1) -/* 497CC 8006E3CC 1000000E */ b .LIQUE_8006E408 -/* 497D0 8006E3D0 20A50001 */ addi $a1, $a1, 0x1 # handwritten instruction -.LIQUE_8006E3D4: -/* 497D4 8006E3D4 94EA0000 */ lhu $t2, 0x0($a3) -/* 497D8 8006E3D8 20E70002 */ addi $a3, $a3, 0x2 # handwritten instruction -/* 497DC 8006E3DC 000A5B02 */ srl $t3, $t2, 12 -/* 497E0 8006E3E0 314A0FFF */ andi $t2, $t2, 0xFFF -/* 497E4 8006E3E4 1160000D */ beqz $t3, .LIQUE_8006E41C -/* 497E8 8006E3E8 00AA4822 */ sub $t1, $a1, $t2 -/* 497EC 8006E3EC 216B0002 */ addi $t3, $t3, 0x2 # handwritten instruction -.LIQUE_8006E3F0: -/* 497F0 8006E3F0 812AFFFF */ lb $t2, -0x1($t1) -/* 497F4 8006E3F4 216BFFFF */ addi $t3, $t3, -0x1 # handwritten instruction -/* 497F8 8006E3F8 21290001 */ addi $t1, $t1, 0x1 # handwritten instruction -/* 497FC 8006E3FC A0AA0000 */ sb $t2, 0x0($a1) -/* 49800 8006E400 1560FFFB */ bnez $t3, .LIQUE_8006E3F0 -/* 49804 8006E404 20A50001 */ addi $a1, $a1, 0x1 # handwritten instruction -.LIQUE_8006E408: -/* 49808 8006E408 00084040 */ sll $t0, $t0, 1 -/* 4980C 8006E40C 14B8FFE4 */ bne $a1, $t8, .LIQUE_8006E3A0 -/* 49810 8006E410 20C6FFFF */ addi $a2, $a2, -0x1 # handwritten instruction -/* 49814 8006E414 03E00008 */ jr $ra -/* 49818 8006E418 00000000 */ nop -.LIQUE_8006E41C: -/* 4981C 8006E41C 932B0000 */ lbu $t3, 0x0($t9) -/* 49820 8006E420 23390001 */ addi $t9, $t9, 0x1 # handwritten instruction -/* 49824 8006E424 1000FFF2 */ b .LIQUE_8006E3F0 -/* 49828 8006E428 216B0012 */ addi $t3, $t3, 0x12 # handwritten instruction -/* 4982C 8006E42C 00000000 */ nop diff --git a/ver/ique/asm/os/exceptasm.s b/ver/ique/asm/os/exceptasm.s deleted file mode 100644 index 2eec30a6db..0000000000 --- a/ver/ique/asm/os/exceptasm.s +++ /dev/null @@ -1,842 +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 - -__osIntOffTable: -/* 73CB0 800988B0 */ .byte 0x00 -/* 73CB1 800988B1 */ .byte 0x14 -/* 73CB2 800988B2 */ .byte 0x18 -/* 73CB3 800988B3 */ .byte 0x18 -/* 73CB4 800988B4 */ .byte 0x1C -/* 73CB5 800988B5 */ .byte 0x1C -/* 73CB6 800988B6 */ .byte 0x1C -/* 73CB7 800988B7 */ .byte 0x1C -/* 73CB8 800988B8 */ .byte 0x20 -/* 73CB9 800988B9 */ .byte 0x20 -/* 73CBA 800988BA */ .byte 0x20 -/* 73CBB 800988BB */ .byte 0x20 -/* 73CBC 800988BC */ .byte 0x20 -/* 73CBD 800988BD */ .byte 0x20 -/* 73CBE 800988BE */ .byte 0x20 -/* 73CBF 800988BF */ .byte 0x20 -/* 73CC0 800988C0 */ .byte 0x00 -/* 73CC1 800988C1 */ .byte 0x04 -/* 73CC2 800988C2 */ .byte 0x08 -/* 73CC3 800988C3 */ .byte 0x08 -/* 73CC4 800988C4 */ .byte 0x0C -/* 73CC5 800988C5 */ .byte 0x0C -/* 73CC6 800988C6 */ .byte 0x0C -/* 73CC7 800988C7 */ .byte 0x0C -/* 73CC8 800988C8 */ .byte 0x10 -/* 73CC9 800988C9 */ .byte 0x10 -/* 73CCA 800988CA */ .byte 0x10 -/* 73CCB 800988CB */ .byte 0x10 -/* 73CCC 800988CC */ .byte 0x10 -/* 73CCD 800988CD */ .byte 0x10 -/* 73CCE 800988CE */ .byte 0x10 -/* 73CCF 800988CF */ .byte 0x10 -.size __osIntOffTable, . - __osIntOffTable - -__osIntTable: -/* 73CD0 800988D0 80066894 */ .word .LIQUE_80066894 -/* 73CD4 800988D4 80066858 */ .word .LIQUE_80066858 -/* 73CD8 800988D8 80066834 */ .word .LIQUE_80066834 -/* 73CDC 800988DC 8006664C */ .word .LIQUE_8006664C -/* 73CE0 800988E0 80066508 */ .word .LIQUE_80066508 -/* 73CE4 800988E4 800667C0 */ .word .LIQUE_800667C0 -/* 73CE8 800988E8 800664CC */ .word .LIQUE_800664CC -/* 73CEC 800988EC 800664D8 */ .word .LIQUE_800664D8 -/* 73CF0 800988F0 800664E4 */ .word .LIQUE_800664E4 -/* 73CF4 800988F4 00000000 */ .word 0x00000000 -/* 73CF8 800988F8 00000000 */ .word 0x00000000 -/* 73CFC 800988FC 00000000 */ .word 0x00000000 -.size __osIntTable, . - __osIntTable - -.section .data - -__osHwIntTable: -/* 6F8F0 800944F0 */ .word 0x00000000 -/* 6F8F4 800944F4 */ .word 0x00000000 -/* 6F8F8 800944F8 */ .word 0x00000000 -/* 6F8FC 800944FC */ .word 0x00000000 -/* 6F900 80094500 */ .word 0x00000000 -/* 6F904 80094504 */ .word 0x00000000 -/* 6F908 80094508 */ .word 0x00000000 -/* 6F90C 8009450C */ .word 0x00000000 -/* 6F910 80094510 */ .word 0x00000000 -/* 6F914 80094514 */ .word 0x00000000 -.size __osHwIntTable, . - __osHwIntTable - -__osPiIntTable: -/* 6F918 80094518 */ .word 0x00000000 -/* 6F91C 8009451C */ .word 0x00000000 -.size __osPiIntTable, . - __osPiIntTable - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osExceptionPreamble -/* 41630 80066230 3C1A8006 */ lui $k0, %hi(__osException) # handwritten instruction -/* 41634 80066234 675A6240 */ daddiu $k0, $k0, %lo(__osException) # handwritten instruction -/* 41638 80066238 03400008 */ jr $k0 -/* 4163C 8006623C 00000000 */ nop - -# Handwritten function -glabel __osException -/* 41640 80066240 3C1A800B */ lui $k0, %hi(__osThreadSave) # handwritten instruction -/* 41644 80066244 675AF740 */ daddiu $k0, $k0, %lo(__osThreadSave) # handwritten instruction -/* 41648 80066248 FF410020 */ sd $at, 0x20($k0) # handwritten instruction -/* 4164C 8006624C 401B6000 */ mfc0 $k1, $12 # handwritten instruction -/* 41650 80066250 AF5B0118 */ sw $k1, 0x118($k0) # handwritten instruction -/* 41654 80066254 2401FFFC */ addiu $at, $zero, -0x4 -/* 41658 80066258 0361D824 */ and $k1, $k1, $at -/* 4165C 8006625C 409B6000 */ mtc0 $k1, $12 # handwritten instruction -/* 41660 80066260 FF480058 */ sd $t0, 0x58($k0) # handwritten instruction -/* 41664 80066264 FF490060 */ sd $t1, 0x60($k0) # handwritten instruction -/* 41668 80066268 FF4A0068 */ sd $t2, 0x68($k0) # handwritten instruction -/* 4166C 8006626C AF400018 */ sw $zero, 0x18($k0) # handwritten instruction -/* 41670 80066270 40086800 */ mfc0 $t0, $13 # handwritten instruction -/* 41674 80066274 0340402D */ daddu $t0, $k0, $zero -/* 41678 80066278 3C1A8009 */ lui $k0, %hi(__osRunningThread) # handwritten instruction -/* 4167C 8006627C 8F5A3280 */ lw $k0, %lo(__osRunningThread)($k0) # handwritten instruction -/* 41680 80066280 DD090020 */ ld $t1, 0x20($t0) -/* 41684 80066284 FF490020 */ sd $t1, 0x20($k0) # handwritten instruction -/* 41688 80066288 DD090118 */ ld $t1, 0x118($t0) -/* 4168C 8006628C FF490118 */ sd $t1, 0x118($k0) # handwritten instruction -/* 41690 80066290 DD090058 */ ld $t1, 0x58($t0) -/* 41694 80066294 FF490058 */ sd $t1, 0x58($k0) # handwritten instruction -/* 41698 80066298 DD090060 */ ld $t1, 0x60($t0) -/* 4169C 8006629C FF490060 */ sd $t1, 0x60($k0) # handwritten instruction -/* 416A0 800662A0 DD090068 */ ld $t1, 0x68($t0) -/* 416A4 800662A4 FF490068 */ sd $t1, 0x68($k0) # handwritten instruction -/* 416A8 800662A8 FF420028 */ sd $v0, 0x28($k0) # handwritten instruction -/* 416AC 800662AC FF430030 */ sd $v1, 0x30($k0) # handwritten instruction -/* 416B0 800662B0 FF440038 */ sd $a0, 0x38($k0) # handwritten instruction -/* 416B4 800662B4 FF450040 */ sd $a1, 0x40($k0) # handwritten instruction -/* 416B8 800662B8 FF460048 */ sd $a2, 0x48($k0) # handwritten instruction -/* 416BC 800662BC FF470050 */ sd $a3, 0x50($k0) # handwritten instruction -/* 416C0 800662C0 FF4B0070 */ sd $t3, 0x70($k0) # handwritten instruction -/* 416C4 800662C4 FF4C0078 */ sd $t4, 0x78($k0) # handwritten instruction -/* 416C8 800662C8 FF4D0080 */ sd $t5, 0x80($k0) # handwritten instruction -/* 416CC 800662CC FF4E0088 */ sd $t6, 0x88($k0) # handwritten instruction -/* 416D0 800662D0 FF4F0090 */ sd $t7, 0x90($k0) # handwritten instruction -/* 416D4 800662D4 FF500098 */ sd $s0, 0x98($k0) # handwritten instruction -/* 416D8 800662D8 FF5100A0 */ sd $s1, 0xA0($k0) # handwritten instruction -/* 416DC 800662DC FF5200A8 */ sd $s2, 0xA8($k0) # handwritten instruction -/* 416E0 800662E0 FF5300B0 */ sd $s3, 0xB0($k0) # handwritten instruction -/* 416E4 800662E4 FF5400B8 */ sd $s4, 0xB8($k0) # handwritten instruction -/* 416E8 800662E8 FF5500C0 */ sd $s5, 0xC0($k0) # handwritten instruction -/* 416EC 800662EC FF5600C8 */ sd $s6, 0xC8($k0) # handwritten instruction -/* 416F0 800662F0 FF5700D0 */ sd $s7, 0xD0($k0) # handwritten instruction -/* 416F4 800662F4 FF5800D8 */ sd $t8, 0xD8($k0) # handwritten instruction -/* 416F8 800662F8 FF5900E0 */ sd $t9, 0xE0($k0) # handwritten instruction -/* 416FC 800662FC FF5C00E8 */ sd $gp, 0xE8($k0) # handwritten instruction -/* 41700 80066300 FF5D00F0 */ sd $sp, 0xF0($k0) # handwritten instruction -/* 41704 80066304 FF5E00F8 */ sd $fp, 0xF8($k0) # handwritten instruction -/* 41708 80066308 FF5F0100 */ sd $ra, 0x100($k0) # handwritten instruction -/* 4170C 8006630C 00004012 */ mflo $t0 -/* 41710 80066310 FF480108 */ sd $t0, 0x108($k0) # handwritten instruction -/* 41714 80066314 00004010 */ mfhi $t0 -/* 41718 80066318 FF480110 */ sd $t0, 0x110($k0) # handwritten instruction -/* 4171C 8006631C 8F5B0118 */ lw $k1, 0x118($k0) # handwritten instruction -/* 41720 80066320 3369FF00 */ andi $t1, $k1, 0xFF00 # handwritten instruction -/* 41724 80066324 11200014 */ beqz $t1, .LIQUE_80066378 -/* 41728 80066328 00000000 */ nop -/* 4172C 8006632C 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 41730 80066330 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 41734 80066334 8D080000 */ lw $t0, 0x0($t0) -/* 41738 80066338 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) -/* 4173C 8006633C 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) -/* 41740 80066340 01015026 */ xor $t2, $t0, $at -/* 41744 80066344 314AFF00 */ andi $t2, $t2, 0xFF00 -/* 41748 80066348 012A6025 */ or $t4, $t1, $t2 -/* 4174C 8006634C 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 41750 80066350 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 41754 80066354 03615824 */ and $t3, $k1, $at -/* 41758 80066358 016C5825 */ or $t3, $t3, $t4 -/* 4175C 8006635C AF4B0118 */ sw $t3, 0x118($k0) # handwritten instruction -/* 41760 80066360 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 41764 80066364 01284824 */ and $t1, $t1, $t0 -/* 41768 80066368 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 4176C 8006636C 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 41770 80066370 0361D824 */ and $k1, $k1, $at -/* 41774 80066374 0369D825 */ or $k1, $k1, $t1 -.LIQUE_80066378: -/* 41778 80066378 3C09A430 */ lui $t1, %hi(D_A430000C) -/* 4177C 8006637C 8D29000C */ lw $t1, %lo(D_A430000C)($t1) -/* 41780 80066380 1120000C */ beqz $t1, .LIQUE_800663B4 -/* 41784 80066384 00000000 */ nop -/* 41788 80066388 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 4178C 8006638C 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 41790 80066390 8D080000 */ lw $t0, 0x0($t0) -/* 41794 80066394 00084402 */ srl $t0, $t0, 16 -/* 41798 80066398 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) -/* 4179C 8006639C 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) -/* 417A0 800663A0 01014026 */ xor $t0, $t0, $at -/* 417A4 800663A4 3108003F */ andi $t0, $t0, 0x3F -/* 417A8 800663A8 8F4C0128 */ lw $t4, 0x128($k0) # handwritten instruction -/* 417AC 800663AC 010C4024 */ and $t0, $t0, $t4 -/* 417B0 800663B0 01284825 */ or $t1, $t1, $t0 -.LIQUE_800663B4: -/* 417B4 800663B4 AF490128 */ sw $t1, 0x128($k0) # handwritten instruction -/* 417B8 800663B8 40087000 */ mfc0 $t0, $14 # handwritten instruction -/* 417BC 800663BC AF48011C */ sw $t0, 0x11C($k0) # handwritten instruction -/* 417C0 800663C0 8F480018 */ lw $t0, 0x18($k0) # handwritten instruction -/* 417C4 800663C4 11000014 */ beqz $t0, .LIQUE_80066418 -/* 417C8 800663C8 00000000 */ nop -/* 417CC 800663CC 4448F800 */ cfc1 $t0, $31 -/* 417D0 800663D0 00000000 */ nop -/* 417D4 800663D4 AF48012C */ sw $t0, 0x12C($k0) # handwritten instruction -/* 417D8 800663D8 F7400130 */ sdc1 $f0, 0x130($k0) -/* 417DC 800663DC F7420138 */ sdc1 $f2, 0x138($k0) -/* 417E0 800663E0 F7440140 */ sdc1 $f4, 0x140($k0) -/* 417E4 800663E4 F7460148 */ sdc1 $f6, 0x148($k0) -/* 417E8 800663E8 F7480150 */ sdc1 $f8, 0x150($k0) -/* 417EC 800663EC F74A0158 */ sdc1 $f10, 0x158($k0) -/* 417F0 800663F0 F74C0160 */ sdc1 $f12, 0x160($k0) -/* 417F4 800663F4 F74E0168 */ sdc1 $f14, 0x168($k0) -/* 417F8 800663F8 F7500170 */ sdc1 $f16, 0x170($k0) -/* 417FC 800663FC F7520178 */ sdc1 $f18, 0x178($k0) -/* 41800 80066400 F7540180 */ sdc1 $f20, 0x180($k0) -/* 41804 80066404 F7560188 */ sdc1 $f22, 0x188($k0) -/* 41808 80066408 F7580190 */ sdc1 $f24, 0x190($k0) -/* 4180C 8006640C F75A0198 */ sdc1 $f26, 0x198($k0) -/* 41810 80066410 F75C01A0 */ sdc1 $f28, 0x1A0($k0) -/* 41814 80066414 F75E01A8 */ sdc1 $f30, 0x1A8($k0) -.LIQUE_80066418: -/* 41818 80066418 40086800 */ mfc0 $t0, $13 # handwritten instruction -/* 4181C 8006641C AF480120 */ sw $t0, 0x120($k0) # handwritten instruction -/* 41820 80066420 24090002 */ addiu $t1, $zero, 0x2 -/* 41824 80066424 A7490010 */ sh $t1, 0x10($k0) # handwritten instruction -/* 41828 80066428 3109007C */ andi $t1, $t0, 0x7C -/* 4182C 8006642C 240A0024 */ addiu $t2, $zero, 0x24 -/* 41830 80066430 112A0112 */ beq $t1, $t2, .LIQUE_8006687C -/* 41834 80066434 00000000 */ nop -/* 41838 80066438 240A002C */ addiu $t2, $zero, 0x2C -/* 4183C 8006643C 112A0164 */ beq $t1, $t2, .LIQUE_800669D0 -/* 41840 80066440 00000000 */ nop -/* 41844 80066444 240A0000 */ addiu $t2, $zero, 0x0 -/* 41848 80066448 152A0126 */ bne $t1, $t2, .LIQUE_800668E4 -/* 4184C 8006644C 00000000 */ nop -/* 41850 80066450 3C098009 */ lui $t1, %hi(__osShutdown) -/* 41854 80066454 652945AC */ daddiu $t1, $t1, %lo(__osShutdown) -/* 41858 80066458 8D2A0000 */ lw $t2, 0x0($t1) -/* 4185C 8006645C 1140000C */ beqz $t2, .LIQUE_80066490 -/* 41860 80066460 00000000 */ nop -/* 41864 80066464 3C098009 */ lui $t1, %hi(__osShutdownTime) -/* 41868 80066468 652945B0 */ daddiu $t1, $t1, %lo(__osShutdownTime) -/* 4186C 8006646C 8D290000 */ lw $t1, 0x0($t1) -/* 41870 80066470 400A4800 */ mfc0 $t2, $9 # handwritten instruction -/* 41874 80066474 01495023 */ subu $t2, $t2, $t1 -/* 41878 80066478 3C090500 */ lui $t1, (0x5000000 >> 16) -/* 4187C 8006647C 012A482B */ sltu $t1, $t1, $t2 -/* 41880 80066480 11200003 */ beqz $t1, .LIQUE_80066490 -/* 41884 80066484 00000000 */ nop -/* 41888 80066488 0C019FEB */ jal skExit -/* 4188C 8006648C 00000000 */ nop -.LIQUE_80066490: -/* 41890 80066490 03688024 */ and $s0, $k1, $t0 -.LIQUE_80066494: -/* 41894 80066494 3209FF00 */ andi $t1, $s0, 0xFF00 -/* 41898 80066498 00095302 */ srl $t2, $t1, 12 -/* 4189C 8006649C 15400003 */ bnez $t2, .LIQUE_800664AC -/* 418A0 800664A0 00000000 */ nop -/* 418A4 800664A4 00095202 */ srl $t2, $t1, 8 -/* 418A8 800664A8 214A0010 */ addi $t2, $t2, 0x10 # handwritten instruction -.LIQUE_800664AC: -/* 418AC 800664AC 3C01800A */ lui $at, %hi(__osIntOffTable) -/* 418B0 800664B0 002A082D */ daddu $at, $at, $t2 -/* 418B4 800664B4 902A88B0 */ lbu $t2, %lo(__osIntOffTable)($at) -/* 418B8 800664B8 3C01800A */ lui $at, %hi(__osIntTable) -/* 418BC 800664BC 002A082D */ daddu $at, $at, $t2 -/* 418C0 800664C0 8C2A88D0 */ lw $t2, %lo(__osIntTable)($at) -/* 418C4 800664C4 01400008 */ jr $t2 -/* 418C8 800664C8 00000000 */ nop -glabel .LIQUE_800664CC -/* 418CC 800664CC 2401DFFF */ addiu $at, $zero, -0x2001 -/* 418D0 800664D0 1000FFF0 */ b .LIQUE_80066494 -/* 418D4 800664D4 02018024 */ and $s0, $s0, $at -glabel .LIQUE_800664D8 -/* 418D8 800664D8 2401BFFF */ addiu $at, $zero, -0x4001 -/* 418DC 800664DC 1000FFED */ b .LIQUE_80066494 -/* 418E0 800664E0 02018024 */ and $s0, $s0, $at -glabel .LIQUE_800664E4 -/* 418E4 800664E4 40095800 */ mfc0 $t1, $11 # handwritten instruction -/* 418E8 800664E8 40895800 */ mtc0 $t1, $11 # handwritten instruction -/* 418EC 800664EC 24040018 */ addiu $a0, $zero, 0x18 -/* 418F0 800664F0 0C019A45 */ jal send_mesg -/* 418F4 800664F4 00000000 */ nop -/* 418F8 800664F8 3C01FFFF */ lui $at, (0xFFFF7FFF >> 16) -/* 418FC 800664FC 34217FFF */ ori $at, $at, (0xFFFF7FFF & 0xFFFF) -/* 41900 80066500 1000FFE4 */ b .LIQUE_80066494 -/* 41904 80066504 02018024 */ and $s0, $s0, $at -glabel .LIQUE_80066508 -/* 41908 80066508 2401F7FF */ addiu $at, $zero, -0x801 -/* 4190C 8006650C 02018024 */ and $s0, $s0, $at -/* 41910 80066510 3C098009 */ lui $t1, %hi(__osHwIntTable) -/* 41914 80066514 652944F0 */ daddiu $t1, $t1, %lo(__osHwIntTable) -/* 41918 80066518 21290008 */ addi $t1, $t1, 0x8 # handwritten instruction -/* 4191C 8006651C 8D2A0000 */ lw $t2, 0x0($t1) -/* 41920 80066520 11400007 */ beqz $t2, .LIQUE_80066540 -/* 41924 80066524 00000000 */ nop -/* 41928 80066528 0140F809 */ jalr $t2 -/* 4192C 8006652C 8D3D0004 */ lw $sp, 0x4($t1) -/* 41930 80066530 10400003 */ beqz $v0, .LIQUE_80066540 -/* 41934 80066534 00000000 */ nop -/* 41938 80066538 100000D6 */ b .LIQUE_80066894 -/* 4193C 8006653C 00000000 */ nop -.LIQUE_80066540: -/* 41940 80066540 3C11A430 */ lui $s1, %hi(D_A4300038) -/* 41944 80066544 8E310038 */ lw $s1, %lo(D_A4300038)($s1) -/* 41948 80066548 32290040 */ andi $t1, $s1, 0x40 -/* 4194C 8006654C 11200007 */ beqz $t1, .LIQUE_8006656C -/* 41950 80066550 00000000 */ nop -/* 41954 80066554 32313F80 */ andi $s1, $s1, 0x3F80 -/* 41958 80066558 24090000 */ addiu $t1, $zero, 0x0 -/* 4195C 8006655C 3C01A460 */ lui $at, %hi(D_A4600048) -/* 41960 80066560 AC290048 */ sw $t1, %lo(D_A4600048)($at) -/* 41964 80066564 0C019A45 */ jal send_mesg -/* 41968 80066568 240400B8 */ addiu $a0, $zero, 0xB8 -.LIQUE_8006656C: -/* 4196C 8006656C 32292000 */ andi $t1, $s1, 0x2000 -/* 41970 80066570 11200007 */ beqz $t1, .LIQUE_80066590 -/* 41974 80066574 00000000 */ nop -/* 41978 80066578 32311FC0 */ andi $s1, $s1, 0x1FC0 -/* 4197C 8006657C 24092000 */ addiu $t1, $zero, 0x2000 -/* 41980 80066580 3C01A430 */ lui $at, %hi(D_A4300038) -/* 41984 80066584 AC290038 */ sw $t1, %lo(D_A4300038)($at) -/* 41988 80066588 0C019A45 */ jal send_mesg -/* 4198C 8006658C 240400F0 */ addiu $a0, $zero, 0xF0 -.LIQUE_80066590: -/* 41990 80066590 32290080 */ andi $t1, $s1, 0x80 -/* 41994 80066594 11200007 */ beqz $t1, .LIQUE_800665B4 -/* 41998 80066598 00000000 */ nop -/* 4199C 8006659C 32313F40 */ andi $s1, $s1, 0x3F40 -/* 419A0 800665A0 24094000 */ addiu $t1, $zero, 0x4000 -/* 419A4 800665A4 3C01A430 */ lui $at, %hi(D_A430003C) -/* 419A8 800665A8 AC29003C */ sw $t1, %lo(D_A430003C)($at) -/* 419AC 800665AC 0C019A45 */ jal send_mesg -/* 419B0 800665B0 240400C0 */ addiu $a0, $zero, 0xC0 -.LIQUE_800665B4: -/* 419B4 800665B4 32290100 */ andi $t1, $s1, 0x100 -/* 419B8 800665B8 11200007 */ beqz $t1, .LIQUE_800665D8 -/* 419BC 800665BC 00000000 */ nop -/* 419C0 800665C0 32313EC0 */ andi $s1, $s1, 0x3EC0 -/* 419C4 800665C4 3C090001 */ lui $t1, (0x10000 >> 16) -/* 419C8 800665C8 3C01A430 */ lui $at, %hi(D_A430003C) -/* 419CC 800665CC AC29003C */ sw $t1, %lo(D_A430003C)($at) -/* 419D0 800665D0 0C019A45 */ jal send_mesg -/* 419D4 800665D4 240400C8 */ addiu $a0, $zero, 0xC8 -.LIQUE_800665D8: -/* 419D8 800665D8 32290200 */ andi $t1, $s1, 0x200 -/* 419DC 800665DC 11200007 */ beqz $t1, .LIQUE_800665FC -/* 419E0 800665E0 00000000 */ nop -/* 419E4 800665E4 32313DC0 */ andi $s1, $s1, 0x3DC0 -/* 419E8 800665E8 3C090004 */ lui $t1, (0x40000 >> 16) -/* 419EC 800665EC 3C01A430 */ lui $at, %hi(D_A430003C) -/* 419F0 800665F0 AC29003C */ sw $t1, %lo(D_A430003C)($at) -/* 419F4 800665F4 0C019A45 */ jal send_mesg -/* 419F8 800665F8 240400D0 */ addiu $a0, $zero, 0xD0 -.LIQUE_800665FC: -/* 419FC 800665FC 32290400 */ andi $t1, $s1, 0x400 -/* 41A00 80066600 11200007 */ beqz $t1, .LIQUE_80066620 -/* 41A04 80066604 00000000 */ nop -/* 41A08 80066608 32313BC0 */ andi $s1, $s1, 0x3BC0 -/* 41A0C 8006660C 3C090010 */ lui $t1, (0x100000 >> 16) -/* 41A10 80066610 3C01A430 */ lui $at, %hi(D_A430003C) -/* 41A14 80066614 AC29003C */ sw $t1, %lo(D_A430003C)($at) -/* 41A18 80066618 0C019A45 */ jal send_mesg -/* 41A1C 8006661C 240400D8 */ addiu $a0, $zero, 0xD8 -.LIQUE_80066620: -/* 41A20 80066620 32290800 */ andi $t1, $s1, 0x800 -/* 41A24 80066624 11200007 */ beqz $t1, .LIQUE_80066644 -/* 41A28 80066628 00000000 */ nop -/* 41A2C 8006662C 323137C0 */ andi $s1, $s1, 0x37C0 -/* 41A30 80066630 3C090040 */ lui $t1, (0x400000 >> 16) -/* 41A34 80066634 3C01A430 */ lui $at, %hi(D_A430003C) -/* 41A38 80066638 AC29003C */ sw $t1, %lo(D_A430003C)($at) -/* 41A3C 8006663C 0C019A45 */ jal send_mesg -/* 41A40 80066640 240400E0 */ addiu $a0, $zero, 0xE0 -.LIQUE_80066644: -/* 41A44 80066644 1000FF93 */ b .LIQUE_80066494 -/* 41A48 80066648 00000000 */ nop -glabel .LIQUE_8006664C -/* 41A4C 8006664C 3C11A430 */ lui $s1, %hi(D_A4300008) -/* 41A50 80066650 8E310008 */ lw $s1, %lo(D_A4300008)($s1) -/* 41A54 80066654 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 41A58 80066658 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 41A5C 8006665C 8D080000 */ lw $t0, 0x0($t0) -/* 41A60 80066660 00084402 */ srl $t0, $t0, 16 -/* 41A64 80066664 02288824 */ and $s1, $s1, $t0 -/* 41A68 80066668 32290001 */ andi $t1, $s1, 0x1 -/* 41A6C 8006666C 11200014 */ beqz $t1, .LIQUE_800666C0 -/* 41A70 80066670 00000000 */ nop -/* 41A74 80066674 3231003E */ andi $s1, $s1, 0x3E -/* 41A78 80066678 3C0CA404 */ lui $t4, %hi(D_A4040010) -/* 41A7C 8006667C 8D8C0010 */ lw $t4, %lo(D_A4040010)($t4) -/* 41A80 80066680 34098008 */ ori $t1, $zero, 0x8008 -/* 41A84 80066684 3C01A404 */ lui $at, %hi(D_A4040010) -/* 41A88 80066688 AC290010 */ sw $t1, %lo(D_A4040010)($at) -/* 41A8C 8006668C 318C0300 */ andi $t4, $t4, 0x300 -/* 41A90 80066690 11800007 */ beqz $t4, .LIQUE_800666B0 -/* 41A94 80066694 00000000 */ nop -/* 41A98 80066698 0C019A45 */ jal send_mesg -/* 41A9C 8006669C 24040020 */ addiu $a0, $zero, 0x20 -/* 41AA0 800666A0 12200044 */ beqz $s1, .LIQUE_800667B4 -/* 41AA4 800666A4 00000000 */ nop -/* 41AA8 800666A8 10000005 */ b .LIQUE_800666C0 -/* 41AAC 800666AC 00000000 */ nop -.LIQUE_800666B0: -/* 41AB0 800666B0 0C019A45 */ jal send_mesg -/* 41AB4 800666B4 24040058 */ addiu $a0, $zero, 0x58 -/* 41AB8 800666B8 1220003E */ beqz $s1, .LIQUE_800667B4 -/* 41ABC 800666BC 00000000 */ nop -.LIQUE_800666C0: -/* 41AC0 800666C0 32290008 */ andi $t1, $s1, 0x8 -/* 41AC4 800666C4 11200008 */ beqz $t1, .LIQUE_800666E8 -/* 41AC8 800666C8 00000000 */ nop -/* 41ACC 800666CC 32310037 */ andi $s1, $s1, 0x37 -/* 41AD0 800666D0 3C01A440 */ lui $at, %hi(D_A4400010) -/* 41AD4 800666D4 AC200010 */ sw $zero, %lo(D_A4400010)($at) -/* 41AD8 800666D8 0C019A45 */ jal send_mesg -/* 41ADC 800666DC 24040038 */ addiu $a0, $zero, 0x38 -/* 41AE0 800666E0 12200034 */ beqz $s1, .LIQUE_800667B4 -/* 41AE4 800666E4 00000000 */ nop -.LIQUE_800666E8: -/* 41AE8 800666E8 32290004 */ andi $t1, $s1, 0x4 -/* 41AEC 800666EC 11200009 */ beqz $t1, .LIQUE_80066714 -/* 41AF0 800666F0 00000000 */ nop -/* 41AF4 800666F4 3231003B */ andi $s1, $s1, 0x3B -/* 41AF8 800666F8 24090001 */ addiu $t1, $zero, 0x1 -/* 41AFC 800666FC 3C01A450 */ lui $at, %hi(D_A450000C) -/* 41B00 80066700 AC29000C */ sw $t1, %lo(D_A450000C)($at) -/* 41B04 80066704 0C019A45 */ jal send_mesg -/* 41B08 80066708 24040030 */ addiu $a0, $zero, 0x30 -/* 41B0C 8006670C 12200029 */ beqz $s1, .LIQUE_800667B4 -/* 41B10 80066710 00000000 */ nop -.LIQUE_80066714: -/* 41B14 80066714 32290002 */ andi $t1, $s1, 0x2 -/* 41B18 80066718 11200008 */ beqz $t1, .LIQUE_8006673C -/* 41B1C 8006671C 00000000 */ nop -/* 41B20 80066720 3231003D */ andi $s1, $s1, 0x3D -/* 41B24 80066724 3C01A480 */ lui $at, %hi(D_A4800018) -/* 41B28 80066728 AC200018 */ sw $zero, %lo(D_A4800018)($at) -/* 41B2C 8006672C 0C019A45 */ jal send_mesg -/* 41B30 80066730 24040028 */ addiu $a0, $zero, 0x28 -/* 41B34 80066734 1220001F */ beqz $s1, .LIQUE_800667B4 -/* 41B38 80066738 00000000 */ nop -.LIQUE_8006673C: -/* 41B3C 8006673C 32290010 */ andi $t1, $s1, 0x10 -/* 41B40 80066740 11200013 */ beqz $t1, .LIQUE_80066790 -/* 41B44 80066744 00000000 */ nop -/* 41B48 80066748 3231002F */ andi $s1, $s1, 0x2F -/* 41B4C 8006674C 24090002 */ addiu $t1, $zero, 0x2 -/* 41B50 80066750 3C01A460 */ lui $at, %hi(D_A4600010) -/* 41B54 80066754 AC290010 */ sw $t1, %lo(D_A4600010)($at) -/* 41B58 80066758 3C098009 */ lui $t1, %hi(__osPiIntTable) -/* 41B5C 8006675C 65294518 */ daddiu $t1, $t1, %lo(__osPiIntTable) -/* 41B60 80066760 8D2A0000 */ lw $t2, 0x0($t1) -/* 41B64 80066764 11400006 */ beqz $t2, .LIQUE_80066780 -/* 41B68 80066768 00000000 */ nop -/* 41B6C 8006676C 8D3D0004 */ lw $sp, 0x4($t1) -/* 41B70 80066770 0140F809 */ jalr $t2 -/* 41B74 80066774 0040202D */ daddu $a0, $v0, $zero -/* 41B78 80066778 14400003 */ bnez $v0, .LIQUE_80066788 -/* 41B7C 8006677C 00000000 */ nop -.LIQUE_80066780: -/* 41B80 80066780 0C019A45 */ jal send_mesg -/* 41B84 80066784 24040040 */ addiu $a0, $zero, 0x40 -.LIQUE_80066788: -/* 41B88 80066788 1220000A */ beqz $s1, .LIQUE_800667B4 -/* 41B8C 8006678C 00000000 */ nop -.LIQUE_80066790: -/* 41B90 80066790 32290020 */ andi $t1, $s1, 0x20 -/* 41B94 80066794 11200007 */ beqz $t1, .LIQUE_800667B4 -/* 41B98 80066798 00000000 */ nop -/* 41B9C 8006679C 3231001F */ andi $s1, $s1, 0x1F -/* 41BA0 800667A0 24090800 */ addiu $t1, $zero, 0x800 -/* 41BA4 800667A4 3C01A430 */ lui $at, %hi(D_A4300000) -/* 41BA8 800667A8 AC290000 */ sw $t1, %lo(D_A4300000)($at) -/* 41BAC 800667AC 0C019A45 */ jal send_mesg -/* 41BB0 800667B0 24040048 */ addiu $a0, $zero, 0x48 -.LIQUE_800667B4: -/* 41BB4 800667B4 2401FBFF */ addiu $at, $zero, -0x401 -/* 41BB8 800667B8 1000FF36 */ b .LIQUE_80066494 -/* 41BBC 800667BC 02018024 */ and $s0, $s0, $at -glabel .LIQUE_800667C0 -/* 41BC0 800667C0 8F5B0118 */ lw $k1, 0x118($k0) # handwritten instruction -/* 41BC4 800667C4 2401EFFF */ addiu $at, $zero, -0x1001 -/* 41BC8 800667C8 0361D824 */ and $k1, $k1, $at -/* 41BCC 800667CC AF5B0118 */ sw $k1, 0x118($k0) # handwritten instruction -/* 41BD0 800667D0 3C098009 */ lui $t1, %hi(__osShutdown) -/* 41BD4 800667D4 652945AC */ daddiu $t1, $t1, %lo(__osShutdown) -/* 41BD8 800667D8 8D2A0000 */ lw $t2, 0x0($t1) -/* 41BDC 800667DC 11400004 */ beqz $t2, .LIQUE_800667F0 -/* 41BE0 800667E0 00000000 */ nop -/* 41BE4 800667E4 2401EFFF */ addiu $at, $zero, -0x1001 -/* 41BE8 800667E8 1000002A */ b .LIQUE_80066894 -/* 41BEC 800667EC 02018024 */ and $s0, $s0, $at -.LIQUE_800667F0: -/* 41BF0 800667F0 240A0001 */ addiu $t2, $zero, 0x1 -/* 41BF4 800667F4 AD2A0000 */ sw $t2, 0x0($t1) -/* 41BF8 800667F8 400A4800 */ mfc0 $t2, $9 # handwritten instruction -/* 41BFC 800667FC 3C098009 */ lui $t1, %hi(__osShutdownTime) -/* 41C00 80066800 652945B0 */ daddiu $t1, $t1, %lo(__osShutdownTime) -/* 41C04 80066804 AD2A0000 */ sw $t2, 0x0($t1) -/* 41C08 80066808 0C019A45 */ jal send_mesg -/* 41C0C 8006680C 24040070 */ addiu $a0, $zero, 0x70 -/* 41C10 80066810 2401EFFF */ addiu $at, $zero, -0x1001 -/* 41C14 80066814 02018024 */ and $s0, $s0, $at -/* 41C18 80066818 3C0A8009 */ lui $t2, %hi(__osRunQueue) -/* 41C1C 8006681C 8D4A3278 */ lw $t2, %lo(__osRunQueue)($t2) -/* 41C20 80066820 8D5B0118 */ lw $k1, 0x118($t2) # handwritten instruction -/* 41C24 80066824 2401EFFF */ addiu $at, $zero, -0x1001 -/* 41C28 80066828 0361D824 */ and $k1, $k1, $at -/* 41C2C 8006682C 10000019 */ b .LIQUE_80066894 -/* 41C30 80066830 AD5B0118 */ sw $k1, 0x118($t2) # handwritten instruction -glabel .LIQUE_80066834 -/* 41C34 80066834 2401FDFF */ addiu $at, $zero, -0x201 -/* 41C38 80066838 01014024 */ and $t0, $t0, $at -/* 41C3C 8006683C 40886800 */ mtc0 $t0, $13 # handwritten instruction -/* 41C40 80066840 24040008 */ addiu $a0, $zero, 0x8 -/* 41C44 80066844 0C019A45 */ jal send_mesg -/* 41C48 80066848 00000000 */ nop -/* 41C4C 8006684C 2401FDFF */ addiu $at, $zero, -0x201 -/* 41C50 80066850 1000FF10 */ b .LIQUE_80066494 -/* 41C54 80066854 02018024 */ and $s0, $s0, $at -glabel .LIQUE_80066858 -/* 41C58 80066858 2401FEFF */ addiu $at, $zero, -0x101 -/* 41C5C 8006685C 01014024 */ and $t0, $t0, $at -/* 41C60 80066860 40886800 */ mtc0 $t0, $13 # handwritten instruction -/* 41C64 80066864 24040000 */ addiu $a0, $zero, 0x0 -/* 41C68 80066868 0C019A45 */ jal send_mesg -/* 41C6C 8006686C 00000000 */ nop -/* 41C70 80066870 2401FEFF */ addiu $at, $zero, -0x101 -/* 41C74 80066874 1000FF07 */ b .LIQUE_80066494 -/* 41C78 80066878 02018024 */ and $s0, $s0, $at -.LIQUE_8006687C: -/* 41C7C 8006687C 24090001 */ addiu $t1, $zero, 0x1 -/* 41C80 80066880 A7490012 */ sh $t1, 0x12($k0) # handwritten instruction -/* 41C84 80066884 0C019A45 */ jal send_mesg -/* 41C88 80066888 24040050 */ addiu $a0, $zero, 0x50 -/* 41C8C 8006688C 10000001 */ b .LIQUE_80066894 -/* 41C90 80066890 00000000 */ nop -glabel .LIQUE_80066894 -/* 41C94 80066894 8F490004 */ lw $t1, 0x4($k0) # handwritten instruction -/* 41C98 80066898 3C0A8009 */ lui $t2, %hi(__osRunQueue) -/* 41C9C 8006689C 8D4A3278 */ lw $t2, %lo(__osRunQueue)($t2) -/* 41CA0 800668A0 8D4B0004 */ lw $t3, 0x4($t2) -/* 41CA4 800668A4 012B082A */ slt $at, $t1, $t3 -/* 41CA8 800668A8 10200008 */ beqz $at, .LIQUE_800668CC -/* 41CAC 800668AC 00000000 */ nop -/* 41CB0 800668B0 0340282D */ daddu $a1, $k0, $zero -/* 41CB4 800668B4 3C048009 */ lui $a0, %hi(__osRunQueue) -/* 41CB8 800668B8 64843278 */ daddiu $a0, $a0, %lo(__osRunQueue) -/* 41CBC 800668BC 0C019AC4 */ jal __osEnqueueThread -/* 41CC0 800668C0 00000000 */ nop -/* 41CC4 800668C4 08019ADC */ j __osDispatchThread -/* 41CC8 800668C8 00000000 */ nop -.LIQUE_800668CC: -/* 41CCC 800668CC 3C098009 */ lui $t1, %hi(__osRunQueue) -/* 41CD0 800668D0 65293278 */ daddiu $t1, $t1, %lo(__osRunQueue) -/* 41CD4 800668D4 8D2A0000 */ lw $t2, 0x0($t1) -/* 41CD8 800668D8 AF4A0000 */ sw $t2, 0x0($k0) # handwritten instruction -/* 41CDC 800668DC 08019ADC */ j __osDispatchThread -/* 41CE0 800668E0 AD3A0000 */ sw $k0, 0x0($t1) # handwritten instruction -.LIQUE_800668E4: -/* 41CE4 800668E4 3C018009 */ lui $at, %hi(__osFaultedThread) -/* 41CE8 800668E8 AC3A3284 */ sw $k0, %lo(__osFaultedThread)($at) # handwritten instruction -/* 41CEC 800668EC 24090001 */ addiu $t1, $zero, 0x1 -/* 41CF0 800668F0 A7490010 */ sh $t1, 0x10($k0) # handwritten instruction -/* 41CF4 800668F4 24090002 */ addiu $t1, $zero, 0x2 -/* 41CF8 800668F8 A7490012 */ sh $t1, 0x12($k0) # handwritten instruction -/* 41CFC 800668FC 400A4000 */ mfc0 $t2, $8 # handwritten instruction -/* 41D00 80066900 AF4A0124 */ sw $t2, 0x124($k0) # handwritten instruction -/* 41D04 80066904 0C019A45 */ jal send_mesg -/* 41D08 80066908 24040060 */ addiu $a0, $zero, 0x60 -/* 41D0C 8006690C 08019ADC */ j __osDispatchThread -/* 41D10 80066910 00000000 */ nop - -# Handwritten function -glabel send_mesg -/* 41D14 80066914 03E0902D */ daddu $s2, $ra, $zero -/* 41D18 80066918 3C0A800E */ lui $t2, %hi(__osEventStateTab) -/* 41D1C 8006691C 654A825C */ daddiu $t2, $t2, %lo(__osEventStateTab) -/* 41D20 80066920 01445021 */ addu $t2, $t2, $a0 -/* 41D24 80066924 8D490000 */ lw $t1, 0x0($t2) -/* 41D28 80066928 11200027 */ beqz $t1, .LIQUE_800669C8 -/* 41D2C 8006692C 00000000 */ nop -/* 41D30 80066930 8D2B0008 */ lw $t3, 0x8($t1) -/* 41D34 80066934 8D2C0010 */ lw $t4, 0x10($t1) -/* 41D38 80066938 016C082A */ slt $at, $t3, $t4 -/* 41D3C 8006693C 10200022 */ beqz $at, .LIQUE_800669C8 -/* 41D40 80066940 00000000 */ nop -/* 41D44 80066944 8D2D000C */ lw $t5, 0xC($t1) -/* 41D48 80066948 01AB6821 */ addu $t5, $t5, $t3 -/* 41D4C 8006694C 15800002 */ bnez $t4, .LIQUE_80066958 -/* 41D50 80066950 01AC001A */ div $zero, $t5, $t4 -/* 41D54 80066954 0007000D */ break 7 -.LIQUE_80066958: -/* 41D58 80066958 2401FFFF */ addiu $at, $zero, -0x1 -/* 41D5C 8006695C 15810004 */ bne $t4, $at, .LIQUE_80066970 -/* 41D60 80066960 3C018000 */ lui $at, (0x80000000 >> 16) -/* 41D64 80066964 15A10002 */ bne $t5, $at, .LIQUE_80066970 -/* 41D68 80066968 00000000 */ nop -/* 41D6C 8006696C 0006000D */ break 6 -.LIQUE_80066970: -/* 41D70 80066970 00006810 */ mfhi $t5 -/* 41D74 80066974 8D2C0014 */ lw $t4, 0x14($t1) -/* 41D78 80066978 24010004 */ addiu $at, $zero, 0x4 -/* 41D7C 8006697C 01A10018 */ mult $t5, $at -/* 41D80 80066980 00006812 */ mflo $t5 -/* 41D84 80066984 018D6021 */ addu $t4, $t4, $t5 -/* 41D88 80066988 8D4D0004 */ lw $t5, 0x4($t2) -/* 41D8C 8006698C AD8D0000 */ sw $t5, 0x0($t4) -/* 41D90 80066990 256A0001 */ addiu $t2, $t3, 0x1 -/* 41D94 80066994 AD2A0008 */ sw $t2, 0x8($t1) -/* 41D98 80066998 8D2A0000 */ lw $t2, 0x0($t1) -/* 41D9C 8006699C 8D4B0000 */ lw $t3, 0x0($t2) -/* 41DA0 800669A0 11600009 */ beqz $t3, .LIQUE_800669C8 -/* 41DA4 800669A4 00000000 */ nop -/* 41DA8 800669A8 0C019AD6 */ jal __osPopThread -/* 41DAC 800669AC 0120202D */ daddu $a0, $t1, $zero -/* 41DB0 800669B0 0040502D */ daddu $t2, $v0, $zero -/* 41DB4 800669B4 0140282D */ daddu $a1, $t2, $zero -/* 41DB8 800669B8 3C048009 */ lui $a0, %hi(__osRunQueue) -/* 41DBC 800669BC 64843278 */ daddiu $a0, $a0, %lo(__osRunQueue) -/* 41DC0 800669C0 0C019AC4 */ jal __osEnqueueThread -/* 41DC4 800669C4 00000000 */ nop -.LIQUE_800669C8: -/* 41DC8 800669C8 02400008 */ jr $s2 -/* 41DCC 800669CC 00000000 */ nop -.LIQUE_800669D0: -/* 41DD0 800669D0 3C013000 */ lui $at, (0x30000000 >> 16) -/* 41DD4 800669D4 01014824 */ and $t1, $t0, $at -/* 41DD8 800669D8 00094F02 */ srl $t1, $t1, 28 -/* 41DDC 800669DC 240A0001 */ addiu $t2, $zero, 0x1 -/* 41DE0 800669E0 152AFFC0 */ bne $t1, $t2, .LIQUE_800668E4 -/* 41DE4 800669E4 00000000 */ nop -/* 41DE8 800669E8 24090001 */ addiu $t1, $zero, 0x1 -/* 41DEC 800669EC AF490018 */ sw $t1, 0x18($k0) # handwritten instruction -/* 41DF0 800669F0 8F5B0118 */ lw $k1, 0x118($k0) # handwritten instruction -/* 41DF4 800669F4 3C012000 */ lui $at, (0x20000000 >> 16) -/* 41DF8 800669F8 0361D825 */ or $k1, $k1, $at -/* 41DFC 800669FC 1000FFB3 */ b .LIQUE_800668CC -/* 41E00 80066A00 AF5B0118 */ sw $k1, 0x118($k0) # handwritten instruction - -# Handwritten function -glabel __osEnqueueAndYield -/* 41E04 80066A04 3C058009 */ lui $a1, %hi(__osRunningThread) -/* 41E08 80066A08 8CA53280 */ lw $a1, %lo(__osRunningThread)($a1) -/* 41E0C 80066A0C 40086000 */ mfc0 $t0, $12 # handwritten instruction -/* 41E10 80066A10 35080002 */ ori $t0, $t0, 0x2 -/* 41E14 80066A14 ACA80118 */ sw $t0, 0x118($a1) -/* 41E18 80066A18 FCB00098 */ sd $s0, 0x98($a1) -/* 41E1C 80066A1C FCB100A0 */ sd $s1, 0xA0($a1) -/* 41E20 80066A20 FCB200A8 */ sd $s2, 0xA8($a1) -/* 41E24 80066A24 FCB300B0 */ sd $s3, 0xB0($a1) -/* 41E28 80066A28 FCB400B8 */ sd $s4, 0xB8($a1) -/* 41E2C 80066A2C FCB500C0 */ sd $s5, 0xC0($a1) -/* 41E30 80066A30 FCB600C8 */ sd $s6, 0xC8($a1) -/* 41E34 80066A34 FCB700D0 */ sd $s7, 0xD0($a1) -/* 41E38 80066A38 FCBC00E8 */ sd $gp, 0xE8($a1) -/* 41E3C 80066A3C FCBD00F0 */ sd $sp, 0xF0($a1) -/* 41E40 80066A40 FCBE00F8 */ sd $fp, 0xF8($a1) -/* 41E44 80066A44 FCBF0100 */ sd $ra, 0x100($a1) -/* 41E48 80066A48 ACBF011C */ sw $ra, 0x11C($a1) -/* 41E4C 80066A4C 8CBB0018 */ lw $k1, 0x18($a1) # handwritten instruction -/* 41E50 80066A50 13600009 */ beqz $k1, .LIQUE_80066A78 # handwritten instruction -/* 41E54 80066A54 00000000 */ nop -/* 41E58 80066A58 445BF800 */ cfc1 $k1, $31 -/* 41E5C 80066A5C ACBB012C */ sw $k1, 0x12C($a1) # handwritten instruction -/* 41E60 80066A60 F4B40180 */ sdc1 $f20, 0x180($a1) -/* 41E64 80066A64 F4B60188 */ sdc1 $f22, 0x188($a1) -/* 41E68 80066A68 F4B80190 */ sdc1 $f24, 0x190($a1) -/* 41E6C 80066A6C F4BA0198 */ sdc1 $f26, 0x198($a1) -/* 41E70 80066A70 F4BC01A0 */ sdc1 $f28, 0x1A0($a1) -/* 41E74 80066A74 F4BE01A8 */ sdc1 $f30, 0x1A8($a1) -.LIQUE_80066A78: -/* 41E78 80066A78 8CBB0118 */ lw $k1, 0x118($a1) # handwritten instruction -/* 41E7C 80066A7C 3369FF00 */ andi $t1, $k1, 0xFF00 # handwritten instruction -/* 41E80 80066A80 1120000E */ beqz $t1, .LIQUE_80066ABC -/* 41E84 80066A84 00000000 */ nop -/* 41E88 80066A88 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 41E8C 80066A8C 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 41E90 80066A90 8D080000 */ lw $t0, 0x0($t0) -/* 41E94 80066A94 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) -/* 41E98 80066A98 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) -/* 41E9C 80066A9C 01014026 */ xor $t0, $t0, $at -/* 41EA0 80066AA0 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 41EA4 80066AA4 01284825 */ or $t1, $t1, $t0 -/* 41EA8 80066AA8 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 41EAC 80066AAC 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 41EB0 80066AB0 0361D824 */ and $k1, $k1, $at -/* 41EB4 80066AB4 0369D825 */ or $k1, $k1, $t1 -/* 41EB8 80066AB8 ACBB0118 */ sw $k1, 0x118($a1) # handwritten instruction -.LIQUE_80066ABC: -/* 41EBC 80066ABC 3C1BA430 */ lui $k1, %hi(D_A430000C) # handwritten instruction -/* 41EC0 80066AC0 8F7B000C */ lw $k1, %lo(D_A430000C)($k1) # handwritten instruction -/* 41EC4 80066AC4 1360000C */ beqz $k1, .LIQUE_80066AF8 # handwritten instruction -/* 41EC8 80066AC8 00000000 */ nop -/* 41ECC 80066ACC 3C1A8009 */ lui $k0, %hi(__OSGlobalIntMask) # handwritten instruction -/* 41ED0 80066AD0 675A45B4 */ daddiu $k0, $k0, %lo(__OSGlobalIntMask) # handwritten instruction -/* 41ED4 80066AD4 8F5A0000 */ lw $k0, 0x0($k0) # handwritten instruction -/* 41ED8 80066AD8 001AD402 */ srl $k0, $k0, 16 -/* 41EDC 80066ADC 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) -/* 41EE0 80066AE0 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) -/* 41EE4 80066AE4 0341D026 */ xor $k0, $k0, $at -/* 41EE8 80066AE8 335A003F */ andi $k0, $k0, 0x3F # handwritten instruction -/* 41EEC 80066AEC 8CA80128 */ lw $t0, 0x128($a1) -/* 41EF0 80066AF0 0348D024 */ and $k0, $k0, $t0 -/* 41EF4 80066AF4 037AD825 */ or $k1, $k1, $k0 -.LIQUE_80066AF8: -/* 41EF8 80066AF8 10800003 */ beqz $a0, .LIQUE_80066B08 -/* 41EFC 80066AFC ACBB0128 */ sw $k1, 0x128($a1) # handwritten instruction -/* 41F00 80066B00 0C019AC4 */ jal __osEnqueueThread -/* 41F04 80066B04 00000000 */ nop -.LIQUE_80066B08: -/* 41F08 80066B08 08019ADC */ j __osDispatchThread -/* 41F0C 80066B0C 00000000 */ nop - -glabel __osEnqueueThread -/* 41F10 80066B10 0080C82D */ daddu $t9, $a0, $zero -/* 41F14 80066B14 8C980000 */ lw $t8, 0x0($a0) -/* 41F18 80066B18 8CAF0004 */ lw $t7, 0x4($a1) -/* 41F1C 80066B1C 8F0E0004 */ lw $t6, 0x4($t8) -/* 41F20 80066B20 01CF082A */ slt $at, $t6, $t7 -/* 41F24 80066B24 14200007 */ bnez $at, .LIQUE_80066B44 -/* 41F28 80066B28 00000000 */ nop -.LIQUE_80066B2C: -/* 41F2C 80066B2C 0300C82D */ daddu $t9, $t8, $zero -/* 41F30 80066B30 8F180000 */ lw $t8, 0x0($t8) -/* 41F34 80066B34 8F0E0004 */ lw $t6, 0x4($t8) -/* 41F38 80066B38 01CF082A */ slt $at, $t6, $t7 -/* 41F3C 80066B3C 1020FFFB */ beqz $at, .LIQUE_80066B2C -/* 41F40 80066B40 00000000 */ nop -.LIQUE_80066B44: -/* 41F44 80066B44 8F380000 */ lw $t8, 0x0($t9) -/* 41F48 80066B48 ACB80000 */ sw $t8, 0x0($a1) -/* 41F4C 80066B4C AF250000 */ sw $a1, 0x0($t9) -/* 41F50 80066B50 03E00008 */ jr $ra -/* 41F54 80066B54 ACA40008 */ sw $a0, 0x8($a1) - -glabel __osPopThread -/* 41F58 80066B58 8C820000 */ lw $v0, 0x0($a0) -/* 41F5C 80066B5C 8C590000 */ lw $t9, 0x0($v0) -/* 41F60 80066B60 03E00008 */ jr $ra -/* 41F64 80066B64 AC990000 */ sw $t9, 0x0($a0) -/* 41F68 80066B68 03E00008 */ jr $ra -/* 41F6C 80066B6C 00000000 */ nop - -# Handwritten function -glabel __osDispatchThread -/* 41F70 80066B70 3C048009 */ lui $a0, %hi(__osRunQueue) -/* 41F74 80066B74 64843278 */ daddiu $a0, $a0, %lo(__osRunQueue) -/* 41F78 80066B78 0C019AD6 */ jal __osPopThread -/* 41F7C 80066B7C 00000000 */ nop -/* 41F80 80066B80 3C018009 */ lui $at, %hi(__osRunningThread) -/* 41F84 80066B84 AC223280 */ sw $v0, %lo(__osRunningThread)($at) -/* 41F88 80066B88 24080004 */ addiu $t0, $zero, 0x4 -/* 41F8C 80066B8C A4480010 */ sh $t0, 0x10($v0) -/* 41F90 80066B90 0040D02D */ daddu $k0, $v0, $zero -/* 41F94 80066B94 8F5B0118 */ lw $k1, 0x118($k0) # handwritten instruction -/* 41F98 80066B98 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 41F9C 80066B9C 650845B4 */ daddiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 41FA0 80066BA0 8D080000 */ lw $t0, 0x0($t0) -/* 41FA4 80066BA4 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 41FA8 80066BA8 3369FF00 */ andi $t1, $k1, 0xFF00 # handwritten instruction -/* 41FAC 80066BAC 01284824 */ and $t1, $t1, $t0 -/* 41FB0 80066BB0 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 41FB4 80066BB4 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 41FB8 80066BB8 0361D824 */ and $k1, $k1, $at -/* 41FBC 80066BBC 0369D825 */ or $k1, $k1, $t1 -/* 41FC0 80066BC0 409B6000 */ mtc0 $k1, $12 # handwritten instruction -/* 41FC4 80066BC4 DF410020 */ ld $at, 0x20($k0) # handwritten instruction -/* 41FC8 80066BC8 DF420028 */ ld $v0, 0x28($k0) # handwritten instruction -/* 41FCC 80066BCC DF430030 */ ld $v1, 0x30($k0) # handwritten instruction -/* 41FD0 80066BD0 DF440038 */ ld $a0, 0x38($k0) # handwritten instruction -/* 41FD4 80066BD4 DF450040 */ ld $a1, 0x40($k0) # handwritten instruction -/* 41FD8 80066BD8 DF460048 */ ld $a2, 0x48($k0) # handwritten instruction -/* 41FDC 80066BDC DF470050 */ ld $a3, 0x50($k0) # handwritten instruction -/* 41FE0 80066BE0 DF480058 */ ld $t0, 0x58($k0) # handwritten instruction -/* 41FE4 80066BE4 DF490060 */ ld $t1, 0x60($k0) # handwritten instruction -/* 41FE8 80066BE8 DF4A0068 */ ld $t2, 0x68($k0) # handwritten instruction -/* 41FEC 80066BEC DF4B0070 */ ld $t3, 0x70($k0) # handwritten instruction -/* 41FF0 80066BF0 DF4C0078 */ ld $t4, 0x78($k0) # handwritten instruction -/* 41FF4 80066BF4 DF4D0080 */ ld $t5, 0x80($k0) # handwritten instruction -/* 41FF8 80066BF8 DF4E0088 */ ld $t6, 0x88($k0) # handwritten instruction -/* 41FFC 80066BFC DF4F0090 */ ld $t7, 0x90($k0) # handwritten instruction -/* 42000 80066C00 DF500098 */ ld $s0, 0x98($k0) # handwritten instruction -/* 42004 80066C04 DF5100A0 */ ld $s1, 0xA0($k0) # handwritten instruction -/* 42008 80066C08 DF5200A8 */ ld $s2, 0xA8($k0) # handwritten instruction -/* 4200C 80066C0C DF5300B0 */ ld $s3, 0xB0($k0) # handwritten instruction -/* 42010 80066C10 DF5400B8 */ ld $s4, 0xB8($k0) # handwritten instruction -/* 42014 80066C14 DF5500C0 */ ld $s5, 0xC0($k0) # handwritten instruction -/* 42018 80066C18 DF5600C8 */ ld $s6, 0xC8($k0) # handwritten instruction -/* 4201C 80066C1C DF5700D0 */ ld $s7, 0xD0($k0) # handwritten instruction -/* 42020 80066C20 DF5800D8 */ ld $t8, 0xD8($k0) # handwritten instruction -/* 42024 80066C24 DF5900E0 */ ld $t9, 0xE0($k0) # handwritten instruction -/* 42028 80066C28 DF5C00E8 */ ld $gp, 0xE8($k0) # handwritten instruction -/* 4202C 80066C2C DF5D00F0 */ ld $sp, 0xF0($k0) # handwritten instruction -/* 42030 80066C30 DF5E00F8 */ ld $fp, 0xF8($k0) # handwritten instruction -/* 42034 80066C34 DF5F0100 */ ld $ra, 0x100($k0) # handwritten instruction -/* 42038 80066C38 DF5B0108 */ ld $k1, 0x108($k0) # handwritten instruction -/* 4203C 80066C3C 03600013 */ mtlo $k1 -/* 42040 80066C40 DF5B0110 */ ld $k1, 0x110($k0) # handwritten instruction -/* 42044 80066C44 03600011 */ mthi $k1 -/* 42048 80066C48 8F5B011C */ lw $k1, 0x11C($k0) # handwritten instruction -/* 4204C 80066C4C 409B7000 */ mtc0 $k1, $14 # handwritten instruction -/* 42050 80066C50 8F5B0018 */ lw $k1, 0x18($k0) # handwritten instruction -/* 42054 80066C54 13600013 */ beqz $k1, .LIQUE_80066CA4 # handwritten instruction -/* 42058 80066C58 00000000 */ nop -/* 4205C 80066C5C 8F5B012C */ lw $k1, 0x12C($k0) # handwritten instruction -/* 42060 80066C60 44DBF800 */ ctc1 $k1, $31 -/* 42064 80066C64 D7400130 */ ldc1 $f0, 0x130($k0) -/* 42068 80066C68 D7420138 */ ldc1 $f2, 0x138($k0) -/* 4206C 80066C6C D7440140 */ ldc1 $f4, 0x140($k0) -/* 42070 80066C70 D7460148 */ ldc1 $f6, 0x148($k0) -/* 42074 80066C74 D7480150 */ ldc1 $f8, 0x150($k0) -/* 42078 80066C78 D74A0158 */ ldc1 $f10, 0x158($k0) -/* 4207C 80066C7C D74C0160 */ ldc1 $f12, 0x160($k0) -/* 42080 80066C80 D74E0168 */ ldc1 $f14, 0x168($k0) -/* 42084 80066C84 D7500170 */ ldc1 $f16, 0x170($k0) -/* 42088 80066C88 D7520178 */ ldc1 $f18, 0x178($k0) -/* 4208C 80066C8C D7540180 */ ldc1 $f20, 0x180($k0) -/* 42090 80066C90 D7560188 */ ldc1 $f22, 0x188($k0) -/* 42094 80066C94 D7580190 */ ldc1 $f24, 0x190($k0) -/* 42098 80066C98 D75A0198 */ ldc1 $f26, 0x198($k0) -/* 4209C 80066C9C D75C01A0 */ ldc1 $f28, 0x1A0($k0) -/* 420A0 80066CA0 D75E01A8 */ ldc1 $f30, 0x1A8($k0) -.LIQUE_80066CA4: -/* 420A4 80066CA4 8F5B0128 */ lw $k1, 0x128($k0) # handwritten instruction -/* 420A8 80066CA8 3C1A8009 */ lui $k0, %hi(__OSGlobalIntMask) # handwritten instruction -/* 420AC 80066CAC 675A45B4 */ daddiu $k0, $k0, %lo(__OSGlobalIntMask) # handwritten instruction -/* 420B0 80066CB0 8F5A0000 */ lw $k0, 0x0($k0) # handwritten instruction -/* 420B4 80066CB4 001AD402 */ srl $k0, $k0, 16 -/* 420B8 80066CB8 037AD824 */ and $k1, $k1, $k0 -/* 420BC 80066CBC 001BD840 */ sll $k1, $k1, 1 -/* 420C0 80066CC0 3C1A800A */ lui $k0, %hi(__osRcpImTable) # handwritten instruction -/* 420C4 80066CC4 675A8900 */ daddiu $k0, $k0, %lo(__osRcpImTable) # handwritten instruction -/* 420C8 80066CC8 037AD821 */ addu $k1, $k1, $k0 -/* 420CC 80066CCC 977B0000 */ lhu $k1, 0x0($k1) # handwritten instruction -/* 420D0 80066CD0 3C1AA430 */ lui $k0, (0xA430000C >> 16) # handwritten instruction -/* 420D4 80066CD4 375A000C */ ori $k0, $k0, (0xA430000C & 0xFFFF) # handwritten instruction -/* 420D8 80066CD8 AF5B0000 */ sw $k1, 0x0($k0) # handwritten instruction -/* 420DC 80066CDC 00000000 */ nop -/* 420E0 80066CE0 00000000 */ nop -/* 420E4 80066CE4 00000000 */ nop -/* 420E8 80066CE8 00000000 */ nop -/* 420EC 80066CEC 42000018 */ eret # handwritten instruction - -glabel __osCleanupThread -/* 420F0 80066CF0 0C01AE38 */ jal osDestroyThread -/* 420F4 80066CF4 0000202D */ daddu $a0, $zero, $zero -/* 420F8 80066CF8 00000000 */ nop -/* 420FC 80066CFC 00000000 */ nop diff --git a/ver/ique/asm/os/getcause.s b/ver/ique/asm/os/getcause.s deleted file mode 100644 index 00a9d16731..0000000000 --- a/ver/ique/asm/os/getcause.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osGetCause -/* 46A30 8006B630 40026800 */ mfc0 $v0, $13 # handwritten instruction -/* 46A34 8006B634 03E00008 */ jr $ra -/* 46A38 8006B638 00000000 */ nop -/* 46A3C 8006B63C 00000000 */ nop diff --git a/ver/ique/asm/os/getsr.s b/ver/ique/asm/os/getsr.s deleted file mode 100644 index 3d7823cb99..0000000000 --- a/ver/ique/asm/os/getsr.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osGetSR -/* 46A40 8006B640 40026000 */ mfc0 $v0, $12 # handwritten instruction -/* 46A44 8006B644 03E00008 */ jr $ra -/* 46A48 8006B648 00000000 */ nop -/* 46A4C 8006B64C 00000000 */ nop diff --git a/ver/ique/asm/os/guMtxCatF.s b/ver/ique/asm/os/guMtxCatF.s deleted file mode 100644 index 6671f7b7c5..0000000000 --- a/ver/ique/asm/os/guMtxCatF.s +++ /dev/null @@ -1,78 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guMtxCatF -/* 40FC0 80065BC0 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 40FC4 80065BC4 24820040 */ addiu $v0, $a0, 0x40 -/* 40FC8 80065BC8 24A30010 */ addiu $v1, $a1, 0x10 -/* 40FCC 80065BCC 03A05021 */ addu $t2, $sp, $zero -.LIQUE_80065BD0: -/* 40FD0 80065BD0 00A03821 */ addu $a3, $a1, $zero -.LIQUE_80065BD4: -/* 40FD4 80065BD4 C4840000 */ lwc1 $f4, 0x0($a0) -/* 40FD8 80065BD8 C4E60000 */ lwc1 $f6, 0x0($a3) -/* 40FDC 80065BDC 46062202 */ mul.s $f8, $f4, $f6 -/* 40FE0 80065BE0 C48A0004 */ lwc1 $f10, 0x4($a0) -/* 40FE4 80065BE4 C4F00010 */ lwc1 $f16, 0x10($a3) -/* 40FE8 80065BE8 46105482 */ mul.s $f18, $f10, $f16 -/* 40FEC 80065BEC 46124200 */ add.s $f8, $f8, $f18 -/* 40FF0 80065BF0 C4840008 */ lwc1 $f4, 0x8($a0) -/* 40FF4 80065BF4 C4E60020 */ lwc1 $f6, 0x20($a3) -/* 40FF8 80065BF8 46062482 */ mul.s $f18, $f4, $f6 -/* 40FFC 80065BFC 46124200 */ add.s $f8, $f8, $f18 -/* 41000 80065C00 C48A000C */ lwc1 $f10, 0xC($a0) -/* 41004 80065C04 C4F00030 */ lwc1 $f16, 0x30($a3) -/* 41008 80065C08 46105482 */ mul.s $f18, $f10, $f16 -/* 4100C 80065C0C 46124200 */ add.s $f8, $f8, $f18 -/* 41010 80065C10 E5480000 */ swc1 $f8, 0x0($t2) -/* 41014 80065C14 24E70004 */ addiu $a3, $a3, 0x4 -/* 41018 80065C18 14E3FFEE */ bne $a3, $v1, .LIQUE_80065BD4 -/* 4101C 80065C1C 254A0004 */ addiu $t2, $t2, 0x4 -/* 41020 80065C20 24840010 */ addiu $a0, $a0, 0x10 -/* 41024 80065C24 1482FFEA */ bne $a0, $v0, .LIQUE_80065BD0 -/* 41028 80065C28 00000000 */ nop -/* 4102C 80065C2C E4C8003C */ swc1 $f8, 0x3C($a2) -/* 41030 80065C30 8FA80000 */ lw $t0, 0x0($sp) -/* 41034 80065C34 8FA90004 */ lw $t1, 0x4($sp) -/* 41038 80065C38 8FAA0008 */ lw $t2, 0x8($sp) -/* 4103C 80065C3C 8FAB000C */ lw $t3, 0xC($sp) -/* 41040 80065C40 8FAC0010 */ lw $t4, 0x10($sp) -/* 41044 80065C44 8FAD0014 */ lw $t5, 0x14($sp) -/* 41048 80065C48 8FAE0018 */ lw $t6, 0x18($sp) -/* 4104C 80065C4C 8FAF001C */ lw $t7, 0x1C($sp) -/* 41050 80065C50 8FB80020 */ lw $t8, 0x20($sp) -/* 41054 80065C54 8FB90024 */ lw $t9, 0x24($sp) -/* 41058 80065C58 8FA20028 */ lw $v0, 0x28($sp) -/* 4105C 80065C5C 8FA3002C */ lw $v1, 0x2C($sp) -/* 41060 80065C60 8FA40030 */ lw $a0, 0x30($sp) -/* 41064 80065C64 8FA50034 */ lw $a1, 0x34($sp) -/* 41068 80065C68 8FA70038 */ lw $a3, 0x38($sp) -/* 4106C 80065C6C ACC80000 */ sw $t0, 0x0($a2) -/* 41070 80065C70 ACC90004 */ sw $t1, 0x4($a2) -/* 41074 80065C74 ACCA0008 */ sw $t2, 0x8($a2) -/* 41078 80065C78 ACCB000C */ sw $t3, 0xC($a2) -/* 4107C 80065C7C ACCC0010 */ sw $t4, 0x10($a2) -/* 41080 80065C80 ACCD0014 */ sw $t5, 0x14($a2) -/* 41084 80065C84 ACCE0018 */ sw $t6, 0x18($a2) -/* 41088 80065C88 ACCF001C */ sw $t7, 0x1C($a2) -/* 4108C 80065C8C ACD80020 */ sw $t8, 0x20($a2) -/* 41090 80065C90 ACD90024 */ sw $t9, 0x24($a2) -/* 41094 80065C94 ACC20028 */ sw $v0, 0x28($a2) -/* 41098 80065C98 ACC3002C */ sw $v1, 0x2C($a2) -/* 4109C 80065C9C ACC40030 */ sw $a0, 0x30($a2) -/* 410A0 80065CA0 ACC50034 */ sw $a1, 0x34($a2) -/* 410A4 80065CA4 ACC70038 */ sw $a3, 0x38($a2) -/* 410A8 80065CA8 03E00008 */ jr $ra -/* 410AC 80065CAC 27BD0040 */ addiu $sp, $sp, 0x40 -/* 410B0 80065CB0 00000000 */ nop -/* 410B4 80065CB4 00000000 */ nop -/* 410B8 80065CB8 00000000 */ nop -/* 410BC 80065CBC 00000000 */ nop diff --git a/ver/ique/asm/os/guMtxF2L.s b/ver/ique/asm/os/guMtxF2L.s deleted file mode 100644 index 0dc2c3ca48..0000000000 --- a/ver/ique/asm/os/guMtxF2L.s +++ /dev/null @@ -1,45 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guMtxF2L -/* 40EC0 80065AC0 3C014780 */ lui $at, (0x47800000 >> 16) -/* 40EC4 80065AC4 44810000 */ mtc1 $at, $f0 -/* 40EC8 80065AC8 3C19FFFF */ lui $t9, (0xFFFF0000 >> 16) -/* 40ECC 80065ACC 24B80020 */ addiu $t8, $a1, 0x20 -.LIQUE_80065AD0: -/* 40ED0 80065AD0 C4840000 */ lwc1 $f4, 0x0($a0) -/* 40ED4 80065AD4 46002182 */ mul.s $f6, $f4, $f0 -/* 40ED8 80065AD8 4600320D */ trunc.w.s $f8, $f6 -/* 40EDC 80065ADC C48A0004 */ lwc1 $f10, 0x4($a0) -/* 40EE0 80065AE0 46005402 */ mul.s $f16, $f10, $f0 -/* 40EE4 80065AE4 4600848D */ trunc.w.s $f18, $f16 -/* 40EE8 80065AE8 44084000 */ mfc1 $t0, $f8 -/* 40EEC 80065AEC 44099000 */ mfc1 $t1, $f18 -/* 40EF0 80065AF0 01195024 */ and $t2, $t0, $t9 -/* 40EF4 80065AF4 00095C02 */ srl $t3, $t1, 16 -/* 40EF8 80065AF8 014B6025 */ or $t4, $t2, $t3 -/* 40EFC 80065AFC ACAC0000 */ sw $t4, 0x0($a1) -/* 40F00 80065B00 00086C00 */ sll $t5, $t0, 16 -/* 40F04 80065B04 312EFFFF */ andi $t6, $t1, 0xFFFF -/* 40F08 80065B08 01AE7825 */ or $t7, $t5, $t6 -/* 40F0C 80065B0C ACAF0020 */ sw $t7, 0x20($a1) -/* 40F10 80065B10 24A50004 */ addiu $a1, $a1, 0x4 -/* 40F14 80065B14 14B8FFEE */ bne $a1, $t8, .LIQUE_80065AD0 -/* 40F18 80065B18 24840008 */ addiu $a0, $a0, 0x8 -/* 40F1C 80065B1C 03E00008 */ jr $ra -/* 40F20 80065B20 00000000 */ nop -/* 40F24 80065B24 00000000 */ nop -/* 40F28 80065B28 00000000 */ nop -/* 40F2C 80065B2C 00000000 */ nop -/* 40F30 80065B30 00000000 */ nop -/* 40F34 80065B34 00000000 */ nop -/* 40F38 80065B38 00000000 */ nop -/* 40F3C 80065B3C 00000000 */ nop diff --git a/ver/ique/asm/os/guMtxIdent.s b/ver/ique/asm/os/guMtxIdent.s deleted file mode 100644 index 317fe02fca..0000000000 --- a/ver/ique/asm/os/guMtxIdent.s +++ /dev/null @@ -1,37 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel guMtxIdent -/* 40E00 80065A00 20080001 */ addi $t0, $zero, 0x1 # handwritten instruction -/* 40E04 80065A04 00084C00 */ sll $t1, $t0, 16 -/* 40E08 80065A08 AC890000 */ sw $t1, 0x0($a0) -/* 40E0C 80065A0C AC800004 */ sw $zero, 0x4($a0) -/* 40E10 80065A10 AC880008 */ sw $t0, 0x8($a0) -/* 40E14 80065A14 AC80000C */ sw $zero, 0xC($a0) -/* 40E18 80065A18 AC800010 */ sw $zero, 0x10($a0) -/* 40E1C 80065A1C AC890014 */ sw $t1, 0x14($a0) -/* 40E20 80065A20 AC800018 */ sw $zero, 0x18($a0) -/* 40E24 80065A24 AC88001C */ sw $t0, 0x1C($a0) -/* 40E28 80065A28 AC800020 */ sw $zero, 0x20($a0) -/* 40E2C 80065A2C AC800024 */ sw $zero, 0x24($a0) -/* 40E30 80065A30 AC800028 */ sw $zero, 0x28($a0) -/* 40E34 80065A34 AC80002C */ sw $zero, 0x2C($a0) -/* 40E38 80065A38 AC800030 */ sw $zero, 0x30($a0) -/* 40E3C 80065A3C AC800034 */ sw $zero, 0x34($a0) -/* 40E40 80065A40 AC800038 */ sw $zero, 0x38($a0) -/* 40E44 80065A44 03E00008 */ jr $ra -/* 40E48 80065A48 AC80003C */ sw $zero, 0x3C($a0) -/* 40E4C 80065A4C 00000000 */ nop -/* 40E50 80065A50 00000000 */ nop -/* 40E54 80065A54 00000000 */ nop -/* 40E58 80065A58 00000000 */ nop -/* 40E5C 80065A5C 00000000 */ nop diff --git a/ver/ique/asm/os/guMtxIdentF.s b/ver/ique/asm/os/guMtxIdentF.s deleted file mode 100644 index 34f697c488..0000000000 --- a/ver/ique/asm/os/guMtxIdentF.s +++ /dev/null @@ -1,36 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guMtxIdentF -/* 40E60 80065A60 3C083F80 */ lui $t0, (0x3F800000 >> 16) -/* 40E64 80065A64 AC880000 */ sw $t0, 0x0($a0) -/* 40E68 80065A68 AC800004 */ sw $zero, 0x4($a0) -/* 40E6C 80065A6C AC800008 */ sw $zero, 0x8($a0) -/* 40E70 80065A70 AC80000C */ sw $zero, 0xC($a0) -/* 40E74 80065A74 AC800010 */ sw $zero, 0x10($a0) -/* 40E78 80065A78 AC880014 */ sw $t0, 0x14($a0) -/* 40E7C 80065A7C AC800018 */ sw $zero, 0x18($a0) -/* 40E80 80065A80 AC80001C */ sw $zero, 0x1C($a0) -/* 40E84 80065A84 AC800020 */ sw $zero, 0x20($a0) -/* 40E88 80065A88 AC800024 */ sw $zero, 0x24($a0) -/* 40E8C 80065A8C AC880028 */ sw $t0, 0x28($a0) -/* 40E90 80065A90 AC80002C */ sw $zero, 0x2C($a0) -/* 40E94 80065A94 AC800030 */ sw $zero, 0x30($a0) -/* 40E98 80065A98 AC800034 */ sw $zero, 0x34($a0) -/* 40E9C 80065A9C AC800038 */ sw $zero, 0x38($a0) -/* 40EA0 80065AA0 03E00008 */ jr $ra -/* 40EA4 80065AA4 AC88003C */ sw $t0, 0x3C($a0) -/* 40EA8 80065AA8 00000000 */ nop -/* 40EAC 80065AAC 00000000 */ nop -/* 40EB0 80065AB0 00000000 */ nop -/* 40EB4 80065AB4 00000000 */ nop -/* 40EB8 80065AB8 00000000 */ nop -/* 40EBC 80065ABC 00000000 */ nop diff --git a/ver/ique/asm/os/guMtxL2F.s b/ver/ique/asm/os/guMtxL2F.s deleted file mode 100644 index e96ba4169c..0000000000 --- a/ver/ique/asm/os/guMtxL2F.s +++ /dev/null @@ -1,45 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guMtxL2F -/* 40F40 80065B40 3C013780 */ lui $at, (0x37800000 >> 16) -/* 40F44 80065B44 44810000 */ mtc1 $at, $f0 -/* 40F48 80065B48 3C19FFFF */ lui $t9, (0xFFFF0000 >> 16) -/* 40F4C 80065B4C 24B80020 */ addiu $t8, $a1, 0x20 -.LIQUE_80065B50: -/* 40F50 80065B50 8CA80000 */ lw $t0, 0x0($a1) -/* 40F54 80065B54 8CA90020 */ lw $t1, 0x20($a1) -/* 40F58 80065B58 01195024 */ and $t2, $t0, $t9 -/* 40F5C 80065B5C 00095C02 */ srl $t3, $t1, 16 -/* 40F60 80065B60 014B6025 */ or $t4, $t2, $t3 -/* 40F64 80065B64 00086C00 */ sll $t5, $t0, 16 -/* 40F68 80065B68 312EFFFF */ andi $t6, $t1, 0xFFFF -/* 40F6C 80065B6C 01AE7825 */ or $t7, $t5, $t6 -/* 40F70 80065B70 448C2000 */ mtc1 $t4, $f4 -/* 40F74 80065B74 468021A0 */ cvt.s.w $f6, $f4 -/* 40F78 80065B78 46003202 */ mul.s $f8, $f6, $f0 -/* 40F7C 80065B7C 448F5000 */ mtc1 $t7, $f10 -/* 40F80 80065B80 46805420 */ cvt.s.w $f16, $f10 -/* 40F84 80065B84 46008482 */ mul.s $f18, $f16, $f0 -/* 40F88 80065B88 E4880000 */ swc1 $f8, 0x0($a0) -/* 40F8C 80065B8C E4920004 */ swc1 $f18, 0x4($a0) -/* 40F90 80065B90 24A50004 */ addiu $a1, $a1, 0x4 -/* 40F94 80065B94 14B8FFEE */ bne $a1, $t8, .LIQUE_80065B50 -/* 40F98 80065B98 24840008 */ addiu $a0, $a0, 0x8 -/* 40F9C 80065B9C 03E00008 */ jr $ra -/* 40FA0 80065BA0 00000000 */ nop -/* 40FA4 80065BA4 00000000 */ nop -/* 40FA8 80065BA8 00000000 */ nop -/* 40FAC 80065BAC 00000000 */ nop -/* 40FB0 80065BB0 00000000 */ nop -/* 40FB4 80065BB4 00000000 */ nop -/* 40FB8 80065BB8 00000000 */ nop -/* 40FBC 80065BBC 00000000 */ nop diff --git a/ver/ique/asm/os/guNormalize.s b/ver/ique/asm/os/guNormalize.s deleted file mode 100644 index a9ac20fcef..0000000000 --- a/ver/ique/asm/os/guNormalize.s +++ /dev/null @@ -1,36 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guNormalize -/* 47040 8006BC40 C4840000 */ lwc1 $f4, 0x0($a0) -/* 47044 8006BC44 C4A60000 */ lwc1 $f6, 0x0($a1) -/* 47048 8006BC48 C4C80000 */ lwc1 $f8, 0x0($a2) -/* 4704C 8006BC4C 46042282 */ mul.s $f10, $f4, $f4 -/* 47050 8006BC50 3C083F80 */ lui $t0, (0x3F800000 >> 16) -/* 47054 8006BC54 46063402 */ mul.s $f16, $f6, $f6 -/* 47058 8006BC58 46105480 */ add.s $f18, $f10, $f16 -/* 4705C 8006BC5C 46084402 */ mul.s $f16, $f8, $f8 -/* 47060 8006BC60 46128280 */ add.s $f10, $f16, $f18 -/* 47064 8006BC64 44889000 */ mtc1 $t0, $f18 -/* 47068 8006BC68 46005404 */ sqrt.s $f16, $f10 -/* 4706C 8006BC6C 46109283 */ div.s $f10, $f18, $f16 -/* 47070 8006BC70 460A2402 */ mul.s $f16, $f4, $f10 -/* 47074 8006BC74 00000000 */ nop -/* 47078 8006BC78 460A3482 */ mul.s $f18, $f6, $f10 -/* 4707C 8006BC7C 00000000 */ nop -/* 47080 8006BC80 460A4102 */ mul.s $f4, $f8, $f10 -/* 47084 8006BC84 E4900000 */ swc1 $f16, 0x0($a0) -/* 47088 8006BC88 E4B20000 */ swc1 $f18, 0x0($a1) -/* 4708C 8006BC8C 03E00008 */ jr $ra -/* 47090 8006BC90 E4C40000 */ swc1 $f4, 0x0($a2) -/* 47094 8006BC94 00000000 */ nop -/* 47098 8006BC98 00000000 */ nop -/* 4709C 8006BC9C 00000000 */ nop diff --git a/ver/ique/asm/os/guScale.s b/ver/ique/asm/os/guScale.s deleted file mode 100644 index cd05fdb4e2..0000000000 --- a/ver/ique/asm/os/guScale.s +++ /dev/null @@ -1,52 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guScale -/* 410C0 80065CC0 3C014780 */ lui $at, (0x47800000 >> 16) -/* 410C4 80065CC4 44812000 */ mtc1 $at, $f4 -/* 410C8 80065CC8 44853000 */ mtc1 $a1, $f6 -/* 410CC 80065CCC 46043202 */ mul.s $f8, $f6, $f4 -/* 410D0 80065CD0 4600428D */ trunc.w.s $f10, $f8 -/* 410D4 80065CD4 44095000 */ mfc1 $t1, $f10 -/* 410D8 80065CD8 00095402 */ srl $t2, $t1, 16 -/* 410DC 80065CDC 000A4400 */ sll $t0, $t2, 16 -/* 410E0 80065CE0 AC880000 */ sw $t0, 0x0($a0) -/* 410E4 80065CE4 00095400 */ sll $t2, $t1, 16 -/* 410E8 80065CE8 AC8A0020 */ sw $t2, 0x20($a0) -/* 410EC 80065CEC 44863000 */ mtc1 $a2, $f6 -/* 410F0 80065CF0 46043202 */ mul.s $f8, $f6, $f4 -/* 410F4 80065CF4 4600428D */ trunc.w.s $f10, $f8 -/* 410F8 80065CF8 44095000 */ mfc1 $t1, $f10 -/* 410FC 80065CFC 00094402 */ srl $t0, $t1, 16 -/* 41100 80065D00 AC880008 */ sw $t0, 0x8($a0) -/* 41104 80065D04 312AFFFF */ andi $t2, $t1, 0xFFFF -/* 41108 80065D08 AC8A0028 */ sw $t2, 0x28($a0) -/* 4110C 80065D0C 44873000 */ mtc1 $a3, $f6 -/* 41110 80065D10 46043202 */ mul.s $f8, $f6, $f4 -/* 41114 80065D14 4600428D */ trunc.w.s $f10, $f8 -/* 41118 80065D18 44095000 */ mfc1 $t1, $f10 -/* 4111C 80065D1C 00095402 */ srl $t2, $t1, 16 -/* 41120 80065D20 000A4400 */ sll $t0, $t2, 16 -/* 41124 80065D24 AC880014 */ sw $t0, 0x14($a0) -/* 41128 80065D28 00095400 */ sll $t2, $t1, 16 -/* 4112C 80065D2C AC8A0034 */ sw $t2, 0x34($a0) -/* 41130 80065D30 24080001 */ addiu $t0, $zero, 0x1 -/* 41134 80065D34 AC88001C */ sw $t0, 0x1C($a0) -/* 41138 80065D38 AC800004 */ sw $zero, 0x4($a0) -/* 4113C 80065D3C AC80000C */ sw $zero, 0xC($a0) -/* 41140 80065D40 AC800010 */ sw $zero, 0x10($a0) -/* 41144 80065D44 AC800018 */ sw $zero, 0x18($a0) -/* 41148 80065D48 AC800024 */ sw $zero, 0x24($a0) -/* 4114C 80065D4C AC80002C */ sw $zero, 0x2C($a0) -/* 41150 80065D50 AC800030 */ sw $zero, 0x30($a0) -/* 41154 80065D54 AC800038 */ sw $zero, 0x38($a0) -/* 41158 80065D58 03E00008 */ jr $ra -/* 4115C 80065D5C AC80003C */ sw $zero, 0x3C($a0) diff --git a/ver/ique/asm/os/guScaleF.s b/ver/ique/asm/os/guScaleF.s deleted file mode 100644 index 2356d3b39c..0000000000 --- a/ver/ique/asm/os/guScaleF.s +++ /dev/null @@ -1,36 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guScaleF -/* 41160 80065D60 AC850000 */ sw $a1, 0x0($a0) -/* 41164 80065D64 AC800004 */ sw $zero, 0x4($a0) -/* 41168 80065D68 AC800008 */ sw $zero, 0x8($a0) -/* 4116C 80065D6C AC80000C */ sw $zero, 0xC($a0) -/* 41170 80065D70 AC800010 */ sw $zero, 0x10($a0) -/* 41174 80065D74 AC860014 */ sw $a2, 0x14($a0) -/* 41178 80065D78 AC800018 */ sw $zero, 0x18($a0) -/* 4117C 80065D7C AC80001C */ sw $zero, 0x1C($a0) -/* 41180 80065D80 AC800020 */ sw $zero, 0x20($a0) -/* 41184 80065D84 AC800024 */ sw $zero, 0x24($a0) -/* 41188 80065D88 AC870028 */ sw $a3, 0x28($a0) -/* 4118C 80065D8C AC80002C */ sw $zero, 0x2C($a0) -/* 41190 80065D90 3C083F80 */ lui $t0, (0x3F800000 >> 16) -/* 41194 80065D94 AC800030 */ sw $zero, 0x30($a0) -/* 41198 80065D98 AC800034 */ sw $zero, 0x34($a0) -/* 4119C 80065D9C AC800038 */ sw $zero, 0x38($a0) -/* 411A0 80065DA0 03E00008 */ jr $ra -/* 411A4 80065DA4 AC88003C */ sw $t0, 0x3C($a0) -/* 411A8 80065DA8 00000000 */ nop -/* 411AC 80065DAC 00000000 */ nop -/* 411B0 80065DB0 00000000 */ nop -/* 411B4 80065DB4 00000000 */ nop -/* 411B8 80065DB8 00000000 */ nop -/* 411BC 80065DBC 00000000 */ nop diff --git a/ver/ique/asm/os/guTranslate.s b/ver/ique/asm/os/guTranslate.s deleted file mode 100644 index 7fb1a62f06..0000000000 --- a/ver/ique/asm/os/guTranslate.s +++ /dev/null @@ -1,68 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guTranslate -/* 411C0 80065DC0 3C014780 */ lui $at, (0x47800000 >> 16) -/* 411C4 80065DC4 44812000 */ mtc1 $at, $f4 -/* 411C8 80065DC8 44853000 */ mtc1 $a1, $f6 -/* 411CC 80065DCC 46043202 */ mul.s $f8, $f6, $f4 -/* 411D0 80065DD0 4600428D */ trunc.w.s $f10, $f8 -/* 411D4 80065DD4 44095000 */ mfc1 $t1, $f10 -/* 411D8 80065DD8 44863000 */ mtc1 $a2, $f6 -/* 411DC 80065DDC 46043202 */ mul.s $f8, $f6, $f4 -/* 411E0 80065DE0 4600428D */ trunc.w.s $f10, $f8 -/* 411E4 80065DE4 440B5000 */ mfc1 $t3, $f10 -/* 411E8 80065DE8 00095402 */ srl $t2, $t1, 16 -/* 411EC 80065DEC 000A4400 */ sll $t0, $t2, 16 -/* 411F0 80065DF0 000B5402 */ srl $t2, $t3, 16 -/* 411F4 80065DF4 010A4025 */ or $t0, $t0, $t2 -/* 411F8 80065DF8 AC880018 */ sw $t0, 0x18($a0) -/* 411FC 80065DFC 00094400 */ sll $t0, $t1, 16 -/* 41200 80065E00 000B5400 */ sll $t2, $t3, 16 -/* 41204 80065E04 000A5402 */ srl $t2, $t2, 16 -/* 41208 80065E08 010A4025 */ or $t0, $t0, $t2 -/* 4120C 80065E0C AC880038 */ sw $t0, 0x38($a0) -/* 41210 80065E10 44873000 */ mtc1 $a3, $f6 -/* 41214 80065E14 46043202 */ mul.s $f8, $f6, $f4 -/* 41218 80065E18 4600428D */ trunc.w.s $f10, $f8 -/* 4121C 80065E1C 44095000 */ mfc1 $t1, $f10 -/* 41220 80065E20 00095402 */ srl $t2, $t1, 16 -/* 41224 80065E24 000A4400 */ sll $t0, $t2, 16 -/* 41228 80065E28 25080001 */ addiu $t0, $t0, 0x1 -/* 4122C 80065E2C AC88001C */ sw $t0, 0x1C($a0) -/* 41230 80065E30 00095400 */ sll $t2, $t1, 16 -/* 41234 80065E34 AC8A003C */ sw $t2, 0x3C($a0) -/* 41238 80065E38 AC800000 */ sw $zero, 0x0($a0) -/* 4123C 80065E3C AC800004 */ sw $zero, 0x4($a0) -/* 41240 80065E40 AC800008 */ sw $zero, 0x8($a0) -/* 41244 80065E44 AC80000C */ sw $zero, 0xC($a0) -/* 41248 80065E48 AC800010 */ sw $zero, 0x10($a0) -/* 4124C 80065E4C AC800014 */ sw $zero, 0x14($a0) -/* 41250 80065E50 AC800020 */ sw $zero, 0x20($a0) -/* 41254 80065E54 AC800024 */ sw $zero, 0x24($a0) -/* 41258 80065E58 AC800028 */ sw $zero, 0x28($a0) -/* 4125C 80065E5C AC80002C */ sw $zero, 0x2C($a0) -/* 41260 80065E60 AC800030 */ sw $zero, 0x30($a0) -/* 41264 80065E64 AC800034 */ sw $zero, 0x34($a0) -/* 41268 80065E68 3C080001 */ lui $t0, (0x10000 >> 16) -/* 4126C 80065E6C 35080000 */ ori $t0, $t0, (0x10000 & 0xFFFF) -/* 41270 80065E70 AC880000 */ sw $t0, 0x0($a0) -/* 41274 80065E74 AC880014 */ sw $t0, 0x14($a0) -/* 41278 80065E78 3C080000 */ lui $t0, (0x1 >> 16) -/* 4127C 80065E7C 35080001 */ ori $t0, $t0, (0x1 & 0xFFFF) -/* 41280 80065E80 03E00008 */ jr $ra -/* 41284 80065E84 AC880008 */ sw $t0, 0x8($a0) -/* 41288 80065E88 00000000 */ nop -/* 4128C 80065E8C 00000000 */ nop -/* 41290 80065E90 00000000 */ nop -/* 41294 80065E94 00000000 */ nop -/* 41298 80065E98 00000000 */ nop -/* 4129C 80065E9C 00000000 */ nop diff --git a/ver/ique/asm/os/guTranslateF.s b/ver/ique/asm/os/guTranslateF.s deleted file mode 100644 index 56a929d43e..0000000000 --- a/ver/ique/asm/os/guTranslateF.s +++ /dev/null @@ -1,32 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guTranslateF -/* 412A0 80065EA0 3C083F80 */ lui $t0, (0x3F800000 >> 16) -/* 412A4 80065EA4 AC880000 */ sw $t0, 0x0($a0) -/* 412A8 80065EA8 AC800004 */ sw $zero, 0x4($a0) -/* 412AC 80065EAC AC800008 */ sw $zero, 0x8($a0) -/* 412B0 80065EB0 AC80000C */ sw $zero, 0xC($a0) -/* 412B4 80065EB4 AC800010 */ sw $zero, 0x10($a0) -/* 412B8 80065EB8 AC880014 */ sw $t0, 0x14($a0) -/* 412BC 80065EBC AC800018 */ sw $zero, 0x18($a0) -/* 412C0 80065EC0 AC80001C */ sw $zero, 0x1C($a0) -/* 412C4 80065EC4 AC800020 */ sw $zero, 0x20($a0) -/* 412C8 80065EC8 AC800024 */ sw $zero, 0x24($a0) -/* 412CC 80065ECC AC880028 */ sw $t0, 0x28($a0) -/* 412D0 80065ED0 AC80002C */ sw $zero, 0x2C($a0) -/* 412D4 80065ED4 AC850030 */ sw $a1, 0x30($a0) -/* 412D8 80065ED8 AC860034 */ sw $a2, 0x34($a0) -/* 412DC 80065EDC AC870038 */ sw $a3, 0x38($a0) -/* 412E0 80065EE0 03E00008 */ jr $ra -/* 412E4 80065EE4 AC88003C */ sw $t0, 0x3C($a0) -/* 412E8 80065EE8 00000000 */ nop -/* 412EC 80065EEC 00000000 */ nop diff --git a/ver/ique/asm/os/interrupt.s b/ver/ique/asm/os/interrupt.s deleted file mode 100644 index 40452ccc56..0000000000 --- a/ver/ique/asm/os/interrupt.s +++ /dev/null @@ -1,53 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osDisableInt -/* 42100 80066D00 3C0A8009 */ lui $t2, %hi(__OSGlobalIntMask) -/* 42104 80066D04 254A45B4 */ addiu $t2, $t2, %lo(__OSGlobalIntMask) -/* 42108 80066D08 8D4B0000 */ lw $t3, 0x0($t2) -/* 4210C 80066D0C 316BFF00 */ andi $t3, $t3, 0xFF00 -/* 42110 80066D10 40086000 */ mfc0 $t0, $12 # handwritten instruction -/* 42114 80066D14 2401FFFE */ addiu $at, $zero, -0x2 -/* 42118 80066D18 01014824 */ and $t1, $t0, $at -/* 4211C 80066D1C 40896000 */ mtc0 $t1, $12 # handwritten instruction -/* 42120 80066D20 31020001 */ andi $v0, $t0, 0x1 -/* 42124 80066D24 8D480000 */ lw $t0, 0x0($t2) -/* 42128 80066D28 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 4212C 80066D2C 110B000E */ beq $t0, $t3, .LIQUE_80066D68 -/* 42130 80066D30 3C0A8009 */ lui $t2, %hi(__osRunningThread) -/* 42134 80066D34 254A3280 */ addiu $t2, $t2, %lo(__osRunningThread) -/* 42138 80066D38 8D490118 */ lw $t1, 0x118($t2) -/* 4213C 80066D3C 312AFF00 */ andi $t2, $t1, 0xFF00 -/* 42140 80066D40 01485024 */ and $t2, $t2, $t0 -/* 42144 80066D44 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 42148 80066D48 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 4214C 80066D4C 01214824 */ and $t1, $t1, $at -/* 42150 80066D50 012A4825 */ or $t1, $t1, $t2 -/* 42154 80066D54 2401FFFE */ addiu $at, $zero, -0x2 -/* 42158 80066D58 01214824 */ and $t1, $t1, $at -/* 4215C 80066D5C 40896000 */ mtc0 $t1, $12 # handwritten instruction -/* 42160 80066D60 00000000 */ nop -/* 42164 80066D64 00000000 */ nop -.LIQUE_80066D68: -/* 42168 80066D68 03E00008 */ jr $ra -/* 4216C 80066D6C 00000000 */ nop - -# Handwritten function -glabel __osRestoreInt -/* 42170 80066D70 40086000 */ mfc0 $t0, $12 # handwritten instruction -/* 42174 80066D74 01044025 */ or $t0, $t0, $a0 -/* 42178 80066D78 40886000 */ mtc0 $t0, $12 # handwritten instruction -/* 4217C 80066D7C 00000000 */ nop -/* 42180 80066D80 00000000 */ nop -/* 42184 80066D84 03E00008 */ jr $ra -/* 42188 80066D88 00000000 */ nop -/* 4218C 80066D8C 00000000 */ nop diff --git a/ver/ique/asm/os/maptlb.s b/ver/ique/asm/os/maptlb.s deleted file mode 100644 index 1c7328ee77..0000000000 --- a/ver/ique/asm/os/maptlb.s +++ /dev/null @@ -1,67 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osMapTLB -/* 40160 80064D60 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 40164 80064D64 40840000 */ mtc0 $a0, $0 # handwritten instruction -/* 40168 80064D68 40852800 */ mtc0 $a1, $5 # handwritten instruction -/* 4016C 80064D6C 8FA90014 */ lw $t1, 0x14($sp) -/* 40170 80064D70 2401FFFF */ addiu $at, $zero, -0x1 -/* 40174 80064D74 11210004 */ beq $t1, $at, .LIQUE_80064D88 -/* 40178 80064D78 240C0001 */ addiu $t4, $zero, 0x1 -/* 4017C 80064D7C 240A001E */ addiu $t2, $zero, 0x1E -/* 40180 80064D80 10000002 */ b .LIQUE_80064D8C -/* 40184 80064D84 00C93025 */ or $a2, $a2, $t1 -.LIQUE_80064D88: -/* 40188 80064D88 240A001F */ addiu $t2, $zero, 0x1F -.LIQUE_80064D8C: -/* 4018C 80064D8C 40865000 */ mtc0 $a2, $10 # handwritten instruction -/* 40190 80064D90 2401FFFF */ addiu $at, $zero, -0x1 -/* 40194 80064D94 10E10006 */ beq $a3, $at, .LIQUE_80064DB0 -/* 40198 80064D98 00000000 */ nop -/* 4019C 80064D9C 00075982 */ srl $t3, $a3, 6 -/* 401A0 80064DA0 016A5825 */ or $t3, $t3, $t2 -/* 401A4 80064DA4 408B1000 */ mtc0 $t3, $2 # handwritten instruction -/* 401A8 80064DA8 10000002 */ b .LIQUE_80064DB4 -/* 401AC 80064DAC 00000000 */ nop -.LIQUE_80064DB0: -/* 401B0 80064DB0 408C1000 */ mtc0 $t4, $2 # handwritten instruction -.LIQUE_80064DB4: -/* 401B4 80064DB4 8FAB0010 */ lw $t3, 0x10($sp) -/* 401B8 80064DB8 2401FFFF */ addiu $at, $zero, -0x1 -/* 401BC 80064DBC 11610006 */ beq $t3, $at, .LIQUE_80064DD8 -/* 401C0 80064DC0 00000000 */ nop -/* 401C4 80064DC4 000B5982 */ srl $t3, $t3, 6 -/* 401C8 80064DC8 016A5825 */ or $t3, $t3, $t2 -/* 401CC 80064DCC 408B1800 */ mtc0 $t3, $3 # handwritten instruction -/* 401D0 80064DD0 10000007 */ b .LIQUE_80064DF0 -/* 401D4 80064DD4 00000000 */ nop -.LIQUE_80064DD8: -/* 401D8 80064DD8 408C1800 */ mtc0 $t4, $3 # handwritten instruction -/* 401DC 80064DDC 2401FFFF */ addiu $at, $zero, -0x1 -/* 401E0 80064DE0 14E10003 */ bne $a3, $at, .LIQUE_80064DF0 -/* 401E4 80064DE4 00000000 */ nop -/* 401E8 80064DE8 3C0B8000 */ lui $t3, (0x80000000 >> 16) -/* 401EC 80064DEC 408B5000 */ mtc0 $t3, $10 # handwritten instruction -.LIQUE_80064DF0: -/* 401F0 80064DF0 00000000 */ nop -/* 401F4 80064DF4 42000002 */ tlbwi # handwritten instruction -/* 401F8 80064DF8 00000000 */ nop -/* 401FC 80064DFC 00000000 */ nop -/* 40200 80064E00 00000000 */ nop -/* 40204 80064E04 00000000 */ nop -/* 40208 80064E08 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 4020C 80064E0C 03E00008 */ jr $ra -/* 40210 80064E10 00000000 */ nop -/* 40214 80064E14 00000000 */ nop -/* 40218 80064E18 00000000 */ nop -/* 4021C 80064E1C 00000000 */ nop diff --git a/ver/ique/asm/os/maptlbrdb.s b/ver/ique/asm/os/maptlbrdb.s deleted file mode 100644 index 0db1bfce6c..0000000000 --- a/ver/ique/asm/os/maptlbrdb.s +++ /dev/null @@ -1,37 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osMapTLBRdb -/* 46EC0 8006BAC0 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 46EC4 8006BAC4 2409001F */ addiu $t1, $zero, 0x1F -/* 46EC8 8006BAC8 40890000 */ mtc0 $t1, $0 # handwritten instruction -/* 46ECC 8006BACC 40802800 */ mtc0 $zero, $5 # handwritten instruction -/* 46ED0 8006BAD0 240A0017 */ addiu $t2, $zero, 0x17 -/* 46ED4 8006BAD4 3C09C000 */ lui $t1, (0xC0000000 >> 16) -/* 46ED8 8006BAD8 40895000 */ mtc0 $t1, $10 # handwritten instruction -/* 46EDC 8006BADC 3C098000 */ lui $t1, (0x80000000 >> 16) -/* 46EE0 8006BAE0 00095982 */ srl $t3, $t1, 6 -/* 46EE4 8006BAE4 016A5825 */ or $t3, $t3, $t2 -/* 46EE8 8006BAE8 408B1000 */ mtc0 $t3, $2 # handwritten instruction -/* 46EEC 8006BAEC 24090001 */ addiu $t1, $zero, 0x1 -/* 46EF0 8006BAF0 40891800 */ mtc0 $t1, $3 # handwritten instruction -/* 46EF4 8006BAF4 00000000 */ nop -/* 46EF8 8006BAF8 42000002 */ tlbwi # handwritten instruction -/* 46EFC 8006BAFC 00000000 */ nop -/* 46F00 8006BB00 00000000 */ nop -/* 46F04 8006BB04 00000000 */ nop -/* 46F08 8006BB08 00000000 */ nop -/* 46F0C 8006BB0C 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 46F10 8006BB10 03E00008 */ jr $ra -/* 46F14 8006BB14 00000000 */ nop -/* 46F18 8006BB18 00000000 */ nop -/* 46F1C 8006BB1C 00000000 */ nop diff --git a/ver/ique/asm/os/osInvalDCache.s b/ver/ique/asm/os/osInvalDCache.s deleted file mode 100644 index a60a03a773..0000000000 --- a/ver/ique/asm/os/osInvalDCache.s +++ /dev/null @@ -1,63 +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 .text, "ax" - -/* Generated by spimdisasm 1.16.0 */ - -# Handwritten function -glabel osInvalDCache -/* 3B8D0 800604D0 18A00020 */ blez $a1, .LIQUE_80060554 -/* 3B8D4 800604D4 00000000 */ nop -/* 3B8D8 800604D8 240B2000 */ addiu $t3, $zero, 0x2000 -/* 3B8DC 800604DC 00AB082B */ sltu $at, $a1, $t3 -/* 3B8E0 800604E0 1020001E */ beqz $at, .LIQUE_8006055C -/* 3B8E4 800604E4 00000000 */ nop -/* 3B8E8 800604E8 0080402D */ daddu $t0, $a0, $zero -/* 3B8EC 800604EC 00854821 */ addu $t1, $a0, $a1 -/* 3B8F0 800604F0 0109082B */ sltu $at, $t0, $t1 -/* 3B8F4 800604F4 10200017 */ beqz $at, .LIQUE_80060554 -/* 3B8F8 800604F8 00000000 */ nop -/* 3B8FC 800604FC 2529FFF0 */ addiu $t1, $t1, -0x10 -/* 3B900 80060500 310A000F */ andi $t2, $t0, 0xF -/* 3B904 80060504 11400007 */ beqz $t2, .LIQUE_80060524 -/* 3B908 80060508 00000000 */ nop -/* 3B90C 8006050C 010A4023 */ subu $t0, $t0, $t2 -/* 3B910 80060510 BD150000 */ cache 0x15, 0x0($t0) # handwritten instruction -/* 3B914 80060514 0109082B */ sltu $at, $t0, $t1 -/* 3B918 80060518 1020000E */ beqz $at, .LIQUE_80060554 -/* 3B91C 8006051C 00000000 */ nop -/* 3B920 80060520 25080010 */ addiu $t0, $t0, 0x10 -.LIQUE_80060524: -/* 3B924 80060524 312A000F */ andi $t2, $t1, 0xF -/* 3B928 80060528 11400006 */ beqz $t2, .LIQUE_80060544 -/* 3B92C 8006052C 00000000 */ nop -/* 3B930 80060530 012A4823 */ subu $t1, $t1, $t2 -/* 3B934 80060534 BD350010 */ cache 0x15, 0x10($t1) # handwritten instruction -/* 3B938 80060538 0128082B */ sltu $at, $t1, $t0 -/* 3B93C 8006053C 14200005 */ bnez $at, .LIQUE_80060554 -/* 3B940 80060540 00000000 */ nop -.LIQUE_80060544: -/* 3B944 80060544 BD110000 */ cache 0x11, 0x0($t0) # handwritten instruction -/* 3B948 80060548 0109082B */ sltu $at, $t0, $t1 -/* 3B94C 8006054C 1420FFFD */ bnez $at, .LIQUE_80060544 -/* 3B950 80060550 25080010 */ addiu $t0, $t0, 0x10 -.LIQUE_80060554: -/* 3B954 80060554 03E00008 */ jr $ra -/* 3B958 80060558 00000000 */ nop -.LIQUE_8006055C: -/* 3B95C 8006055C 3C088000 */ lui $t0, 0x8000 -/* 3B960 80060560 010B4821 */ addu $t1, $t0, $t3 -/* 3B964 80060564 2529FFF0 */ addiu $t1, $t1, -0x10 -.LIQUE_80060568: -/* 3B968 80060568 BD010000 */ cache 0x01, 0x0($t0) # handwritten instruction -/* 3B96C 8006056C 0109082B */ sltu $at, $t0, $t1 -/* 3B970 80060570 1420FFFD */ bnez $at, .LIQUE_80060568 -/* 3B974 80060574 25080010 */ addiu $t0, $t0, (0x80000010 & 0xFFFF) -/* 3B978 80060578 03E00008 */ jr $ra -/* 3B97C 8006057C 00000000 */ nop -.size osInvalDCache, . - osInvalDCache diff --git a/ver/ique/asm/os/osInvalICache.s b/ver/ique/asm/os/osInvalICache.s deleted file mode 100644 index 99fac8c094..0000000000 --- a/ver/ique/asm/os/osInvalICache.s +++ /dev/null @@ -1,50 +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 .text, "ax" - -/* Generated by spimdisasm 1.16.0 */ - -# Handwritten function -glabel osInvalICache -/* 3B980 80060580 18A00011 */ blez $a1, .LIQUE_800605C8 -/* 3B984 80060584 00000000 */ nop -/* 3B988 80060588 240B4000 */ addiu $t3, $zero, 0x4000 -/* 3B98C 8006058C 00AB082B */ sltu $at, $a1, $t3 -/* 3B990 80060590 1020000F */ beqz $at, .LIQUE_800605D0 -/* 3B994 80060594 00000000 */ nop -/* 3B998 80060598 0080402D */ daddu $t0, $a0, $zero -/* 3B99C 8006059C 00854821 */ addu $t1, $a0, $a1 -/* 3B9A0 800605A0 0109082B */ sltu $at, $t0, $t1 -/* 3B9A4 800605A4 10200008 */ beqz $at, .LIQUE_800605C8 -/* 3B9A8 800605A8 00000000 */ nop -/* 3B9AC 800605AC 2529FFE0 */ addiu $t1, $t1, -0x20 -/* 3B9B0 800605B0 310A001F */ andi $t2, $t0, 0x1F -/* 3B9B4 800605B4 010A4023 */ subu $t0, $t0, $t2 -.LIQUE_800605B8: -/* 3B9B8 800605B8 BD100000 */ cache 0x10, 0x0($t0) # handwritten instruction -/* 3B9BC 800605BC 0109082B */ sltu $at, $t0, $t1 -/* 3B9C0 800605C0 1420FFFD */ bnez $at, .LIQUE_800605B8 -/* 3B9C4 800605C4 25080020 */ addiu $t0, $t0, 0x20 -.LIQUE_800605C8: -/* 3B9C8 800605C8 03E00008 */ jr $ra -/* 3B9CC 800605CC 00000000 */ nop -.LIQUE_800605D0: -/* 3B9D0 800605D0 3C088000 */ lui $t0, 0x8000 -/* 3B9D4 800605D4 010B4821 */ addu $t1, $t0, $t3 -/* 3B9D8 800605D8 2529FFE0 */ addiu $t1, $t1, -0x20 -.LIQUE_800605DC: -/* 3B9DC 800605DC BD000000 */ cache 0x00, 0x0($t0) # handwritten instruction -/* 3B9E0 800605E0 0109082B */ sltu $at, $t0, $t1 -/* 3B9E4 800605E4 1420FFFD */ bnez $at, .LIQUE_800605DC -/* 3B9E8 800605E8 25080020 */ addiu $t0, $t0, (0x80000020 & 0xFFFF) -/* 3B9EC 800605EC 03E00008 */ jr $ra -/* 3B9F0 800605F0 00000000 */ nop -/* 3B9F4 800605F4 00000000 */ nop -/* 3B9F8 800605F8 00000000 */ nop -/* 3B9FC 800605FC 00000000 */ nop -.size osInvalICache, . - osInvalICache diff --git a/ver/ique/asm/os/osWritebackDCache.s b/ver/ique/asm/os/osWritebackDCache.s deleted file mode 100644 index aa0332901b..0000000000 --- a/ver/ique/asm/os/osWritebackDCache.s +++ /dev/null @@ -1,50 +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 .text, "ax" - -/* Generated by spimdisasm 1.16.0 */ - -# Handwritten function -glabel osWritebackDCache -/* 3BA00 80060600 18A00011 */ blez $a1, .LIQUE_80060648 -/* 3BA04 80060604 00000000 */ nop -/* 3BA08 80060608 240B2000 */ addiu $t3, $zero, 0x2000 -/* 3BA0C 8006060C 00AB082B */ sltu $at, $a1, $t3 -/* 3BA10 80060610 1020000F */ beqz $at, .LIQUE_80060650 -/* 3BA14 80060614 00000000 */ nop -/* 3BA18 80060618 0080402D */ daddu $t0, $a0, $zero -/* 3BA1C 8006061C 00854821 */ addu $t1, $a0, $a1 -/* 3BA20 80060620 0109082B */ sltu $at, $t0, $t1 -/* 3BA24 80060624 10200008 */ beqz $at, .LIQUE_80060648 -/* 3BA28 80060628 00000000 */ nop -/* 3BA2C 8006062C 2529FFF0 */ addiu $t1, $t1, -0x10 -/* 3BA30 80060630 310A000F */ andi $t2, $t0, 0xF -/* 3BA34 80060634 010A4023 */ subu $t0, $t0, $t2 -.LIQUE_80060638: -/* 3BA38 80060638 BD190000 */ cache 0x19, 0x0($t0) # handwritten instruction -/* 3BA3C 8006063C 0109082B */ sltu $at, $t0, $t1 -/* 3BA40 80060640 1420FFFD */ bnez $at, .LIQUE_80060638 -/* 3BA44 80060644 25080010 */ addiu $t0, $t0, 0x10 -.LIQUE_80060648: -/* 3BA48 80060648 03E00008 */ jr $ra -/* 3BA4C 8006064C 00000000 */ nop -.LIQUE_80060650: -/* 3BA50 80060650 3C088000 */ lui $t0, 0x8000 -/* 3BA54 80060654 010B4821 */ addu $t1, $t0, $t3 -/* 3BA58 80060658 2529FFF0 */ addiu $t1, $t1, -0x10 -.LIQUE_8006065C: -/* 3BA5C 8006065C BD010000 */ cache 0x01, 0x0($t0) # handwritten instruction -/* 3BA60 80060660 0109082B */ sltu $at, $t0, $t1 -/* 3BA64 80060664 1420FFFD */ bnez $at, .LIQUE_8006065C -/* 3BA68 80060668 25080010 */ addiu $t0, $t0, (0x80000010 & 0xFFFF) -/* 3BA6C 8006066C 03E00008 */ jr $ra -/* 3BA70 80060670 00000000 */ nop -/* 3BA74 80060674 00000000 */ nop -/* 3BA78 80060678 00000000 */ nop -/* 3BA7C 8006067C 00000000 */ nop -.size osWritebackDCache, . - osWritebackDCache diff --git a/ver/ique/asm/os/osWritebackDCacheAll.s b/ver/ique/asm/os/osWritebackDCacheAll.s deleted file mode 100644 index 346234bfe5..0000000000 --- a/ver/ique/asm/os/osWritebackDCacheAll.s +++ /dev/null @@ -1,27 +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 .text, "ax" - -/* Generated by spimdisasm 1.16.0 */ - -# Handwritten function -glabel osWritebackDCacheAll -/* 3BA80 80060680 3C088000 */ lui $t0, 0x8000 -/* 3BA84 80060684 240A2000 */ addiu $t2, $zero, 0x2000 -/* 3BA88 80060688 010A4821 */ addu $t1, $t0, $t2 -/* 3BA8C 8006068C 2529FFF0 */ addiu $t1, $t1, -0x10 -.LIQUE_80060690: -/* 3BA90 80060690 BD010000 */ cache 0x01, 0x0($t0) # handwritten instruction -/* 3BA94 80060694 0109082B */ sltu $at, $t0, $t1 -/* 3BA98 80060698 1420FFFD */ bnez $at, .LIQUE_80060690 -/* 3BA9C 8006069C 25080010 */ addiu $t0, $t0, (0x80000010 & 0xFFFF) -/* 3BAA0 800606A0 03E00008 */ jr $ra -/* 3BAA4 800606A4 00000000 */ nop -/* 3BAA8 800606A8 00000000 */ nop -/* 3BAAC 800606AC 00000000 */ nop -.size osWritebackDCacheAll, . - osWritebackDCacheAll diff --git a/ver/ique/asm/os/probetlb.s b/ver/ique/asm/os/probetlb.s deleted file mode 100644 index 76f4fa936d..0000000000 --- a/ver/ique/asm/os/probetlb.s +++ /dev/null @@ -1,65 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osProbeTLB -/* 40220 80064E20 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 40224 80064E24 310900FF */ andi $t1, $t0, 0xFF -/* 40228 80064E28 3C01FFFF */ lui $at, (0xFFFFE000 >> 16) -/* 4022C 80064E2C 3421E000 */ ori $at, $at, (0xFFFFE000 & 0xFFFF) -/* 40230 80064E30 00815024 */ and $t2, $a0, $at -/* 40234 80064E34 012A4825 */ or $t1, $t1, $t2 -/* 40238 80064E38 40895000 */ mtc0 $t1, $10 # handwritten instruction -/* 4023C 80064E3C 00000000 */ nop -/* 40240 80064E40 00000000 */ nop -/* 40244 80064E44 00000000 */ nop -/* 40248 80064E48 42000008 */ tlbp # handwritten instruction -/* 4024C 80064E4C 00000000 */ nop -/* 40250 80064E50 00000000 */ nop -/* 40254 80064E54 400B0000 */ mfc0 $t3, $0 # handwritten instruction -/* 40258 80064E58 3C018000 */ lui $at, (0x80000000 >> 16) -/* 4025C 80064E5C 01615824 */ and $t3, $t3, $at -/* 40260 80064E60 1560001A */ bnez $t3, .LIQUE_80064ECC -/* 40264 80064E64 00000000 */ nop -/* 40268 80064E68 42000001 */ tlbr # handwritten instruction -/* 4026C 80064E6C 00000000 */ nop -/* 40270 80064E70 00000000 */ nop -/* 40274 80064E74 00000000 */ nop -/* 40278 80064E78 400B2800 */ mfc0 $t3, $5 # handwritten instruction -/* 4027C 80064E7C 216B2000 */ addi $t3, $t3, 0x2000 # handwritten instruction -/* 40280 80064E80 000B5842 */ srl $t3, $t3, 1 -/* 40284 80064E84 01646024 */ and $t4, $t3, $a0 -/* 40288 80064E88 15800004 */ bnez $t4, .LIQUE_80064E9C -/* 4028C 80064E8C 216BFFFF */ addi $t3, $t3, -0x1 # handwritten instruction -/* 40290 80064E90 40021000 */ mfc0 $v0, $2 # handwritten instruction -/* 40294 80064E94 10000002 */ b .LIQUE_80064EA0 -/* 40298 80064E98 00000000 */ nop -.LIQUE_80064E9C: -/* 4029C 80064E9C 40021800 */ mfc0 $v0, $3 # handwritten instruction -.LIQUE_80064EA0: -/* 402A0 80064EA0 304D0002 */ andi $t5, $v0, 0x2 -/* 402A4 80064EA4 11A00009 */ beqz $t5, .LIQUE_80064ECC -/* 402A8 80064EA8 00000000 */ nop -/* 402AC 80064EAC 3C013FFF */ lui $at, (0x3FFFFFC0 >> 16) -/* 402B0 80064EB0 3421FFC0 */ ori $at, $at, (0x3FFFFFC0 & 0xFFFF) -/* 402B4 80064EB4 00411024 */ and $v0, $v0, $at -/* 402B8 80064EB8 00021180 */ sll $v0, $v0, 6 -/* 402BC 80064EBC 008B6824 */ and $t5, $a0, $t3 -/* 402C0 80064EC0 004D1020 */ add $v0, $v0, $t5 # handwritten instruction -/* 402C4 80064EC4 10000002 */ b .LIQUE_80064ED0 -/* 402C8 80064EC8 00000000 */ nop -.LIQUE_80064ECC: -/* 402CC 80064ECC 2402FFFF */ addiu $v0, $zero, -0x1 -.LIQUE_80064ED0: -/* 402D0 80064ED0 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 402D4 80064ED4 03E00008 */ jr $ra -/* 402D8 80064ED8 00000000 */ nop -/* 402DC 80064EDC 00000000 */ nop diff --git a/ver/ique/asm/os/setfpccsr.s b/ver/ique/asm/os/setfpccsr.s deleted file mode 100644 index 8d2269cdf3..0000000000 --- a/ver/ique/asm/os/setfpccsr.s +++ /dev/null @@ -1,16 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel __osSetFpcCsr -/* 46A50 8006B650 4442F800 */ cfc1 $v0, $31 -/* 46A54 8006B654 44C4F800 */ ctc1 $a0, $31 -/* 46A58 8006B658 03E00008 */ jr $ra -/* 46A5C 8006B65C 00000000 */ nop diff --git a/ver/ique/asm/os/setintmask.s b/ver/ique/asm/os/setintmask.s deleted file mode 100644 index 3f77642854..0000000000 --- a/ver/ique/asm/os/setintmask.s +++ /dev/null @@ -1,127 +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 - -glabel __osRcpImTable -/* 73D00 80098900 */ .short 0x0555 -/* 73D02 80098902 */ .short 0x0556 -/* 73D04 80098904 */ .short 0x0559 -/* 73D06 80098906 */ .short 0x055A -/* 73D08 80098908 */ .short 0x0565 -/* 73D0A 8009890A */ .short 0x0566 -/* 73D0C 8009890C */ .short 0x0569 -/* 73D0E 8009890E */ .short 0x056A -/* 73D10 80098910 */ .short 0x0595 -/* 73D12 80098912 */ .short 0x0596 -/* 73D14 80098914 */ .short 0x0599 -/* 73D16 80098916 */ .short 0x059A -/* 73D18 80098918 */ .short 0x05A5 -/* 73D1A 8009891A */ .short 0x05A6 -/* 73D1C 8009891C */ .short 0x05A9 -/* 73D1E 8009891E */ .short 0x05AA -/* 73D20 80098920 */ .short 0x0655 -/* 73D22 80098922 */ .short 0x0656 -/* 73D24 80098924 */ .short 0x0659 -/* 73D26 80098926 */ .short 0x065A -/* 73D28 80098928 */ .short 0x0665 -/* 73D2A 8009892A */ .short 0x0666 -/* 73D2C 8009892C */ .short 0x0669 -/* 73D2E 8009892E */ .short 0x066A -/* 73D30 80098930 */ .short 0x0695 -/* 73D32 80098932 */ .short 0x0696 -/* 73D34 80098934 */ .short 0x0699 -/* 73D36 80098936 */ .short 0x069A -/* 73D38 80098938 */ .short 0x06A5 -/* 73D3A 8009893A */ .short 0x06A6 -/* 73D3C 8009893C */ .short 0x06A9 -/* 73D3E 8009893E */ .short 0x06AA -/* 73D40 80098940 */ .short 0x0955 -/* 73D42 80098942 */ .short 0x0956 -/* 73D44 80098944 */ .short 0x0959 -/* 73D46 80098946 */ .short 0x095A -/* 73D48 80098948 */ .short 0x0965 -/* 73D4A 8009894A */ .short 0x0966 -/* 73D4C 8009894C */ .short 0x0969 -/* 73D4E 8009894E */ .short 0x096A -/* 73D50 80098950 */ .short 0x0995 -/* 73D52 80098952 */ .short 0x0996 -/* 73D54 80098954 */ .short 0x0999 -/* 73D56 80098956 */ .short 0x099A -/* 73D58 80098958 */ .short 0x09A5 -/* 73D5A 8009895A */ .short 0x09A6 -/* 73D5C 8009895C */ .short 0x09A9 -/* 73D5E 8009895E */ .short 0x09AA -/* 73D60 80098960 */ .short 0x0A55 -/* 73D62 80098962 */ .short 0x0A56 -/* 73D64 80098964 */ .short 0x0A59 -/* 73D66 80098966 */ .short 0x0A5A -/* 73D68 80098968 */ .short 0x0A65 -/* 73D6A 8009896A */ .short 0x0A66 -/* 73D6C 8009896C */ .short 0x0A69 -/* 73D6E 8009896E */ .short 0x0A6A -/* 73D70 80098970 */ .short 0x0A95 -/* 73D72 80098972 */ .short 0x0A96 -/* 73D74 80098974 */ .short 0x0A99 -/* 73D76 80098976 */ .short 0x0A9A -/* 73D78 80098978 */ .short 0x0AA5 -/* 73D7A 8009897A */ .short 0x0AA6 -/* 73D7C 8009897C */ .short 0x0AA9 -/* 73D7E 8009897E */ .short 0x0AAA -.size __osRcpImTable, . - __osRcpImTable - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osSetIntMask -/* 42190 80066D90 400C6000 */ mfc0 $t4, $12 # handwritten instruction -/* 42194 80066D94 3182FF01 */ andi $v0, $t4, 0xFF01 -/* 42198 80066D98 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 4219C 80066D9C 250845B4 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 421A0 80066DA0 8D0B0000 */ lw $t3, 0x0($t0) -/* 421A4 80066DA4 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) -/* 421A8 80066DA8 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) -/* 421AC 80066DAC 01614026 */ xor $t0, $t3, $at -/* 421B0 80066DB0 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 421B4 80066DB4 00481025 */ or $v0, $v0, $t0 -/* 421B8 80066DB8 3C0AA430 */ lui $t2, %hi(D_A430000C) -/* 421BC 80066DBC 8D4A000C */ lw $t2, %lo(D_A430000C)($t2) -/* 421C0 80066DC0 11400006 */ beqz $t2, .LIQUE_80066DDC -/* 421C4 80066DC4 000B4C02 */ srl $t1, $t3, 16 -/* 421C8 80066DC8 3C01FFFF */ lui $at, (0xFFFFFFFF >> 16) -/* 421CC 80066DCC 3421FFFF */ ori $at, $at, (0xFFFFFFFF & 0xFFFF) -/* 421D0 80066DD0 01214826 */ xor $t1, $t1, $at -/* 421D4 80066DD4 3129003F */ andi $t1, $t1, 0x3F -/* 421D8 80066DD8 01495025 */ or $t2, $t2, $t1 -.LIQUE_80066DDC: -/* 421DC 80066DDC 000A5400 */ sll $t2, $t2, 16 -/* 421E0 80066DE0 004A1025 */ or $v0, $v0, $t2 -/* 421E4 80066DE4 3C01003F */ lui $at, (0x3F0000 >> 16) -/* 421E8 80066DE8 00814024 */ and $t0, $a0, $at -/* 421EC 80066DEC 010B4024 */ and $t0, $t0, $t3 -/* 421F0 80066DF0 000843C2 */ srl $t0, $t0, 15 -/* 421F4 80066DF4 3C0A800A */ lui $t2, %hi(__osRcpImTable) -/* 421F8 80066DF8 01485021 */ addu $t2, $t2, $t0 -/* 421FC 80066DFC 954A8900 */ lhu $t2, %lo(__osRcpImTable)($t2) -/* 42200 80066E00 3C01A430 */ lui $at, %hi(D_A430000C) -/* 42204 80066E04 AC2A000C */ sw $t2, %lo(D_A430000C)($at) -/* 42208 80066E08 3088FF01 */ andi $t0, $a0, 0xFF01 -/* 4220C 80066E0C 3169FF00 */ andi $t1, $t3, 0xFF00 -/* 42210 80066E10 01094024 */ and $t0, $t0, $t1 -/* 42214 80066E14 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 42218 80066E18 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 4221C 80066E1C 01816024 */ and $t4, $t4, $at -/* 42220 80066E20 01886025 */ or $t4, $t4, $t0 -/* 42224 80066E24 408C6000 */ mtc0 $t4, $12 # handwritten instruction -/* 42228 80066E28 00000000 */ nop -/* 4222C 80066E2C 00000000 */ nop -/* 42230 80066E30 03E00008 */ jr $ra -/* 42234 80066E34 00000000 */ nop -/* 42238 80066E38 00000000 */ nop -/* 4223C 80066E3C 00000000 */ nop diff --git a/ver/ique/asm/os/setsr.s b/ver/ique/asm/os/setsr.s deleted file mode 100644 index d232294979..0000000000 --- a/ver/ique/asm/os/setsr.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osSetSR -/* 46A60 8006B660 40846000 */ mtc0 $a0, $12 # handwritten instruction -/* 46A64 8006B664 00000000 */ nop -/* 46A68 8006B668 03E00008 */ jr $ra -/* 46A6C 8006B66C 00000000 */ nop diff --git a/ver/ique/asm/os/setwatchlo.s b/ver/ique/asm/os/setwatchlo.s deleted file mode 100644 index 9798c3aa06..0000000000 --- a/ver/ique/asm/os/setwatchlo.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osSetWatchLo -/* 46A70 8006B670 40849000 */ mtc0 $a0, $18 # handwritten instruction -/* 46A74 8006B674 00000000 */ nop -/* 46A78 8006B678 03E00008 */ jr $ra -/* 46A7C 8006B67C 00000000 */ nop diff --git a/ver/ique/asm/os/unmaptlb.s b/ver/ique/asm/os/unmaptlb.s deleted file mode 100644 index 0c7c1bdf1d..0000000000 --- a/ver/ique/asm/os/unmaptlb.s +++ /dev/null @@ -1,29 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osUnmapTLB -/* 402E0 80064EE0 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 402E4 80064EE4 40840000 */ mtc0 $a0, $0 # handwritten instruction -/* 402E8 80064EE8 3C098000 */ lui $t1, (0x80000000 >> 16) -/* 402EC 80064EEC 40895000 */ mtc0 $t1, $10 # handwritten instruction -/* 402F0 80064EF0 40801000 */ mtc0 $zero, $2 # handwritten instruction -/* 402F4 80064EF4 40801800 */ mtc0 $zero, $3 # handwritten instruction -/* 402F8 80064EF8 00000000 */ nop -/* 402FC 80064EFC 42000002 */ tlbwi # handwritten instruction -/* 40300 80064F00 00000000 */ nop -/* 40304 80064F04 00000000 */ nop -/* 40308 80064F08 00000000 */ nop -/* 4030C 80064F0C 00000000 */ nop -/* 40310 80064F10 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 40314 80064F14 03E00008 */ jr $ra -/* 40318 80064F18 00000000 */ nop -/* 4031C 80064F1C 00000000 */ nop diff --git a/ver/ique/asm/os/unmaptlball.s b/ver/ique/asm/os/unmaptlball.s deleted file mode 100644 index ab84227826..0000000000 --- a/ver/ique/asm/os/unmaptlball.s +++ /dev/null @@ -1,34 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osUnmapTLBAll -/* 40320 80064F20 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 40324 80064F24 2409001E */ addiu $t1, $zero, 0x1E -/* 40328 80064F28 3C0A8000 */ lui $t2, (0x80000000 >> 16) -/* 4032C 80064F2C 408A5000 */ mtc0 $t2, $10 # handwritten instruction -/* 40330 80064F30 40801000 */ mtc0 $zero, $2 # handwritten instruction -/* 40334 80064F34 40801800 */ mtc0 $zero, $3 # handwritten instruction -.LIQUE_80064F38: -/* 40338 80064F38 40890000 */ mtc0 $t1, $0 # handwritten instruction -/* 4033C 80064F3C 00000000 */ nop -/* 40340 80064F40 42000002 */ tlbwi # handwritten instruction -/* 40344 80064F44 00000000 */ nop -/* 40348 80064F48 00000000 */ nop -/* 4034C 80064F4C 2129FFFF */ addi $t1, $t1, -0x1 # handwritten instruction -/* 40350 80064F50 0521FFF9 */ bgez $t1, .LIQUE_80064F38 -/* 40354 80064F54 00000000 */ nop -/* 40358 80064F58 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 4035C 80064F5C 03E00008 */ jr $ra -/* 40360 80064F60 00000000 */ nop -/* 40364 80064F64 00000000 */ nop -/* 40368 80064F68 00000000 */ nop -/* 4036C 80064F6C 00000000 */ nop diff --git a/ver/ique/splat.yaml b/ver/ique/splat.yaml index a6f0c6c3f3..a7bd672348 100644 --- a/ver/ique/splat.yaml +++ b/ver/ique/splat.yaml @@ -27,6 +27,7 @@ options: symbol_name_format_no_rom: IQUE_$VRAM_$SEG ld_wildcard_sections: True ld_use_symbolic_vram_addresses: False + hasm_in_src_path: True asset_stack: - ique segments: @@ -40,8 +41,8 @@ segments: start: 0x1000 vram: 0x80025C00 subsegments: - - [auto, hasm, bss] - - [auto, hasm, entry_point] + - [auto, hasm, boot/entry_point] + - [auto, c, bss/main_pre_bss] - [auto, c, main_pre] - [auto, c, main] - [auto, c, main_loop] @@ -178,10 +179,10 @@ segments: - [auto, c, os/settime, egcs -O0 -mips2] - [auto, c, os/settimer, egcs -O0 -mips2] - [auto, c, os/timerintr, egcs -O0 -mips2] - - [auto, hasm, os/maptlb] - - [auto, hasm, os/probetlb] - - [auto, hasm, os/unmaptlb] - - [auto, hasm, os/unmaptlball] + - [auto, hasm, os/osMapTLB] + - [auto, hasm, os/__osProbeTLB] + - [auto, hasm, os/osUnmapTLB] + - [auto, hasm, os/osUnmapTLBAll] - [auto, c, os/vigetcurrframebuf, egcs -O2 -mips2] - [auto, c, os/vigetnextframebuf, egcs -O2 -mips2] - [auto, c, os/vigetmode, egcs -O2 -mips2] @@ -211,8 +212,9 @@ segments: - [auto, c, os/guMtxXFMF, egcs -O2 -mips2] - [auto, c, os/guRotate, egcs -O2 -mips2] - [auto, hasm, os/exceptasm] - - [auto, hasm, os/interrupt] - - [auto, hasm, os/setintmask] + - [auto, hasm, os/__osDisableInt] + - [auto, hasm, os/__osRestoreInt] + - [auto, hasm, os/osSetIntMask] - [auto, c, os/pimgr, egcs -O2 -mips2] - [auto, c, os/epirawdma, egcs -O2 -mips2] - [auto, c, os/epiwrite, egcs -O2 -mips2] @@ -253,11 +255,11 @@ segments: - [auto, c, os/xlitob, egcs -O2 -mips2] - [auto, c, os/xldtob, egcs -O2 -mips2] - [auto, c, os/jammesg, egcs -O0 -mips2] - - [auto, hasm, os/getcause] - - [auto, hasm, os/getsr] + - [auto, hasm, os/__osGetCause] + - [auto, hasm, os/__osGetSR] - [auto, hasm, os/setfpccsr] - [auto, hasm, os/setsr] - - [auto, hasm, os/setwatchlo] + - [auto, hasm, os/__osSetWatchLo] - [auto, c, os/_setcompare, egcs -O0 -mips3 -mgp64 -mfp64] - [auto, c, os/sp, egcs -O2 -mips2] - [auto, c, os/spgetstat, egcs -O2 -mips2] @@ -269,7 +271,7 @@ segments: - [auto, c, os/destroythread, egcs -O0 -mips2] - [auto, c, os/getthreadpri, egcs -O0 -mips2] - [auto, c, os/yieldthread, egcs -O0 -mips2] - - [auto, hasm, os/maptlbrdb] + - [auto, hasm, os/osMapTLBRdb] - [auto, c, os/vi, egcs -O2 -mips2] - [auto, c, os/vigetcurrcontext, egcs -O2 -mips2] - [auto, c, os/vimodepallan1, egcs -O2 -mips2] @@ -292,7 +294,9 @@ segments: - [auto, c, os/strcpy, gcc_272 -O1] - [auto, hasm, os/decode_yay0] - [0x49830, pm_effect_loads, effect_loads] + - [auto, c, bss/main_post_bss] - [auto, c, battle/battle] + - [auto, c, battle/battle_bss] - [0x4D140, bin, rspboot] - [0x4D210, bin, n_aspMain_text] - start: 0x4DE70 @@ -332,7 +336,7 @@ segments: start: 0x74570 vram: 0x800da8e0 subsegments: - - [auto, hasm, bss2] + - [auto, c, bss/engine1_pre_bss] - [auto, c, npc_collision] - [auto, c, 77480] - [auto, c, 7B440] @@ -342,12 +346,12 @@ segments: - [auto, c, inventory] - [auto, c, world/actions] - [auto, c, world/partners] - - [auto, hasm, bss2_2] - [auto, c, global_hud_scripts] - [auto, c, 891b0_len_fb0] - [auto, c, 8a160_len_700] - [auto, c, 8a860_len_3f30] - [auto, c, draw_box] + - [auto, c, bss/engine1_post_bss] - start: 0x90570 type: .data name: global_hud_scripts @@ -767,7 +771,7 @@ segments: start: 0xa4990 vram: 0x8010dab0 subsegments: - - [auto, hasm, bss3] + - [auto, c, bss/engine2_pre_bss] - [auto, c, entity] - [auto, c, game_states] - [auto, c, model] @@ -790,6 +794,7 @@ segments: - [auto, c, sprite_shading] - [auto, c, audio/sfx] - [auto, c, audio/e0b30_len_b80] + - [auto, c, bss/engine2_post_bss] - start: 0xE1D60 type: .data name: screen_overlays diff --git a/ver/jp/asm/bss2.s b/ver/jp/asm/bss2.s deleted file mode 100644 index fd1019a927..0000000000 --- a/ver/jp/asm/bss2.s +++ /dev/null @@ -1,114 +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 - -#ifndef SHIFT - -.section .bss - -dlabel PulseStoneNotificationCallback -.space 4 - -dlabel D_8010C924 -.space 4 - -dlabel D_8010C928 -.space 4 - -dlabel D_8010C92C -.space 4 - -dlabel wPartnerNpc -.space 4 - -dlabel TweesterTouchingPlayer -.space 4 - -dlabel PlayerNormalYaw -.space 4 - -dlabel ISpyNotificationCallback -.space 4 - -dlabel TalkNotificationCallback -.space 4 - -dlabel gSpinHistoryBufferPos -.space 4 - -dlabel D_8010C948 -.space 4 - -dlabel NpcHitQueryBehindRightY -.space 4 - -dlabel D_8010C950 -.space 4 - -dlabel TweesterTouchingPartner -.space 4 - -dlabel InteractNotificationCallback -.space 4 - -dlabel PrevPlayerDirection -.space 4 - -dlabel JumpedOnSwitchX -.space 4 - -dlabel D_8010C964 -.space 4 - -dlabel NpcHitQueryBehindCollider -.space 4 - -dlabel PeachDisguiseNpcIndex -.space 4 - -dlabel NpcHitQueryAheadY -.space 4 - -dlabel NpcHitQueryBehindLeftY -.space 4 - -dlabel NpcHitQueryColliderID -.space 4 - -dlabel JumpedOnSwitchZ -.space 4 - -dlabel PlayerRunStateTime -.space 4 - -dlabel D_8010C984 -.space 4 - -dlabel D_8010C988 -.space 4 - -dlabel NpcHitQueryAheadCollider -.space 4 - -dlabel PlayerNormalPitch -.space 4 - -dlabel D_8010C994 -.space 0x0000000c - -dlabel PlayerYInterpUpdateDelay -.space 4 - -dlabel D_8010C9A4 -.space 0x0000000c - -dlabel D_8010C9B0 -.space 4 - -dlabel D_8010C9B4 -.space 0x0000000c - -#endif diff --git a/ver/jp/asm/bss2_2.s b/ver/jp/asm/bss2_2.s deleted file mode 100644 index dd58463ae8..0000000000 --- a/ver/jp/asm/bss2_2.s +++ /dev/null @@ -1,225 +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 - -#ifndef SHIFT - -.section .bss - -dlabel wPartnerTetherDistance -.space 4 - -dlabel D_8010CFC4 -.space 4 - -dlabel wPartnerFollowState -.space 2 - -dlabel D_8010CFCA -.space 2 - -dlabel D_8010CFCC -.space 2 - -dlabel D_8010CFCE -.space 2 - -dlabel wPartnerNpcIndex -.space 4 - -dlabel wPartnerCurrentScript -.space 4 - -dlabel wCurrentPartnerId -.space 4 - -dlabel wPartnerCurrentScriptID -.space 4 - -dlabel D_8010CFE0 -.space 4 - -dlabel NextPartnerID -.space 4 - -dlabel NextPartnerCommand -.space 4 - -dlabel wPartner -.space 4 - -dlabel D_8010CFF0 -.space 4 - -dlabel D_8010CFF4 -.space 4 - -dlabel D_8010CFF8 -.space 8 - -dlabel D_8010D000 -.space 0x63C - -dlabel D_8010D63C -.space 0x4 - -dlabel gPopupState -.space 4 - -dlabel D_8010D644 -.space 4 - -dlabel PopupMenu_SelectedIndex -.space 4 - -dlabel PopupMenu_PrevSelectedIndex -.space 4 - -dlabel PopupMenu_Alpha -.space 4 - -dlabel PopupMenu_FirstDisplayIndex -.space 1 - -dlabel PopupMenu_LastDisplayIndex -.space 1 - -dlabel PopupMenu_DisplayedEntryCount -.space 2 - -dlabel D_8010D658 -.space 2 - -dlabel D_8010D65A -.space 2 - -dlabel PopupMenu_EmptybarHEID -.space 4 - -dlabel PopupMenu_TitleIconHEID -.space 4 - -dlabel PopupMenu_TimesHEID -.space 4 - -dlabel PopupMenu_PartnerLevelHEID -.space 4 - -dlabel PopupMenu_CursorHEID -.space 4 - -dlabel PopupMenu_UpArrowHEID -.space 4 - -dlabel PopupMenu_DownArrowHEID -.space 4 - -dlabel PopupMenu_EntryIconHEID -.space 4 - -dlabel D_8010D67C -.space 2 - -dlabel D_8010D67E -.space 2 - -dlabel D_8010D680 -.space 2 - -dlabel D_8010D682 -.space 2 - -dlabel D_8010D684 -.space 2 - -dlabel D_8010D686 -.space 2 - -dlabel PopupMenu_StarPieceCounterPosX -.space 2 - -dlabel PopupMenu_StarPieceCounterPosY -.space 2 - -dlabel D_8010D68C -.space 2 - -dlabel PopupNotBattle -.space 1 - -dlabel PopupMenu_MaxDisplayableEntryCount -.space 1 - -dlabel D_8010D690 -.space 1 - -dlabel D_8010D691 -.space 1 - -dlabel D_8010D692 -.space 1 - -dlabel D_8010D693 -.space 1 - -dlabel gPopupWorker -.space 4 - -dlabel PopupNotDipping -.space 1 - -dlabel PopupDipMode -.space 1 - -dlabel PopupMenu_WasStatusBarIgnoringChanges -.space 2 - -dlabel gPopupMenu -.space 4 - -dlabel D_8010D6A0 -.space 4 - -dlabel D_8010D6A4 -.space 4 - -dlabel D_8010D6A8 -.space 0x8 - -dlabel gBoxQuadBuffer -.space 0x1500 - -dlabel gPartnerStatus -.space 0x360 - -dlabel gSpinHistoryPosY -.space 0x18 - -dlabel gSpinHistoryPosX -.space 0x18 - -dlabel gSpinHistoryPosZ -.space 0x18 - -dlabel gStatusBar -.space 0x70 - -dlabel gPlayerStatus -.space 0x288 - -dlabel gPlayerSpinState -.space 0x34 - -dlabel D_8010F284 -.space 0xC - -dlabel gPlayerData -.space 0x428 - -dlabel gSpinHistoryPosAngle -.space 0x10 - -#endif diff --git a/ver/jp/asm/bss3.s b/ver/jp/asm/bss3.s deleted file mode 100644 index 88b0988287..0000000000 --- a/ver/jp/asm/bss3.s +++ /dev/null @@ -1,682 +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 - -#ifndef SHIFT - -.section .bss - -dlabel gAuxSpriteShadingProfile -.space 4 - -dlabel gHudElementsNumber -.space 4 - -dlabel gCurrentCustomModelGfxBuildersPtr -.space 4 - -dlabel D_801512BC -.space 4 - -dlabel entity_numEntities -.space 4 - -dlabel gEntityHeapBase -.space 4 - -dlabel gHudElementCacheTableRaster -.space 4 - -dlabel gCurrentModels -.space 4 - -dlabel gHudElementCacheTablePalette -.space 4 - -dlabel gAnimCount -.space 4 - -dlabel gMsgBGScrollAmtX -.space 4 - -dlabel D_801512DC -.space 4 - -dlabel gCurrentTransformGroups -.space 4 - -dlabel gMsgGlobalWaveCounter -.space 4 - -dlabel gCurrentCustomModelGfxPtr -.space 4 - -dlabel gLastCreatedEntityIndex -.space 4 - -dlabel gBackgroundTintModePtr -.space 4 - -dlabel gMsgVarImages -.space 4 - -dlabel ItemEntitiesCreated -.space 4 - -dlabel gCurrentModelTreeRoot -.space 4 - -dlabel gEntityHeapBottom -.space 4 - -dlabel D_80151304 -.space 4 - -dlabel gCurrentRoomDoorSounds -.space 4 - -dlabel gMsgBGScrollAmtY -.space 2 - -dlabel D_8015130E -.space 2 - -dlabel gEntityHideMode -.space 4 - -dlabel gHudElementCacheBuffer -.space 4 - -dlabel gEntityModelCount -.space 4 - -dlabel D_8015131C -.space 4 - -dlabel D_80151320 -.space 4 - -dlabel entity_numShadows -.space 4 - -dlabel gSpriteShadingProfile -.space 4 - -dlabel isAreaSpecificEntityDataLoaded -.space 4 - -dlabel entity_updateCounter -.space 4 - -dlabel gTriggerCount -.space 4 - -dlabel D_80151338 -.space 4 - -dlabel gHudElementCacheSize -.space 4 - -dlabel gCurrentDoorSounds -.space 4 - -dlabel D_80151344 -.space 4 - -dlabel D_80151348 -.space 0x00000018 - -dlabel gWorldEntityList -.space 0x00000078 - -dlabel gBattleEntityList -.space 0x00000078 - -dlabel gCurrentEntityListPtr -.space 4 - -dlabel D_80151474 -.space 4 - -dlabel gWorldShadowList -.space 0x000000f0 - -dlabel gBattleShadowList -.space 0x000000f0 - -dlabel gCurrentShadowListPtr -.space 4 - -dlabel wEntityDataLoadedSize -.space 4 - -dlabel bEntityDataLoadedSize -.space 4 - -dlabel D_80151664 -.space 4 - -dlabel wEntityBlueprint -.space 0x00000078 - -.space 8 - -dlabel bEntityBlueprint -.space 0x00000014 - -dlabel D_801516FC -.space 4 - -dlabel gMainGameMode -.space 0x00000040 - -dlabel gCurrentTextureHeader -.space 0x00000030 - -dlabel wModelList -.space 0x00000400 - -dlabel bModelList -.space 0x00000400 - -dlabel wTransformGroups -.space 0x00000010 - -dlabel bTransformGroups -.space 0x00000010 - -dlabel wCustomModelGfx -.space 0x00000080 - -dlabel bCustomModelGfx -.space 0x00000080 - -dlabel wCustomModelGfxBuilders -.space 0x00000080 - -dlabel bCustomModelGfxBuilders -.space 0x00000080 - -dlabel wModelLocalVtxBuffers -.space 0x00000040 - -dlabel bModelLocalVtxBuffers -.space 0x00000040 - -dlabel gCurrentModelLocalVtxBuffers -.space 4 - -dlabel wModelTreeRoot -.space 4 - -dlabel bModelTreeRoot -.space 4 - -dlabel D_8015221C -.space 4 - -dlabel wModelTreeNodeInfo -.space 0x00000800 - -dlabel bModelTreeNodeInfo -.space 0x00000800 - -dlabel wBackgroundTintMode -.space 1 - -dlabel bBackgroundTintMode -.space 1 - -dlabel D_80153222 -.space 1 - -dlabel D_80153223 -.space 1 - -dlabel TreeIterPos -.space 4 - -dlabel wFogSettings -.space 0x00000020 - -dlabel bFogSettings -.space 0x0000001c - -dlabel gFogSettings -.space 4 - -dlabel texPannerMainU -.space 0x00000040 - -dlabel texPannerMainV -.space 0x00000040 - -dlabel texPannerAuxU -.space 0x00000040 - -dlabel texPannerAuxV -.space 0x00000040 - -dlabel TextureHeapPos -.space 4 - -dlabel mtg_IterIdx -.space 2 - -dlabel mtg_SearchModelID -.space 2 - -dlabel mtg_FoundModelNode -.space 4 - -dlabel mtg_MinChild -.space 2 - -dlabel mtg_MaxChild -.space 2 - -dlabel D_80153378 -.space 8 - -dlabel DepthCopyBuffer -.space 0x00000020 - -dlabel RenderTaskLists -.space 0x0000000c - -dlabel RenderTaskListIdx -.space 4 - -dlabel RenderTaskCount -.space 0x00000010 - -dlabel D_801533C0 -.space 0x00000300 - -dlabel D_801536C0 -.space 0x00000300 - -dlabel D_801539C0 -.space 0x00000040 - -dlabel D_80153A00 -.space 0x00000040 - -dlabel gCurrentAnimMeshListPtr -.space 4 - -dlabel gAnimModelFogEnabled -.space 4 - -dlabel gAnimModelFogR -.space 4 - -dlabel gAnimModelFogG -.space 4 - -dlabel gAnimModelFogB -.space 4 - -dlabel gAnimModelFogA -.space 4 - -dlabel gAnimModelFogStart -.space 4 - -dlabel gAnimModelFogEnd -.space 4 - -dlabel gAnimVtxSegment -.space 4 - -dlabel D_80153A64 -.space 4 - -dlabel gAnimRotMtx -.space 0x00000040 - -dlabel gAnimScaleMtx -.space 0x00000040 - -dlabel gAnimTranslateMtx -.space 0x00000040 - -dlabel gAnimRotScaleMtx -.space 0x00000040 - -dlabel gAnimTreeRoot -.space 8 - -dlabel gWorldEntityModelList -.space 0x00000400 - -dlabel gBattleEntityModelList -.space 0x00000400 - -dlabel gCurrentEntityModelList -.space 4 - -dlabel D_80154374 -.space 4 - -dlabel entity_fog_enabled -.space 4 - -dlabel entity_fog_red -.space 4 - -dlabel entity_fog_green -.space 4 - -dlabel entity_fog_blue -.space 4 - -dlabel entity_fog_alpha -.space 4 - -dlabel entity_fog_dist_min -.space 4 - -dlabel entity_fog_dist_max -.space 4 - -dlabel D_80154394 -.space 0x0000000c - -dlabel gWorldWorkerList -.space 0x00000040 - -dlabel gBattleWorkerList -.space 0x00000040 - -dlabel gCurrentWorkerListPtr -.space 4 - -dlabel D_80154424 -.space 0x0000000c - -dlabel gMessageBuffers -.space 0x00000800 - -dlabel gMessagePrinters -.space 0x00000F40 - -dlabel gMessageMsgVars -.space 0x00000060 - -dlabel D_80155C98 -.space 8 - -dlabel gMessageWindowProjMatrix -.space 0x00000080 - -dlabel D_JP_8015AC98_pad -.space 8 - -dlabel D_80155D20 -.space 4 - -dlabel D_8015DD24 -.space 0x00000050 - -dlabel msg_drawState -.space 4 - -dlabel D_8015DD78 -.space 8 - -dlabel UnusedItemPhysicsScriptID -.space 4 - -dlabel ItemEntityAlternatingSpawn -.space 4 - -dlabel ItemEntityRenderGroup -.space 4 - -dlabel CoinSparkleCenterX -.space 2 - -dlabel CoinSparkleCenterY -.space 2 - -dlabel CoinSparkleCenterZ -.space 2 - -dlabel pad_ItemEntity -.space 0x000000E - -dlabel WorldItemEntities -.space 0x00000400 - -dlabel BattleItemEntities -.space 0x00000400 - -dlabel gCurrentItemEntities -.space 4 - -dlabel isPickingUpItem -.space 2 - -dlabel ItemSpawnWithinPlayerPickupDelay -.space 2 - -dlabel ItemPickupMenu -.space 0x00000330 - -dlabel ItemPickupIconID -.space 4 - -dlabel ItemPickupStateDelay -.space 4 - -dlabel ThrowAwayMenuIdx -.space 4 - -dlabel ThrowAwayItemID -.space 4 - -dlabel ItemPickupGotOutline -.space 4 - -dlabel GotItemTutorialPrinter -.space 4 - -dlabel GotItemTutorialClosed -.space 4 - -dlabel D_801568FC -.space 0xC - -dlabel screen_overlay_frontType -.space 4 - -dlabel screen_overlay_frontZoom -.space 4 - -dlabel screen_overlay_backType -.space 4 - -dlabel screen_overlay_backZoom -.space 4 - -dlabel D_80156910 -.space 0x00000010 - -dlabel ImgFXCurrentTexture -.space 0x00000028 - -dlabel ImgFXVtxBuffers -.space 8 - -dlabel imgfx_vtxBuf -.space 4 - -dlabel ImgFXInstances -.space 4 - -dlabel D_80156958 -.space 8 - -dlabel D_80156960 -.space 8 - -dlabel D_80156968 -.space 8 - -dlabel D_80156970 -.space 0x00000010 - -dlabel ImgFXAnimHeaders -.space 0x000005a0 - -dlabel ImgFXDataCache -.space 0x00000040 - -dlabel gHudElementsWorld -.space 0x00000500 - -dlabel gHudElementsBattle -.space 0x00000500 - -dlabel gHudElements -.space 4 - -dlabel gHudElementCacheBufferWorld -.space 4 - -dlabel gHudElementCacheSizeWorld -.space 4 - -dlabel D_8015796C -.space 4 - -dlabel gHudElementCacheTableRasterWorld -.space 0x00000600 - -dlabel gHudElementCacheTablePaletteWorld -.space 0x00000600 - -dlabel gHudElementCacheBufferBattle -.space 4 - -dlabel gHudElementCacheSizeBattle -.space 4 - -dlabel D_80158578 -.space 8 - -dlabel gHudElementCacheTableRasterBattle -.space 0x00000600 - -dlabel gHudElementCacheTablePaletteBattle -.space 0x00000600 - -dlabel D_80159180 -.space 0x00000010 - -dlabel wTriggerList -.space 0x00000100 - -dlabel bTriggerList -.space 0x00000100 - -dlabel gCurrentTriggerListPtr -.space 4 - -dlabel D_80159394 -.space 0x0000000c - -dlabel gBackgroundPalette -.space 0x00000200 - -dlabel gBackroundLastScrollValue -.space 0x00000020 - -dlabel wSpriteShadingProfile -.space 0x000000b0 - -dlabel bSpriteShadingProfile -.space 0x000000b0 - -dlabel wSpriteShadingProfileAux -.space 0x000000b0 - -dlabel bSpriteShadingProfileAux -.space 0x000000b0 - -dlabel SpriteShadingPalette -.space 0x00000020 - -dlabel wEnvSounds -.space 0x00000118 - -dlabel bEnvSounds -.space 0x00000118 - -dlabel gCurrentEnvSounds -.space 4 - -dlabel SfxReverbMode -.space 4 - -dlabel D_80159AD8 -.space 8 - -dlabel MusicDefaultVolume -.space 2 - -dlabel MusicTargetVolume -.space 2 - -dlabel MusicMaxVolume -.space 2 - -dlabel MusicCurrentVolume -.space 2 - -dlabel D_80159AE8 -.space 8 - -dlabel gMusicSettings -.space 0x00000060 - -dlabel D_80159B50 -.space 0x00000200 - -dlabel gWindows -.space 0x00000800 - -dlabel gCollisionStatus -.space 0x00000028 - -dlabel gCurrentHiddenPanels -.space 0x10 - -.space 8 - -dlabel TextureHandles -.space 0x00002200 - -dlabel ScreenOverlays -.space 0x00000030 - -dlabel AmbientSoundData -.space 0x00000010 - -dlabel CreateEntityVarArgBuffer -.space 0x00000010 - -dlabel D_8015C7E0 -.space 0x20 - -dlabel D_8015C800 -.space 0x2880 - -dlabel D_80164000 -.space 0x32C60 - -#endif diff --git a/ver/jp/asm/entry_point.s b/ver/jp/asm/entry_point.s deleted file mode 100644 index d887c9cd27..0000000000 --- a/ver/jp/asm/entry_point.s +++ /dev/null @@ -1,38 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel func_JP_80025C00 -/* 1000 80025C00 3C08800A */ lui $t0, %hi(main_BSS_START) -/* 1004 80025C04 2508A590 */ addiu $t0, $t0, %lo(main_BSS_START) -/* 1008 80025C08 3C090004 */ lui $t1, %hi(main_BSS_SIZE) -/* 100C 80025C0C 25291F50 */ addiu $t1, $t1, %lo(main_BSS_SIZE) -.LJP_80025C10: -/* 1010 80025C10 AD000000 */ sw $zero, 0x0($t0) -/* 1014 80025C14 AD000004 */ sw $zero, 0x4($t0) -/* 1018 80025C18 21080008 */ addi $t0, $t0, 0x8 # handwritten instruction -/* 101C 80025C1C 2129FFF8 */ addi $t1, $t1, -0x8 # handwritten instruction -/* 1020 80025C20 1520FFFB */ bnez $t1, .LJP_80025C10 -/* 1024 80025C24 00000000 */ nop -/* 1028 80025C28 3C1D800B */ lui $sp, %hi(nuBootStack + 0x2000) -/* 102C 80025C2C 27BD6570 */ addiu $sp, $sp, %lo(nuBootStack + 0x2000) -/* 1030 80025C30 3C0A8006 */ lui $t2, %hi(nuBoot) -/* 1034 80025C34 254AE560 */ addiu $t2, $t2, %lo(nuBoot) -/* 1038 80025C38 01400008 */ jr $t2 -/* 103C 80025C3C 00000000 */ nop -/* 1040 80025C40 00000000 */ nop -/* 1044 80025C44 00000000 */ nop -/* 1048 80025C48 00000000 */ nop -/* 104C 80025C4C 00000000 */ nop -/* 1050 80025C50 00000000 */ nop -/* 1054 80025C54 00000000 */ nop -/* 1058 80025C58 00000000 */ nop -/* 105C 80025C5C 00000000 */ nop diff --git a/ver/jp/asm/main.bss.s b/ver/jp/asm/main.bss.s deleted file mode 100644 index 48c914dd79..0000000000 --- a/ver/jp/asm/main.bss.s +++ /dev/null @@ -1,770 +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 .bss - -dlabel nuScPreNMIFlag -.space 8 - -dlabel D_8009A5B8 -.space 8 - -dlabel gSoundGlobals -.space 8 - -dlabel __osBaseCounter -.space 4 - -dlabel gBGMPlayerC -.space 4 - -dlabel gEncounterSubState -.space 4 - -dlabel CurrentSefCmdHandler -.space 4 - -dlabel timeFreezeMode -.space 4 - -dlabel nuGfxZBuffer -.space 4 - -dlabel nuContDataLockKey -.space 4 - -dlabel __osViIntrCount -.space 4 - -dlabel BeginSoundUpdateCallback -.space 4 - -dlabel D_8009A5EC -.space 4 - -dlabel nuGfxCfbCounter -.space 8 - -dlabel nuGfxDisplay -.space 4 - -dlabel gBGMPlayerB -.space 4 - -dlabel gEncounterState -.space 4 - -dlabel gNpcCount -.space 2 - -dlabel __osMaxControllers -.space 2 - -dlabel __osCurrentTime -.space 8 - -dlabel nuGfxUcode -.space 4 - -dlabel nuContNum -.space 4 - -dlabel nuGfxTaskSpool -.space 4 - -dlabel __osContLastCmd -.space 4 - -dlabel __osEepromTimerMsg -.space 8 - -dlabel gAuAmbienceManager -.space 4 - -dlabel __osTimerCounter -.space 4 - -dlabel nuIdleFunc -.space 4 - -dlabel gCurrentCamID -.space 4 - -dlabel nuPiCartHandle -.space 4 - -dlabel D_8009A63C -.space 4 - -dlabel gSoundManager -.space 12 - -dlabel nuGfxCfb_ptr -.space 4 - -dlabel gOverrideFlags -.space 4 - -dlabel HasPreBattleSongPushed -.space 4 - -dlabel nuGfxCfb -.space 8 - -dlabel __osFinalrom -.space 4 - -dlabel gBGMPlayerA -.space 4 - -dlabel gFirstStrikeMessagePos -.space 4 - -dlabel gMainGfxPos -.space 4 - -dlabel D_8009A670 -.space 4 - -dlabel gDisplayContext -.space 4 - -dlabel D_8009A678 -.space 8 - -dlabel ResetFrameBufferArray -.space 0x00000010 - -dlabel SoftResetDelay -.space 0x00000010 - -dlabel D_8009A6A0 -.space 2 - -dlabel D_8009A6A2 -.space 2 - -dlabel D_8009A6A4 -.space 2 - -dlabel D_8009A6A6 -.space 10 - -dlabel FetchSaveBuffer -.space 0x00001380 - -dlabel LogicalSaveInfo -.space 0x00000020 - -dlabel PhysicalSaveInfo -.space 0x00000030 - -dlabel NextAvailablePhysicalSave -.space 0x00000010 - -dlabel gCurtainScale -.space 4 - -dlabel gCurtainScaleGoal -.space 4 - -dlabel gCurtainFade -.space 4 - -dlabel gCurtainFadeGoal -.space 4 - -dlabel gCurtainDrawCallback -.space 8 - -dlabel D_8009BAA8 -.space 0x00000088 - -dlabel gCrashScreen -.space 0x000009E0 - -dlabel nuGfxTask_ptr -.space 4 - -dlabel taskDoneMsg -.space 2 - -dlabel swapBufMsg -.space 2 - -dlabel GfxTaskMgrThread -.space 0x000001B8 - -dlabel GfxTaskMgrStack -.space 0x00002000 - -dlabel D_8009E6D0 -.space 0x00000020 - -dlabel gCurrentCamConfiguration -.space 0x0000001C - -dlabel D_800A08DC -.space 4 - -dlabel D_800A08E0 -.space 4 - -dlabel D_800A08E4 -.space 4 - -dlabel D_800A08E8 -.space 4 - -dlabel D_800A08EC -.space 4 - -dlabel CurGameMode -.space 0x00000010 - -dlabel D_800A0900 -.space 4 - -dlabel D_800A0904 -.space 4 - -dlabel D_800A0908 -.space 8 - -dlabel gLogosImages -.space 4 - -dlabel gLogosImage3 -.space 4 - -dlabel gLogosImage1 -.space 4 - -dlabel gLogosImage2 -.space 4 - -dlabel StepPauseDelay -.space 1 - -dlabel StepPauseState -.space 1 - -dlabel StepPauseAlpha -.space 2 - -dlabel SavedReverbMode -.space 12 - -dlabel D_800A0930 -.space 1 - -dlabel D_800A0931 -.space 1 - -dlabel D_800A0932 -.space 14 - -dlabel gMapTransitionAlpha -.space 2 - -dlabel gMapTransitionFadeRate -.space 2 - -dlabel gMapTransitionState -.space 2 - -dlabel gMapTransitionStateTime -.space 2 - -dlabel gLoadedFromFileSelect -.space 8 - -dlabel IntroEnableDrawFrameDelay -.space 4 - -dlabel IntroOverlayAlpha -.space 2 - -dlabel IntroFrontFadeAlpha -.space 2 - -dlabel IntroOverlayDelta -.space 2 - -dlabel IntroFadeColorR -.space 2 - -dlabel IntroFadeColorG -.space 2 - -dlabel IntroFadeColorB -.space 2 - -dlabel IntroOverlayType -.space 4 - -dlabel D_800A0964 -.space 12 - -dlabel TitleScreen_AppearDelay -.space 4 - -dlabel TitleScreen_ImgList -.space 4 - -dlabel TitleScreen_ImgList_Logo -.space 4 - -dlabel TitleScreen_ImgList_Copyright -.space 4 - -dlabel TitleScreen_ImgList_PressStart -.space 4 - -dlabel TitleScreen_ImgList_CopyrightPalette -.space 4 - -dlabel TitleScreen_TimeLeft -.space 8 - -dlabel gWorldNpcList -.space 0x00000100 - -dlabel gBattleNpcList -.space 0x00000100 - -dlabel gCurrentNpcListPtr -.space 4 - -dlabel gNpcPlayerCollisionsEnabled -.space 12 - -dlabel D_800A0BA0 -.space 4 - -dlabel D_800A0BA4 -.space 4 - -dlabel WorldMerleeOrbEffect -.space 4 - -dlabel WorldMerleeWaveEffect -.space 4 - -dlabel D_800A0BB0 -.space 4 - -dlabel D_800A0BB4 -.space 4 - -dlabel D_800A0BB8 -.space 8 - -dlabel D_800A0BC0 -.space 0x00000380 - -dlabel D_800A0F40 -.space 4 - -dlabel D_800A0F44 -.space 12 - -dlabel AuInitialGlobalVolume -.space 8 - -dlabel nuAuMgrThread -.space 0x000005B8 - -dlabel AuStack -.space 0x00002000 - -dlabel AlCmdListBuffers -.space 0x00000010 - -dlabel nuAuTasks -.space 0x00000108 - -dlabel D_800A3628 -.space 12 - -dlabel AlFrameSize -.space 4 - -dlabel AlMinFrameSize -.space 8 - -dlabel nuAuDmaMesgQ -.space 0x00000018 - -dlabel nuAuDmaMesgBuf -.space 0x000000C8 - -dlabel nuAuDmaIOMesgBuf -.space 0x000004B0 - -dlabel nuAuDmaState -.space 0x00000010 - -dlabel nuAuDmaBufList -.space 0x000003F0 - -dlabel CurrentSeqCmdHandler -.space 0x00000010 - -dlabel AuDelayBufferMain -.space 4 - -dlabel AuDelayBufferAux -.space 4 - -dlabel AuDelayCounter -.space 4 - -dlabel AuDelayedVoiceGroup -.space 2 - -dlabel AuDelayedChannel -.space 2 - -dlabel AuDelayCount -.space 0x00000010 - -dlabel gEffectGraphicsData -.space 0x000001E0 - -dlabel gMapConfig -.space 8 - -dlabel gMapSettings -.space 0x00000048 - -dlabel gCollisionRayStartX -.space 4 - -dlabel gCollisionRayStartY -.space 4 - -dlabel gCollisionRayStartZ -.space 4 - -dlabel gCollisionRayDirX -.space 4 - -dlabel gCollisionRayDirY -.space 4 - -dlabel gCollisionRayDirZ -.space 4 - -dlabel gCollisionPointX -.space 4 - -dlabel gCollisionPointY -.space 4 - -dlabel gCollisionPointZ -.space 4 - -dlabel gCollisionRayLength -.space 4 - -dlabel gCollisionNormalX -.space 4 - -dlabel gCollisionNormalY -.space 4 - -dlabel gCollisionNormalZ -.space 4 - -dlabel gCollisionDataBackup -.space 4 - -dlabel gCollisionDataZoneBackup -.space 8 - -dlabel IdleThread -.space 0x000001B0 - -dlabel MainThread -.space 0x000001B0 - -dlabel IdleStack -.space 0x00002000 - -dlabel nuScStack -.space 0x00002000 - -dlabel nuScAudioStack -.space 0x00002000 - -dlabel nuScGraphicsStack -.space 0x00002000 - -dlabel D_800AC5D0 -.space 0x00000018 - -dlabel D_800AC5E8 -.space 0x000000C8 - -dlabel nuGfxMesgBuf -.space 0x00000020 - -dlabel GfxStack -.space 0x00002000 - -dlabel nuSiMesgBuf -.space 0x00000020 - -dlabel siMgrThread -.space 0x000001B0 - -dlabel siMgrStack -.space 0x00002000 - -dlabel nuContWaitMesgBuf -.space 4 - -dlabel nuContDataMutexBuf -.space 12 - -dlabel piThread -.space 0x000001B0 - -dlabel piThreadStack -.space 0x00001000 - -dlabel piEventQueue -.space 0x00000018 - -dlabel piEventBuf -.space 8 - -dlabel piAccessBuf -.space 0x00000010 - -dlabel tmp_task -.space 0x00000040 - -dlabel siAccessBuf -.space 0x00000010 - -dlabel retrace -.space 8 - -dlabel viThread -.space 0x000001B8 - -dlabel viThreadStack -.space 0x00001000 - -dlabel viEventQueue -.space 0x00000018 - -dlabel viEventBuf -.space 0x00000018 - -dlabel viRetraceMsg -.space 0x00000018 - -dlabel viCounterMsg -.space 0x00000018 - -dlabel __MotorDataBuf -.space 0x00000100 - -dlabel __osFlashID -.space 0x00000010 - -dlabel __osFlashMsg -.space 0x00000018 - -dlabel __osFlashMessageQ -.space 0x00000018 - -dlabel __osFlashHandler -.space 0x00000074 - -dlabel __osFlashMsgBuf -.space 4 - -dlabel __osFlashVersion -.space 8 - -dlabel wMapTexName -.space 0x00000018 - -dlabel __osThreadSave -.space 0x000001B0 - -dlabel nuContWaitMesgQ -.space 0x00000018 - -dlabel __osContPifRam -.space 0x00000040 - -dlabel gCurrentEncounter -.space 0x00000BF8 - -dlabel __Dom2SpeedParam -.space 0x00000074 - -dlabel nuContStatus -.space 0x00000014 - -dlabel D_800B1B90 -.space 0x000001B0 - -dlabel nuContRmbCtl -.space 0x00000028 - -dlabel nuContData -.space 0x00000018 - -dlabel gCameras -.space 0x00002560 - -dlabel gCollisionData -.space 0x00000010 - -dlabel nuGfxMesgQ -.space 0x00000018 - -dlabel __CartRomHandle -.space 0x00000078 - -dlabel __osPiAccessQueue -.space 0x00000018 - -dlabel gEffectInstances -.space 0x00000180 - -dlabel __Dom1SpeedParam -.space 0x00000078 - -dlabel nuBootStack -.space 0x00002000 - -dlabel nuMainStack -.space 0x00002000 - -dlabel nuYieldBuf -.space 0x00000C10 - -dlabel auSynDriver -.space 0x00000030 - -dlabel D_800B91D0 -.space 0x00020000 - -dlabel gZoneCollisionData -.space 0x00000010 - -dlabel wMapHitName -.space 0x00000014 - -dlabel nuSiMgrMesgQ -.space 0x0000001C - -dlabel __osBaseTimer -.space 0x00000020 - -dlabel wMapShapeName -.space 0x00000018 - -dlabel nuAuHeap -.space 0x00000030 - -dlabel nuGfxTask -.space 0x00000370 - -dlabel gSaveGlobals -.space 0x00000080 - -dlabel wMapBgName -.space 0x00000018 - -dlabel __osPfsInodeCache -.space 0x00000100 - -dlabel rspbootUcodeBuffer -.space 0x00000800 - -dlabel __osEventStateTab -.space 0x00000080 - -dlabel __osPfsPifRam -.space 0x00000040 - -dlabel D_800DA040 -.space 0x00000400 - -dlabel nusched -.space 0x00000680 - -dlabel __osEepromTimerQ -.space 0x00000018 - -dlabel nuContPfs -.space 0x000001A0 - -dlabel nuSiMesgQ -.space 0x00000018 - -dlabel D_800DAC90 -.space 0x00000018 - -dlabel __osSiAccessQueue -.space 0x00000018 - -dlabel gCurrentSaveFile -.space 0x00001380 - -dlabel nuContDataMutexQ -.space 0x00000020 - -dlabel D_800DC060 -.space 4 - -dlabel gCurrentStagePtr -.space 4 - -dlabel gBattleState -.space 8 - -dlabel gBattleStatus -.space 0x00000460 - -dlabel gLastDrawBattleState -.space 4 - -dlabel D_800DC4D4 -.space 8 - -dlabel gBattleSubState -.space 4 - -dlabel D_800DC4E0 -.space 8 - -dlabel gCurrentBattleID -.space 4 - -dlabel gCurrentStageID -.space 4 - -dlabel D_800DC4F0 -.space 4 - -dlabel gOverrideBattlePtr -.space 4 - -dlabel D_800DC4F8 -.space 4 - -dlabel gCurrentBattlePtr -.space 4 diff --git a/ver/jp/asm/os/__osDisableInt.s b/ver/jp/asm/os/__osDisableInt.s deleted file mode 100644 index d9fe22f842..0000000000 --- a/ver/jp/asm/os/__osDisableInt.s +++ /dev/null @@ -1,42 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osDisableInt -/* 46740 8006B340 3C0A8009 */ lui $t2, %hi(__OSGlobalIntMask) -/* 46744 8006B344 254A5890 */ addiu $t2, $t2, %lo(__OSGlobalIntMask) -/* 46748 8006B348 8D4B0000 */ lw $t3, 0x0($t2) -/* 4674C 8006B34C 316BFF00 */ andi $t3, $t3, 0xFF00 -/* 46750 8006B350 40086000 */ mfc0 $t0, $12 # handwritten instruction -/* 46754 8006B354 2401FFFE */ addiu $at, $zero, -0x2 -/* 46758 8006B358 01014824 */ and $t1, $t0, $at -/* 4675C 8006B35C 40896000 */ mtc0 $t1, $12 # handwritten instruction -/* 46760 8006B360 31020001 */ andi $v0, $t0, 0x1 -/* 46764 8006B364 8D480000 */ lw $t0, 0x0($t2) -/* 46768 8006B368 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 4676C 8006B36C 110B000E */ beq $t0, $t3, .LJP_8006B3A8 -/* 46770 8006B370 3C0A8009 */ lui $t2, %hi(__osRunningThread) -/* 46774 8006B374 254A4640 */ addiu $t2, $t2, %lo(__osRunningThread) -/* 46778 8006B378 8D490118 */ lw $t1, 0x118($t2) -/* 4677C 8006B37C 312AFF00 */ andi $t2, $t1, 0xFF00 -/* 46780 8006B380 01485024 */ and $t2, $t2, $t0 -/* 46784 8006B384 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 46788 8006B388 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 4678C 8006B38C 01214824 */ and $t1, $t1, $at -/* 46790 8006B390 012A4825 */ or $t1, $t1, $t2 -/* 46794 8006B394 2401FFFE */ addiu $at, $zero, -0x2 -/* 46798 8006B398 01214824 */ and $t1, $t1, $at -/* 4679C 8006B39C 40896000 */ mtc0 $t1, $12 # handwritten instruction -/* 467A0 8006B3A0 00000000 */ nop -/* 467A4 8006B3A4 00000000 */ nop -.LJP_8006B3A8: -/* 467A8 8006B3A8 03E00008 */ jr $ra -/* 467AC 8006B3AC 00000000 */ nop diff --git a/ver/jp/asm/os/__osGetCause.s b/ver/jp/asm/os/__osGetCause.s deleted file mode 100644 index 3fc09fd4cf..0000000000 --- a/ver/jp/asm/os/__osGetCause.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osGetCause -/* 47A40 8006C640 40026800 */ mfc0 $v0, $13 # handwritten instruction -/* 47A44 8006C644 03E00008 */ jr $ra -/* 47A48 8006C648 00000000 */ nop -/* 47A4C 8006C64C 00000000 */ nop diff --git a/ver/jp/asm/os/__osGetSR.s b/ver/jp/asm/os/__osGetSR.s deleted file mode 100644 index 1dde530b9f..0000000000 --- a/ver/jp/asm/os/__osGetSR.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osGetSR -/* 47A50 8006C650 40026000 */ mfc0 $v0, $12 # handwritten instruction -/* 47A54 8006C654 03E00008 */ jr $ra -/* 47A58 8006C658 00000000 */ nop -/* 47A5C 8006C65C 00000000 */ nop diff --git a/ver/jp/asm/os/__osProbeTLB.s b/ver/jp/asm/os/__osProbeTLB.s deleted file mode 100644 index 4f6863934d..0000000000 --- a/ver/jp/asm/os/__osProbeTLB.s +++ /dev/null @@ -1,65 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osProbeTLB -/* 41C30 80066830 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 41C34 80066834 310900FF */ andi $t1, $t0, 0xFF -/* 41C38 80066838 2401E000 */ addiu $at, $zero, -0x2000 -/* 41C3C 8006683C 00815024 */ and $t2, $a0, $at -/* 41C40 80066840 012A4825 */ or $t1, $t1, $t2 -/* 41C44 80066844 40895000 */ mtc0 $t1, $10 # handwritten instruction -/* 41C48 80066848 00000000 */ nop -/* 41C4C 8006684C 00000000 */ nop -/* 41C50 80066850 00000000 */ nop -/* 41C54 80066854 42000008 */ tlbp # handwritten instruction -/* 41C58 80066858 00000000 */ nop -/* 41C5C 8006685C 00000000 */ nop -/* 41C60 80066860 400B0000 */ mfc0 $t3, $0 # handwritten instruction -/* 41C64 80066864 3C018000 */ lui $at, (0x80000000 >> 16) -/* 41C68 80066868 01615824 */ and $t3, $t3, $at -/* 41C6C 8006686C 1560001A */ bnez $t3, .LJP_800668D8 -/* 41C70 80066870 00000000 */ nop -/* 41C74 80066874 42000001 */ tlbr # handwritten instruction -/* 41C78 80066878 00000000 */ nop -/* 41C7C 8006687C 00000000 */ nop -/* 41C80 80066880 00000000 */ nop -/* 41C84 80066884 400B2800 */ mfc0 $t3, $5 # handwritten instruction -/* 41C88 80066888 216B2000 */ addi $t3, $t3, 0x2000 # handwritten instruction -/* 41C8C 8006688C 000B5842 */ srl $t3, $t3, 1 -/* 41C90 80066890 01646024 */ and $t4, $t3, $a0 -/* 41C94 80066894 15800004 */ bnez $t4, .LJP_800668A8 -/* 41C98 80066898 216BFFFF */ addi $t3, $t3, -0x1 # handwritten instruction -/* 41C9C 8006689C 40021000 */ mfc0 $v0, $2 # handwritten instruction -/* 41CA0 800668A0 10000002 */ b .LJP_800668AC -/* 41CA4 800668A4 00000000 */ nop -.LJP_800668A8: -/* 41CA8 800668A8 40021800 */ mfc0 $v0, $3 # handwritten instruction -.LJP_800668AC: -/* 41CAC 800668AC 304D0002 */ andi $t5, $v0, 0x2 -/* 41CB0 800668B0 11A00009 */ beqz $t5, .LJP_800668D8 -/* 41CB4 800668B4 00000000 */ nop -/* 41CB8 800668B8 3C013FFF */ lui $at, (0x3FFFFFC0 >> 16) -/* 41CBC 800668BC 3421FFC0 */ ori $at, $at, (0x3FFFFFC0 & 0xFFFF) -/* 41CC0 800668C0 00411024 */ and $v0, $v0, $at -/* 41CC4 800668C4 00021180 */ sll $v0, $v0, 6 -/* 41CC8 800668C8 008B6824 */ and $t5, $a0, $t3 -/* 41CCC 800668CC 004D1020 */ add $v0, $v0, $t5 # handwritten instruction -/* 41CD0 800668D0 10000002 */ b .LJP_800668DC -/* 41CD4 800668D4 00000000 */ nop -.LJP_800668D8: -/* 41CD8 800668D8 2402FFFF */ addiu $v0, $zero, -0x1 -.LJP_800668DC: -/* 41CDC 800668DC 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 41CE0 800668E0 03E00008 */ jr $ra -/* 41CE4 800668E4 00000000 */ nop -/* 41CE8 800668E8 00000000 */ nop -/* 41CEC 800668EC 00000000 */ nop diff --git a/ver/jp/asm/os/__osRestoreInt.s b/ver/jp/asm/os/__osRestoreInt.s deleted file mode 100644 index 13f611577e..0000000000 --- a/ver/jp/asm/os/__osRestoreInt.s +++ /dev/null @@ -1,21 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osRestoreInt -/* 467B0 8006B3B0 40086000 */ mfc0 $t0, $12 # handwritten instruction -/* 467B4 8006B3B4 01044025 */ or $t0, $t0, $a0 -/* 467B8 8006B3B8 40886000 */ mtc0 $t0, $12 # handwritten instruction -/* 467BC 8006B3BC 00000000 */ nop -/* 467C0 8006B3C0 00000000 */ nop -/* 467C4 8006B3C4 03E00008 */ jr $ra -/* 467C8 8006B3C8 00000000 */ nop -/* 467CC 8006B3CC 00000000 */ nop diff --git a/ver/jp/asm/os/__osSetCompare.s b/ver/jp/asm/os/__osSetCompare.s deleted file mode 100644 index 8b8f391095..0000000000 --- a/ver/jp/asm/os/__osSetCompare.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osSetCompare -/* 47A60 8006C660 40845800 */ mtc0 $a0, $11 # handwritten instruction -/* 47A64 8006C664 03E00008 */ jr $ra -/* 47A68 8006C668 00000000 */ nop -/* 47A6C 8006C66C 00000000 */ nop diff --git a/ver/jp/asm/os/__osSetWatchLo.s b/ver/jp/asm/os/__osSetWatchLo.s deleted file mode 100644 index e5e7d9faf5..0000000000 --- a/ver/jp/asm/os/__osSetWatchLo.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osSetWatchLo -/* 47A90 8006C690 40849000 */ mtc0 $a0, $18 # handwritten instruction -/* 47A94 8006C694 00000000 */ nop -/* 47A98 8006C698 03E00008 */ jr $ra -/* 47A9C 8006C69C 00000000 */ nop diff --git a/ver/jp/asm/os/bcmp.s b/ver/jp/asm/os/bcmp.s deleted file mode 100644 index ddd6d0158c..0000000000 --- a/ver/jp/asm/os/bcmp.s +++ /dev/null @@ -1,90 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel bcmp -/* 46C50 8006B850 00851026 */ xor $v0, $a0, $a1 -/* 46C54 8006B854 28C10010 */ slti $at, $a2, 0x10 -/* 46C58 8006B858 14200034 */ bnez $at, .LJP_8006B92C -/* 46C5C 8006B85C 00000000 */ nop -/* 46C60 8006B860 30420003 */ andi $v0, $v0, 0x3 -/* 46C64 8006B864 14400018 */ bnez $v0, .LJP_8006B8C8 -/* 46C68 8006B868 0004C023 */ negu $t8, $a0 -/* 46C6C 8006B86C 33180003 */ andi $t8, $t8, 0x3 -/* 46C70 8006B870 13000007 */ beqz $t8, .LJP_8006B890 -/* 46C74 8006B874 00D83023 */ subu $a2, $a2, $t8 -/* 46C78 8006B878 00601021 */ addu $v0, $v1, $zero -/* 46C7C 8006B87C 88820000 */ lwl $v0, 0x0($a0) -/* 46C80 8006B880 88A30000 */ lwl $v1, 0x0($a1) -/* 46C84 8006B884 00982021 */ addu $a0, $a0, $t8 -/* 46C88 8006B888 14430033 */ bne $v0, $v1, .LJP_8006B958 -/* 46C8C 8006B88C 00B82821 */ addu $a1, $a1, $t8 -.LJP_8006B890: -/* 46C90 8006B890 2401FFFC */ addiu $at, $zero, -0x4 -/* 46C94 8006B894 00C13824 */ and $a3, $a2, $at -/* 46C98 8006B898 10E00024 */ beqz $a3, .LJP_8006B92C -/* 46C9C 8006B89C 00C73023 */ subu $a2, $a2, $a3 -/* 46CA0 8006B8A0 00E43821 */ addu $a3, $a3, $a0 -.LJP_8006B8A4: -/* 46CA4 8006B8A4 8C820000 */ lw $v0, 0x0($a0) -/* 46CA8 8006B8A8 8CA30000 */ lw $v1, 0x0($a1) -/* 46CAC 8006B8AC 24840004 */ addiu $a0, $a0, 0x4 -/* 46CB0 8006B8B0 14430029 */ bne $v0, $v1, .LJP_8006B958 -/* 46CB4 8006B8B4 24A50004 */ addiu $a1, $a1, 0x4 -/* 46CB8 8006B8B8 1487FFFA */ bne $a0, $a3, .LJP_8006B8A4 -/* 46CBC 8006B8BC 00000000 */ nop -/* 46CC0 8006B8C0 1000001A */ b .LJP_8006B92C -/* 46CC4 8006B8C4 00000000 */ nop -.LJP_8006B8C8: -/* 46CC8 8006B8C8 00053823 */ negu $a3, $a1 -/* 46CCC 8006B8CC 30E70003 */ andi $a3, $a3, 0x3 -/* 46CD0 8006B8D0 10E00009 */ beqz $a3, .LJP_8006B8F8 -/* 46CD4 8006B8D4 00C73023 */ subu $a2, $a2, $a3 -/* 46CD8 8006B8D8 00E43821 */ addu $a3, $a3, $a0 -.LJP_8006B8DC: -/* 46CDC 8006B8DC 90820000 */ lbu $v0, 0x0($a0) -/* 46CE0 8006B8E0 90A30000 */ lbu $v1, 0x0($a1) -/* 46CE4 8006B8E4 24840001 */ addiu $a0, $a0, 0x1 -/* 46CE8 8006B8E8 1443001B */ bne $v0, $v1, .LJP_8006B958 -/* 46CEC 8006B8EC 24A50001 */ addiu $a1, $a1, 0x1 -/* 46CF0 8006B8F0 1487FFFA */ bne $a0, $a3, .LJP_8006B8DC -/* 46CF4 8006B8F4 00000000 */ nop -.LJP_8006B8F8: -/* 46CF8 8006B8F8 2401FFFC */ addiu $at, $zero, -0x4 -/* 46CFC 8006B8FC 00C13824 */ and $a3, $a2, $at -/* 46D00 8006B900 10E0000A */ beqz $a3, .LJP_8006B92C -/* 46D04 8006B904 00C73023 */ subu $a2, $a2, $a3 -/* 46D08 8006B908 00E43821 */ addu $a3, $a3, $a0 -.LJP_8006B90C: -/* 46D0C 8006B90C 88820000 */ lwl $v0, 0x0($a0) -/* 46D10 8006B910 98820003 */ lwr $v0, 0x3($a0) -/* 46D14 8006B914 8CA30000 */ lw $v1, 0x0($a1) -/* 46D18 8006B918 24840004 */ addiu $a0, $a0, 0x4 -/* 46D1C 8006B91C 1443000E */ bne $v0, $v1, .LJP_8006B958 -/* 46D20 8006B920 24A50004 */ addiu $a1, $a1, 0x4 -/* 46D24 8006B924 1487FFF9 */ bne $a0, $a3, .LJP_8006B90C -/* 46D28 8006B928 00000000 */ nop -.LJP_8006B92C: -/* 46D2C 8006B92C 18C00008 */ blez $a2, .LJP_8006B950 -/* 46D30 8006B930 00C43821 */ addu $a3, $a2, $a0 -.LJP_8006B934: -/* 46D34 8006B934 90820000 */ lbu $v0, 0x0($a0) -/* 46D38 8006B938 90A30000 */ lbu $v1, 0x0($a1) -/* 46D3C 8006B93C 24840001 */ addiu $a0, $a0, 0x1 -/* 46D40 8006B940 14430005 */ bne $v0, $v1, .LJP_8006B958 -/* 46D44 8006B944 24A50001 */ addiu $a1, $a1, 0x1 -/* 46D48 8006B948 1487FFFA */ bne $a0, $a3, .LJP_8006B934 -/* 46D4C 8006B94C 00000000 */ nop -.LJP_8006B950: -/* 46D50 8006B950 03E00008 */ jr $ra -/* 46D54 8006B954 00001021 */ addu $v0, $zero, $zero -.LJP_8006B958: -/* 46D58 8006B958 03E00008 */ jr $ra -/* 46D5C 8006B95C 24020001 */ addiu $v0, $zero, 0x1 diff --git a/ver/jp/asm/os/bcopy.s b/ver/jp/asm/os/bcopy.s deleted file mode 100644 index 4d470e42d1..0000000000 --- a/ver/jp/asm/os/bcopy.s +++ /dev/null @@ -1,232 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel bcopy -/* 3FA20 80064620 10C0001B */ beqz $a2, .LJP_80064690 -/* 3FA24 80064624 00A03821 */ addu $a3, $a1, $zero -/* 3FA28 80064628 10850019 */ beq $a0, $a1, .LJP_80064690 -/* 3FA2C 8006462C 00000000 */ nop -/* 3FA30 80064630 00A4082A */ slt $at, $a1, $a0 -/* 3FA34 80064634 14200007 */ bnez $at, .LJP_80064654 -/* 3FA38 80064638 00000000 */ nop -/* 3FA3C 8006463C 00861020 */ add $v0, $a0, $a2 # handwritten instruction -/* 3FA40 80064640 00A2082A */ slt $at, $a1, $v0 -/* 3FA44 80064644 10200003 */ beqz $at, .LJP_80064654 -/* 3FA48 80064648 00000000 */ nop -/* 3FA4C 8006464C 1000005C */ b .LJP_800647C0 -/* 3FA50 80064650 00000000 */ nop -.LJP_80064654: -/* 3FA54 80064654 28C10010 */ slti $at, $a2, 0x10 -/* 3FA58 80064658 14200005 */ bnez $at, .LJP_80064670 -/* 3FA5C 8006465C 00000000 */ nop -/* 3FA60 80064660 30820003 */ andi $v0, $a0, 0x3 -/* 3FA64 80064664 30A30003 */ andi $v1, $a1, 0x3 -/* 3FA68 80064668 1043000B */ beq $v0, $v1, .LJP_80064698 -/* 3FA6C 8006466C 00000000 */ nop -.LJP_80064670: -/* 3FA70 80064670 10C00007 */ beqz $a2, .LJP_80064690 -/* 3FA74 80064674 00000000 */ nop -/* 3FA78 80064678 00861821 */ addu $v1, $a0, $a2 -.LJP_8006467C: -/* 3FA7C 8006467C 80820000 */ lb $v0, 0x0($a0) -/* 3FA80 80064680 24840001 */ addiu $a0, $a0, 0x1 -/* 3FA84 80064684 A0A20000 */ sb $v0, 0x0($a1) -/* 3FA88 80064688 1483FFFC */ bne $a0, $v1, .LJP_8006467C -/* 3FA8C 8006468C 24A50001 */ addiu $a1, $a1, 0x1 -.LJP_80064690: -/* 3FA90 80064690 03E00008 */ jr $ra -/* 3FA94 80064694 00E01021 */ addu $v0, $a3, $zero -.LJP_80064698: -/* 3FA98 80064698 1040001A */ beqz $v0, .LJP_80064704 -/* 3FA9C 8006469C 00000000 */ nop -/* 3FAA0 800646A0 24010001 */ addiu $at, $zero, 0x1 -/* 3FAA4 800646A4 10410010 */ beq $v0, $at, .LJP_800646E8 -/* 3FAA8 800646A8 00000000 */ nop -/* 3FAAC 800646AC 24010002 */ addiu $at, $zero, 0x2 -/* 3FAB0 800646B0 10410007 */ beq $v0, $at, .LJP_800646D0 -/* 3FAB4 800646B4 00000000 */ nop -/* 3FAB8 800646B8 80820000 */ lb $v0, 0x0($a0) -/* 3FABC 800646BC 24840001 */ addiu $a0, $a0, 0x1 -/* 3FAC0 800646C0 A0A20000 */ sb $v0, 0x0($a1) -/* 3FAC4 800646C4 24A50001 */ addiu $a1, $a1, 0x1 -/* 3FAC8 800646C8 1000000E */ b .LJP_80064704 -/* 3FACC 800646CC 24C6FFFF */ addiu $a2, $a2, -0x1 -.LJP_800646D0: -/* 3FAD0 800646D0 84820000 */ lh $v0, 0x0($a0) -/* 3FAD4 800646D4 24840002 */ addiu $a0, $a0, 0x2 -/* 3FAD8 800646D8 A4A20000 */ sh $v0, 0x0($a1) -/* 3FADC 800646DC 24A50002 */ addiu $a1, $a1, 0x2 -/* 3FAE0 800646E0 10000008 */ b .LJP_80064704 -/* 3FAE4 800646E4 24C6FFFE */ addiu $a2, $a2, -0x2 -.LJP_800646E8: -/* 3FAE8 800646E8 80820000 */ lb $v0, 0x0($a0) -/* 3FAEC 800646EC 84830001 */ lh $v1, 0x1($a0) -/* 3FAF0 800646F0 24840003 */ addiu $a0, $a0, 0x3 -/* 3FAF4 800646F4 A0A20000 */ sb $v0, 0x0($a1) -/* 3FAF8 800646F8 A4A30001 */ sh $v1, 0x1($a1) -/* 3FAFC 800646FC 24A50003 */ addiu $a1, $a1, 0x3 -/* 3FB00 80064700 24C6FFFD */ addiu $a2, $a2, -0x3 -.LJP_80064704: -/* 3FB04 80064704 28C10020 */ slti $at, $a2, 0x20 -/* 3FB08 80064708 14200015 */ bnez $at, .LJP_80064760 -/* 3FB0C 8006470C 00000000 */ nop -/* 3FB10 80064710 8C820000 */ lw $v0, 0x0($a0) -/* 3FB14 80064714 8C830004 */ lw $v1, 0x4($a0) -/* 3FB18 80064718 8C880008 */ lw $t0, 0x8($a0) -/* 3FB1C 8006471C 8C89000C */ lw $t1, 0xC($a0) -/* 3FB20 80064720 8C8A0010 */ lw $t2, 0x10($a0) -/* 3FB24 80064724 8C8B0014 */ lw $t3, 0x14($a0) -/* 3FB28 80064728 8C8C0018 */ lw $t4, 0x18($a0) -/* 3FB2C 8006472C 8C8D001C */ lw $t5, 0x1C($a0) -/* 3FB30 80064730 24840020 */ addiu $a0, $a0, 0x20 -/* 3FB34 80064734 ACA20000 */ sw $v0, 0x0($a1) -/* 3FB38 80064738 ACA30004 */ sw $v1, 0x4($a1) -/* 3FB3C 8006473C ACA80008 */ sw $t0, 0x8($a1) -/* 3FB40 80064740 ACA9000C */ sw $t1, 0xC($a1) -/* 3FB44 80064744 ACAA0010 */ sw $t2, 0x10($a1) -/* 3FB48 80064748 ACAB0014 */ sw $t3, 0x14($a1) -/* 3FB4C 8006474C ACAC0018 */ sw $t4, 0x18($a1) -/* 3FB50 80064750 ACAD001C */ sw $t5, 0x1C($a1) -/* 3FB54 80064754 24A50020 */ addiu $a1, $a1, 0x20 -/* 3FB58 80064758 1000FFEA */ b .LJP_80064704 -/* 3FB5C 8006475C 24C6FFE0 */ addiu $a2, $a2, -0x20 -.LJP_80064760: -/* 3FB60 80064760 28C10010 */ slti $at, $a2, 0x10 -/* 3FB64 80064764 1420000D */ bnez $at, .LJP_8006479C -/* 3FB68 80064768 00000000 */ nop -/* 3FB6C 8006476C 8C820000 */ lw $v0, 0x0($a0) -/* 3FB70 80064770 8C830004 */ lw $v1, 0x4($a0) -/* 3FB74 80064774 8C880008 */ lw $t0, 0x8($a0) -/* 3FB78 80064778 8C89000C */ lw $t1, 0xC($a0) -/* 3FB7C 8006477C 24840010 */ addiu $a0, $a0, 0x10 -/* 3FB80 80064780 ACA20000 */ sw $v0, 0x0($a1) -/* 3FB84 80064784 ACA30004 */ sw $v1, 0x4($a1) -/* 3FB88 80064788 ACA80008 */ sw $t0, 0x8($a1) -/* 3FB8C 8006478C ACA9000C */ sw $t1, 0xC($a1) -/* 3FB90 80064790 24A50010 */ addiu $a1, $a1, 0x10 -/* 3FB94 80064794 1000FFF2 */ b .LJP_80064760 -/* 3FB98 80064798 24C6FFF0 */ addiu $a2, $a2, -0x10 -.LJP_8006479C: -/* 3FB9C 8006479C 28C10004 */ slti $at, $a2, 0x4 -/* 3FBA0 800647A0 1420FFB3 */ bnez $at, .LJP_80064670 -/* 3FBA4 800647A4 00000000 */ nop -/* 3FBA8 800647A8 8C820000 */ lw $v0, 0x0($a0) -/* 3FBAC 800647AC 24840004 */ addiu $a0, $a0, 0x4 -/* 3FBB0 800647B0 ACA20000 */ sw $v0, 0x0($a1) -/* 3FBB4 800647B4 24A50004 */ addiu $a1, $a1, 0x4 -/* 3FBB8 800647B8 1000FFF8 */ b .LJP_8006479C -/* 3FBBC 800647BC 24C6FFFC */ addiu $a2, $a2, -0x4 -.LJP_800647C0: -/* 3FBC0 800647C0 00862020 */ add $a0, $a0, $a2 # handwritten instruction -/* 3FBC4 800647C4 00A62820 */ add $a1, $a1, $a2 # handwritten instruction -/* 3FBC8 800647C8 28C10010 */ slti $at, $a2, 0x10 -/* 3FBCC 800647CC 14200005 */ bnez $at, .LJP_800647E4 -/* 3FBD0 800647D0 00000000 */ nop -/* 3FBD4 800647D4 30820003 */ andi $v0, $a0, 0x3 -/* 3FBD8 800647D8 30A30003 */ andi $v1, $a1, 0x3 -/* 3FBDC 800647DC 1043000D */ beq $v0, $v1, .LJP_80064814 -/* 3FBE0 800647E0 00000000 */ nop -.LJP_800647E4: -/* 3FBE4 800647E4 10C0FFAA */ beqz $a2, .LJP_80064690 -/* 3FBE8 800647E8 00000000 */ nop -/* 3FBEC 800647EC 2484FFFF */ addiu $a0, $a0, -0x1 -/* 3FBF0 800647F0 24A5FFFF */ addiu $a1, $a1, -0x1 -/* 3FBF4 800647F4 00861823 */ subu $v1, $a0, $a2 -.LJP_800647F8: -/* 3FBF8 800647F8 80820000 */ lb $v0, 0x0($a0) -/* 3FBFC 800647FC 2484FFFF */ addiu $a0, $a0, -0x1 -/* 3FC00 80064800 A0A20000 */ sb $v0, 0x0($a1) -/* 3FC04 80064804 1483FFFC */ bne $a0, $v1, .LJP_800647F8 -/* 3FC08 80064808 24A5FFFF */ addiu $a1, $a1, -0x1 -/* 3FC0C 8006480C 03E00008 */ jr $ra -/* 3FC10 80064810 00E01021 */ addu $v0, $a3, $zero -.LJP_80064814: -/* 3FC14 80064814 1040001A */ beqz $v0, .LJP_80064880 -/* 3FC18 80064818 00000000 */ nop -/* 3FC1C 8006481C 24010003 */ addiu $at, $zero, 0x3 -/* 3FC20 80064820 10410010 */ beq $v0, $at, .LJP_80064864 -/* 3FC24 80064824 00000000 */ nop -/* 3FC28 80064828 24010002 */ addiu $at, $zero, 0x2 -/* 3FC2C 8006482C 10410007 */ beq $v0, $at, .LJP_8006484C -/* 3FC30 80064830 00000000 */ nop -/* 3FC34 80064834 8082FFFF */ lb $v0, -0x1($a0) -/* 3FC38 80064838 2484FFFF */ addiu $a0, $a0, -0x1 -/* 3FC3C 8006483C A0A2FFFF */ sb $v0, -0x1($a1) -/* 3FC40 80064840 24A5FFFF */ addiu $a1, $a1, -0x1 -/* 3FC44 80064844 1000000E */ b .LJP_80064880 -/* 3FC48 80064848 24C6FFFF */ addiu $a2, $a2, -0x1 -.LJP_8006484C: -/* 3FC4C 8006484C 8482FFFE */ lh $v0, -0x2($a0) -/* 3FC50 80064850 2484FFFE */ addiu $a0, $a0, -0x2 -/* 3FC54 80064854 A4A2FFFE */ sh $v0, -0x2($a1) -/* 3FC58 80064858 24A5FFFE */ addiu $a1, $a1, -0x2 -/* 3FC5C 8006485C 10000008 */ b .LJP_80064880 -/* 3FC60 80064860 24C6FFFE */ addiu $a2, $a2, -0x2 -.LJP_80064864: -/* 3FC64 80064864 8082FFFF */ lb $v0, -0x1($a0) -/* 3FC68 80064868 8483FFFD */ lh $v1, -0x3($a0) -/* 3FC6C 8006486C 2484FFFD */ addiu $a0, $a0, -0x3 -/* 3FC70 80064870 A0A2FFFF */ sb $v0, -0x1($a1) -/* 3FC74 80064874 A4A3FFFD */ sh $v1, -0x3($a1) -/* 3FC78 80064878 24A5FFFD */ addiu $a1, $a1, -0x3 -/* 3FC7C 8006487C 24C6FFFD */ addiu $a2, $a2, -0x3 -.LJP_80064880: -/* 3FC80 80064880 28C10020 */ slti $at, $a2, 0x20 -/* 3FC84 80064884 14200015 */ bnez $at, .LJP_800648DC -/* 3FC88 80064888 00000000 */ nop -/* 3FC8C 8006488C 8C82FFFC */ lw $v0, -0x4($a0) -/* 3FC90 80064890 8C83FFF8 */ lw $v1, -0x8($a0) -/* 3FC94 80064894 8C88FFF4 */ lw $t0, -0xC($a0) -/* 3FC98 80064898 8C89FFF0 */ lw $t1, -0x10($a0) -/* 3FC9C 8006489C 8C8AFFEC */ lw $t2, -0x14($a0) -/* 3FCA0 800648A0 8C8BFFE8 */ lw $t3, -0x18($a0) -/* 3FCA4 800648A4 8C8CFFE4 */ lw $t4, -0x1C($a0) -/* 3FCA8 800648A8 8C8DFFE0 */ lw $t5, -0x20($a0) -/* 3FCAC 800648AC 2484FFE0 */ addiu $a0, $a0, -0x20 -/* 3FCB0 800648B0 ACA2FFFC */ sw $v0, -0x4($a1) -/* 3FCB4 800648B4 ACA3FFF8 */ sw $v1, -0x8($a1) -/* 3FCB8 800648B8 ACA8FFF4 */ sw $t0, -0xC($a1) -/* 3FCBC 800648BC ACA9FFF0 */ sw $t1, -0x10($a1) -/* 3FCC0 800648C0 ACAAFFEC */ sw $t2, -0x14($a1) -/* 3FCC4 800648C4 ACABFFE8 */ sw $t3, -0x18($a1) -/* 3FCC8 800648C8 ACACFFE4 */ sw $t4, -0x1C($a1) -/* 3FCCC 800648CC ACADFFE0 */ sw $t5, -0x20($a1) -/* 3FCD0 800648D0 24A5FFE0 */ addiu $a1, $a1, -0x20 -/* 3FCD4 800648D4 1000FFEA */ b .LJP_80064880 -/* 3FCD8 800648D8 24C6FFE0 */ addiu $a2, $a2, -0x20 -.LJP_800648DC: -/* 3FCDC 800648DC 28C10010 */ slti $at, $a2, 0x10 -/* 3FCE0 800648E0 1420000D */ bnez $at, .LJP_80064918 -/* 3FCE4 800648E4 00000000 */ nop -/* 3FCE8 800648E8 8C82FFFC */ lw $v0, -0x4($a0) -/* 3FCEC 800648EC 8C83FFF8 */ lw $v1, -0x8($a0) -/* 3FCF0 800648F0 8C88FFF4 */ lw $t0, -0xC($a0) -/* 3FCF4 800648F4 8C89FFF0 */ lw $t1, -0x10($a0) -/* 3FCF8 800648F8 2484FFF0 */ addiu $a0, $a0, -0x10 -/* 3FCFC 800648FC ACA2FFFC */ sw $v0, -0x4($a1) -/* 3FD00 80064900 ACA3FFF8 */ sw $v1, -0x8($a1) -/* 3FD04 80064904 ACA8FFF4 */ sw $t0, -0xC($a1) -/* 3FD08 80064908 ACA9FFF0 */ sw $t1, -0x10($a1) -/* 3FD0C 8006490C 24A5FFF0 */ addiu $a1, $a1, -0x10 -/* 3FD10 80064910 1000FFF2 */ b .LJP_800648DC -/* 3FD14 80064914 24C6FFF0 */ addiu $a2, $a2, -0x10 -.LJP_80064918: -/* 3FD18 80064918 28C10004 */ slti $at, $a2, 0x4 -/* 3FD1C 8006491C 1420FFB1 */ bnez $at, .LJP_800647E4 -/* 3FD20 80064920 00000000 */ nop -/* 3FD24 80064924 8C82FFFC */ lw $v0, -0x4($a0) -/* 3FD28 80064928 2484FFFC */ addiu $a0, $a0, -0x4 -/* 3FD2C 8006492C ACA2FFFC */ sw $v0, -0x4($a1) -/* 3FD30 80064930 24A5FFFC */ addiu $a1, $a1, -0x4 -/* 3FD34 80064934 1000FFF8 */ b .LJP_80064918 -/* 3FD38 80064938 24C6FFFC */ addiu $a2, $a2, -0x4 -/* 3FD3C 8006493C 00000000 */ nop diff --git a/ver/jp/asm/os/bzero.s b/ver/jp/asm/os/bzero.s deleted file mode 100644 index 3dbe7a096b..0000000000 --- a/ver/jp/asm/os/bzero.s +++ /dev/null @@ -1,59 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel bzero -/* 3FD40 80064940 00041823 */ negu $v1, $a0 -/* 3FD44 80064944 28A1000C */ slti $at, $a1, 0xC -/* 3FD48 80064948 1420001D */ bnez $at, .LJP_800649C0 -/* 3FD4C 8006494C 00000000 */ nop -/* 3FD50 80064950 30630003 */ andi $v1, $v1, 0x3 -/* 3FD54 80064954 10600003 */ beqz $v1, .LJP_80064964 -/* 3FD58 80064958 00A32823 */ subu $a1, $a1, $v1 -/* 3FD5C 8006495C A8800000 */ swl $zero, 0x0($a0) -/* 3FD60 80064960 00832021 */ addu $a0, $a0, $v1 -.LJP_80064964: -/* 3FD64 80064964 2401FFE0 */ addiu $at, $zero, -0x20 -/* 3FD68 80064968 00A13824 */ and $a3, $a1, $at -/* 3FD6C 8006496C 10E0000C */ beqz $a3, .LJP_800649A0 -/* 3FD70 80064970 00A72823 */ subu $a1, $a1, $a3 -/* 3FD74 80064974 00E43821 */ addu $a3, $a3, $a0 -.LJP_80064978: -/* 3FD78 80064978 AC800000 */ sw $zero, 0x0($a0) -/* 3FD7C 8006497C AC800004 */ sw $zero, 0x4($a0) -/* 3FD80 80064980 AC800008 */ sw $zero, 0x8($a0) -/* 3FD84 80064984 AC80000C */ sw $zero, 0xC($a0) -/* 3FD88 80064988 24840020 */ addiu $a0, $a0, 0x20 -/* 3FD8C 8006498C AC80FFF0 */ sw $zero, -0x10($a0) -/* 3FD90 80064990 AC80FFF4 */ sw $zero, -0xC($a0) -/* 3FD94 80064994 AC80FFF8 */ sw $zero, -0x8($a0) -/* 3FD98 80064998 1487FFF7 */ bne $a0, $a3, .LJP_80064978 -/* 3FD9C 8006499C AC80FFFC */ sw $zero, -0x4($a0) -.LJP_800649A0: -/* 3FDA0 800649A0 2401FFFC */ addiu $at, $zero, -0x4 -/* 3FDA4 800649A4 00A13824 */ and $a3, $a1, $at -/* 3FDA8 800649A8 10E00005 */ beqz $a3, .LJP_800649C0 -/* 3FDAC 800649AC 00A72823 */ subu $a1, $a1, $a3 -/* 3FDB0 800649B0 00E43821 */ addu $a3, $a3, $a0 -.LJP_800649B4: -/* 3FDB4 800649B4 24840004 */ addiu $a0, $a0, 0x4 -/* 3FDB8 800649B8 1487FFFE */ bne $a0, $a3, .LJP_800649B4 -/* 3FDBC 800649BC AC80FFFC */ sw $zero, -0x4($a0) -.LJP_800649C0: -/* 3FDC0 800649C0 18A00005 */ blez $a1, .LJP_800649D8 -/* 3FDC4 800649C4 00000000 */ nop -/* 3FDC8 800649C8 00A42821 */ addu $a1, $a1, $a0 -.LJP_800649CC: -/* 3FDCC 800649CC 24840001 */ addiu $a0, $a0, 0x1 -/* 3FDD0 800649D0 1485FFFE */ bne $a0, $a1, .LJP_800649CC -/* 3FDD4 800649D4 A080FFFF */ sb $zero, -0x1($a0) -.LJP_800649D8: -/* 3FDD8 800649D8 03E00008 */ jr $ra -/* 3FDDC 800649DC 00000000 */ nop diff --git a/ver/jp/asm/os/decode_yay0.s b/ver/jp/asm/os/decode_yay0.s deleted file mode 100644 index a0efce2fd3..0000000000 --- a/ver/jp/asm/os/decode_yay0.s +++ /dev/null @@ -1,63 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel decode_yay0 -/* 4A1D0 8006EDD0 8C980004 */ lw $t8, 0x4($a0) -/* 4A1D4 8006EDD4 8C870008 */ lw $a3, 0x8($a0) -/* 4A1D8 8006EDD8 8C99000C */ lw $t9, 0xC($a0) -/* 4A1DC 8006EDDC 0000302D */ daddu $a2, $zero, $zero -/* 4A1E0 8006EDE0 0305C020 */ add $t8, $t8, $a1 # handwritten instruction -/* 4A1E4 8006EDE4 00E43820 */ add $a3, $a3, $a0 # handwritten instruction -/* 4A1E8 8006EDE8 0324C820 */ add $t9, $t9, $a0 # handwritten instruction -/* 4A1EC 8006EDEC 20840010 */ addi $a0, $a0, 0x10 # handwritten instruction -.LJP_8006EDF0: -/* 4A1F0 8006EDF0 14C00004 */ bnez $a2, .LJP_8006EE04 -/* 4A1F4 8006EDF4 00000000 */ nop -/* 4A1F8 8006EDF8 8C880000 */ lw $t0, 0x0($a0) -/* 4A1FC 8006EDFC 24060020 */ addiu $a2, $zero, 0x20 -/* 4A200 8006EE00 20840004 */ addi $a0, $a0, 0x4 # handwritten instruction -.LJP_8006EE04: -/* 4A204 8006EE04 0100482A */ slt $t1, $t0, $zero -/* 4A208 8006EE08 11200006 */ beqz $t1, .LJP_8006EE24 -/* 4A20C 8006EE0C 00000000 */ nop -/* 4A210 8006EE10 832A0000 */ lb $t2, 0x0($t9) -/* 4A214 8006EE14 23390001 */ addi $t9, $t9, 0x1 # handwritten instruction -/* 4A218 8006EE18 A0AA0000 */ sb $t2, 0x0($a1) -/* 4A21C 8006EE1C 1000000E */ b .LJP_8006EE58 -/* 4A220 8006EE20 20A50001 */ addi $a1, $a1, 0x1 # handwritten instruction -.LJP_8006EE24: -/* 4A224 8006EE24 94EA0000 */ lhu $t2, 0x0($a3) -/* 4A228 8006EE28 20E70002 */ addi $a3, $a3, 0x2 # handwritten instruction -/* 4A22C 8006EE2C 000A5B02 */ srl $t3, $t2, 12 -/* 4A230 8006EE30 314A0FFF */ andi $t2, $t2, 0xFFF -/* 4A234 8006EE34 1160000D */ beqz $t3, .LJP_8006EE6C -/* 4A238 8006EE38 00AA4822 */ sub $t1, $a1, $t2 -/* 4A23C 8006EE3C 216B0002 */ addi $t3, $t3, 0x2 # handwritten instruction -.LJP_8006EE40: -/* 4A240 8006EE40 812AFFFF */ lb $t2, -0x1($t1) -/* 4A244 8006EE44 216BFFFF */ addi $t3, $t3, -0x1 # handwritten instruction -/* 4A248 8006EE48 21290001 */ addi $t1, $t1, 0x1 # handwritten instruction -/* 4A24C 8006EE4C A0AA0000 */ sb $t2, 0x0($a1) -/* 4A250 8006EE50 1560FFFB */ bnez $t3, .LJP_8006EE40 -/* 4A254 8006EE54 20A50001 */ addi $a1, $a1, 0x1 # handwritten instruction -.LJP_8006EE58: -/* 4A258 8006EE58 00084040 */ sll $t0, $t0, 1 -/* 4A25C 8006EE5C 14B8FFE4 */ bne $a1, $t8, .LJP_8006EDF0 -/* 4A260 8006EE60 20C6FFFF */ addi $a2, $a2, -0x1 # handwritten instruction -/* 4A264 8006EE64 03E00008 */ jr $ra -/* 4A268 8006EE68 00000000 */ nop -.LJP_8006EE6C: -/* 4A26C 8006EE6C 932B0000 */ lbu $t3, 0x0($t9) -/* 4A270 8006EE70 23390001 */ addi $t9, $t9, 0x1 # handwritten instruction -/* 4A274 8006EE74 1000FFF2 */ b .LJP_8006EE40 -/* 4A278 8006EE78 216B0012 */ addi $t3, $t3, 0x12 # handwritten instruction -/* 4A27C 8006EE7C 00000000 */ nop diff --git a/ver/jp/asm/os/exceptasm.s b/ver/jp/asm/os/exceptasm.s deleted file mode 100644 index 9db4092f03..0000000000 --- a/ver/jp/asm/os/exceptasm.s +++ /dev/null @@ -1,746 +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 - -__osIntOffTable: -/* 75160 80099D60 */ .byte 0x00 -/* 75161 80099D61 */ .byte 0x14 -/* 75162 80099D62 */ .byte 0x18 -/* 75163 80099D63 */ .byte 0x18 -/* 75164 80099D64 */ .byte 0x1C -/* 75165 80099D65 */ .byte 0x1C -/* 75166 80099D66 */ .byte 0x1C -/* 75167 80099D67 */ .byte 0x1C -/* 75168 80099D68 */ .byte 0x20 -/* 75169 80099D69 */ .byte 0x20 -/* 7516A 80099D6A */ .byte 0x20 -/* 7516B 80099D6B */ .byte 0x20 -/* 7516C 80099D6C */ .byte 0x20 -/* 7516D 80099D6D */ .byte 0x20 -/* 7516E 80099D6E */ .byte 0x20 -/* 7516F 80099D6F */ .byte 0x20 -/* 75170 80099D70 */ .byte 0x00 -/* 75171 80099D71 */ .byte 0x04 -/* 75172 80099D72 */ .byte 0x08 -/* 75173 80099D73 */ .byte 0x08 -/* 75174 80099D74 */ .byte 0x0C -/* 75175 80099D75 */ .byte 0x0C -/* 75176 80099D76 */ .byte 0x0C -/* 75177 80099D77 */ .byte 0x0C -/* 75178 80099D78 */ .byte 0x10 -/* 75179 80099D79 */ .byte 0x10 -/* 7517A 80099D7A */ .byte 0x10 -/* 7517B 80099D7B */ .byte 0x10 -/* 7517C 80099D7C */ .byte 0x10 -/* 7517D 80099D7D */ .byte 0x10 -/* 7517E 80099D7E */ .byte 0x10 -/* 7517F 80099D7F */ .byte 0x10 - -.align 3 -__osIntTable: -/* 75180 80099D80 8006AEE0 */ .word .LJP_8006AEE0 -/* 75184 80099D84 8006AEA4 */ .word .LJP_8006AEA4 -/* 75188 80099D88 8006AE80 */ .word .LJP_8006AE80 -/* 7518C 80099D8C 8006ACA8 */ .word .LJP_8006ACA8 -/* 75190 80099D90 8006AC60 */ .word .LJP_8006AC60 -/* 75194 80099D94 8006AE1C */ .word .LJP_8006AE1C -/* 75198 80099D98 8006AC24 */ .word .LJP_8006AC24 -/* 7519C 80099D9C 8006AC30 */ .word .LJP_8006AC30 -/* 751A0 80099DA0 8006AC3C */ .word .LJP_8006AC3C -/* 751A4 80099DA4 00000000 */ .word 0x00000000 -/* 751A8 80099DA8 00000000 */ .word 0x00000000 -/* 751AC 80099DAC 00000000 */ .word 0x00000000 -.size __osIntTable, . - __osIntTable - -.section .data - -__osHwIntTable: - .word 0x00000000 - .word 0x00000000 - .word 0x00000000 - .word 0x00000000 - .word 0x00000000 - .word 0x00000000 - .word 0x00000000 - .word 0x00000000 - .word 0x00000000 - .word 0x00000000 -.size __osHwIntTable, . - __osHwIntTable - -__osPiIntTable: - .word 0x00000000 - .word 0x00000000 -.size __osPiIntTable, . - __osPiIntTable - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osExceptionPreamble -/* 45DD0 8006A9D0 3C1A8007 */ lui $k0, %hi(osExceptionPreamble) # handwritten instruction -/* 45DD4 8006A9D4 275AA9E0 */ addiu $k0, $k0, %lo(osExceptionPreamble) # handwritten instruction -/* 45DD8 8006A9D8 03400008 */ jr $k0 -/* 45DDC 8006A9DC 00000000 */ nop - -# Handwritten function -glabel osExceptionPreamble -/* 45DE0 8006A9E0 3C1A800B */ lui $k0, %hi(__osThreadSave) # handwritten instruction -/* 45DE4 8006A9E4 275A0CE8 */ addiu $k0, $k0, %lo(__osThreadSave) # handwritten instruction -/* 45DE8 8006A9E8 FF410020 */ sd $at, 0x20($k0) # handwritten instruction -/* 45DEC 8006A9EC 401B6000 */ mfc0 $k1, $12 # handwritten instruction -/* 45DF0 8006A9F0 AF5B0118 */ sw $k1, 0x118($k0) # handwritten instruction -/* 45DF4 8006A9F4 2401FFFC */ addiu $at, $zero, -0x4 -/* 45DF8 8006A9F8 0361D824 */ and $k1, $k1, $at -/* 45DFC 8006A9FC 409B6000 */ mtc0 $k1, $12 # handwritten instruction -/* 45E00 8006AA00 FF480058 */ sd $t0, 0x58($k0) # handwritten instruction -/* 45E04 8006AA04 FF490060 */ sd $t1, 0x60($k0) # handwritten instruction -/* 45E08 8006AA08 FF4A0068 */ sd $t2, 0x68($k0) # handwritten instruction -/* 45E0C 8006AA0C AF400018 */ sw $zero, 0x18($k0) # handwritten instruction -/* 45E10 8006AA10 40086800 */ mfc0 $t0, $13 # handwritten instruction -/* 45E14 8006AA14 03404021 */ addu $t0, $k0, $zero -/* 45E18 8006AA18 3C1A8009 */ lui $k0, %hi(__osRunningThread) # handwritten instruction -/* 45E1C 8006AA1C 8F5A4640 */ lw $k0, %lo(__osRunningThread)($k0) # handwritten instruction -/* 45E20 8006AA20 DD090020 */ ld $t1, 0x20($t0) -/* 45E24 8006AA24 FF490020 */ sd $t1, 0x20($k0) # handwritten instruction -/* 45E28 8006AA28 DD090118 */ ld $t1, 0x118($t0) -/* 45E2C 8006AA2C FF490118 */ sd $t1, 0x118($k0) # handwritten instruction -/* 45E30 8006AA30 DD090058 */ ld $t1, 0x58($t0) -/* 45E34 8006AA34 FF490058 */ sd $t1, 0x58($k0) # handwritten instruction -/* 45E38 8006AA38 DD090060 */ ld $t1, 0x60($t0) -/* 45E3C 8006AA3C FF490060 */ sd $t1, 0x60($k0) # handwritten instruction -/* 45E40 8006AA40 DD090068 */ ld $t1, 0x68($t0) -/* 45E44 8006AA44 FF490068 */ sd $t1, 0x68($k0) # handwritten instruction -/* 45E48 8006AA48 FF420028 */ sd $v0, 0x28($k0) # handwritten instruction -/* 45E4C 8006AA4C FF430030 */ sd $v1, 0x30($k0) # handwritten instruction -/* 45E50 8006AA50 FF440038 */ sd $a0, 0x38($k0) # handwritten instruction -/* 45E54 8006AA54 FF450040 */ sd $a1, 0x40($k0) # handwritten instruction -/* 45E58 8006AA58 FF460048 */ sd $a2, 0x48($k0) # handwritten instruction -/* 45E5C 8006AA5C FF470050 */ sd $a3, 0x50($k0) # handwritten instruction -/* 45E60 8006AA60 FF4B0070 */ sd $t3, 0x70($k0) # handwritten instruction -/* 45E64 8006AA64 FF4C0078 */ sd $t4, 0x78($k0) # handwritten instruction -/* 45E68 8006AA68 FF4D0080 */ sd $t5, 0x80($k0) # handwritten instruction -/* 45E6C 8006AA6C FF4E0088 */ sd $t6, 0x88($k0) # handwritten instruction -/* 45E70 8006AA70 FF4F0090 */ sd $t7, 0x90($k0) # handwritten instruction -/* 45E74 8006AA74 FF500098 */ sd $s0, 0x98($k0) # handwritten instruction -/* 45E78 8006AA78 FF5100A0 */ sd $s1, 0xA0($k0) # handwritten instruction -/* 45E7C 8006AA7C FF5200A8 */ sd $s2, 0xA8($k0) # handwritten instruction -/* 45E80 8006AA80 FF5300B0 */ sd $s3, 0xB0($k0) # handwritten instruction -/* 45E84 8006AA84 FF5400B8 */ sd $s4, 0xB8($k0) # handwritten instruction -/* 45E88 8006AA88 FF5500C0 */ sd $s5, 0xC0($k0) # handwritten instruction -/* 45E8C 8006AA8C FF5600C8 */ sd $s6, 0xC8($k0) # handwritten instruction -/* 45E90 8006AA90 FF5700D0 */ sd $s7, 0xD0($k0) # handwritten instruction -/* 45E94 8006AA94 FF5800D8 */ sd $t8, 0xD8($k0) # handwritten instruction -/* 45E98 8006AA98 FF5900E0 */ sd $t9, 0xE0($k0) # handwritten instruction -/* 45E9C 8006AA9C FF5C00E8 */ sd $gp, 0xE8($k0) # handwritten instruction -/* 45EA0 8006AAA0 FF5D00F0 */ sd $sp, 0xF0($k0) # handwritten instruction -/* 45EA4 8006AAA4 FF5E00F8 */ sd $fp, 0xF8($k0) # handwritten instruction -/* 45EA8 8006AAA8 FF5F0100 */ sd $ra, 0x100($k0) # handwritten instruction -/* 45EAC 8006AAAC 00004012 */ mflo $t0 -/* 45EB0 8006AAB0 FF480108 */ sd $t0, 0x108($k0) # handwritten instruction -/* 45EB4 8006AAB4 00004010 */ mfhi $t0 -/* 45EB8 8006AAB8 FF480110 */ sd $t0, 0x110($k0) # handwritten instruction -/* 45EBC 8006AABC 8F5B0118 */ lw $k1, 0x118($k0) # handwritten instruction -/* 45EC0 8006AAC0 3369FF00 */ andi $t1, $k1, 0xFF00 # handwritten instruction -/* 45EC4 8006AAC4 11200013 */ beqz $t1, .LJP_8006AB14 -/* 45EC8 8006AAC8 00000000 */ nop -/* 45ECC 8006AACC 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 45ED0 8006AAD0 25085890 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 45ED4 8006AAD4 8D080000 */ lw $t0, 0x0($t0) -/* 45ED8 8006AAD8 2401FFFF */ addiu $at, $zero, -0x1 -/* 45EDC 8006AADC 01015026 */ xor $t2, $t0, $at -/* 45EE0 8006AAE0 314AFF00 */ andi $t2, $t2, 0xFF00 -/* 45EE4 8006AAE4 012A6025 */ or $t4, $t1, $t2 -/* 45EE8 8006AAE8 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 45EEC 8006AAEC 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 45EF0 8006AAF0 03615824 */ and $t3, $k1, $at -/* 45EF4 8006AAF4 016C5825 */ or $t3, $t3, $t4 -/* 45EF8 8006AAF8 AF4B0118 */ sw $t3, 0x118($k0) # handwritten instruction -/* 45EFC 8006AAFC 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 45F00 8006AB00 01284824 */ and $t1, $t1, $t0 -/* 45F04 8006AB04 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 45F08 8006AB08 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 45F0C 8006AB0C 0361D824 */ and $k1, $k1, $at -/* 45F10 8006AB10 0369D825 */ or $k1, $k1, $t1 -.LJP_8006AB14: -/* 45F14 8006AB14 3C09A430 */ lui $t1, %hi(D_A430000C) -/* 45F18 8006AB18 8D29000C */ lw $t1, %lo(D_A430000C)($t1) -/* 45F1C 8006AB1C 1120000B */ beqz $t1, .LJP_8006AB4C -/* 45F20 8006AB20 00000000 */ nop -/* 45F24 8006AB24 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 45F28 8006AB28 25085890 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 45F2C 8006AB2C 8D080000 */ lw $t0, 0x0($t0) -/* 45F30 8006AB30 00084402 */ srl $t0, $t0, 16 -/* 45F34 8006AB34 2401FFFF */ addiu $at, $zero, -0x1 -/* 45F38 8006AB38 01014026 */ xor $t0, $t0, $at -/* 45F3C 8006AB3C 3108003F */ andi $t0, $t0, 0x3F -/* 45F40 8006AB40 8F4C0128 */ lw $t4, 0x128($k0) # handwritten instruction -/* 45F44 8006AB44 010C4024 */ and $t0, $t0, $t4 -/* 45F48 8006AB48 01284825 */ or $t1, $t1, $t0 -.LJP_8006AB4C: -/* 45F4C 8006AB4C AF490128 */ sw $t1, 0x128($k0) # handwritten instruction -/* 45F50 8006AB50 40087000 */ mfc0 $t0, $14 # handwritten instruction -/* 45F54 8006AB54 AF48011C */ sw $t0, 0x11C($k0) # handwritten instruction -/* 45F58 8006AB58 8F480018 */ lw $t0, 0x18($k0) # handwritten instruction -/* 45F5C 8006AB5C 11000014 */ beqz $t0, .LJP_8006ABB0 -/* 45F60 8006AB60 00000000 */ nop -/* 45F64 8006AB64 4448F800 */ cfc1 $t0, $31 -/* 45F68 8006AB68 00000000 */ nop -/* 45F6C 8006AB6C AF48012C */ sw $t0, 0x12C($k0) # handwritten instruction -/* 45F70 8006AB70 F7400130 */ sdc1 $f0, 0x130($k0) -/* 45F74 8006AB74 F7420138 */ sdc1 $f2, 0x138($k0) -/* 45F78 8006AB78 F7440140 */ sdc1 $f4, 0x140($k0) -/* 45F7C 8006AB7C F7460148 */ sdc1 $f6, 0x148($k0) -/* 45F80 8006AB80 F7480150 */ sdc1 $f8, 0x150($k0) -/* 45F84 8006AB84 F74A0158 */ sdc1 $f10, 0x158($k0) -/* 45F88 8006AB88 F74C0160 */ sdc1 $f12, 0x160($k0) -/* 45F8C 8006AB8C F74E0168 */ sdc1 $f14, 0x168($k0) -/* 45F90 8006AB90 F7500170 */ sdc1 $f16, 0x170($k0) -/* 45F94 8006AB94 F7520178 */ sdc1 $f18, 0x178($k0) -/* 45F98 8006AB98 F7540180 */ sdc1 $f20, 0x180($k0) -/* 45F9C 8006AB9C F7560188 */ sdc1 $f22, 0x188($k0) -/* 45FA0 8006ABA0 F7580190 */ sdc1 $f24, 0x190($k0) -/* 45FA4 8006ABA4 F75A0198 */ sdc1 $f26, 0x198($k0) -/* 45FA8 8006ABA8 F75C01A0 */ sdc1 $f28, 0x1A0($k0) -/* 45FAC 8006ABAC F75E01A8 */ sdc1 $f30, 0x1A8($k0) -.LJP_8006ABB0: -/* 45FB0 8006ABB0 40086800 */ mfc0 $t0, $13 # handwritten instruction -/* 45FB4 8006ABB4 AF480120 */ sw $t0, 0x120($k0) # handwritten instruction -/* 45FB8 8006ABB8 24090002 */ addiu $t1, $zero, 0x2 -/* 45FBC 8006ABBC A7490010 */ sh $t1, 0x10($k0) # handwritten instruction -/* 45FC0 8006ABC0 3109007C */ andi $t1, $t0, 0x7C -/* 45FC4 8006ABC4 240A0024 */ addiu $t2, $zero, 0x24 -/* 45FC8 8006ABC8 112A00BF */ beq $t1, $t2, .LJP_8006AEC8 -/* 45FCC 8006ABCC 00000000 */ nop -/* 45FD0 8006ABD0 240A002C */ addiu $t2, $zero, 0x2C -/* 45FD4 8006ABD4 112A0110 */ beq $t1, $t2, .LJP_8006B018 -/* 45FD8 8006ABD8 00000000 */ nop -/* 45FDC 8006ABDC 240A0000 */ addiu $t2, $zero, 0x0 -/* 45FE0 8006ABE0 152A00D2 */ bne $t1, $t2, .LJP_8006AF2C -/* 45FE4 8006ABE4 00000000 */ nop -/* 45FE8 8006ABE8 03688024 */ and $s0, $k1, $t0 -.LJP_8006ABEC: -/* 45FEC 8006ABEC 3209FF00 */ andi $t1, $s0, 0xFF00 -/* 45FF0 8006ABF0 00095302 */ srl $t2, $t1, 12 -/* 45FF4 8006ABF4 15400003 */ bnez $t2, .LJP_8006AC04 -/* 45FF8 8006ABF8 00000000 */ nop -/* 45FFC 8006ABFC 00095202 */ srl $t2, $t1, 8 -/* 46000 8006AC00 214A0010 */ addi $t2, $t2, 0x10 # handwritten instruction -.LJP_8006AC04: -/* 46004 8006AC04 3C01800A */ lui $at, %hi(__osIntOffTable) -/* 46008 8006AC08 002A0821 */ addu $at, $at, $t2 -/* 4600C 8006AC0C 902A9D60 */ lbu $t2, %lo(__osIntOffTable)($at) -/* 46010 8006AC10 3C01800A */ lui $at, %hi(__osIntTable) -/* 46014 8006AC14 002A0821 */ addu $at, $at, $t2 -/* 46018 8006AC18 8C2A9D80 */ lw $t2, %lo(__osIntTable)($at) -/* 4601C 8006AC1C 01400008 */ jr $t2 -/* 46020 8006AC20 00000000 */ nop -glabel .LJP_8006AC24 -/* 46024 8006AC24 2401DFFF */ addiu $at, $zero, -0x2001 -/* 46028 8006AC28 1000FFF0 */ b .LJP_8006ABEC -/* 4602C 8006AC2C 02018024 */ and $s0, $s0, $at -glabel .LJP_8006AC30 -/* 46030 8006AC30 2401BFFF */ addiu $at, $zero, -0x4001 -/* 46034 8006AC34 1000FFED */ b .LJP_8006ABEC -/* 46038 8006AC38 02018024 */ and $s0, $s0, $at -glabel .LJP_8006AC3C -/* 4603C 8006AC3C 40095800 */ mfc0 $t1, $11 # handwritten instruction -/* 46040 8006AC40 40895800 */ mtc0 $t1, $11 # handwritten instruction -/* 46044 8006AC44 24040018 */ addiu $a0, $zero, 0x18 -/* 46048 8006AC48 0C01ABD7 */ jal send_mesg -/* 4604C 8006AC4C 00000000 */ nop -/* 46050 8006AC50 3C01FFFF */ lui $at, (0xFFFF7FFF >> 16) -/* 46054 8006AC54 34217FFF */ ori $at, $at, (0xFFFF7FFF & 0xFFFF) -/* 46058 8006AC58 1000FFE4 */ b .LJP_8006ABEC -/* 4605C 8006AC5C 02018024 */ and $s0, $s0, $at -glabel .LJP_8006AC60 -/* 46060 8006AC60 2401F7FF */ addiu $at, $zero, -0x801 -/* 46064 8006AC64 02018024 */ and $s0, $s0, $at -/* 46068 8006AC68 3C098009 */ lui $t1, %hi(__osHwIntTable) -/* 4606C 8006AC6C 252958A0 */ addiu $t1, $t1, %lo(__osHwIntTable) -/* 46070 8006AC70 21290008 */ addi $t1, $t1, 0x8 # handwritten instruction -/* 46074 8006AC74 8D2A0000 */ lw $t2, 0x0($t1) -/* 46078 8006AC78 11400007 */ beqz $t2, .LJP_8006AC98 -/* 4607C 8006AC7C 00000000 */ nop -/* 46080 8006AC80 0140F809 */ jalr $t2 -/* 46084 8006AC84 8D3D0004 */ lw $sp, 0x4($t1) -/* 46088 8006AC88 10400003 */ beqz $v0, .LJP_8006AC98 -/* 4608C 8006AC8C 00000000 */ nop -/* 46090 8006AC90 10000093 */ b .LJP_8006AEE0 -/* 46094 8006AC94 00000000 */ nop -.LJP_8006AC98: -/* 46098 8006AC98 0C01ABD7 */ jal send_mesg -/* 4609C 8006AC9C 24040010 */ addiu $a0, $zero, 0x10 -/* 460A0 8006ACA0 1000FFD2 */ b .LJP_8006ABEC -/* 460A4 8006ACA4 00000000 */ nop -glabel .LJP_8006ACA8 -/* 460A8 8006ACA8 3C11A430 */ lui $s1, %hi(D_A4300008) -/* 460AC 8006ACAC 8E310008 */ lw $s1, %lo(D_A4300008)($s1) -/* 460B0 8006ACB0 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 460B4 8006ACB4 25085890 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 460B8 8006ACB8 8D080000 */ lw $t0, 0x0($t0) -/* 460BC 8006ACBC 00084402 */ srl $t0, $t0, 16 -/* 460C0 8006ACC0 02288824 */ and $s1, $s1, $t0 -/* 460C4 8006ACC4 32290001 */ andi $t1, $s1, 0x1 -/* 460C8 8006ACC8 11200014 */ beqz $t1, .LJP_8006AD1C -/* 460CC 8006ACCC 00000000 */ nop -/* 460D0 8006ACD0 3231003E */ andi $s1, $s1, 0x3E -/* 460D4 8006ACD4 3C0CA404 */ lui $t4, %hi(D_A4040010) -/* 460D8 8006ACD8 8D8C0010 */ lw $t4, %lo(D_A4040010)($t4) -/* 460DC 8006ACDC 34098008 */ ori $t1, $zero, 0x8008 -/* 460E0 8006ACE0 3C01A404 */ lui $at, %hi(D_A4040010) -/* 460E4 8006ACE4 AC290010 */ sw $t1, %lo(D_A4040010)($at) -/* 460E8 8006ACE8 318C0300 */ andi $t4, $t4, 0x300 -/* 460EC 8006ACEC 11800007 */ beqz $t4, .LJP_8006AD0C -/* 460F0 8006ACF0 00000000 */ nop -/* 460F4 8006ACF4 0C01ABD7 */ jal send_mesg -/* 460F8 8006ACF8 24040020 */ addiu $a0, $zero, 0x20 -/* 460FC 8006ACFC 12200044 */ beqz $s1, .LJP_8006AE10 -/* 46100 8006AD00 00000000 */ nop -/* 46104 8006AD04 10000005 */ b .LJP_8006AD1C -/* 46108 8006AD08 00000000 */ nop -.LJP_8006AD0C: -/* 4610C 8006AD0C 0C01ABD7 */ jal send_mesg -/* 46110 8006AD10 24040058 */ addiu $a0, $zero, 0x58 -/* 46114 8006AD14 1220003E */ beqz $s1, .LJP_8006AE10 -/* 46118 8006AD18 00000000 */ nop -.LJP_8006AD1C: -/* 4611C 8006AD1C 32290008 */ andi $t1, $s1, 0x8 -/* 46120 8006AD20 11200008 */ beqz $t1, .LJP_8006AD44 -/* 46124 8006AD24 00000000 */ nop -/* 46128 8006AD28 32310037 */ andi $s1, $s1, 0x37 -/* 4612C 8006AD2C 3C01A440 */ lui $at, %hi(D_A4400010) -/* 46130 8006AD30 AC200010 */ sw $zero, %lo(D_A4400010)($at) -/* 46134 8006AD34 0C01ABD7 */ jal send_mesg -/* 46138 8006AD38 24040038 */ addiu $a0, $zero, 0x38 -/* 4613C 8006AD3C 12200034 */ beqz $s1, .LJP_8006AE10 -/* 46140 8006AD40 00000000 */ nop -.LJP_8006AD44: -/* 46144 8006AD44 32290004 */ andi $t1, $s1, 0x4 -/* 46148 8006AD48 11200009 */ beqz $t1, .LJP_8006AD70 -/* 4614C 8006AD4C 00000000 */ nop -/* 46150 8006AD50 3231003B */ andi $s1, $s1, 0x3B -/* 46154 8006AD54 24090001 */ addiu $t1, $zero, 0x1 -/* 46158 8006AD58 3C01A450 */ lui $at, %hi(D_A450000C) -/* 4615C 8006AD5C AC29000C */ sw $t1, %lo(D_A450000C)($at) -/* 46160 8006AD60 0C01ABD7 */ jal send_mesg -/* 46164 8006AD64 24040030 */ addiu $a0, $zero, 0x30 -/* 46168 8006AD68 12200029 */ beqz $s1, .LJP_8006AE10 -/* 4616C 8006AD6C 00000000 */ nop -.LJP_8006AD70: -/* 46170 8006AD70 32290002 */ andi $t1, $s1, 0x2 -/* 46174 8006AD74 11200008 */ beqz $t1, .LJP_8006AD98 -/* 46178 8006AD78 00000000 */ nop -/* 4617C 8006AD7C 3231003D */ andi $s1, $s1, 0x3D -/* 46180 8006AD80 3C01A480 */ lui $at, %hi(D_A4800018) -/* 46184 8006AD84 AC200018 */ sw $zero, %lo(D_A4800018)($at) -/* 46188 8006AD88 0C01ABD7 */ jal send_mesg -/* 4618C 8006AD8C 24040028 */ addiu $a0, $zero, 0x28 -/* 46190 8006AD90 1220001F */ beqz $s1, .LJP_8006AE10 -/* 46194 8006AD94 00000000 */ nop -.LJP_8006AD98: -/* 46198 8006AD98 32290010 */ andi $t1, $s1, 0x10 -/* 4619C 8006AD9C 11200013 */ beqz $t1, .LJP_8006ADEC -/* 461A0 8006ADA0 00000000 */ nop -/* 461A4 8006ADA4 3231002F */ andi $s1, $s1, 0x2F -/* 461A8 8006ADA8 24090002 */ addiu $t1, $zero, 0x2 -/* 461AC 8006ADAC 3C01A460 */ lui $at, %hi(D_A4600010) -/* 461B0 8006ADB0 AC290010 */ sw $t1, %lo(D_A4600010)($at) -/* 461B4 8006ADB4 3C098009 */ lui $t1, %hi(__osPiIntTable) -/* 461B8 8006ADB8 252958C8 */ addiu $t1, $t1, %lo(__osPiIntTable) -/* 461BC 8006ADBC 8D2A0000 */ lw $t2, 0x0($t1) -/* 461C0 8006ADC0 11400006 */ beqz $t2, .LJP_8006ADDC -/* 461C4 8006ADC4 00000000 */ nop -/* 461C8 8006ADC8 8D3D0004 */ lw $sp, 0x4($t1) -/* 461CC 8006ADCC 0140F809 */ jalr $t2 -/* 461D0 8006ADD0 00402021 */ addu $a0, $v0, $zero -/* 461D4 8006ADD4 14400003 */ bnez $v0, .LJP_8006ADE4 -/* 461D8 8006ADD8 00000000 */ nop -.LJP_8006ADDC: -/* 461DC 8006ADDC 0C01ABD7 */ jal send_mesg -/* 461E0 8006ADE0 24040040 */ addiu $a0, $zero, 0x40 -.LJP_8006ADE4: -/* 461E4 8006ADE4 1220000A */ beqz $s1, .LJP_8006AE10 -/* 461E8 8006ADE8 00000000 */ nop -.LJP_8006ADEC: -/* 461EC 8006ADEC 32290020 */ andi $t1, $s1, 0x20 -/* 461F0 8006ADF0 11200007 */ beqz $t1, .LJP_8006AE10 -/* 461F4 8006ADF4 00000000 */ nop -/* 461F8 8006ADF8 3231001F */ andi $s1, $s1, 0x1F -/* 461FC 8006ADFC 24090800 */ addiu $t1, $zero, 0x800 -/* 46200 8006AE00 3C01A430 */ lui $at, %hi(D_A4300000) -/* 46204 8006AE04 AC290000 */ sw $t1, %lo(D_A4300000)($at) -/* 46208 8006AE08 0C01ABD7 */ jal send_mesg -/* 4620C 8006AE0C 24040048 */ addiu $a0, $zero, 0x48 -.LJP_8006AE10: -/* 46210 8006AE10 2401FBFF */ addiu $at, $zero, -0x401 -/* 46214 8006AE14 1000FF75 */ b .LJP_8006ABEC -/* 46218 8006AE18 02018024 */ and $s0, $s0, $at -glabel .LJP_8006AE1C -/* 4621C 8006AE1C 8F5B0118 */ lw $k1, 0x118($k0) # handwritten instruction -/* 46220 8006AE20 2401EFFF */ addiu $at, $zero, -0x1001 -/* 46224 8006AE24 0361D824 */ and $k1, $k1, $at -/* 46228 8006AE28 AF5B0118 */ sw $k1, 0x118($k0) # handwritten instruction -/* 4622C 8006AE2C 3C098009 */ lui $t1, %hi(__osShutdown) -/* 46230 8006AE30 2529588C */ addiu $t1, $t1, %lo(__osShutdown) -/* 46234 8006AE34 8D2A0000 */ lw $t2, 0x0($t1) -/* 46238 8006AE38 11400004 */ beqz $t2, .LJP_8006AE4C -/* 4623C 8006AE3C 00000000 */ nop -/* 46240 8006AE40 2401EFFF */ addiu $at, $zero, -0x1001 -/* 46244 8006AE44 10000026 */ b .LJP_8006AEE0 -/* 46248 8006AE48 02018024 */ and $s0, $s0, $at -.LJP_8006AE4C: -/* 4624C 8006AE4C 240A0001 */ addiu $t2, $zero, 0x1 -/* 46250 8006AE50 AD2A0000 */ sw $t2, 0x0($t1) -/* 46254 8006AE54 0C01ABD7 */ jal send_mesg -/* 46258 8006AE58 24040070 */ addiu $a0, $zero, 0x70 -/* 4625C 8006AE5C 2401EFFF */ addiu $at, $zero, -0x1001 -/* 46260 8006AE60 02018024 */ and $s0, $s0, $at -/* 46264 8006AE64 3C0A8009 */ lui $t2, %hi(__osRunQueue) -/* 46268 8006AE68 8D4A4638 */ lw $t2, %lo(__osRunQueue)($t2) -/* 4626C 8006AE6C 8D5B0118 */ lw $k1, 0x118($t2) # handwritten instruction -/* 46270 8006AE70 2401EFFF */ addiu $at, $zero, -0x1001 -/* 46274 8006AE74 0361D824 */ and $k1, $k1, $at -/* 46278 8006AE78 10000019 */ b .LJP_8006AEE0 -/* 4627C 8006AE7C AD5B0118 */ sw $k1, 0x118($t2) # handwritten instruction -glabel .LJP_8006AE80 -/* 46280 8006AE80 2401FDFF */ addiu $at, $zero, -0x201 -/* 46284 8006AE84 01014024 */ and $t0, $t0, $at -/* 46288 8006AE88 40886800 */ mtc0 $t0, $13 # handwritten instruction -/* 4628C 8006AE8C 24040008 */ addiu $a0, $zero, 0x8 -/* 46290 8006AE90 0C01ABD7 */ jal send_mesg -/* 46294 8006AE94 00000000 */ nop -/* 46298 8006AE98 2401FDFF */ addiu $at, $zero, -0x201 -/* 4629C 8006AE9C 1000FF53 */ b .LJP_8006ABEC -/* 462A0 8006AEA0 02018024 */ and $s0, $s0, $at -glabel .LJP_8006AEA4 -/* 462A4 8006AEA4 2401FEFF */ addiu $at, $zero, -0x101 -/* 462A8 8006AEA8 01014024 */ and $t0, $t0, $at -/* 462AC 8006AEAC 40886800 */ mtc0 $t0, $13 # handwritten instruction -/* 462B0 8006AEB0 24040000 */ addiu $a0, $zero, 0x0 -/* 462B4 8006AEB4 0C01ABD7 */ jal send_mesg -/* 462B8 8006AEB8 00000000 */ nop -/* 462BC 8006AEBC 2401FEFF */ addiu $at, $zero, -0x101 -/* 462C0 8006AEC0 1000FF4A */ b .LJP_8006ABEC -/* 462C4 8006AEC4 02018024 */ and $s0, $s0, $at -.LJP_8006AEC8: -/* 462C8 8006AEC8 24090001 */ addiu $t1, $zero, 0x1 -/* 462CC 8006AECC A7490012 */ sh $t1, 0x12($k0) # handwritten instruction -/* 462D0 8006AED0 0C01ABD7 */ jal send_mesg -/* 462D4 8006AED4 24040050 */ addiu $a0, $zero, 0x50 -/* 462D8 8006AED8 10000001 */ b .LJP_8006AEE0 -/* 462DC 8006AEDC 00000000 */ nop -glabel .LJP_8006AEE0 -/* 462E0 8006AEE0 8F490004 */ lw $t1, 0x4($k0) # handwritten instruction -/* 462E4 8006AEE4 3C0A8009 */ lui $t2, %hi(__osRunQueue) -/* 462E8 8006AEE8 8D4A4638 */ lw $t2, %lo(__osRunQueue)($t2) -/* 462EC 8006AEEC 8D4B0004 */ lw $t3, 0x4($t2) -/* 462F0 8006AEF0 012B082A */ slt $at, $t1, $t3 -/* 462F4 8006AEF4 10200007 */ beqz $at, .LJP_8006AF14 -/* 462F8 8006AEF8 00000000 */ nop -/* 462FC 8006AEFC 03402821 */ addu $a1, $k0, $zero -/* 46300 8006AF00 3C048009 */ lui $a0, %hi(__osRunQueue) -/* 46304 8006AF04 0C01AC55 */ jal __osEnqueueThread -/* 46308 8006AF08 24844638 */ addiu $a0, $a0, %lo(__osRunQueue) -/* 4630C 8006AF0C 0801AC6D */ j __osDispatchThread -/* 46310 8006AF10 00000000 */ nop -.LJP_8006AF14: -/* 46314 8006AF14 3C098009 */ lui $t1, %hi(__osRunQueue) -/* 46318 8006AF18 25294638 */ addiu $t1, $t1, %lo(__osRunQueue) -/* 4631C 8006AF1C 8D2A0000 */ lw $t2, 0x0($t1) -/* 46320 8006AF20 AF4A0000 */ sw $t2, 0x0($k0) # handwritten instruction -/* 46324 8006AF24 0801AC6D */ j __osDispatchThread -/* 46328 8006AF28 AD3A0000 */ sw $k0, 0x0($t1) # handwritten instruction -.LJP_8006AF2C: -/* 4632C 8006AF2C 3C018009 */ lui $at, %hi(__osFaultedThread) -/* 46330 8006AF30 AC3A4644 */ sw $k0, %lo(__osFaultedThread)($at) # handwritten instruction -/* 46334 8006AF34 24090001 */ addiu $t1, $zero, 0x1 -/* 46338 8006AF38 A7490010 */ sh $t1, 0x10($k0) # handwritten instruction -/* 4633C 8006AF3C 24090002 */ addiu $t1, $zero, 0x2 -/* 46340 8006AF40 A7490012 */ sh $t1, 0x12($k0) # handwritten instruction -/* 46344 8006AF44 400A4000 */ mfc0 $t2, $8 # handwritten instruction -/* 46348 8006AF48 AF4A0124 */ sw $t2, 0x124($k0) # handwritten instruction -/* 4634C 8006AF4C 0C01ABD7 */ jal send_mesg -/* 46350 8006AF50 24040060 */ addiu $a0, $zero, 0x60 -/* 46354 8006AF54 0801AC6D */ j __osDispatchThread -/* 46358 8006AF58 00000000 */ nop - -# Handwritten function -glabel send_mesg -/* 4635C 8006AF5C 03E09021 */ addu $s2, $ra, $zero -/* 46360 8006AF60 3C0A800E */ lui $t2, %hi(__osEventStateTab) -/* 46364 8006AF64 254A9F60 */ addiu $t2, $t2, %lo(__osEventStateTab) -/* 46368 8006AF68 01445021 */ addu $t2, $t2, $a0 -/* 4636C 8006AF6C 8D490000 */ lw $t1, 0x0($t2) -/* 46370 8006AF70 11200027 */ beqz $t1, .LJP_8006B010 -/* 46374 8006AF74 00000000 */ nop -/* 46378 8006AF78 8D2B0008 */ lw $t3, 0x8($t1) -/* 4637C 8006AF7C 8D2C0010 */ lw $t4, 0x10($t1) -/* 46380 8006AF80 016C082A */ slt $at, $t3, $t4 -/* 46384 8006AF84 10200022 */ beqz $at, .LJP_8006B010 -/* 46388 8006AF88 00000000 */ nop -/* 4638C 8006AF8C 8D2D000C */ lw $t5, 0xC($t1) -/* 46390 8006AF90 01AB6821 */ addu $t5, $t5, $t3 -/* 46394 8006AF94 01AC001A */ div $zero, $t5, $t4 -/* 46398 8006AF98 15800002 */ bnez $t4, .LJP_8006AFA4 -/* 4639C 8006AF9C 00000000 */ nop -/* 463A0 8006AFA0 0007000D */ break 7 -.LJP_8006AFA4: -/* 463A4 8006AFA4 2401FFFF */ addiu $at, $zero, -0x1 -/* 463A8 8006AFA8 15810004 */ bne $t4, $at, .LJP_8006AFBC -/* 463AC 8006AFAC 3C018000 */ lui $at, (0x80000000 >> 16) -/* 463B0 8006AFB0 15A10002 */ bne $t5, $at, .LJP_8006AFBC -/* 463B4 8006AFB4 00000000 */ nop -/* 463B8 8006AFB8 0006000D */ break 6 -.LJP_8006AFBC: -/* 463BC 8006AFBC 00006810 */ mfhi $t5 -/* 463C0 8006AFC0 8D2C0014 */ lw $t4, 0x14($t1) -/* 463C4 8006AFC4 24010004 */ addiu $at, $zero, 0x4 -/* 463C8 8006AFC8 01A10018 */ mult $t5, $at -/* 463CC 8006AFCC 00006812 */ mflo $t5 -/* 463D0 8006AFD0 018D6021 */ addu $t4, $t4, $t5 -/* 463D4 8006AFD4 8D4D0004 */ lw $t5, 0x4($t2) -/* 463D8 8006AFD8 AD8D0000 */ sw $t5, 0x0($t4) -/* 463DC 8006AFDC 256A0001 */ addiu $t2, $t3, 0x1 -/* 463E0 8006AFE0 AD2A0008 */ sw $t2, 0x8($t1) -/* 463E4 8006AFE4 8D2A0000 */ lw $t2, 0x0($t1) -/* 463E8 8006AFE8 8D4B0000 */ lw $t3, 0x0($t2) -/* 463EC 8006AFEC 11600008 */ beqz $t3, .LJP_8006B010 -/* 463F0 8006AFF0 00000000 */ nop -/* 463F4 8006AFF4 0C01AC67 */ jal __osPopThread -/* 463F8 8006AFF8 01202021 */ addu $a0, $t1, $zero -/* 463FC 8006AFFC 00405021 */ addu $t2, $v0, $zero -/* 46400 8006B000 01402821 */ addu $a1, $t2, $zero -/* 46404 8006B004 3C048009 */ lui $a0, %hi(__osRunQueue) -/* 46408 8006B008 0C01AC55 */ jal __osEnqueueThread -/* 4640C 8006B00C 24844638 */ addiu $a0, $a0, %lo(__osRunQueue) -.LJP_8006B010: -/* 46410 8006B010 02400008 */ jr $s2 -/* 46414 8006B014 00000000 */ nop -.LJP_8006B018: -/* 46418 8006B018 3C013000 */ lui $at, (0x30000000 >> 16) -/* 4641C 8006B01C 01014824 */ and $t1, $t0, $at -/* 46420 8006B020 00094F02 */ srl $t1, $t1, 28 -/* 46424 8006B024 240A0001 */ addiu $t2, $zero, 0x1 -/* 46428 8006B028 152AFFC0 */ bne $t1, $t2, .LJP_8006AF2C -/* 4642C 8006B02C 00000000 */ nop -/* 46430 8006B030 24090001 */ addiu $t1, $zero, 0x1 -/* 46434 8006B034 AF490018 */ sw $t1, 0x18($k0) # handwritten instruction -/* 46438 8006B038 8F5B0118 */ lw $k1, 0x118($k0) # handwritten instruction -/* 4643C 8006B03C 3C012000 */ lui $at, (0x20000000 >> 16) -/* 46440 8006B040 0361D825 */ or $k1, $k1, $at -/* 46444 8006B044 1000FFB3 */ b .LJP_8006AF14 -/* 46448 8006B048 AF5B0118 */ sw $k1, 0x118($k0) # handwritten instruction - -# Handwritten function -glabel __osEnqueueAndYield -/* 4644C 8006B04C 3C058009 */ lui $a1, %hi(__osRunningThread) -/* 46450 8006B050 8CA54640 */ lw $a1, %lo(__osRunningThread)($a1) -/* 46454 8006B054 40086000 */ mfc0 $t0, $12 # handwritten instruction -/* 46458 8006B058 35080002 */ ori $t0, $t0, 0x2 -/* 4645C 8006B05C ACA80118 */ sw $t0, 0x118($a1) -/* 46460 8006B060 FCB00098 */ sd $s0, 0x98($a1) -/* 46464 8006B064 FCB100A0 */ sd $s1, 0xA0($a1) -/* 46468 8006B068 FCB200A8 */ sd $s2, 0xA8($a1) -/* 4646C 8006B06C FCB300B0 */ sd $s3, 0xB0($a1) -/* 46470 8006B070 FCB400B8 */ sd $s4, 0xB8($a1) -/* 46474 8006B074 FCB500C0 */ sd $s5, 0xC0($a1) -/* 46478 8006B078 FCB600C8 */ sd $s6, 0xC8($a1) -/* 4647C 8006B07C FCB700D0 */ sd $s7, 0xD0($a1) -/* 46480 8006B080 FCBC00E8 */ sd $gp, 0xE8($a1) -/* 46484 8006B084 FCBD00F0 */ sd $sp, 0xF0($a1) -/* 46488 8006B088 FCBE00F8 */ sd $fp, 0xF8($a1) -/* 4648C 8006B08C FCBF0100 */ sd $ra, 0x100($a1) -/* 46490 8006B090 ACBF011C */ sw $ra, 0x11C($a1) -/* 46494 8006B094 8CBB0018 */ lw $k1, 0x18($a1) # handwritten instruction -/* 46498 8006B098 1360000A */ beqz $k1, .LJP_8006B0C4 # handwritten instruction -/* 4649C 8006B09C 00000000 */ nop -/* 464A0 8006B0A0 445BF800 */ cfc1 $k1, $31 -/* 464A4 8006B0A4 00000000 */ nop -/* 464A8 8006B0A8 ACBB012C */ sw $k1, 0x12C($a1) # handwritten instruction -/* 464AC 8006B0AC F4B40180 */ sdc1 $f20, 0x180($a1) -/* 464B0 8006B0B0 F4B60188 */ sdc1 $f22, 0x188($a1) -/* 464B4 8006B0B4 F4B80190 */ sdc1 $f24, 0x190($a1) -/* 464B8 8006B0B8 F4BA0198 */ sdc1 $f26, 0x198($a1) -/* 464BC 8006B0BC F4BC01A0 */ sdc1 $f28, 0x1A0($a1) -/* 464C0 8006B0C0 F4BE01A8 */ sdc1 $f30, 0x1A8($a1) -.LJP_8006B0C4: -/* 464C4 8006B0C4 8CBB0118 */ lw $k1, 0x118($a1) # handwritten instruction -/* 464C8 8006B0C8 3369FF00 */ andi $t1, $k1, 0xFF00 # handwritten instruction -/* 464CC 8006B0CC 1120000D */ beqz $t1, .LJP_8006B104 -/* 464D0 8006B0D0 00000000 */ nop -/* 464D4 8006B0D4 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 464D8 8006B0D8 25085890 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 464DC 8006B0DC 8D080000 */ lw $t0, 0x0($t0) -/* 464E0 8006B0E0 2401FFFF */ addiu $at, $zero, -0x1 -/* 464E4 8006B0E4 01014026 */ xor $t0, $t0, $at -/* 464E8 8006B0E8 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 464EC 8006B0EC 01284825 */ or $t1, $t1, $t0 -/* 464F0 8006B0F0 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 464F4 8006B0F4 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 464F8 8006B0F8 0361D824 */ and $k1, $k1, $at -/* 464FC 8006B0FC 0369D825 */ or $k1, $k1, $t1 -/* 46500 8006B100 ACBB0118 */ sw $k1, 0x118($a1) # handwritten instruction -.LJP_8006B104: -/* 46504 8006B104 3C1BA430 */ lui $k1, %hi(D_A430000C) # handwritten instruction -/* 46508 8006B108 8F7B000C */ lw $k1, %lo(D_A430000C)($k1) # handwritten instruction -/* 4650C 8006B10C 1360000B */ beqz $k1, .LJP_8006B13C # handwritten instruction -/* 46510 8006B110 00000000 */ nop -/* 46514 8006B114 3C1A8009 */ lui $k0, %hi(__OSGlobalIntMask) # handwritten instruction -/* 46518 8006B118 275A5890 */ addiu $k0, $k0, %lo(__OSGlobalIntMask) # handwritten instruction -/* 4651C 8006B11C 8F5A0000 */ lw $k0, 0x0($k0) # handwritten instruction -/* 46520 8006B120 001AD402 */ srl $k0, $k0, 16 -/* 46524 8006B124 2401FFFF */ addiu $at, $zero, -0x1 -/* 46528 8006B128 0341D026 */ xor $k0, $k0, $at -/* 4652C 8006B12C 335A003F */ andi $k0, $k0, 0x3F # handwritten instruction -/* 46530 8006B130 8CA80128 */ lw $t0, 0x128($a1) -/* 46534 8006B134 0348D024 */ and $k0, $k0, $t0 -/* 46538 8006B138 037AD825 */ or $k1, $k1, $k0 -.LJP_8006B13C: -/* 4653C 8006B13C 10800003 */ beqz $a0, .LJP_8006B14C -/* 46540 8006B140 ACBB0128 */ sw $k1, 0x128($a1) # handwritten instruction -/* 46544 8006B144 0C01AC55 */ jal __osEnqueueThread -/* 46548 8006B148 00000000 */ nop -.LJP_8006B14C: -/* 4654C 8006B14C 0801AC6D */ j __osDispatchThread -/* 46550 8006B150 00000000 */ nop - -glabel __osEnqueueThread -/* 46554 8006B154 0080C821 */ addu $t9, $a0, $zero -/* 46558 8006B158 8C980000 */ lw $t8, 0x0($a0) -/* 4655C 8006B15C 8CAF0004 */ lw $t7, 0x4($a1) -/* 46560 8006B160 8F0E0004 */ lw $t6, 0x4($t8) -/* 46564 8006B164 01CF082A */ slt $at, $t6, $t7 -/* 46568 8006B168 14200007 */ bnez $at, .LJP_8006B188 -/* 4656C 8006B16C 00000000 */ nop -.LJP_8006B170: -/* 46570 8006B170 0300C821 */ addu $t9, $t8, $zero -/* 46574 8006B174 8F180000 */ lw $t8, 0x0($t8) -/* 46578 8006B178 8F0E0004 */ lw $t6, 0x4($t8) -/* 4657C 8006B17C 01CF082A */ slt $at, $t6, $t7 -/* 46580 8006B180 1020FFFB */ beqz $at, .LJP_8006B170 -/* 46584 8006B184 00000000 */ nop -.LJP_8006B188: -/* 46588 8006B188 8F380000 */ lw $t8, 0x0($t9) -/* 4658C 8006B18C ACB80000 */ sw $t8, 0x0($a1) -/* 46590 8006B190 AF250000 */ sw $a1, 0x0($t9) -/* 46594 8006B194 03E00008 */ jr $ra -/* 46598 8006B198 ACA40008 */ sw $a0, 0x8($a1) - -glabel __osPopThread -/* 4659C 8006B19C 8C820000 */ lw $v0, 0x0($a0) -/* 465A0 8006B1A0 8C590000 */ lw $t9, 0x0($v0) -/* 465A4 8006B1A4 03E00008 */ jr $ra -/* 465A8 8006B1A8 AC990000 */ sw $t9, 0x0($a0) -/* 465AC 8006B1AC 03E00008 */ jr $ra -/* 465B0 8006B1B0 00000000 */ nop - -# Handwritten function -glabel __osDispatchThread -/* 465B4 8006B1B4 3C048009 */ lui $a0, %hi(__osRunQueue) -/* 465B8 8006B1B8 0C01AC67 */ jal __osPopThread -/* 465BC 8006B1BC 24844638 */ addiu $a0, $a0, %lo(__osRunQueue) -/* 465C0 8006B1C0 3C018009 */ lui $at, %hi(__osRunningThread) -/* 465C4 8006B1C4 AC224640 */ sw $v0, %lo(__osRunningThread)($at) -/* 465C8 8006B1C8 24080004 */ addiu $t0, $zero, 0x4 -/* 465CC 8006B1CC A4480010 */ sh $t0, 0x10($v0) -/* 465D0 8006B1D0 0040D021 */ addu $k0, $v0, $zero -/* 465D4 8006B1D4 8F5B0118 */ lw $k1, 0x118($k0) # handwritten instruction -/* 465D8 8006B1D8 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 465DC 8006B1DC 25085890 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 465E0 8006B1E0 8D080000 */ lw $t0, 0x0($t0) -/* 465E4 8006B1E4 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 465E8 8006B1E8 3369FF00 */ andi $t1, $k1, 0xFF00 # handwritten instruction -/* 465EC 8006B1EC 01284824 */ and $t1, $t1, $t0 -/* 465F0 8006B1F0 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 465F4 8006B1F4 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 465F8 8006B1F8 0361D824 */ and $k1, $k1, $at -/* 465FC 8006B1FC 0369D825 */ or $k1, $k1, $t1 -/* 46600 8006B200 409B6000 */ mtc0 $k1, $12 # handwritten instruction -/* 46604 8006B204 DF410020 */ ld $at, 0x20($k0) # handwritten instruction -/* 46608 8006B208 DF420028 */ ld $v0, 0x28($k0) # handwritten instruction -/* 4660C 8006B20C DF430030 */ ld $v1, 0x30($k0) # handwritten instruction -/* 46610 8006B210 DF440038 */ ld $a0, 0x38($k0) # handwritten instruction -/* 46614 8006B214 DF450040 */ ld $a1, 0x40($k0) # handwritten instruction -/* 46618 8006B218 DF460048 */ ld $a2, 0x48($k0) # handwritten instruction -/* 4661C 8006B21C DF470050 */ ld $a3, 0x50($k0) # handwritten instruction -/* 46620 8006B220 DF480058 */ ld $t0, 0x58($k0) # handwritten instruction -/* 46624 8006B224 DF490060 */ ld $t1, 0x60($k0) # handwritten instruction -/* 46628 8006B228 DF4A0068 */ ld $t2, 0x68($k0) # handwritten instruction -/* 4662C 8006B22C DF4B0070 */ ld $t3, 0x70($k0) # handwritten instruction -/* 46630 8006B230 DF4C0078 */ ld $t4, 0x78($k0) # handwritten instruction -/* 46634 8006B234 DF4D0080 */ ld $t5, 0x80($k0) # handwritten instruction -/* 46638 8006B238 DF4E0088 */ ld $t6, 0x88($k0) # handwritten instruction -/* 4663C 8006B23C DF4F0090 */ ld $t7, 0x90($k0) # handwritten instruction -/* 46640 8006B240 DF500098 */ ld $s0, 0x98($k0) # handwritten instruction -/* 46644 8006B244 DF5100A0 */ ld $s1, 0xA0($k0) # handwritten instruction -/* 46648 8006B248 DF5200A8 */ ld $s2, 0xA8($k0) # handwritten instruction -/* 4664C 8006B24C DF5300B0 */ ld $s3, 0xB0($k0) # handwritten instruction -/* 46650 8006B250 DF5400B8 */ ld $s4, 0xB8($k0) # handwritten instruction -/* 46654 8006B254 DF5500C0 */ ld $s5, 0xC0($k0) # handwritten instruction -/* 46658 8006B258 DF5600C8 */ ld $s6, 0xC8($k0) # handwritten instruction -/* 4665C 8006B25C DF5700D0 */ ld $s7, 0xD0($k0) # handwritten instruction -/* 46660 8006B260 DF5800D8 */ ld $t8, 0xD8($k0) # handwritten instruction -/* 46664 8006B264 DF5900E0 */ ld $t9, 0xE0($k0) # handwritten instruction -/* 46668 8006B268 DF5C00E8 */ ld $gp, 0xE8($k0) # handwritten instruction -/* 4666C 8006B26C DF5D00F0 */ ld $sp, 0xF0($k0) # handwritten instruction -/* 46670 8006B270 DF5E00F8 */ ld $fp, 0xF8($k0) # handwritten instruction -/* 46674 8006B274 DF5F0100 */ ld $ra, 0x100($k0) # handwritten instruction -/* 46678 8006B278 DF5B0108 */ ld $k1, 0x108($k0) # handwritten instruction -/* 4667C 8006B27C 03600013 */ mtlo $k1 -/* 46680 8006B280 DF5B0110 */ ld $k1, 0x110($k0) # handwritten instruction -/* 46684 8006B284 03600011 */ mthi $k1 -/* 46688 8006B288 8F5B011C */ lw $k1, 0x11C($k0) # handwritten instruction -/* 4668C 8006B28C 409B7000 */ mtc0 $k1, $14 # handwritten instruction -/* 46690 8006B290 8F5B0018 */ lw $k1, 0x18($k0) # handwritten instruction -/* 46694 8006B294 13600013 */ beqz $k1, .LJP_8006B2E4 # handwritten instruction -/* 46698 8006B298 00000000 */ nop -/* 4669C 8006B29C 8F5B012C */ lw $k1, 0x12C($k0) # handwritten instruction -/* 466A0 8006B2A0 44DBF800 */ ctc1 $k1, $31 -/* 466A4 8006B2A4 D7400130 */ ldc1 $f0, 0x130($k0) -/* 466A8 8006B2A8 D7420138 */ ldc1 $f2, 0x138($k0) -/* 466AC 8006B2AC D7440140 */ ldc1 $f4, 0x140($k0) -/* 466B0 8006B2B0 D7460148 */ ldc1 $f6, 0x148($k0) -/* 466B4 8006B2B4 D7480150 */ ldc1 $f8, 0x150($k0) -/* 466B8 8006B2B8 D74A0158 */ ldc1 $f10, 0x158($k0) -/* 466BC 8006B2BC D74C0160 */ ldc1 $f12, 0x160($k0) -/* 466C0 8006B2C0 D74E0168 */ ldc1 $f14, 0x168($k0) -/* 466C4 8006B2C4 D7500170 */ ldc1 $f16, 0x170($k0) -/* 466C8 8006B2C8 D7520178 */ ldc1 $f18, 0x178($k0) -/* 466CC 8006B2CC D7540180 */ ldc1 $f20, 0x180($k0) -/* 466D0 8006B2D0 D7560188 */ ldc1 $f22, 0x188($k0) -/* 466D4 8006B2D4 D7580190 */ ldc1 $f24, 0x190($k0) -/* 466D8 8006B2D8 D75A0198 */ ldc1 $f26, 0x198($k0) -/* 466DC 8006B2DC D75C01A0 */ ldc1 $f28, 0x1A0($k0) -/* 466E0 8006B2E0 D75E01A8 */ ldc1 $f30, 0x1A8($k0) -.LJP_8006B2E4: -/* 466E4 8006B2E4 8F5B0128 */ lw $k1, 0x128($k0) # handwritten instruction -/* 466E8 8006B2E8 3C1A8009 */ lui $k0, %hi(__OSGlobalIntMask) # handwritten instruction -/* 466EC 8006B2EC 275A5890 */ addiu $k0, $k0, %lo(__OSGlobalIntMask) # handwritten instruction -/* 466F0 8006B2F0 8F5A0000 */ lw $k0, 0x0($k0) # handwritten instruction -/* 466F4 8006B2F4 001AD402 */ srl $k0, $k0, 16 -/* 466F8 8006B2F8 037AD824 */ and $k1, $k1, $k0 -/* 466FC 8006B2FC 001BD840 */ sll $k1, $k1, 1 -/* 46700 8006B300 3C1A800A */ lui $k0, %hi(D_80099AA0) # handwritten instruction -/* 46704 8006B304 275A9A80 */ addiu $k0, $k0, %lo(D_80099AA0) # handwritten instruction -/* 46708 8006B308 037AD821 */ addu $k1, $k1, $k0 -/* 4670C 8006B30C 977B0000 */ lhu $k1, 0x0($k1) # handwritten instruction -/* 46710 8006B310 3C1AA430 */ lui $k0, (0xA430000C >> 16) # handwritten instruction -/* 46714 8006B314 375A000C */ ori $k0, $k0, (0xA430000C & 0xFFFF) # handwritten instruction -/* 46718 8006B318 AF5B0000 */ sw $k1, 0x0($k0) # handwritten instruction -/* 4671C 8006B31C 00000000 */ nop -/* 46720 8006B320 00000000 */ nop -/* 46724 8006B324 00000000 */ nop -/* 46728 8006B328 00000000 */ nop -/* 4672C 8006B32C 42000018 */ eret # handwritten instruction - -glabel __osCleanupThread -/* 46730 8006B330 00002021 */ addu $a0, $zero, $zero -/* 46734 8006B334 0C01B24C */ jal osDestroyThread -/* 46738 8006B338 00000000 */ nop -/* 4673C 8006B33C 00000000 */ nop diff --git a/ver/jp/asm/os/guMtxCatF.s b/ver/jp/asm/os/guMtxCatF.s deleted file mode 100644 index 6b1f231709..0000000000 --- a/ver/jp/asm/os/guMtxCatF.s +++ /dev/null @@ -1,78 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guMtxCatF -/* 429E0 800675E0 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 429E4 800675E4 24820040 */ addiu $v0, $a0, 0x40 -/* 429E8 800675E8 24A30010 */ addiu $v1, $a1, 0x10 -/* 429EC 800675EC 03A05021 */ addu $t2, $sp, $zero -.LJP_800675F0: -/* 429F0 800675F0 00A03821 */ addu $a3, $a1, $zero -.LJP_800675F4: -/* 429F4 800675F4 C4840000 */ lwc1 $f4, 0x0($a0) -/* 429F8 800675F8 C4E60000 */ lwc1 $f6, 0x0($a3) -/* 429FC 800675FC 46062202 */ mul.s $f8, $f4, $f6 -/* 42A00 80067600 C48A0004 */ lwc1 $f10, 0x4($a0) -/* 42A04 80067604 C4F00010 */ lwc1 $f16, 0x10($a3) -/* 42A08 80067608 46105482 */ mul.s $f18, $f10, $f16 -/* 42A0C 8006760C 46124200 */ add.s $f8, $f8, $f18 -/* 42A10 80067610 C4840008 */ lwc1 $f4, 0x8($a0) -/* 42A14 80067614 C4E60020 */ lwc1 $f6, 0x20($a3) -/* 42A18 80067618 46062482 */ mul.s $f18, $f4, $f6 -/* 42A1C 8006761C 46124200 */ add.s $f8, $f8, $f18 -/* 42A20 80067620 C48A000C */ lwc1 $f10, 0xC($a0) -/* 42A24 80067624 C4F00030 */ lwc1 $f16, 0x30($a3) -/* 42A28 80067628 46105482 */ mul.s $f18, $f10, $f16 -/* 42A2C 8006762C 46124200 */ add.s $f8, $f8, $f18 -/* 42A30 80067630 E5480000 */ swc1 $f8, 0x0($t2) -/* 42A34 80067634 24E70004 */ addiu $a3, $a3, 0x4 -/* 42A38 80067638 14E3FFEE */ bne $a3, $v1, .LJP_800675F4 -/* 42A3C 8006763C 254A0004 */ addiu $t2, $t2, 0x4 -/* 42A40 80067640 24840010 */ addiu $a0, $a0, 0x10 -/* 42A44 80067644 1482FFEA */ bne $a0, $v0, .LJP_800675F0 -/* 42A48 80067648 00000000 */ nop -/* 42A4C 8006764C E4C8003C */ swc1 $f8, 0x3C($a2) -/* 42A50 80067650 8FA80000 */ lw $t0, 0x0($sp) -/* 42A54 80067654 8FA90004 */ lw $t1, 0x4($sp) -/* 42A58 80067658 8FAA0008 */ lw $t2, 0x8($sp) -/* 42A5C 8006765C 8FAB000C */ lw $t3, 0xC($sp) -/* 42A60 80067660 8FAC0010 */ lw $t4, 0x10($sp) -/* 42A64 80067664 8FAD0014 */ lw $t5, 0x14($sp) -/* 42A68 80067668 8FAE0018 */ lw $t6, 0x18($sp) -/* 42A6C 8006766C 8FAF001C */ lw $t7, 0x1C($sp) -/* 42A70 80067670 8FB80020 */ lw $t8, 0x20($sp) -/* 42A74 80067674 8FB90024 */ lw $t9, 0x24($sp) -/* 42A78 80067678 8FA20028 */ lw $v0, 0x28($sp) -/* 42A7C 8006767C 8FA3002C */ lw $v1, 0x2C($sp) -/* 42A80 80067680 8FA40030 */ lw $a0, 0x30($sp) -/* 42A84 80067684 8FA50034 */ lw $a1, 0x34($sp) -/* 42A88 80067688 8FA70038 */ lw $a3, 0x38($sp) -/* 42A8C 8006768C ACC80000 */ sw $t0, 0x0($a2) -/* 42A90 80067690 ACC90004 */ sw $t1, 0x4($a2) -/* 42A94 80067694 ACCA0008 */ sw $t2, 0x8($a2) -/* 42A98 80067698 ACCB000C */ sw $t3, 0xC($a2) -/* 42A9C 8006769C ACCC0010 */ sw $t4, 0x10($a2) -/* 42AA0 800676A0 ACCD0014 */ sw $t5, 0x14($a2) -/* 42AA4 800676A4 ACCE0018 */ sw $t6, 0x18($a2) -/* 42AA8 800676A8 ACCF001C */ sw $t7, 0x1C($a2) -/* 42AAC 800676AC ACD80020 */ sw $t8, 0x20($a2) -/* 42AB0 800676B0 ACD90024 */ sw $t9, 0x24($a2) -/* 42AB4 800676B4 ACC20028 */ sw $v0, 0x28($a2) -/* 42AB8 800676B8 ACC3002C */ sw $v1, 0x2C($a2) -/* 42ABC 800676BC ACC40030 */ sw $a0, 0x30($a2) -/* 42AC0 800676C0 ACC50034 */ sw $a1, 0x34($a2) -/* 42AC4 800676C4 ACC70038 */ sw $a3, 0x38($a2) -/* 42AC8 800676C8 03E00008 */ jr $ra -/* 42ACC 800676CC 27BD0040 */ addiu $sp, $sp, 0x40 -/* 42AD0 800676D0 00000000 */ nop -/* 42AD4 800676D4 00000000 */ nop -/* 42AD8 800676D8 00000000 */ nop -/* 42ADC 800676DC 00000000 */ nop diff --git a/ver/jp/asm/os/guMtxF2L.s b/ver/jp/asm/os/guMtxF2L.s deleted file mode 100644 index 94adf51c5e..0000000000 --- a/ver/jp/asm/os/guMtxF2L.s +++ /dev/null @@ -1,45 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guMtxF2L -/* 428E0 800674E0 3C014780 */ lui $at, (0x47800000 >> 16) -/* 428E4 800674E4 44810000 */ mtc1 $at, $f0 -/* 428E8 800674E8 3C19FFFF */ lui $t9, (0xFFFF0000 >> 16) -/* 428EC 800674EC 24B80020 */ addiu $t8, $a1, 0x20 -.LJP_800674F0: -/* 428F0 800674F0 C4840000 */ lwc1 $f4, 0x0($a0) -/* 428F4 800674F4 46002182 */ mul.s $f6, $f4, $f0 -/* 428F8 800674F8 4600320D */ trunc.w.s $f8, $f6 -/* 428FC 800674FC C48A0004 */ lwc1 $f10, 0x4($a0) -/* 42900 80067500 46005402 */ mul.s $f16, $f10, $f0 -/* 42904 80067504 4600848D */ trunc.w.s $f18, $f16 -/* 42908 80067508 44084000 */ mfc1 $t0, $f8 -/* 4290C 8006750C 44099000 */ mfc1 $t1, $f18 -/* 42910 80067510 01195024 */ and $t2, $t0, $t9 -/* 42914 80067514 00095C02 */ srl $t3, $t1, 16 -/* 42918 80067518 014B6025 */ or $t4, $t2, $t3 -/* 4291C 8006751C ACAC0000 */ sw $t4, 0x0($a1) -/* 42920 80067520 00086C00 */ sll $t5, $t0, 16 -/* 42924 80067524 312EFFFF */ andi $t6, $t1, 0xFFFF -/* 42928 80067528 01AE7825 */ or $t7, $t5, $t6 -/* 4292C 8006752C ACAF0020 */ sw $t7, 0x20($a1) -/* 42930 80067530 24A50004 */ addiu $a1, $a1, 0x4 -/* 42934 80067534 14B8FFEE */ bne $a1, $t8, .LJP_800674F0 -/* 42938 80067538 24840008 */ addiu $a0, $a0, 0x8 -/* 4293C 8006753C 03E00008 */ jr $ra -/* 42940 80067540 00000000 */ nop -/* 42944 80067544 00000000 */ nop -/* 42948 80067548 00000000 */ nop -/* 4294C 8006754C 00000000 */ nop -/* 42950 80067550 00000000 */ nop -/* 42954 80067554 00000000 */ nop -/* 42958 80067558 00000000 */ nop -/* 4295C 8006755C 00000000 */ nop diff --git a/ver/jp/asm/os/guMtxIdent.s b/ver/jp/asm/os/guMtxIdent.s deleted file mode 100644 index 67d7dd7690..0000000000 --- a/ver/jp/asm/os/guMtxIdent.s +++ /dev/null @@ -1,37 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel guMtxIdent -/* 42820 80067420 20080001 */ addi $t0, $zero, 0x1 # handwritten instruction -/* 42824 80067424 00084C00 */ sll $t1, $t0, 16 -/* 42828 80067428 AC890000 */ sw $t1, 0x0($a0) -/* 4282C 8006742C AC800004 */ sw $zero, 0x4($a0) -/* 42830 80067430 AC880008 */ sw $t0, 0x8($a0) -/* 42834 80067434 AC80000C */ sw $zero, 0xC($a0) -/* 42838 80067438 AC800010 */ sw $zero, 0x10($a0) -/* 4283C 8006743C AC890014 */ sw $t1, 0x14($a0) -/* 42840 80067440 AC800018 */ sw $zero, 0x18($a0) -/* 42844 80067444 AC88001C */ sw $t0, 0x1C($a0) -/* 42848 80067448 AC800020 */ sw $zero, 0x20($a0) -/* 4284C 8006744C AC800024 */ sw $zero, 0x24($a0) -/* 42850 80067450 AC800028 */ sw $zero, 0x28($a0) -/* 42854 80067454 AC80002C */ sw $zero, 0x2C($a0) -/* 42858 80067458 AC800030 */ sw $zero, 0x30($a0) -/* 4285C 8006745C AC800034 */ sw $zero, 0x34($a0) -/* 42860 80067460 AC800038 */ sw $zero, 0x38($a0) -/* 42864 80067464 03E00008 */ jr $ra -/* 42868 80067468 AC80003C */ sw $zero, 0x3C($a0) -/* 4286C 8006746C 00000000 */ nop -/* 42870 80067470 00000000 */ nop -/* 42874 80067474 00000000 */ nop -/* 42878 80067478 00000000 */ nop -/* 4287C 8006747C 00000000 */ nop diff --git a/ver/jp/asm/os/guMtxIdentF.s b/ver/jp/asm/os/guMtxIdentF.s deleted file mode 100644 index 019dd8dbfb..0000000000 --- a/ver/jp/asm/os/guMtxIdentF.s +++ /dev/null @@ -1,36 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guMtxIdentF -/* 42880 80067480 3C083F80 */ lui $t0, (0x3F800000 >> 16) -/* 42884 80067484 AC880000 */ sw $t0, 0x0($a0) -/* 42888 80067488 AC800004 */ sw $zero, 0x4($a0) -/* 4288C 8006748C AC800008 */ sw $zero, 0x8($a0) -/* 42890 80067490 AC80000C */ sw $zero, 0xC($a0) -/* 42894 80067494 AC800010 */ sw $zero, 0x10($a0) -/* 42898 80067498 AC880014 */ sw $t0, 0x14($a0) -/* 4289C 8006749C AC800018 */ sw $zero, 0x18($a0) -/* 428A0 800674A0 AC80001C */ sw $zero, 0x1C($a0) -/* 428A4 800674A4 AC800020 */ sw $zero, 0x20($a0) -/* 428A8 800674A8 AC800024 */ sw $zero, 0x24($a0) -/* 428AC 800674AC AC880028 */ sw $t0, 0x28($a0) -/* 428B0 800674B0 AC80002C */ sw $zero, 0x2C($a0) -/* 428B4 800674B4 AC800030 */ sw $zero, 0x30($a0) -/* 428B8 800674B8 AC800034 */ sw $zero, 0x34($a0) -/* 428BC 800674BC AC800038 */ sw $zero, 0x38($a0) -/* 428C0 800674C0 03E00008 */ jr $ra -/* 428C4 800674C4 AC88003C */ sw $t0, 0x3C($a0) -/* 428C8 800674C8 00000000 */ nop -/* 428CC 800674CC 00000000 */ nop -/* 428D0 800674D0 00000000 */ nop -/* 428D4 800674D4 00000000 */ nop -/* 428D8 800674D8 00000000 */ nop -/* 428DC 800674DC 00000000 */ nop diff --git a/ver/jp/asm/os/guMtxL2F.s b/ver/jp/asm/os/guMtxL2F.s deleted file mode 100644 index 770cbd6504..0000000000 --- a/ver/jp/asm/os/guMtxL2F.s +++ /dev/null @@ -1,45 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guMtxL2F -/* 42960 80067560 3C013780 */ lui $at, (0x37800000 >> 16) -/* 42964 80067564 44810000 */ mtc1 $at, $f0 -/* 42968 80067568 3C19FFFF */ lui $t9, (0xFFFF0000 >> 16) -/* 4296C 8006756C 24B80020 */ addiu $t8, $a1, 0x20 -.LJP_80067570: -/* 42970 80067570 8CA80000 */ lw $t0, 0x0($a1) -/* 42974 80067574 8CA90020 */ lw $t1, 0x20($a1) -/* 42978 80067578 01195024 */ and $t2, $t0, $t9 -/* 4297C 8006757C 00095C02 */ srl $t3, $t1, 16 -/* 42980 80067580 014B6025 */ or $t4, $t2, $t3 -/* 42984 80067584 00086C00 */ sll $t5, $t0, 16 -/* 42988 80067588 312EFFFF */ andi $t6, $t1, 0xFFFF -/* 4298C 8006758C 01AE7825 */ or $t7, $t5, $t6 -/* 42990 80067590 448C2000 */ mtc1 $t4, $f4 -/* 42994 80067594 00000000 */ nop -/* 42998 80067598 468021A0 */ cvt.s.w $f6, $f4 -/* 4299C 8006759C 46003202 */ mul.s $f8, $f6, $f0 -/* 429A0 800675A0 448F5000 */ mtc1 $t7, $f10 -/* 429A4 800675A4 00000000 */ nop -/* 429A8 800675A8 46805420 */ cvt.s.w $f16, $f10 -/* 429AC 800675AC 46008482 */ mul.s $f18, $f16, $f0 -/* 429B0 800675B0 E4880000 */ swc1 $f8, 0x0($a0) -/* 429B4 800675B4 E4920004 */ swc1 $f18, 0x4($a0) -/* 429B8 800675B8 24A50004 */ addiu $a1, $a1, 0x4 -/* 429BC 800675BC 14B8FFEC */ bne $a1, $t8, .LJP_80067570 -/* 429C0 800675C0 24840008 */ addiu $a0, $a0, 0x8 -/* 429C4 800675C4 03E00008 */ jr $ra -/* 429C8 800675C8 00000000 */ nop -/* 429CC 800675CC 00000000 */ nop -/* 429D0 800675D0 00000000 */ nop -/* 429D4 800675D4 00000000 */ nop -/* 429D8 800675D8 00000000 */ nop -/* 429DC 800675DC 00000000 */ nop diff --git a/ver/jp/asm/os/guNormalize.s b/ver/jp/asm/os/guNormalize.s deleted file mode 100644 index b8e61f980d..0000000000 --- a/ver/jp/asm/os/guNormalize.s +++ /dev/null @@ -1,36 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guNormalize -/* 47FA0 8006CBA0 C4840000 */ lwc1 $f4, 0x0($a0) -/* 47FA4 8006CBA4 C4A60000 */ lwc1 $f6, 0x0($a1) -/* 47FA8 8006CBA8 C4C80000 */ lwc1 $f8, 0x0($a2) -/* 47FAC 8006CBAC 46042282 */ mul.s $f10, $f4, $f4 -/* 47FB0 8006CBB0 3C083F80 */ lui $t0, (0x3F800000 >> 16) -/* 47FB4 8006CBB4 46063402 */ mul.s $f16, $f6, $f6 -/* 47FB8 8006CBB8 46105480 */ add.s $f18, $f10, $f16 -/* 47FBC 8006CBBC 46084402 */ mul.s $f16, $f8, $f8 -/* 47FC0 8006CBC0 46128280 */ add.s $f10, $f16, $f18 -/* 47FC4 8006CBC4 44889000 */ mtc1 $t0, $f18 -/* 47FC8 8006CBC8 46005404 */ sqrt.s $f16, $f10 -/* 47FCC 8006CBCC 46109283 */ div.s $f10, $f18, $f16 -/* 47FD0 8006CBD0 460A2402 */ mul.s $f16, $f4, $f10 -/* 47FD4 8006CBD4 00000000 */ nop -/* 47FD8 8006CBD8 460A3482 */ mul.s $f18, $f6, $f10 -/* 47FDC 8006CBDC 00000000 */ nop -/* 47FE0 8006CBE0 460A4102 */ mul.s $f4, $f8, $f10 -/* 47FE4 8006CBE4 E4900000 */ swc1 $f16, 0x0($a0) -/* 47FE8 8006CBE8 E4B20000 */ swc1 $f18, 0x0($a1) -/* 47FEC 8006CBEC 03E00008 */ jr $ra -/* 47FF0 8006CBF0 E4C40000 */ swc1 $f4, 0x0($a2) -/* 47FF4 8006CBF4 00000000 */ nop -/* 47FF8 8006CBF8 00000000 */ nop -/* 47FFC 8006CBFC 00000000 */ nop diff --git a/ver/jp/asm/os/guScale.s b/ver/jp/asm/os/guScale.s deleted file mode 100644 index f369fc0a6c..0000000000 --- a/ver/jp/asm/os/guScale.s +++ /dev/null @@ -1,60 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guScale -/* 42AE0 800676E0 3C014780 */ lui $at, (0x47800000 >> 16) -/* 42AE4 800676E4 44812000 */ mtc1 $at, $f4 -/* 42AE8 800676E8 44853000 */ mtc1 $a1, $f6 -/* 42AEC 800676EC 00000000 */ nop -/* 42AF0 800676F0 46043202 */ mul.s $f8, $f6, $f4 -/* 42AF4 800676F4 4600428D */ trunc.w.s $f10, $f8 -/* 42AF8 800676F8 44095000 */ mfc1 $t1, $f10 -/* 42AFC 800676FC 00000000 */ nop -/* 42B00 80067700 00095402 */ srl $t2, $t1, 16 -/* 42B04 80067704 000A4400 */ sll $t0, $t2, 16 -/* 42B08 80067708 AC880000 */ sw $t0, 0x0($a0) -/* 42B0C 8006770C 00095400 */ sll $t2, $t1, 16 -/* 42B10 80067710 AC8A0020 */ sw $t2, 0x20($a0) -/* 42B14 80067714 44863000 */ mtc1 $a2, $f6 -/* 42B18 80067718 00000000 */ nop -/* 42B1C 8006771C 46043202 */ mul.s $f8, $f6, $f4 -/* 42B20 80067720 4600428D */ trunc.w.s $f10, $f8 -/* 42B24 80067724 44095000 */ mfc1 $t1, $f10 -/* 42B28 80067728 00000000 */ nop -/* 42B2C 8006772C 00094402 */ srl $t0, $t1, 16 -/* 42B30 80067730 AC880008 */ sw $t0, 0x8($a0) -/* 42B34 80067734 312AFFFF */ andi $t2, $t1, 0xFFFF -/* 42B38 80067738 AC8A0028 */ sw $t2, 0x28($a0) -/* 42B3C 8006773C 44873000 */ mtc1 $a3, $f6 -/* 42B40 80067740 00000000 */ nop -/* 42B44 80067744 46043202 */ mul.s $f8, $f6, $f4 -/* 42B48 80067748 4600428D */ trunc.w.s $f10, $f8 -/* 42B4C 8006774C 44095000 */ mfc1 $t1, $f10 -/* 42B50 80067750 00000000 */ nop -/* 42B54 80067754 00095402 */ srl $t2, $t1, 16 -/* 42B58 80067758 000A4400 */ sll $t0, $t2, 16 -/* 42B5C 8006775C AC880014 */ sw $t0, 0x14($a0) -/* 42B60 80067760 00095400 */ sll $t2, $t1, 16 -/* 42B64 80067764 AC8A0034 */ sw $t2, 0x34($a0) -/* 42B68 80067768 24080001 */ addiu $t0, $zero, 0x1 -/* 42B6C 8006776C AC88001C */ sw $t0, 0x1C($a0) -/* 42B70 80067770 AC800004 */ sw $zero, 0x4($a0) -/* 42B74 80067774 AC80000C */ sw $zero, 0xC($a0) -/* 42B78 80067778 AC800010 */ sw $zero, 0x10($a0) -/* 42B7C 8006777C AC800018 */ sw $zero, 0x18($a0) -/* 42B80 80067780 AC800024 */ sw $zero, 0x24($a0) -/* 42B84 80067784 AC80002C */ sw $zero, 0x2C($a0) -/* 42B88 80067788 AC800030 */ sw $zero, 0x30($a0) -/* 42B8C 8006778C AC800038 */ sw $zero, 0x38($a0) -/* 42B90 80067790 03E00008 */ jr $ra -/* 42B94 80067794 AC80003C */ sw $zero, 0x3C($a0) -/* 42B98 80067798 00000000 */ nop -/* 42B9C 8006779C 00000000 */ nop diff --git a/ver/jp/asm/os/guScaleF.s b/ver/jp/asm/os/guScaleF.s deleted file mode 100644 index dec5974b56..0000000000 --- a/ver/jp/asm/os/guScaleF.s +++ /dev/null @@ -1,36 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guScaleF -/* 42BA0 800677A0 AC850000 */ sw $a1, 0x0($a0) -/* 42BA4 800677A4 AC800004 */ sw $zero, 0x4($a0) -/* 42BA8 800677A8 AC800008 */ sw $zero, 0x8($a0) -/* 42BAC 800677AC AC80000C */ sw $zero, 0xC($a0) -/* 42BB0 800677B0 AC800010 */ sw $zero, 0x10($a0) -/* 42BB4 800677B4 AC860014 */ sw $a2, 0x14($a0) -/* 42BB8 800677B8 AC800018 */ sw $zero, 0x18($a0) -/* 42BBC 800677BC AC80001C */ sw $zero, 0x1C($a0) -/* 42BC0 800677C0 AC800020 */ sw $zero, 0x20($a0) -/* 42BC4 800677C4 AC800024 */ sw $zero, 0x24($a0) -/* 42BC8 800677C8 AC870028 */ sw $a3, 0x28($a0) -/* 42BCC 800677CC AC80002C */ sw $zero, 0x2C($a0) -/* 42BD0 800677D0 3C083F80 */ lui $t0, (0x3F800000 >> 16) -/* 42BD4 800677D4 AC800030 */ sw $zero, 0x30($a0) -/* 42BD8 800677D8 AC800034 */ sw $zero, 0x34($a0) -/* 42BDC 800677DC AC800038 */ sw $zero, 0x38($a0) -/* 42BE0 800677E0 03E00008 */ jr $ra -/* 42BE4 800677E4 AC88003C */ sw $t0, 0x3C($a0) -/* 42BE8 800677E8 00000000 */ nop -/* 42BEC 800677EC 00000000 */ nop -/* 42BF0 800677F0 00000000 */ nop -/* 42BF4 800677F4 00000000 */ nop -/* 42BF8 800677F8 00000000 */ nop -/* 42BFC 800677FC 00000000 */ nop diff --git a/ver/jp/asm/os/guTranslate.s b/ver/jp/asm/os/guTranslate.s deleted file mode 100644 index 7cd5009d44..0000000000 --- a/ver/jp/asm/os/guTranslate.s +++ /dev/null @@ -1,68 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guTranslate -/* 42C00 80067800 3C014780 */ lui $at, (0x47800000 >> 16) -/* 42C04 80067804 44812000 */ mtc1 $at, $f4 -/* 42C08 80067808 44853000 */ mtc1 $a1, $f6 -/* 42C0C 8006780C 00000000 */ nop -/* 42C10 80067810 46043202 */ mul.s $f8, $f6, $f4 -/* 42C14 80067814 4600428D */ trunc.w.s $f10, $f8 -/* 42C18 80067818 44095000 */ mfc1 $t1, $f10 -/* 42C1C 8006781C 44863000 */ mtc1 $a2, $f6 -/* 42C20 80067820 00000000 */ nop -/* 42C24 80067824 46043202 */ mul.s $f8, $f6, $f4 -/* 42C28 80067828 4600428D */ trunc.w.s $f10, $f8 -/* 42C2C 8006782C 440B5000 */ mfc1 $t3, $f10 -/* 42C30 80067830 00095402 */ srl $t2, $t1, 16 -/* 42C34 80067834 000A4400 */ sll $t0, $t2, 16 -/* 42C38 80067838 000B5402 */ srl $t2, $t3, 16 -/* 42C3C 8006783C 010A4025 */ or $t0, $t0, $t2 -/* 42C40 80067840 AC880018 */ sw $t0, 0x18($a0) -/* 42C44 80067844 00094400 */ sll $t0, $t1, 16 -/* 42C48 80067848 000B5400 */ sll $t2, $t3, 16 -/* 42C4C 8006784C 000A5402 */ srl $t2, $t2, 16 -/* 42C50 80067850 010A4025 */ or $t0, $t0, $t2 -/* 42C54 80067854 AC880038 */ sw $t0, 0x38($a0) -/* 42C58 80067858 44873000 */ mtc1 $a3, $f6 -/* 42C5C 8006785C 00000000 */ nop -/* 42C60 80067860 46043202 */ mul.s $f8, $f6, $f4 -/* 42C64 80067864 4600428D */ trunc.w.s $f10, $f8 -/* 42C68 80067868 44095000 */ mfc1 $t1, $f10 -/* 42C6C 8006786C 00000000 */ nop -/* 42C70 80067870 00095402 */ srl $t2, $t1, 16 -/* 42C74 80067874 000A4400 */ sll $t0, $t2, 16 -/* 42C78 80067878 25080001 */ addiu $t0, $t0, 0x1 -/* 42C7C 8006787C AC88001C */ sw $t0, 0x1C($a0) -/* 42C80 80067880 00095400 */ sll $t2, $t1, 16 -/* 42C84 80067884 AC8A003C */ sw $t2, 0x3C($a0) -/* 42C88 80067888 AC800000 */ sw $zero, 0x0($a0) -/* 42C8C 8006788C AC800004 */ sw $zero, 0x4($a0) -/* 42C90 80067890 AC800008 */ sw $zero, 0x8($a0) -/* 42C94 80067894 AC80000C */ sw $zero, 0xC($a0) -/* 42C98 80067898 AC800010 */ sw $zero, 0x10($a0) -/* 42C9C 8006789C AC800014 */ sw $zero, 0x14($a0) -/* 42CA0 800678A0 AC800020 */ sw $zero, 0x20($a0) -/* 42CA4 800678A4 AC800024 */ sw $zero, 0x24($a0) -/* 42CA8 800678A8 AC800028 */ sw $zero, 0x28($a0) -/* 42CAC 800678AC AC80002C */ sw $zero, 0x2C($a0) -/* 42CB0 800678B0 AC800030 */ sw $zero, 0x30($a0) -/* 42CB4 800678B4 AC800034 */ sw $zero, 0x34($a0) -/* 42CB8 800678B8 3C080001 */ lui $t0, (0x10000 >> 16) -/* 42CBC 800678BC 35080000 */ ori $t0, $t0, (0x10000 & 0xFFFF) -/* 42CC0 800678C0 AC880000 */ sw $t0, 0x0($a0) -/* 42CC4 800678C4 AC880014 */ sw $t0, 0x14($a0) -/* 42CC8 800678C8 3C080000 */ lui $t0, (0x1 >> 16) -/* 42CCC 800678CC 35080001 */ ori $t0, $t0, (0x1 & 0xFFFF) -/* 42CD0 800678D0 03E00008 */ jr $ra -/* 42CD4 800678D4 AC880008 */ sw $t0, 0x8($a0) -/* 42CD8 800678D8 00000000 */ nop -/* 42CDC 800678DC 00000000 */ nop diff --git a/ver/jp/asm/os/guTranslateF.s b/ver/jp/asm/os/guTranslateF.s deleted file mode 100644 index d762243c52..0000000000 --- a/ver/jp/asm/os/guTranslateF.s +++ /dev/null @@ -1,36 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel guTranslateF -/* 42CE0 800678E0 3C083F80 */ lui $t0, (0x3F800000 >> 16) -/* 42CE4 800678E4 AC880000 */ sw $t0, 0x0($a0) -/* 42CE8 800678E8 AC800004 */ sw $zero, 0x4($a0) -/* 42CEC 800678EC AC800008 */ sw $zero, 0x8($a0) -/* 42CF0 800678F0 AC80000C */ sw $zero, 0xC($a0) -/* 42CF4 800678F4 AC800010 */ sw $zero, 0x10($a0) -/* 42CF8 800678F8 AC880014 */ sw $t0, 0x14($a0) -/* 42CFC 800678FC AC800018 */ sw $zero, 0x18($a0) -/* 42D00 80067900 AC80001C */ sw $zero, 0x1C($a0) -/* 42D04 80067904 AC800020 */ sw $zero, 0x20($a0) -/* 42D08 80067908 AC800024 */ sw $zero, 0x24($a0) -/* 42D0C 8006790C AC880028 */ sw $t0, 0x28($a0) -/* 42D10 80067910 AC80002C */ sw $zero, 0x2C($a0) -/* 42D14 80067914 AC850030 */ sw $a1, 0x30($a0) -/* 42D18 80067918 AC860034 */ sw $a2, 0x34($a0) -/* 42D1C 8006791C AC870038 */ sw $a3, 0x38($a0) -/* 42D20 80067920 03E00008 */ jr $ra -/* 42D24 80067924 AC88003C */ sw $t0, 0x3C($a0) -/* 42D28 80067928 00000000 */ nop -/* 42D2C 8006792C 00000000 */ nop -/* 42D30 80067930 00000000 */ nop -/* 42D34 80067934 00000000 */ nop -/* 42D38 80067938 00000000 */ nop -/* 42D3C 8006793C 00000000 */ nop diff --git a/ver/jp/asm/os/osGetCount.s b/ver/jp/asm/os/osGetCount.s deleted file mode 100644 index de84efd3d0..0000000000 --- a/ver/jp/asm/os/osGetCount.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osGetCount -/* 40DD0 800659D0 40024800 */ mfc0 $v0, $9 # handwritten instruction -/* 40DD4 800659D4 03E00008 */ jr $ra -/* 40DD8 800659D8 00000000 */ nop -/* 40DDC 800659DC 00000000 */ nop diff --git a/ver/jp/asm/os/osInvalDCache.s b/ver/jp/asm/os/osInvalDCache.s deleted file mode 100644 index 73ea2d9d6f..0000000000 --- a/ver/jp/asm/os/osInvalDCache.s +++ /dev/null @@ -1,62 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osInvalDCache -/* 3CAF0 800616F0 18A00020 */ blez $a1, .LJP_80061774 -/* 3CAF4 800616F4 00000000 */ nop -/* 3CAF8 800616F8 240B2000 */ addiu $t3, $zero, 0x2000 -/* 3CAFC 800616FC 00AB082B */ sltu $at, $a1, $t3 -/* 3CB00 80061700 1020001E */ beqz $at, .LJP_8006177C -/* 3CB04 80061704 00000000 */ nop -/* 3CB08 80061708 00804021 */ addu $t0, $a0, $zero -/* 3CB0C 8006170C 00854821 */ addu $t1, $a0, $a1 -/* 3CB10 80061710 0109082B */ sltu $at, $t0, $t1 -/* 3CB14 80061714 10200017 */ beqz $at, .LJP_80061774 -/* 3CB18 80061718 00000000 */ nop -/* 3CB1C 8006171C 2529FFF0 */ addiu $t1, $t1, -0x10 -/* 3CB20 80061720 310A000F */ andi $t2, $t0, 0xF -/* 3CB24 80061724 11400007 */ beqz $t2, .LJP_80061744 -/* 3CB28 80061728 00000000 */ nop -/* 3CB2C 8006172C 010A4023 */ subu $t0, $t0, $t2 -/* 3CB30 80061730 BD150000 */ cache 0x15, 0x0($t0) # handwritten instruction -/* 3CB34 80061734 0109082B */ sltu $at, $t0, $t1 -/* 3CB38 80061738 1020000E */ beqz $at, .LJP_80061774 -/* 3CB3C 8006173C 00000000 */ nop -/* 3CB40 80061740 25080010 */ addiu $t0, $t0, 0x10 -.LJP_80061744: -/* 3CB44 80061744 312A000F */ andi $t2, $t1, 0xF -/* 3CB48 80061748 11400006 */ beqz $t2, .LJP_80061764 -/* 3CB4C 8006174C 00000000 */ nop -/* 3CB50 80061750 012A4823 */ subu $t1, $t1, $t2 -/* 3CB54 80061754 BD350010 */ cache 0x15, 0x10($t1) # handwritten instruction -/* 3CB58 80061758 0128082B */ sltu $at, $t1, $t0 -/* 3CB5C 8006175C 14200005 */ bnez $at, .LJP_80061774 -/* 3CB60 80061760 00000000 */ nop -.LJP_80061764: -/* 3CB64 80061764 BD110000 */ cache 0x11, 0x0($t0) # handwritten instruction -/* 3CB68 80061768 0109082B */ sltu $at, $t0, $t1 -/* 3CB6C 8006176C 1420FFFD */ bnez $at, .LJP_80061764 -/* 3CB70 80061770 25080010 */ addiu $t0, $t0, 0x10 -.LJP_80061774: -/* 3CB74 80061774 03E00008 */ jr $ra -/* 3CB78 80061778 00000000 */ nop -.LJP_8006177C: -/* 3CB7C 8006177C 3C088000 */ lui $t0, 0x8000 -/* 3CB80 80061780 010B4821 */ addu $t1, $t0, $t3 -/* 3CB84 80061784 2529FFF0 */ addiu $t1, $t1, -0x10 -.LJP_80061788: -/* 3CB88 80061788 BD010000 */ cache 0x01, 0x0($t0) # handwritten instruction -/* 3CB8C 8006178C 0109082B */ sltu $at, $t0, $t1 -/* 3CB90 80061790 1420FFFD */ bnez $at, .LJP_80061788 -/* 3CB94 80061794 25080010 */ addiu $t0, $t0, (0x80000010 & 0xFFFF) -/* 3CB98 80061798 03E00008 */ jr $ra -/* 3CB9C 8006179C 00000000 */ nop diff --git a/ver/jp/asm/os/osInvalICache.s b/ver/jp/asm/os/osInvalICache.s deleted file mode 100644 index 2cdce3c6fd..0000000000 --- a/ver/jp/asm/os/osInvalICache.s +++ /dev/null @@ -1,49 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osInvalICache -/* 3CBA0 800617A0 18A00011 */ blez $a1, .LJP_800617E8 -/* 3CBA4 800617A4 00000000 */ nop -/* 3CBA8 800617A8 240B4000 */ addiu $t3, $zero, 0x4000 -/* 3CBAC 800617AC 00AB082B */ sltu $at, $a1, $t3 -/* 3CBB0 800617B0 1020000F */ beqz $at, .LJP_800617F0 -/* 3CBB4 800617B4 00000000 */ nop -/* 3CBB8 800617B8 00804021 */ addu $t0, $a0, $zero -/* 3CBBC 800617BC 00854821 */ addu $t1, $a0, $a1 -/* 3CBC0 800617C0 0109082B */ sltu $at, $t0, $t1 -/* 3CBC4 800617C4 10200008 */ beqz $at, .LJP_800617E8 -/* 3CBC8 800617C8 00000000 */ nop -/* 3CBCC 800617CC 2529FFE0 */ addiu $t1, $t1, -0x20 -/* 3CBD0 800617D0 310A001F */ andi $t2, $t0, 0x1F -/* 3CBD4 800617D4 010A4023 */ subu $t0, $t0, $t2 -.LJP_800617D8: -/* 3CBD8 800617D8 BD100000 */ cache 0x10, 0x0($t0) # handwritten instruction -/* 3CBDC 800617DC 0109082B */ sltu $at, $t0, $t1 -/* 3CBE0 800617E0 1420FFFD */ bnez $at, .LJP_800617D8 -/* 3CBE4 800617E4 25080020 */ addiu $t0, $t0, 0x20 -.LJP_800617E8: -/* 3CBE8 800617E8 03E00008 */ jr $ra -/* 3CBEC 800617EC 00000000 */ nop -.LJP_800617F0: -/* 3CBF0 800617F0 3C088000 */ lui $t0, 0x8000 -/* 3CBF4 800617F4 010B4821 */ addu $t1, $t0, $t3 -/* 3CBF8 800617F8 2529FFE0 */ addiu $t1, $t1, -0x20 -.LJP_800617FC: -/* 3CBFC 800617FC BD000000 */ cache 0x00, 0x0($t0) # handwritten instruction -/* 3CC00 80061800 0109082B */ sltu $at, $t0, $t1 -/* 3CC04 80061804 1420FFFD */ bnez $at, .LJP_800617FC -/* 3CC08 80061808 25080020 */ addiu $t0, $t0, (0x80000020 & 0xFFFF) -/* 3CC0C 8006180C 03E00008 */ jr $ra -/* 3CC10 80061810 00000000 */ nop -/* 3CC14 80061814 00000000 */ nop -/* 3CC18 80061818 00000000 */ nop -/* 3CC1C 8006181C 00000000 */ nop diff --git a/ver/jp/asm/os/osMapTLB.s b/ver/jp/asm/os/osMapTLB.s deleted file mode 100644 index c273b08b30..0000000000 --- a/ver/jp/asm/os/osMapTLB.s +++ /dev/null @@ -1,67 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osMapTLB -/* 41B70 80066770 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 41B74 80066774 40840000 */ mtc0 $a0, $0 # handwritten instruction -/* 41B78 80066778 40852800 */ mtc0 $a1, $5 # handwritten instruction -/* 41B7C 8006677C 8FA90014 */ lw $t1, 0x14($sp) -/* 41B80 80066780 2401FFFF */ addiu $at, $zero, -0x1 -/* 41B84 80066784 11210004 */ beq $t1, $at, .LJP_80066798 -/* 41B88 80066788 240C0001 */ addiu $t4, $zero, 0x1 -/* 41B8C 8006678C 240A001E */ addiu $t2, $zero, 0x1E -/* 41B90 80066790 10000002 */ b .LJP_8006679C -/* 41B94 80066794 00C93025 */ or $a2, $a2, $t1 -.LJP_80066798: -/* 41B98 80066798 240A001F */ addiu $t2, $zero, 0x1F -.LJP_8006679C: -/* 41B9C 8006679C 40865000 */ mtc0 $a2, $10 # handwritten instruction -/* 41BA0 800667A0 2401FFFF */ addiu $at, $zero, -0x1 -/* 41BA4 800667A4 10E10006 */ beq $a3, $at, .LJP_800667C0 -/* 41BA8 800667A8 00000000 */ nop -/* 41BAC 800667AC 00075982 */ srl $t3, $a3, 6 -/* 41BB0 800667B0 016A5825 */ or $t3, $t3, $t2 -/* 41BB4 800667B4 408B1000 */ mtc0 $t3, $2 # handwritten instruction -/* 41BB8 800667B8 10000002 */ b .LJP_800667C4 -/* 41BBC 800667BC 00000000 */ nop -.LJP_800667C0: -/* 41BC0 800667C0 408C1000 */ mtc0 $t4, $2 # handwritten instruction -.LJP_800667C4: -/* 41BC4 800667C4 8FAB0010 */ lw $t3, 0x10($sp) -/* 41BC8 800667C8 2401FFFF */ addiu $at, $zero, -0x1 -/* 41BCC 800667CC 11610006 */ beq $t3, $at, .LJP_800667E8 -/* 41BD0 800667D0 00000000 */ nop -/* 41BD4 800667D4 000B5982 */ srl $t3, $t3, 6 -/* 41BD8 800667D8 016A5825 */ or $t3, $t3, $t2 -/* 41BDC 800667DC 408B1800 */ mtc0 $t3, $3 # handwritten instruction -/* 41BE0 800667E0 10000007 */ b .LJP_80066800 -/* 41BE4 800667E4 00000000 */ nop -.LJP_800667E8: -/* 41BE8 800667E8 408C1800 */ mtc0 $t4, $3 # handwritten instruction -/* 41BEC 800667EC 2401FFFF */ addiu $at, $zero, -0x1 -/* 41BF0 800667F0 14E10003 */ bne $a3, $at, .LJP_80066800 -/* 41BF4 800667F4 00000000 */ nop -/* 41BF8 800667F8 3C0B8000 */ lui $t3, (0x80000000 >> 16) -/* 41BFC 800667FC 408B5000 */ mtc0 $t3, $10 # handwritten instruction -.LJP_80066800: -/* 41C00 80066800 00000000 */ nop -/* 41C04 80066804 42000002 */ tlbwi # handwritten instruction -/* 41C08 80066808 00000000 */ nop -/* 41C0C 8006680C 00000000 */ nop -/* 41C10 80066810 00000000 */ nop -/* 41C14 80066814 00000000 */ nop -/* 41C18 80066818 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 41C1C 8006681C 03E00008 */ jr $ra -/* 41C20 80066820 00000000 */ nop -/* 41C24 80066824 00000000 */ nop -/* 41C28 80066828 00000000 */ nop -/* 41C2C 8006682C 00000000 */ nop diff --git a/ver/jp/asm/os/osMapTLBRdb.s b/ver/jp/asm/os/osMapTLBRdb.s deleted file mode 100644 index 6a9618bb5b..0000000000 --- a/ver/jp/asm/os/osMapTLBRdb.s +++ /dev/null @@ -1,37 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osMapTLBRdb -/* 47E10 8006CA10 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 47E14 8006CA14 2409001F */ addiu $t1, $zero, 0x1F -/* 47E18 8006CA18 40890000 */ mtc0 $t1, $0 # handwritten instruction -/* 47E1C 8006CA1C 40802800 */ mtc0 $zero, $5 # handwritten instruction -/* 47E20 8006CA20 240A0017 */ addiu $t2, $zero, 0x17 -/* 47E24 8006CA24 3C09C000 */ lui $t1, (0xC0000000 >> 16) -/* 47E28 8006CA28 40895000 */ mtc0 $t1, $10 # handwritten instruction -/* 47E2C 8006CA2C 3C098000 */ lui $t1, (0x80000000 >> 16) -/* 47E30 8006CA30 00095982 */ srl $t3, $t1, 6 -/* 47E34 8006CA34 016A5825 */ or $t3, $t3, $t2 -/* 47E38 8006CA38 408B1000 */ mtc0 $t3, $2 # handwritten instruction -/* 47E3C 8006CA3C 24090001 */ addiu $t1, $zero, 0x1 -/* 47E40 8006CA40 40891800 */ mtc0 $t1, $3 # handwritten instruction -/* 47E44 8006CA44 00000000 */ nop -/* 47E48 8006CA48 42000002 */ tlbwi # handwritten instruction -/* 47E4C 8006CA4C 00000000 */ nop -/* 47E50 8006CA50 00000000 */ nop -/* 47E54 8006CA54 00000000 */ nop -/* 47E58 8006CA58 00000000 */ nop -/* 47E5C 8006CA5C 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 47E60 8006CA60 03E00008 */ jr $ra -/* 47E64 8006CA64 00000000 */ nop -/* 47E68 8006CA68 00000000 */ nop -/* 47E6C 8006CA6C 00000000 */ nop diff --git a/ver/jp/asm/os/osSetIntMask.s b/ver/jp/asm/os/osSetIntMask.s deleted file mode 100644 index 55900940eb..0000000000 --- a/ver/jp/asm/os/osSetIntMask.s +++ /dev/null @@ -1,122 +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 - -glabel D_80099AA0 -/* 74E80 80099A80 */ .short 0x0555 -/* 74E82 80099A82 */ .short 0x0556 -/* 74E84 80099A84 */ .short 0x0559 -/* 74E86 80099A86 */ .short 0x055A -/* 74E88 80099A88 */ .short 0x0565 -/* 74E8A 80099A8A */ .short 0x0566 -/* 74E8C 80099A8C */ .short 0x0569 -/* 74E8E 80099A8E */ .short 0x056A -/* 74E90 80099A90 */ .short 0x0595 -/* 74E92 80099A92 */ .short 0x0596 -/* 74E94 80099A94 */ .short 0x0599 -/* 74E96 80099A96 */ .short 0x059A -/* 74E98 80099A98 */ .short 0x05A5 -/* 74E9A 80099A9A */ .short 0x05A6 -/* 74E9C 80099A9C */ .short 0x05A9 -/* 74E9E 80099A9E */ .short 0x05AA -/* 74EA0 80099AA0 */ .short 0x0655 -/* 74EA2 80099AA2 */ .short 0x0656 -/* 74EA4 80099AA4 */ .short 0x0659 -/* 74EA6 80099AA6 */ .short 0x065A -/* 74EA8 80099AA8 */ .short 0x0665 -/* 74EAA 80099AAA */ .short 0x0666 -/* 74EAC 80099AAC */ .short 0x0669 -/* 74EAE 80099AAE */ .short 0x066A -/* 74EB0 80099AB0 */ .short 0x0695 -/* 74EB2 80099AB2 */ .short 0x0696 -/* 74EB4 80099AB4 */ .short 0x0699 -/* 74EB6 80099AB6 */ .short 0x069A -/* 74EB8 80099AB8 */ .short 0x06A5 -/* 74EBA 80099ABA */ .short 0x06A6 -/* 74EBC 80099ABC */ .short 0x06A9 -/* 74EBE 80099ABE */ .short 0x06AA -/* 74EC0 80099AC0 */ .short 0x0955 -/* 74EC2 80099AC2 */ .short 0x0956 -/* 74EC4 80099AC4 */ .short 0x0959 -/* 74EC6 80099AC6 */ .short 0x095A -/* 74EC8 80099AC8 */ .short 0x0965 -/* 74ECA 80099ACA */ .short 0x0966 -/* 74ECC 80099ACC */ .short 0x0969 -/* 74ECE 80099ACE */ .short 0x096A -/* 74ED0 80099AD0 */ .short 0x0995 -/* 74ED2 80099AD2 */ .short 0x0996 -/* 74ED4 80099AD4 */ .short 0x0999 -/* 74ED6 80099AD6 */ .short 0x099A -/* 74ED8 80099AD8 */ .short 0x09A5 -/* 74EDA 80099ADA */ .short 0x09A6 -/* 74EDC 80099ADC */ .short 0x09A9 -/* 74EDE 80099ADE */ .short 0x09AA -/* 74EE0 80099AE0 */ .short 0x0A55 -/* 74EE2 80099AE2 */ .short 0x0A56 -/* 74EE4 80099AE4 */ .short 0x0A59 -/* 74EE6 80099AE6 */ .short 0x0A5A -/* 74EE8 80099AE8 */ .short 0x0A65 -/* 74EEA 80099AEA */ .short 0x0A66 -/* 74EEC 80099AEC */ .short 0x0A69 -/* 74EEE 80099AEE */ .short 0x0A6A -/* 74EF0 80099AF0 */ .short 0x0A95 -/* 74EF2 80099AF2 */ .short 0x0A96 -/* 74EF4 80099AF4 */ .short 0x0A99 -/* 74EF6 80099AF6 */ .short 0x0A9A -/* 74EF8 80099AF8 */ .short 0x0AA5 -/* 74EFA 80099AFA */ .short 0x0AA6 -/* 74EFC 80099AFC */ .short 0x0AA9 -/* 74EFE 80099AFE */ .short 0x0AAA - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osSetIntMask -/* 3BD10 80060910 400C6000 */ mfc0 $t4, $12 # handwritten instruction -/* 3BD14 80060914 3182FF01 */ andi $v0, $t4, 0xFF01 -/* 3BD18 80060918 3C088009 */ lui $t0, %hi(__OSGlobalIntMask) -/* 3BD1C 8006091C 25085890 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) -/* 3BD20 80060920 8D0B0000 */ lw $t3, 0x0($t0) -/* 3BD24 80060924 2401FFFF */ addiu $at, $zero, -0x1 -/* 3BD28 80060928 01614026 */ xor $t0, $t3, $at -/* 3BD2C 8006092C 3108FF00 */ andi $t0, $t0, 0xFF00 -/* 3BD30 80060930 00481025 */ or $v0, $v0, $t0 -/* 3BD34 80060934 3C0AA430 */ lui $t2, %hi(D_A430000C) -/* 3BD38 80060938 8D4A000C */ lw $t2, %lo(D_A430000C)($t2) -/* 3BD3C 8006093C 11400005 */ beqz $t2, .LJP_80060954 -/* 3BD40 80060940 000B4C02 */ srl $t1, $t3, 16 -/* 3BD44 80060944 2401FFFF */ addiu $at, $zero, -0x1 -/* 3BD48 80060948 01214826 */ xor $t1, $t1, $at -/* 3BD4C 8006094C 3129003F */ andi $t1, $t1, 0x3F -/* 3BD50 80060950 01495025 */ or $t2, $t2, $t1 -.LJP_80060954: -/* 3BD54 80060954 000A5400 */ sll $t2, $t2, 16 -/* 3BD58 80060958 004A1025 */ or $v0, $v0, $t2 -/* 3BD5C 8006095C 3C01003F */ lui $at, (0x3F0000 >> 16) -/* 3BD60 80060960 00814024 */ and $t0, $a0, $at -/* 3BD64 80060964 010B4024 */ and $t0, $t0, $t3 -/* 3BD68 80060968 000843C2 */ srl $t0, $t0, 15 -/* 3BD6C 8006096C 3C0A800A */ lui $t2, %hi(D_80099AA0) -/* 3BD70 80060970 01485021 */ addu $t2, $t2, $t0 -/* 3BD74 80060974 954A9A80 */ lhu $t2, %lo(D_80099AA0)($t2) -/* 3BD78 80060978 3C01A430 */ lui $at, %hi(D_A430000C) -/* 3BD7C 8006097C AC2A000C */ sw $t2, %lo(D_A430000C)($at) -/* 3BD80 80060980 3088FF01 */ andi $t0, $a0, 0xFF01 -/* 3BD84 80060984 3169FF00 */ andi $t1, $t3, 0xFF00 -/* 3BD88 80060988 01094024 */ and $t0, $t0, $t1 -/* 3BD8C 8006098C 3C01FFFF */ lui $at, (0xFFFF00FF >> 16) -/* 3BD90 80060990 342100FF */ ori $at, $at, (0xFFFF00FF & 0xFFFF) -/* 3BD94 80060994 01816024 */ and $t4, $t4, $at -/* 3BD98 80060998 01886025 */ or $t4, $t4, $t0 -/* 3BD9C 8006099C 408C6000 */ mtc0 $t4, $12 # handwritten instruction -/* 3BDA0 800609A0 00000000 */ nop -/* 3BDA4 800609A4 00000000 */ nop -/* 3BDA8 800609A8 03E00008 */ jr $ra -/* 3BDAC 800609AC 00000000 */ nop diff --git a/ver/jp/asm/os/osUnmapTLB.s b/ver/jp/asm/os/osUnmapTLB.s deleted file mode 100644 index e06b0f599e..0000000000 --- a/ver/jp/asm/os/osUnmapTLB.s +++ /dev/null @@ -1,29 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osUnmapTLB -/* 41CF0 800668F0 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 41CF4 800668F4 40840000 */ mtc0 $a0, $0 # handwritten instruction -/* 41CF8 800668F8 3C098000 */ lui $t1, (0x80000000 >> 16) -/* 41CFC 800668FC 40895000 */ mtc0 $t1, $10 # handwritten instruction -/* 41D00 80066900 40801000 */ mtc0 $zero, $2 # handwritten instruction -/* 41D04 80066904 40801800 */ mtc0 $zero, $3 # handwritten instruction -/* 41D08 80066908 00000000 */ nop -/* 41D0C 8006690C 42000002 */ tlbwi # handwritten instruction -/* 41D10 80066910 00000000 */ nop -/* 41D14 80066914 00000000 */ nop -/* 41D18 80066918 00000000 */ nop -/* 41D1C 8006691C 00000000 */ nop -/* 41D20 80066920 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 41D24 80066924 03E00008 */ jr $ra -/* 41D28 80066928 00000000 */ nop -/* 41D2C 8006692C 00000000 */ nop diff --git a/ver/jp/asm/os/osUnmapTLBAll.s b/ver/jp/asm/os/osUnmapTLBAll.s deleted file mode 100644 index 3432d85477..0000000000 --- a/ver/jp/asm/os/osUnmapTLBAll.s +++ /dev/null @@ -1,34 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osUnmapTLBAll -/* 41D30 80066930 40085000 */ mfc0 $t0, $10 # handwritten instruction -/* 41D34 80066934 2409001E */ addiu $t1, $zero, 0x1E -/* 41D38 80066938 3C0A8000 */ lui $t2, (0x80000000 >> 16) -/* 41D3C 8006693C 408A5000 */ mtc0 $t2, $10 # handwritten instruction -/* 41D40 80066940 40801000 */ mtc0 $zero, $2 # handwritten instruction -/* 41D44 80066944 40801800 */ mtc0 $zero, $3 # handwritten instruction -.LJP_80066948: -/* 41D48 80066948 40890000 */ mtc0 $t1, $0 # handwritten instruction -/* 41D4C 8006694C 00000000 */ nop -/* 41D50 80066950 42000002 */ tlbwi # handwritten instruction -/* 41D54 80066954 00000000 */ nop -/* 41D58 80066958 00000000 */ nop -/* 41D5C 8006695C 2129FFFF */ addi $t1, $t1, -0x1 # handwritten instruction -/* 41D60 80066960 0521FFF9 */ bgez $t1, .LJP_80066948 -/* 41D64 80066964 00000000 */ nop -/* 41D68 80066968 40885000 */ mtc0 $t0, $10 # handwritten instruction -/* 41D6C 8006696C 03E00008 */ jr $ra -/* 41D70 80066970 00000000 */ nop -/* 41D74 80066974 00000000 */ nop -/* 41D78 80066978 00000000 */ nop -/* 41D7C 8006697C 00000000 */ nop diff --git a/ver/jp/asm/os/osWritebackDCache.s b/ver/jp/asm/os/osWritebackDCache.s deleted file mode 100644 index 25414aa13d..0000000000 --- a/ver/jp/asm/os/osWritebackDCache.s +++ /dev/null @@ -1,49 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osWritebackDCache -/* 3CC20 80061820 18A00011 */ blez $a1, .LJP_80061868 -/* 3CC24 80061824 00000000 */ nop -/* 3CC28 80061828 240B2000 */ addiu $t3, $zero, 0x2000 -/* 3CC2C 8006182C 00AB082B */ sltu $at, $a1, $t3 -/* 3CC30 80061830 1020000F */ beqz $at, .LJP_80061870 -/* 3CC34 80061834 00000000 */ nop -/* 3CC38 80061838 00804021 */ addu $t0, $a0, $zero -/* 3CC3C 8006183C 00854821 */ addu $t1, $a0, $a1 -/* 3CC40 80061840 0109082B */ sltu $at, $t0, $t1 -/* 3CC44 80061844 10200008 */ beqz $at, .LJP_80061868 -/* 3CC48 80061848 00000000 */ nop -/* 3CC4C 8006184C 2529FFF0 */ addiu $t1, $t1, -0x10 -/* 3CC50 80061850 310A000F */ andi $t2, $t0, 0xF -/* 3CC54 80061854 010A4023 */ subu $t0, $t0, $t2 -.LJP_80061858: -/* 3CC58 80061858 BD190000 */ cache 0x19, 0x0($t0) # handwritten instruction -/* 3CC5C 8006185C 0109082B */ sltu $at, $t0, $t1 -/* 3CC60 80061860 1420FFFD */ bnez $at, .LJP_80061858 -/* 3CC64 80061864 25080010 */ addiu $t0, $t0, 0x10 -.LJP_80061868: -/* 3CC68 80061868 03E00008 */ jr $ra -/* 3CC6C 8006186C 00000000 */ nop -.LJP_80061870: -/* 3CC70 80061870 3C088000 */ lui $t0, 0x8000 -/* 3CC74 80061874 010B4821 */ addu $t1, $t0, $t3 -/* 3CC78 80061878 2529FFF0 */ addiu $t1, $t1, -0x10 -.LJP_8006187C: -/* 3CC7C 8006187C BD010000 */ cache 0x01, 0x0($t0) # handwritten instruction -/* 3CC80 80061880 0109082B */ sltu $at, $t0, $t1 -/* 3CC84 80061884 1420FFFD */ bnez $at, .LJP_8006187C -/* 3CC88 80061888 25080010 */ addiu $t0, $t0, (0x80000010 & 0xFFFF) -/* 3CC8C 8006188C 03E00008 */ jr $ra -/* 3CC90 80061890 00000000 */ nop -/* 3CC94 80061894 00000000 */ nop -/* 3CC98 80061898 00000000 */ nop -/* 3CC9C 8006189C 00000000 */ nop diff --git a/ver/jp/asm/os/osWritebackDCacheAll.s b/ver/jp/asm/os/osWritebackDCacheAll.s deleted file mode 100644 index d04a2af6c1..0000000000 --- a/ver/jp/asm/os/osWritebackDCacheAll.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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel osWritebackDCacheAll -/* 3CCA0 800618A0 3C088000 */ lui $t0, 0x8000 -/* 3CCA4 800618A4 240A2000 */ addiu $t2, $zero, 0x2000 -/* 3CCA8 800618A8 010A4821 */ addu $t1, $t0, $t2 -/* 3CCAC 800618AC 2529FFF0 */ addiu $t1, $t1, -0x10 -.LJP_800618B0: -/* 3CCB0 800618B0 BD010000 */ cache 0x01, 0x0($t0) # handwritten instruction -/* 3CCB4 800618B4 0109082B */ sltu $at, $t0, $t1 -/* 3CCB8 800618B8 1420FFFD */ bnez $at, .LJP_800618B0 -/* 3CCBC 800618BC 25080010 */ addiu $t0, $t0, (0x80000010 & 0xFFFF) -/* 3CCC0 800618C0 03E00008 */ jr $ra -/* 3CCC4 800618C4 00000000 */ nop -/* 3CCC8 800618C8 00000000 */ nop -/* 3CCCC 800618CC 00000000 */ nop diff --git a/ver/jp/asm/os/padding.s b/ver/jp/asm/os/padding.s deleted file mode 100644 index a343705499..0000000000 --- a/ver/jp/asm/os/padding.s +++ /dev/null @@ -1,16 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel func_JP_8006CB90 -/* 47F90 8006CB90 00000000 */ nop -/* 47F94 8006CB94 00000000 */ nop -/* 47F98 8006CB98 00000000 */ nop -/* 47F9C 8006CB9C 00000000 */ nop diff --git a/ver/jp/asm/os/parameters.s b/ver/jp/asm/os/parameters.s deleted file mode 100644 index 73d6bcc454..0000000000 --- a/ver/jp/asm/os/parameters.s +++ /dev/null @@ -1,37 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers - -.section .text, "ax" - -.globl leoBootID -leoBootID = 0x800001a0 - -.globl osTvType -osTvType = 0x80000300 - -.globl osRomType -osRomType = 0x80000304 - -.globl osRomBase -osRomBase = 0x80000308 - -.globl osResetType -osResetType = 0x8000030C - -.globl osCicId -osCicId = 0x80000310 - -.globl osVersion -osVersion = 0x80000314 - -.globl osMemSize -osMemSize = 0x80000318 - -.globl osAppNMIBuffer -osAppNMIBuffer = 0x8000031C - -.fill 0x60 diff --git a/ver/jp/asm/os/setfpccsr.s b/ver/jp/asm/os/setfpccsr.s deleted file mode 100644 index bf92b01561..0000000000 --- a/ver/jp/asm/os/setfpccsr.s +++ /dev/null @@ -1,16 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -glabel __osSetFpcCsr -/* 47A70 8006C670 4442F800 */ cfc1 $v0, $31 -/* 47A74 8006C674 44C4F800 */ ctc1 $a0, $31 -/* 47A78 8006C678 03E00008 */ jr $ra -/* 47A7C 8006C67C 00000000 */ nop diff --git a/ver/jp/asm/os/setsr.s b/ver/jp/asm/os/setsr.s deleted file mode 100644 index 694d3e0816..0000000000 --- a/ver/jp/asm/os/setsr.s +++ /dev/null @@ -1,17 +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 .text, "ax" - -/* Generated by spimdisasm 1.11.1 */ - -# Handwritten function -glabel __osSetSR -/* 47A80 8006C680 40846000 */ mtc0 $a0, $12 # handwritten instruction -/* 47A84 8006C684 00000000 */ nop -/* 47A88 8006C688 03E00008 */ jr $ra -/* 47A8C 8006C68C 00000000 */ nop diff --git a/ver/jp/splat.yaml b/ver/jp/splat.yaml index d153e7ec3d..56153f6110 100644 --- a/ver/jp/splat.yaml +++ b/ver/jp/splat.yaml @@ -26,6 +26,7 @@ options: undefined_syms_auto_path: ver/jp/undefined_syms_auto.txt symbol_name_format: JP_$VRAM symbol_name_format_no_rom: JP_$VRAM_$SEG + hasm_in_src_path: True asset_stack: - jp segments: @@ -37,14 +38,15 @@ segments: start: 0x0040 vram: 0xA4000040 subsegments: - - [0x0040, bin] + - [0x0040, hasm, boot/ipl3_boot] + - [0x0B70, bin, rspboot_font] - name: main type: code start: 0x1000 vram: 0x80025C00 subsegments: - - [auto, hasm, main.bss] - - [auto, hasm, entry_point] + - [auto, hasm, boot/entry_point] + - [auto, c, bss/main_pre_bss] - [auto, c, is_debug, -g -fforce-addr] - [auto, c, main_pre] - [auto, c, main] @@ -299,7 +301,9 @@ segments: - [auto, hasm, os/decode_yay0] - [auto, c, os/osFlash] - [0x4AC70, pm_effect_loads, effect_loads] + - [auto, c, bss/main_post_bss] - [auto, c, battle/battle] + - [auto, c, battle/battle_bss] - [0x4E580, bin, n_aspMain_text] - start: 0x4F1E0 type: .data @@ -338,7 +342,7 @@ segments: start: 0x75990 vram: 0x800dc4e0 subsegments: - - [auto, hasm, bss2] + - [auto, c, bss/engine1_pre_bss] - [auto, c, npc_collision] - [auto, c, 77480] - [auto, c, 7B440] @@ -348,12 +352,12 @@ segments: - [auto, c, inventory] - [auto, c, world/actions] # DUMMY ROM - [auto, c, world/partners] - - [auto, hasm, bss2_2] - [auto, c, global_hud_scripts] - [auto, c, 891b0_len_fb0] - [auto, c, 8a160_len_700] - [auto, c, 8a860_len_3f30] - [auto, c, draw_box] + - [auto, c, bss/engine1_post_bss] - start: 0x91B40 type: .data name: global_hud_scripts @@ -781,7 +785,7 @@ segments: start: 0xa9770 vram: 0x801148e0 subsegments: - - [auto, hasm, bss3] + - [auto, c, bss/engine2_pre_bss] - [auto, c, entity] - [auto, c, game_states] - [auto, c, model] @@ -804,6 +808,7 @@ segments: - [auto, c, sprite_shading] - [auto, c, audio/sfx] - [auto, c, audio/e0b30_len_b80] + - [auto, c, bss/engine2_post_bss] - start: 0xE6620 type: .data name: screen_overlays diff --git a/ver/jp/undefined_syms.txt b/ver/jp/undefined_syms.txt index 13aab97e48..7025b55d8f 100644 --- a/ver/jp/undefined_syms.txt +++ b/ver/jp/undefined_syms.txt @@ -1,11 +1,25 @@ +// boot +D_A0000000 = 0xA0000000; +D_A4000000 = 0xA4000000; +D_A4000768 = 0xA4000768; +D_A4001000 = 0xA4001000; D_A4040010 = 0xA4040010; D_A4300000 = 0xA4300000; +D_A4300004 = 0xA4300004; D_A4300008 = 0xA4300008; D_A430000C = 0xA430000C; D_A4400010 = 0xA4400010; D_A450000C = 0xA450000C; +D_A4600004 = 0xA4600004; +D_A460000C = 0xA460000C; D_A4600010 = 0xA4600010; +D_A4700000 = 0xA4700000; +D_A4700010 = 0xA4700010; D_A4800018 = 0xA4800018; +D_A6000000 = 0xA6000000; +D_B0000000 = 0xB0000000; +D_B0000008 = 0xB0000008; +D_B0000010 = 0xB0000010; filemenu_ROM_START = 0x0016B550; filemenu_ROM_END = 0x01749F0; @@ -973,7 +987,6 @@ EVS_WorldTwink_UseAbility = 0x802BD228; EVS_WorldTwink_PutAway = 0x802BD244; heap_spriteHead = 0x8034F800; -gCurrentModelTreeNodeInfo = 0x8009A5D4; sprite_shading_profiles_ROM_START = 0x0031DF90; Entity_UltraBlockContent_Render = 0x0A000800; entity_model_SimpleSpring_gfx_ROM_END = 0x00E72BD0; diff --git a/ver/pal/asm/bss2.s b/ver/pal/asm/bss2.s deleted file mode 100644 index fd1019a927..0000000000 --- a/ver/pal/asm/bss2.s +++ /dev/null @@ -1,114 +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 - -#ifndef SHIFT - -.section .bss - -dlabel PulseStoneNotificationCallback -.space 4 - -dlabel D_8010C924 -.space 4 - -dlabel D_8010C928 -.space 4 - -dlabel D_8010C92C -.space 4 - -dlabel wPartnerNpc -.space 4 - -dlabel TweesterTouchingPlayer -.space 4 - -dlabel PlayerNormalYaw -.space 4 - -dlabel ISpyNotificationCallback -.space 4 - -dlabel TalkNotificationCallback -.space 4 - -dlabel gSpinHistoryBufferPos -.space 4 - -dlabel D_8010C948 -.space 4 - -dlabel NpcHitQueryBehindRightY -.space 4 - -dlabel D_8010C950 -.space 4 - -dlabel TweesterTouchingPartner -.space 4 - -dlabel InteractNotificationCallback -.space 4 - -dlabel PrevPlayerDirection -.space 4 - -dlabel JumpedOnSwitchX -.space 4 - -dlabel D_8010C964 -.space 4 - -dlabel NpcHitQueryBehindCollider -.space 4 - -dlabel PeachDisguiseNpcIndex -.space 4 - -dlabel NpcHitQueryAheadY -.space 4 - -dlabel NpcHitQueryBehindLeftY -.space 4 - -dlabel NpcHitQueryColliderID -.space 4 - -dlabel JumpedOnSwitchZ -.space 4 - -dlabel PlayerRunStateTime -.space 4 - -dlabel D_8010C984 -.space 4 - -dlabel D_8010C988 -.space 4 - -dlabel NpcHitQueryAheadCollider -.space 4 - -dlabel PlayerNormalPitch -.space 4 - -dlabel D_8010C994 -.space 0x0000000c - -dlabel PlayerYInterpUpdateDelay -.space 4 - -dlabel D_8010C9A4 -.space 0x0000000c - -dlabel D_8010C9B0 -.space 4 - -dlabel D_8010C9B4 -.space 0x0000000c - -#endif diff --git a/ver/pal/asm/bss2_2.s b/ver/pal/asm/bss2_2.s deleted file mode 100644 index dd58463ae8..0000000000 --- a/ver/pal/asm/bss2_2.s +++ /dev/null @@ -1,225 +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 - -#ifndef SHIFT - -.section .bss - -dlabel wPartnerTetherDistance -.space 4 - -dlabel D_8010CFC4 -.space 4 - -dlabel wPartnerFollowState -.space 2 - -dlabel D_8010CFCA -.space 2 - -dlabel D_8010CFCC -.space 2 - -dlabel D_8010CFCE -.space 2 - -dlabel wPartnerNpcIndex -.space 4 - -dlabel wPartnerCurrentScript -.space 4 - -dlabel wCurrentPartnerId -.space 4 - -dlabel wPartnerCurrentScriptID -.space 4 - -dlabel D_8010CFE0 -.space 4 - -dlabel NextPartnerID -.space 4 - -dlabel NextPartnerCommand -.space 4 - -dlabel wPartner -.space 4 - -dlabel D_8010CFF0 -.space 4 - -dlabel D_8010CFF4 -.space 4 - -dlabel D_8010CFF8 -.space 8 - -dlabel D_8010D000 -.space 0x63C - -dlabel D_8010D63C -.space 0x4 - -dlabel gPopupState -.space 4 - -dlabel D_8010D644 -.space 4 - -dlabel PopupMenu_SelectedIndex -.space 4 - -dlabel PopupMenu_PrevSelectedIndex -.space 4 - -dlabel PopupMenu_Alpha -.space 4 - -dlabel PopupMenu_FirstDisplayIndex -.space 1 - -dlabel PopupMenu_LastDisplayIndex -.space 1 - -dlabel PopupMenu_DisplayedEntryCount -.space 2 - -dlabel D_8010D658 -.space 2 - -dlabel D_8010D65A -.space 2 - -dlabel PopupMenu_EmptybarHEID -.space 4 - -dlabel PopupMenu_TitleIconHEID -.space 4 - -dlabel PopupMenu_TimesHEID -.space 4 - -dlabel PopupMenu_PartnerLevelHEID -.space 4 - -dlabel PopupMenu_CursorHEID -.space 4 - -dlabel PopupMenu_UpArrowHEID -.space 4 - -dlabel PopupMenu_DownArrowHEID -.space 4 - -dlabel PopupMenu_EntryIconHEID -.space 4 - -dlabel D_8010D67C -.space 2 - -dlabel D_8010D67E -.space 2 - -dlabel D_8010D680 -.space 2 - -dlabel D_8010D682 -.space 2 - -dlabel D_8010D684 -.space 2 - -dlabel D_8010D686 -.space 2 - -dlabel PopupMenu_StarPieceCounterPosX -.space 2 - -dlabel PopupMenu_StarPieceCounterPosY -.space 2 - -dlabel D_8010D68C -.space 2 - -dlabel PopupNotBattle -.space 1 - -dlabel PopupMenu_MaxDisplayableEntryCount -.space 1 - -dlabel D_8010D690 -.space 1 - -dlabel D_8010D691 -.space 1 - -dlabel D_8010D692 -.space 1 - -dlabel D_8010D693 -.space 1 - -dlabel gPopupWorker -.space 4 - -dlabel PopupNotDipping -.space 1 - -dlabel PopupDipMode -.space 1 - -dlabel PopupMenu_WasStatusBarIgnoringChanges -.space 2 - -dlabel gPopupMenu -.space 4 - -dlabel D_8010D6A0 -.space 4 - -dlabel D_8010D6A4 -.space 4 - -dlabel D_8010D6A8 -.space 0x8 - -dlabel gBoxQuadBuffer -.space 0x1500 - -dlabel gPartnerStatus -.space 0x360 - -dlabel gSpinHistoryPosY -.space 0x18 - -dlabel gSpinHistoryPosX -.space 0x18 - -dlabel gSpinHistoryPosZ -.space 0x18 - -dlabel gStatusBar -.space 0x70 - -dlabel gPlayerStatus -.space 0x288 - -dlabel gPlayerSpinState -.space 0x34 - -dlabel D_8010F284 -.space 0xC - -dlabel gPlayerData -.space 0x428 - -dlabel gSpinHistoryPosAngle -.space 0x10 - -#endif diff --git a/ver/pal/asm/bss3.s b/ver/pal/asm/bss3.s deleted file mode 100644 index 00220d7371..0000000000 --- a/ver/pal/asm/bss3.s +++ /dev/null @@ -1,688 +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 - -#ifndef SHIFT - -.section .bss - -dlabel gAuxSpriteShadingProfile -.space 4 - -dlabel gHudElementsNumber -.space 4 - -dlabel gCurrentCustomModelGfxBuildersPtr -.space 4 - -dlabel D_801512BC -.space 4 - -dlabel entity_numEntities -.space 4 - -dlabel gEntityHeapBase -.space 4 - -dlabel gHudElementCacheTableRaster -.space 4 - -dlabel gCurrentModels -.space 4 - -dlabel gHudElementCacheTablePalette -.space 4 - -dlabel gAnimCount -.space 4 - -dlabel gMsgBGScrollAmtX -.space 4 - -dlabel D_801512DC -.space 4 - -dlabel gCurrentTransformGroups -.space 4 - -dlabel gMsgGlobalWaveCounter -.space 4 - -dlabel gCurrentCustomModelGfxPtr -.space 4 - -dlabel gLastCreatedEntityIndex -.space 4 - -dlabel gBackgroundTintModePtr -.space 4 - -dlabel gMsgVarImages -.space 4 - -dlabel ItemEntitiesCreated -.space 4 - -dlabel gCurrentModelTreeRoot -.space 4 - -dlabel gEntityHeapBottom -.space 4 - -dlabel D_80151304 -.space 4 - -dlabel gCurrentRoomDoorSounds -.space 4 - -dlabel gMsgBGScrollAmtY -.space 2 - -dlabel D_8015130E -.space 2 - -dlabel gEntityHideMode -.space 4 - -dlabel gHudElementCacheBuffer -.space 4 - -dlabel gEntityModelCount -.space 4 - -dlabel D_8015131C -.space 4 - -dlabel D_80151320 -.space 4 - -dlabel entity_numShadows -.space 4 - -dlabel gSpriteShadingProfile -.space 4 - -dlabel isAreaSpecificEntityDataLoaded -.space 4 - -dlabel entity_updateCounter -.space 4 - -dlabel gTriggerCount -.space 4 - -dlabel D_80151338 -.space 4 - -dlabel gHudElementCacheSize -.space 4 - -dlabel gCurrentDoorSounds -.space 4 - -dlabel D_80151344 -.space 4 - -dlabel D_80151348 -.space 0x00000038 - 0x10 # TODO: find offset - -dlabel gWorldEntityList -.space 0x00000078 - -dlabel gBattleEntityList -.space 0x00000078 - -dlabel gCurrentEntityListPtr -.space 4 - -dlabel D_80151474 -.space 4 - -dlabel gWorldShadowList -.space 0x000000f0 - -dlabel gBattleShadowList -.space 0x000000f0 - -dlabel gCurrentShadowListPtr -.space 4 - -dlabel wEntityDataLoadedSize -.space 4 - -dlabel bEntityDataLoadedSize -.space 4 - -dlabel D_80151664 -.space 4 - -dlabel wEntityBlueprint -.space 0x00000078 - -.space 8 - -dlabel bEntityBlueprint -.space 0x00000014 - -dlabel D_801516FC -.space 4 - -dlabel gMainGameMode -.space 0x00000040 - -dlabel gCurrentTextureHeader -.space 0x00000030 - -dlabel wModelList -.space 0x00000400 - -dlabel bModelList -.space 0x00000400 - -dlabel wTransformGroups -.space 0x00000010 - -dlabel bTransformGroups -.space 0x00000010 - -dlabel wCustomModelGfx -.space 0x00000080 - -dlabel bCustomModelGfx -.space 0x00000080 - -dlabel wCustomModelGfxBuilders -.space 0x00000080 - -dlabel bCustomModelGfxBuilders -.space 0x00000080 - -dlabel wModelLocalVtxBuffers -.space 0x00000040 - -dlabel bModelLocalVtxBuffers -.space 0x00000040 - -dlabel gCurrentModelLocalVtxBuffers -.space 4 - -dlabel wModelTreeRoot -.space 4 - -dlabel bModelTreeRoot -.space 4 - -dlabel D_8015221C -.space 4 - -dlabel wModelTreeNodeInfo -.space 0x00000800 - -dlabel bModelTreeNodeInfo -.space 0x00000800 - -dlabel wBackgroundTintMode -.space 1 - -dlabel bBackgroundTintMode -.space 1 - -dlabel D_80153222 -.space 1 - -dlabel D_80153223 -.space 1 - -dlabel TreeIterPos -.space 4 - -dlabel wFogSettings -.space 0x00000020 - -dlabel bFogSettings -.space 0x0000001c - -dlabel gFogSettings -.space 4 - -dlabel texPannerMainU -.space 0x00000040 - -dlabel texPannerMainV -.space 0x00000040 - -dlabel texPannerAuxU -.space 0x00000040 - -dlabel texPannerAuxV -.space 0x00000040 - -dlabel TextureHeapPos -.space 4 - -dlabel mtg_IterIdx -.space 2 - -dlabel mtg_SearchModelID -.space 2 - -dlabel mtg_FoundModelNode -.space 4 - -dlabel mtg_MinChild -.space 2 - -dlabel mtg_MaxChild -.space 2 - -dlabel D_80153378 -.space 8 - -dlabel DepthCopyBuffer -.space 0x00000020 - -dlabel RenderTaskLists -.space 0x0000000c - -dlabel RenderTaskListIdx -.space 4 - -dlabel RenderTaskCount -.space 0x00000010 - -dlabel D_801533C0 -.space 0x00000300 - -dlabel D_801536C0 -.space 0x00000300 - -dlabel D_801539C0 -.space 0x00000040 - -dlabel D_80153A00 -.space 0x00000040 - -dlabel gCurrentAnimMeshListPtr -.space 4 - -dlabel gAnimModelFogEnabled -.space 4 - -dlabel gAnimModelFogR -.space 4 - -dlabel gAnimModelFogG -.space 4 - -dlabel gAnimModelFogB -.space 4 - -dlabel gAnimModelFogA -.space 4 - -dlabel gAnimModelFogStart -.space 4 - -dlabel gAnimModelFogEnd -.space 4 - -dlabel gAnimVtxSegment -.space 4 - -dlabel D_80153A64 -.space 4 - -dlabel gAnimRotMtx -.space 0x00000040 - -dlabel gAnimScaleMtx -.space 0x00000040 - -dlabel gAnimTranslateMtx -.space 0x00000040 - -dlabel gAnimRotScaleMtx -.space 0x00000040 - -dlabel gAnimTreeRoot -.space 8 - -dlabel gWorldEntityModelList -.space 0x00000400 - -dlabel gBattleEntityModelList -.space 0x00000400 - -dlabel gCurrentEntityModelList -.space 4 - -dlabel D_80154374 -.space 4 - -dlabel entity_fog_enabled -.space 4 - -dlabel entity_fog_red -.space 4 - -dlabel entity_fog_green -.space 4 - -dlabel entity_fog_blue -.space 4 - -dlabel entity_fog_alpha -.space 4 - -dlabel entity_fog_dist_min -.space 4 - -dlabel entity_fog_dist_max -.space 4 - -dlabel D_80154394 -.space 0x0000000c - -dlabel gWorldWorkerList -.space 0x00000040 - -dlabel gBattleWorkerList -.space 0x00000040 - -dlabel gCurrentWorkerListPtr -.space 4 - -dlabel D_80154424 -.space 0x0000000c - -dlabel gMessageBuffers -.space 0x00000800 - -dlabel gMessagePrinters -.space 0x00001008 - -dlabel gMessageMsgVars -.space 0x00000060 - -dlabel D_80155C98 -.space 8 - -dlabel gMessageWindowProjMatrix -.space 0x00000080 - -dlabel D_80155D20 -.space 4 - -dlabel D_8015DD24 -.space 0x00000050 - -dlabel msg_drawState -.space 4 - -dlabel D_8015DD78 -.space 8 - -dlabel UnusedItemPhysicsScriptID -.space 4 - -dlabel ItemEntityAlternatingSpawn -.space 4 - -dlabel ItemEntityRenderGroup -.space 4 - -dlabel CoinSparkleCenterX -.space 2 - -dlabel CoinSparkleCenterY -.space 2 - -dlabel CoinSparkleCenterZ -.space 2 - -dlabel pad_ItemEntity -.space 0x000000E - -dlabel WorldItemEntities -.space 0x00000400 - -dlabel BattleItemEntities -.space 0x00000400 - -dlabel gCurrentItemEntities -.space 4 - -dlabel isPickingUpItem -.space 2 - -dlabel ItemSpawnWithinPlayerPickupDelay -.space 2 - -dlabel D_801565A8 -.space 4 - -dlabel D_801565AC -.space 4 - -dlabel ItemPickupMenu -.space 0x00000330 -.space 0x14 - -dlabel ItemPickupIconID -.space 4 - -dlabel ItemPickupStateDelay -.space 4 - -dlabel ThrowAwayMenuIdx -.space 4 - -dlabel ThrowAwayItemID -.space 4 - -dlabel ItemPickupGotOutline -.space 4 - -dlabel GotItemTutorialPrinter -.space 4 - -dlabel GotItemTutorialClosed -.space 4 - -dlabel D_801568FC -# .space 4 - -dlabel screen_overlay_frontType -.space 4 - -dlabel screen_overlay_frontZoom -.space 4 - -dlabel screen_overlay_backType -.space 4 - -dlabel screen_overlay_backZoom -.space 4 - -dlabel D_80156910 -.space 0x00000010 - -dlabel ImgFXCurrentTexture -.space 0x00000028 - -dlabel ImgFXVtxBuffers -.space 8 - -dlabel imgfx_vtxBuf -.space 4 - -dlabel ImgFXInstances -.space 4 - -dlabel D_80156958 -.space 8 - -dlabel D_80156960 -.space 8 - -dlabel D_80156968 -.space 8 - -dlabel D_80156970 -.space 0x00000010 - -dlabel ImgFXAnimHeaders -.space 0x000005a0 - -dlabel ImgFXDataCache -.space 0x00000040 - -dlabel gHudElementsWorld -.space 0x00000500 - -dlabel gHudElementsBattle -.space 0x00000500 - -dlabel gHudElements -.space 4 - -dlabel gHudElementCacheBufferWorld -.space 4 - -dlabel gHudElementCacheSizeWorld -.space 4 - -dlabel D_8015796C -.space 4 - -dlabel gHudElementCacheTableRasterWorld -.space 0x00000600 - -dlabel gHudElementCacheTablePaletteWorld -.space 0x00000600 - -dlabel gHudElementCacheBufferBattle -.space 4 - -dlabel gHudElementCacheSizeBattle -.space 4 - -dlabel D_80158578 -.space 8 - -dlabel gHudElementCacheTableRasterBattle -.space 0x00000600 - -dlabel gHudElementCacheTablePaletteBattle -.space 0x00000600 - -dlabel D_80159180 -.space 0x00000010 - -dlabel wTriggerList -.space 0x00000100 - -dlabel bTriggerList -.space 0x00000100 - -dlabel gCurrentTriggerListPtr -.space 4 - -dlabel D_80159394 -.space 0x0000000c - -dlabel gBackgroundPalette -.space 0x00000200 - -dlabel gBackroundLastScrollValue -.space 0x00000020 - 0x10 - -dlabel wSpriteShadingProfile -.space 0x000000b0 - -dlabel bSpriteShadingProfile -.space 0x000000b0 - -dlabel wSpriteShadingProfileAux -.space 0x000000b0 - -dlabel bSpriteShadingProfileAux -.space 0x000000b0 - -dlabel SpriteShadingPalette -.space 0x00000020 - -dlabel wEnvSounds -.space 0x00000118 - -dlabel bEnvSounds -.space 0x00000118 - -dlabel gCurrentEnvSounds -.space 4 - -dlabel SfxReverbMode -.space 4 - -dlabel D_80159AD8 -.space 8 - -dlabel MusicDefaultVolume -.space 2 - -dlabel MusicTargetVolume -.space 2 - -dlabel MusicMaxVolume -.space 2 - -dlabel MusicCurrentVolume -.space 2 - -dlabel D_80159AE8 -.space 8 - -dlabel gMusicSettings -.space 0x00000060 - -dlabel D_80159B50 -.space 0x00000200 - 0x14 - -.space 4 -.space 0x10 -dlabel gWindows -.space 0x00000800 - -dlabel gCollisionStatus -.space 0x00000028 - -dlabel gCurrentHiddenPanels -.space 0x10 - -.space 8 - -dlabel TextureHandles -.space 0x00002200 - -dlabel ScreenOverlays -.space 0x00000030 - -dlabel AmbientSoundData -.space 0x00000010 - -dlabel CreateEntityVarArgBuffer -.space 0x00000010 - -dlabel D_8015C7E0 -.space 0x20 - -dlabel D_8015C800 -.space 0x7800 - -dlabel D_80164000 -.space 0x32C60 - -#endif diff --git a/ver/pal/splat.yaml b/ver/pal/splat.yaml index 7c67695767..b7f312edaa 100644 --- a/ver/pal/splat.yaml +++ b/ver/pal/splat.yaml @@ -26,6 +26,7 @@ options: undefined_syms_auto_path: ver/us/undefined_syms_auto.txt symbol_name_format: PAL_$VRAM symbol_name_format_no_rom: PAL_$VRAM_$SEG + hasm_in_src_path: True asset_stack: - pal segments: @@ -39,7 +40,7 @@ segments: start: 0x71D80 vram: 0x800D8C70 subsegments: - - [auto, hasm, bss2] + - [auto, c, bss/engine1_pre_bss] - [auto, c, npc_collision] - [auto, c, 77480] - [auto, c, 7B440] @@ -49,12 +50,12 @@ segments: - [auto, c, inventory] - [auto, c, world/actions] # DUMMY ROM - [auto, c, world/partners] - - [auto, hasm, bss2_2] - [auto, c, global_hud_scripts] - [auto, c, 891b0_len_fb0] - [auto, c, 8a160_len_700] - [auto, c, 8a860_len_3f30] - [auto, c, draw_box] + - [auto, c, bss/engine1_post_bss] - start: 0x8DA40 type: .data name: global_hud_scripts @@ -544,7 +545,7 @@ segments: start: 0xA4520 vram: 0x8010E1D0 subsegments: - - [auto, hasm, bss3] + - [auto, c, bss/engine2_pre_bss] - [auto, c, entity] - [auto, c, game_states] - [auto, c, model] @@ -567,6 +568,7 @@ segments: - [auto, c, sprite_shading] - [auto, c, audio/sfx] - [auto, c, audio/e0b30_len_b80] + - [auto, c, bss/engine2_post_bss] - start: 0xE1610 type: .data name: screen_overlays diff --git a/ver/us/asm/bss.s b/ver/us/asm/bss.s deleted file mode 100644 index 6f2a7250b1..0000000000 --- a/ver/us/asm/bss.s +++ /dev/null @@ -1,974 +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 - -#ifndef SHIFT - -.section .bss - -dlabel nuScPreNMIFlag -.space 4 - -dlabel D_8009A5B4 -.space 4 - -dlabel D_8009A5B8 -.space 4 - -dlabel D_8009A5BC -.space 4 - -dlabel gSoundGlobals -.space 4 - -dlabel D_8009A5C4 -.space 4 - -dlabel __osBaseCounter -.space 4 - -dlabel gBGMPlayerC -.space 4 - -dlabel gEncounterSubState -.space 4 - -dlabel CurrentSefCmdHandler -.space 4 - -dlabel timeFreezeMode -.space 4 - -dlabel nuGfxZBuffer -.space 4 - -dlabel nuContDataLockKey -.space 4 - -dlabel __osViIntrCount -.space 4 - -dlabel BeginSoundUpdateCallback -.space 4 - -dlabel D_8009A5EC -.space 4 - -dlabel nuGfxCfbCounter -.space 4 - -dlabel gCurrentModelTreeNodeInfo -.space 4 - -dlabel nuGfxDisplay -.space 4 - -dlabel gBGMPlayerB -.space 4 - -dlabel gEncounterState -.space 4 - -dlabel gNpcCount -.space 2 - -dlabel __osMaxControllers -.space 2 - -dlabel __osCurrentTime -.space 4 - -dlabel D_8009A60C -.space 4 - -dlabel nuGfxUcode -.space 4 - -dlabel nuContNum -.space 4 - -dlabel nuGfxTaskSpool -.space 4 - -dlabel __osContLastCmd -.space 4 - -dlabel __osEepromTimerMsg -.space 4 - -dlabel D_8009A624 -.space 4 - -dlabel gAuAmbienceManager -.space 4 - -dlabel __osTimerCounter -.space 4 - -dlabel nuIdleFunc -.space 4 - -dlabel gCurrentCamID -.space 4 - -dlabel nuPiCartHandle -.space 4 - -dlabel D_8009A63C -.space 4 - -dlabel gSoundManager -.space 4 - -dlabel D_8009A644 -.space 8 - -dlabel nuGfxCfb_ptr -.space 4 - -dlabel gOverrideFlags -.space 4 - -dlabel HasPreBattleSongPushed -.space 4 - -dlabel nuGfxCfb -.space 4 - -dlabel D_8009A65C -.space 4 - -dlabel __osFinalrom -.space 4 - -dlabel gBGMPlayerA -.space 4 - -dlabel gFirstStrikeMessagePos -.space 4 - -dlabel gMainGfxPos -.space 4 - -dlabel D_8009A670 -.space 4 - -dlabel gDisplayContext -.space 4 - -dlabel D_8009A678 -.space 4 - -dlabel D_8009A67C -.space 4 - -dlabel ResetFrameBufferArray -.space 4 - -dlabel D_8009A684 -.space 0x0000000c - -dlabel SoftResetDelay -.space 4 - -dlabel D_8009A694 -.space 0x0000000c - -dlabel D_8009A6A0 -.space 2 - -dlabel D_8009A6A2 -.space 2 - -dlabel D_8009A6A4 -.space 2 - -dlabel D_8009A6A6 -.space 2 - -dlabel D_8009A6A8 -.space 8 - -dlabel FetchSaveBuffer -.space 0x00001380 - -dlabel LogicalSaveInfo -.space 0x00000020 - -dlabel PhysicalSaveInfo -.space 0x00000030 - -dlabel NextAvailablePhysicalSave -.space 4 - -dlabel D_8009BA84 -.space 0x0000000c - -dlabel gCurtainScale -.space 4 - -dlabel gCurtainScaleGoal -.space 4 - -dlabel gCurtainFade -.space 4 - -dlabel gCurtainFadeGoal -.space 4 - -dlabel gCurtainDrawCallback -.space 4 - -dlabel D_8009BAA4 -.space 4 - -dlabel D_8009BAA8 -.space 0x00000080 - -dlabel D_8009BA28 -.space 8 - -dlabel gCrashScreen -.space 0x000009e0 - -dlabel nuGfxTask_ptr -.space 4 - -dlabel taskDoneMsg -.space 2 - -dlabel swapBufMsg -.space 2 - -dlabel GfxTaskMgrThread -.space 0x000001b0 - -.align 4 -dlabel GfxTaskMgrStack -.space 0x00002000 - -dlabel D_8009E6D0 -.space 0x00000020 - -dlabel nuSiMesgBuf -.space 0x00000020 - -dlabel siMgrThread -.space 0x1b0 - -dlabel siMgrStack -.space 0x2000 - -dlabel gCurrentCamConfiguration -.space 0x0000001c - -dlabel D_800A08DC -.space 4 - -dlabel D_800A08E0 -.space 4 - -dlabel D_800A08E4 -.space 4 - -dlabel D_800A08E8 -.space 4 - -dlabel D_800A08EC -.space 4 - -dlabel CurGameMode -.space 4 - -dlabel D_800A08F4 -.space 0x0000000c - -dlabel D_800A0900 -.space 4 - -dlabel D_800A0904 -.space 4 - -dlabel D_800A0908 -.space 4 - -dlabel D_800A090C -.space 4 - -dlabel gLogosImages -.space 4 - -dlabel gLogosImage3 -.space 4 - -dlabel gLogosImage1 -.space 4 - -dlabel gLogosImage2 -.space 4 - -dlabel StepPauseDelay -.space 1 - -dlabel StepPauseState -.space 1 - -dlabel StepPauseAlpha -.space 2 - -dlabel SavedReverbMode -.space 4 - -dlabel D_800A0928 -.space 8 - -dlabel D_800A0930 -.space 1 - -dlabel D_800A0931 -.space 1 - -dlabel D_800A0932 -.space 2 - -dlabel D_800A0934 -.space 0x0000000c - -dlabel gMapTransitionAlpha -.space 2 - -dlabel gMapTransitionFadeRate -.space 2 - -dlabel gMapTransitionState -.space 2 - -dlabel gMapTransitionStateTime -.space 2 - -dlabel gLoadedFromFileSelect -.space 4 - -dlabel D_800A094C -.space 4 - -dlabel IntroEnableDrawFrameDelay -.space 4 - -dlabel IntroOverlayAlpha -.space 2 - -dlabel IntroFrontFadeAlpha -.space 2 - -dlabel IntroOverlayDelta -.space 2 - -dlabel IntroFadeColorR -.space 2 - -dlabel IntroFadeColorG -.space 2 - -dlabel IntroFadeColorB -.space 2 - -dlabel IntroOverlayType -.space 0x00000004 - -dlabel D_800A0964 -.space 4 - -dlabel D_800A0968 -.space 8 - -dlabel TitleScreen_AppearDelay -.space 4 - -dlabel TitleScreen_ImgList -.space 4 - -dlabel TitleScreen_ImgList_Logo -.space 4 - -dlabel TitleScreen_ImgList_Copyright -.space 4 - -dlabel TitleScreen_ImgList_PressStart -.space 4 - -dlabel D_800A0984 -.space 4 - -dlabel TitleScreen_TimeLeft -.space 4 - -dlabel D_800A098C -.space 4 - -dlabel gWorldNpcList -.space 0x00000100 - -dlabel gBattleNpcList -.space 0x00000100 - -dlabel gCurrentNpcListPtr -.space 4 - -dlabel gNpcPlayerCollisionsEnabled -.space 4 - -dlabel D_800A0B98 -.space 8 - -dlabel D_800A0BA0 -.space 4 - -dlabel D_800A0BA4 -.space 4 - -dlabel WorldMerleeOrbEffect -.space 4 - -dlabel WorldMerleeWaveEffect -.space 4 - -dlabel D_800A0BB0 -.space 4 - -dlabel D_800A0BB4 -.space 4 - -dlabel D_800A0BB8 -.space 4 - -dlabel D_800A0BBC -.space 4 - -dlabel D_800A0BC0 -.space 0x00000380 - -dlabel D_800A0F40 -.space 4 - -dlabel D_800A0F44 -.space 4 - -dlabel D_800A0F48 -.space 8 - -dlabel AuInitialGlobalVolume -.space 4 - -dlabel D_800A0F54 -.space 4 - -dlabel nuAuMgrThread -.space 0x000005b8 - -dlabel AuStack -.space 0x00002000 - -dlabel AlCmdListBuffers -.space 0x0000000c - -dlabel D_800A351C -.space 4 - -dlabel nuAuTasks -.space 0x00000108 - -dlabel D_800A3628 -.space 0x0000000c - -dlabel AlFrameSize -.space 4 - -dlabel AlMinFrameSize -.space 4 - -dlabel D_800A363C -.space 4 - -dlabel nuAuDmaMesgQ -.space 0x18 - -dlabel nuAuDmaMesgBuf -.space 0x000000c8 - -dlabel nuAuDmaIOMesgBuf -.space 0x000004b0 - -dlabel nuAuDmaState -.space 0x0000000c - -.space 4 - -dlabel nuAuDmaBufList -.space 0x000003e8 - -dlabel D_800A3FC8 -.space 8 - -dlabel CurrentSeqCmdHandler -.space 4 - -dlabel D_800A3FD4 -.space 0x0000000c - -dlabel AuDelayBufferMain -.space 4 - -dlabel AuDelayBufferAux -.space 4 - -dlabel AuDelayCounter -.space 4 - -dlabel AuDelayedVoiceGroup -.space 2 - -dlabel AuDelayedChannel -.space 2 - -dlabel AuDelayCount -.space 4 - -dlabel D_800A3FF4 -.space 0x0000000c - -dlabel gEffectGraphicsData -.space 0x000001E0 - -dlabel gMapConfig -.space 4 - -dlabel D_800A41E4 -.space 4 - -dlabel gMapSettings -.space 0x40 - -.space 8 - -dlabel gCollisionRayStartX -.space 4 - -dlabel gCollisionRayStartY -.space 4 - -dlabel gCollisionRayStartZ -.space 4 - -dlabel gCollisionRayDirX -.space 4 - -dlabel gCollisionRayDirY -.space 4 - -dlabel gCollisionRayDirZ -.space 4 - -dlabel gCollisionPointX -.space 4 - -dlabel gCollisionPointY -.space 4 - -dlabel gCollisionPointZ -.space 4 - -dlabel gCollisionRayLength -.space 4 - -dlabel gCollisionNormalX -.space 4 - -dlabel gCollisionNormalY -.space 4 - -dlabel gCollisionNormalZ -.space 4 - -dlabel gCollisionDataBackup -.space 4 - -dlabel gCollisionDataZoneBackup -.space 4 - -dlabel D_800A426C -.space 4 - -dlabel IdleThread -.space 0x000001b0 - -dlabel MainThread -.space 0x000001b0 - -dlabel IdleStack -.space 0x00002000 - -dlabel nuScStack -.space 0x00002000 - -dlabel nuScAudioStack -.space 0x00002000 - -dlabel nuScGraphicsStack -.space 0x00002000 - -dlabel D_800AC5D0 -.space 4 - -dlabel D_800AC5D4 -.space 0x00000014 - -dlabel D_800AC5E8 -.space 0x000000c8 - -dlabel nuGfxMesgBuf -.space 0x00000020 - -dlabel GfxStack -.space 0x00002000 - -dlabel nuContWaitMesgBuf -.space 4 - -dlabel nuContDataMutexBuf -.space 4 - -dlabel D_800AC6D8 -.space 8 - -dlabel piThread -.space 0x1B0 - -dlabel piThreadStack -.space 0x1000 - -dlabel piEventQueue -.space 0x18 - -dlabel piEventBuf -.space 0x8 - -dlabel piAccessBuf -.space 0x10 - -dlabel tmp_task -.space 0x00000040 - -dlabel siAccessBuf -.space 4 - -dlabel D_800AF904 -.space 0x0000000c - -dlabel retrace -.space 4 - -dlabel D_800AF914 -.space 4 - -dlabel viThread -.space 0x1B8 - -dlabel viThreadStack -.space 0x1000 - -dlabel viEventQueue -.space 0x18 - -dlabel viEventBuf -.space 0x18 - -dlabel viRetraceMsg -.space 0x18 - -dlabel viCounterMsg -.space 0x18 - -dlabel __MotorDataBuf -.space 0x100 - -dlabel __osFlashID -.space 0x10 - -dlabel __osFlashMsg -.space 0x18 - -dlabel __osFlashMessageQ -.space 0x18 - -dlabel __osFlashHandler -.space 0x74 - -dlabel __osFlashMsgBuf -.space 4 - -dlabel __osFlashVersion -.space 4 - -dlabel D_800B0CEC -.space 4 - -dlabel wMapTexName -.space 0x18 - -dlabel __osThreadSave -.space 0x000001B0 - -dlabel nuContWaitMesgQ -.space 0x18 - -dlabel __osContPifRam -.space 0x40 - -dlabel gCurrentEncounter -.space 0x00000bf8 - -dlabel __Dom2SpeedParam -.space 4 - -dlabel D_800B1B0C -.space 1 - -dlabel D_800B1B0D -.space 1 - -dlabel D_800B1B0E -.space 1 - -dlabel D_800B1B0F -.space 1 - -dlabel D_800B1B10 -.space 4 - -dlabel D_800B1B14 -.space 0x00000068 - -dlabel nuContStatus -.space 0x00000014 - -dlabel D_800B1B90 -.space 0x000001b0 - -dlabel nuContRmbCtl -.space 0x00000028 - -dlabel nuContData -.space 0x00000018 - -dlabel gCameras -.space 0x00001560 - -dlabel D_800B32E0 -.space 0x800 - -dlabel D_800B3AE0 -.space 0x800 - -dlabel gCollisionData -.space 0x10 - -dlabel nuGfxMesgQ -.space 0x18 - -dlabel __CartRomHandle -.space 4 - -dlabel D_800B430C -.space 1 - -dlabel D_800B430D -.space 1 - -dlabel D_800B430E -.space 1 - -dlabel D_800B430F -.space 1 - -dlabel D_800B4310 -.space 1 - -dlabel D_800B4311 -.space 3 - -dlabel D_800B4314 -.space 4 - -dlabel D_800B4318 -.space 4 - -dlabel D_800B431C -.space 0x00000064 - -dlabel __osPiAccessQueue -.space 0x18 - -dlabel gEffectInstances -.space 0x00000180 - -dlabel __Dom1SpeedParam -.space 4 - -dlabel D_800B451C -.space 1 - -dlabel D_800B451D -.space 1 - -dlabel D_800B451E -.space 1 - -dlabel D_800B451F -.space 1 - -dlabel D_800B4520 -.space 0x00000070 - -dlabel nuBootStack -.space 0x00002000 - -dlabel nuMainStack -.space 0x00002000 - -dlabel nuYieldBuf -.space 0x00000c10 - -dlabel auSynDriver -.space 0x00000030 - -dlabel D_800B91D0 -.space 0x00020000 - -dlabel gZoneCollisionData -.space 0x00000010 - -dlabel wMapHitName -.space 0x00000018 - -dlabel nuSiMgrMesgQ -.space 0x00000018 - -dlabel __osBaseTimer -.space 0x20 - -dlabel wMapShapeName -.space 0x00000018 - -dlabel nuAuHeap -.space 0x00000030 - -dlabel nuGfxTask -.space 0x00000370 - -dlabel gSaveGlobals -.space 0x00000038 - -dlabel D_800D9620 -.space 0x00000048 - -dlabel wMapBgName -.space 0x00000018 - -dlabel __osPfsInodeCache -.space 0x00000100 - -dlabel rspbootUcodeBuffer -.space 0x00000100 - -dlabel D_800D9880 -.space 0x00000700 - -dlabel __osEventStateTab -.space 0x00000080 - -dlabel __osPfsPifRam -.space 0x00000040 - -dlabel D_800DA040 -.space 0x00000400 - -dlabel nusched -.space 0x00000680 - -dlabel __osEepromTimerQ -.space 0x00000018 - -dlabel nuContPfs -.space 0x000001a0 - -dlabel nuSiMesgQ -.space 0x00000018 - -dlabel D_800DAC90 -.space 0x00000018 - -dlabel __osSiAccessQueue -.space 0x00000018 - -dlabel gCurrentSaveFile -.space 0x00001380 - -dlabel nuContDataMutexQ -.space 0x00000020 - -dlabel D_800DC060 -.space 4 - -dlabel gCurrentStagePtr -.space 4 - -dlabel gBattleState -.space 4 - -dlabel D_800DC06C -.space 4 - -dlabel gBattleStatus -.space 0x00000460 - -dlabel gLastDrawBattleState -.space 4 - -dlabel D_800DC4D4 -.space 4 - -dlabel gDefeatedBattleSubstate -.space 4 - -dlabel gBattleSubState -.space 4 - -dlabel D_800DC4E0 -.space 4 - -dlabel gDefeatedBattleState -.space 4 - -dlabel gCurrentBattleID -.space 4 - -dlabel gCurrentStageID -.space 4 - -dlabel D_800DC4F0 -.space 4 - -dlabel gOverrideBattlePtr -.space 4 - -dlabel D_800DC4F8 -.space 4 - -dlabel gCurrentBattlePtr -.space 4 - -#endif diff --git a/ver/us/asm/bss2.s b/ver/us/asm/bss2.s deleted file mode 100644 index fd1019a927..0000000000 --- a/ver/us/asm/bss2.s +++ /dev/null @@ -1,114 +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 - -#ifndef SHIFT - -.section .bss - -dlabel PulseStoneNotificationCallback -.space 4 - -dlabel D_8010C924 -.space 4 - -dlabel D_8010C928 -.space 4 - -dlabel D_8010C92C -.space 4 - -dlabel wPartnerNpc -.space 4 - -dlabel TweesterTouchingPlayer -.space 4 - -dlabel PlayerNormalYaw -.space 4 - -dlabel ISpyNotificationCallback -.space 4 - -dlabel TalkNotificationCallback -.space 4 - -dlabel gSpinHistoryBufferPos -.space 4 - -dlabel D_8010C948 -.space 4 - -dlabel NpcHitQueryBehindRightY -.space 4 - -dlabel D_8010C950 -.space 4 - -dlabel TweesterTouchingPartner -.space 4 - -dlabel InteractNotificationCallback -.space 4 - -dlabel PrevPlayerDirection -.space 4 - -dlabel JumpedOnSwitchX -.space 4 - -dlabel D_8010C964 -.space 4 - -dlabel NpcHitQueryBehindCollider -.space 4 - -dlabel PeachDisguiseNpcIndex -.space 4 - -dlabel NpcHitQueryAheadY -.space 4 - -dlabel NpcHitQueryBehindLeftY -.space 4 - -dlabel NpcHitQueryColliderID -.space 4 - -dlabel JumpedOnSwitchZ -.space 4 - -dlabel PlayerRunStateTime -.space 4 - -dlabel D_8010C984 -.space 4 - -dlabel D_8010C988 -.space 4 - -dlabel NpcHitQueryAheadCollider -.space 4 - -dlabel PlayerNormalPitch -.space 4 - -dlabel D_8010C994 -.space 0x0000000c - -dlabel PlayerYInterpUpdateDelay -.space 4 - -dlabel D_8010C9A4 -.space 0x0000000c - -dlabel D_8010C9B0 -.space 4 - -dlabel D_8010C9B4 -.space 0x0000000c - -#endif diff --git a/ver/us/asm/bss2_2.s b/ver/us/asm/bss2_2.s deleted file mode 100644 index dd58463ae8..0000000000 --- a/ver/us/asm/bss2_2.s +++ /dev/null @@ -1,225 +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 - -#ifndef SHIFT - -.section .bss - -dlabel wPartnerTetherDistance -.space 4 - -dlabel D_8010CFC4 -.space 4 - -dlabel wPartnerFollowState -.space 2 - -dlabel D_8010CFCA -.space 2 - -dlabel D_8010CFCC -.space 2 - -dlabel D_8010CFCE -.space 2 - -dlabel wPartnerNpcIndex -.space 4 - -dlabel wPartnerCurrentScript -.space 4 - -dlabel wCurrentPartnerId -.space 4 - -dlabel wPartnerCurrentScriptID -.space 4 - -dlabel D_8010CFE0 -.space 4 - -dlabel NextPartnerID -.space 4 - -dlabel NextPartnerCommand -.space 4 - -dlabel wPartner -.space 4 - -dlabel D_8010CFF0 -.space 4 - -dlabel D_8010CFF4 -.space 4 - -dlabel D_8010CFF8 -.space 8 - -dlabel D_8010D000 -.space 0x63C - -dlabel D_8010D63C -.space 0x4 - -dlabel gPopupState -.space 4 - -dlabel D_8010D644 -.space 4 - -dlabel PopupMenu_SelectedIndex -.space 4 - -dlabel PopupMenu_PrevSelectedIndex -.space 4 - -dlabel PopupMenu_Alpha -.space 4 - -dlabel PopupMenu_FirstDisplayIndex -.space 1 - -dlabel PopupMenu_LastDisplayIndex -.space 1 - -dlabel PopupMenu_DisplayedEntryCount -.space 2 - -dlabel D_8010D658 -.space 2 - -dlabel D_8010D65A -.space 2 - -dlabel PopupMenu_EmptybarHEID -.space 4 - -dlabel PopupMenu_TitleIconHEID -.space 4 - -dlabel PopupMenu_TimesHEID -.space 4 - -dlabel PopupMenu_PartnerLevelHEID -.space 4 - -dlabel PopupMenu_CursorHEID -.space 4 - -dlabel PopupMenu_UpArrowHEID -.space 4 - -dlabel PopupMenu_DownArrowHEID -.space 4 - -dlabel PopupMenu_EntryIconHEID -.space 4 - -dlabel D_8010D67C -.space 2 - -dlabel D_8010D67E -.space 2 - -dlabel D_8010D680 -.space 2 - -dlabel D_8010D682 -.space 2 - -dlabel D_8010D684 -.space 2 - -dlabel D_8010D686 -.space 2 - -dlabel PopupMenu_StarPieceCounterPosX -.space 2 - -dlabel PopupMenu_StarPieceCounterPosY -.space 2 - -dlabel D_8010D68C -.space 2 - -dlabel PopupNotBattle -.space 1 - -dlabel PopupMenu_MaxDisplayableEntryCount -.space 1 - -dlabel D_8010D690 -.space 1 - -dlabel D_8010D691 -.space 1 - -dlabel D_8010D692 -.space 1 - -dlabel D_8010D693 -.space 1 - -dlabel gPopupWorker -.space 4 - -dlabel PopupNotDipping -.space 1 - -dlabel PopupDipMode -.space 1 - -dlabel PopupMenu_WasStatusBarIgnoringChanges -.space 2 - -dlabel gPopupMenu -.space 4 - -dlabel D_8010D6A0 -.space 4 - -dlabel D_8010D6A4 -.space 4 - -dlabel D_8010D6A8 -.space 0x8 - -dlabel gBoxQuadBuffer -.space 0x1500 - -dlabel gPartnerStatus -.space 0x360 - -dlabel gSpinHistoryPosY -.space 0x18 - -dlabel gSpinHistoryPosX -.space 0x18 - -dlabel gSpinHistoryPosZ -.space 0x18 - -dlabel gStatusBar -.space 0x70 - -dlabel gPlayerStatus -.space 0x288 - -dlabel gPlayerSpinState -.space 0x34 - -dlabel D_8010F284 -.space 0xC - -dlabel gPlayerData -.space 0x428 - -dlabel gSpinHistoryPosAngle -.space 0x10 - -#endif diff --git a/ver/us/asm/bss3.s b/ver/us/asm/bss3.s deleted file mode 100644 index 9be96e3f54..0000000000 --- a/ver/us/asm/bss3.s +++ /dev/null @@ -1,685 +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 - -#ifndef SHIFT - -.section .bss - -dlabel gAuxSpriteShadingProfile -.space 4 - -dlabel gHudElementsNumber -.space 4 - -dlabel gCurrentCustomModelGfxBuildersPtr -.space 4 - -dlabel D_801512BC -.space 4 - -dlabel entity_numEntities -.space 4 - -dlabel gEntityHeapBase -.space 4 - -dlabel gHudElementCacheTableRaster -.space 4 - -dlabel gCurrentModels -.space 4 - -dlabel gHudElementCacheTablePalette -.space 4 - -dlabel gAnimCount -.space 4 - -dlabel gMsgBGScrollAmtX -.space 4 - -dlabel D_801512DC -.space 4 - -dlabel gCurrentTransformGroups -.space 4 - -dlabel gMsgGlobalWaveCounter -.space 4 - -dlabel gCurrentCustomModelGfxPtr -.space 4 - -dlabel gLastCreatedEntityIndex -.space 4 - -dlabel gBackgroundTintModePtr -.space 4 - -dlabel gMsgVarImages -.space 4 - -dlabel ItemEntitiesCreated -.space 4 - -dlabel gCurrentModelTreeRoot -.space 4 - -dlabel gEntityHeapBottom -.space 4 - -dlabel D_80151304 -.space 4 - -dlabel gCurrentRoomDoorSounds -.space 4 - -dlabel gMsgBGScrollAmtY -.space 2 - -dlabel D_8015130E -.space 2 - -dlabel gEntityHideMode -.space 4 - -dlabel gHudElementCacheBuffer -.space 4 - -dlabel gEntityModelCount -.space 4 - -dlabel D_8015131C -.space 4 - -dlabel D_80151320 -.space 4 - -dlabel entity_numShadows -.space 4 - -dlabel gSpriteShadingProfile -.space 4 - -dlabel isAreaSpecificEntityDataLoaded -.space 4 - -dlabel entity_updateCounter -.space 4 - -dlabel gTriggerCount -.space 4 - -dlabel D_80151338 -.space 4 - -dlabel gHudElementCacheSize -.space 4 - -dlabel gCurrentDoorSounds -.space 4 - -dlabel D_80151344 -.space 4 - -dlabel D_80151348 -.space 0x00000038 - -dlabel gWorldEntityList -.space 0x00000078 - -dlabel gBattleEntityList -.space 0x00000078 - -dlabel gCurrentEntityListPtr -.space 4 - -dlabel D_80151474 -.space 4 - -dlabel gWorldShadowList -.space 0x000000f0 - -dlabel gBattleShadowList -.space 0x000000f0 - -dlabel gCurrentShadowListPtr -.space 4 - -dlabel wEntityDataLoadedSize -.space 4 - -dlabel bEntityDataLoadedSize -.space 4 - -dlabel D_80151664 -.space 4 - -dlabel wEntityBlueprint -.space 0x00000078 - -.space 8 - -dlabel bEntityBlueprint -.space 0x00000014 - -dlabel D_801516FC -.space 4 - -dlabel gMainGameMode -.space 0x00000040 - -dlabel gCurrentTextureHeader -.space 0x00000030 - -dlabel wModelList -.space 0x00000400 - -dlabel bModelList -.space 0x00000400 - -dlabel wTransformGroups -.space 0x00000010 - -dlabel bTransformGroups -.space 0x00000010 - -dlabel wCustomModelGfx -.space 0x00000080 - -dlabel bCustomModelGfx -.space 0x00000080 - -dlabel wCustomModelGfxBuilders -.space 0x00000080 - -dlabel bCustomModelGfxBuilders -.space 0x00000080 - -dlabel wModelLocalVtxBuffers -.space 0x00000040 - -dlabel bModelLocalVtxBuffers -.space 0x00000040 - -dlabel gCurrentModelLocalVtxBuffers -.space 4 - -dlabel wModelTreeRoot -.space 4 - -dlabel bModelTreeRoot -.space 4 - -dlabel D_8015221C -.space 4 - -dlabel wModelTreeNodeInfo -.space 0x00000800 - -dlabel bModelTreeNodeInfo -.space 0x00000800 - -dlabel wBackgroundTintMode -.space 1 - -dlabel bBackgroundTintMode -.space 1 - -dlabel D_80153222 -.space 1 - -dlabel D_80153223 -.space 1 - -dlabel TreeIterPos -.space 4 - -dlabel wFogSettings -.space 0x00000020 - -dlabel bFogSettings -.space 0x0000001c - -dlabel gFogSettings -.space 4 - -dlabel texPannerMainU -.space 0x00000040 - -dlabel texPannerMainV -.space 0x00000040 - -dlabel texPannerAuxU -.space 0x00000040 - -dlabel texPannerAuxV -.space 0x00000040 - -dlabel TextureHeapPos -.space 4 - -dlabel mtg_IterIdx -.space 2 - -dlabel mtg_SearchModelID -.space 2 - -dlabel mtg_FoundModelNode -.space 4 - -dlabel mtg_MinChild -.space 2 - -dlabel mtg_MaxChild -.space 2 - -dlabel D_80153378 -.space 8 - -dlabel DepthCopyBuffer -.space 0x00000020 - -dlabel RenderTaskLists -.space 0x0000000c - -dlabel RenderTaskListIdx -.space 4 - -dlabel RenderTaskCount -.space 0x00000010 - -dlabel D_801533C0 -.space 0x00000300 - -dlabel D_801536C0 -.space 0x00000300 - -dlabel D_801539C0 -.space 0x00000040 - -dlabel D_80153A00 -.space 0x00000040 - -dlabel gCurrentAnimMeshListPtr -.space 4 - -dlabel gAnimModelFogEnabled -.space 4 - -dlabel gAnimModelFogR -.space 4 - -dlabel gAnimModelFogG -.space 4 - -dlabel gAnimModelFogB -.space 4 - -dlabel gAnimModelFogA -.space 4 - -dlabel gAnimModelFogStart -.space 4 - -dlabel gAnimModelFogEnd -.space 4 - -dlabel gAnimVtxSegment -.space 4 - -dlabel D_80153A64 -.space 4 - -dlabel gAnimRotMtx -.space 0x00000040 - -dlabel gAnimScaleMtx -.space 0x00000040 - -dlabel gAnimTranslateMtx -.space 0x00000040 - -dlabel gAnimRotScaleMtx -.space 0x00000040 - -dlabel gAnimTreeRoot -.space 8 - -dlabel gWorldEntityModelList -.space 0x00000400 - -dlabel gBattleEntityModelList -.space 0x00000400 - -dlabel gCurrentEntityModelList -.space 4 - -dlabel D_80154374 -.space 4 - -dlabel entity_fog_enabled -.space 4 - -dlabel entity_fog_red -.space 4 - -dlabel entity_fog_green -.space 4 - -dlabel entity_fog_blue -.space 4 - -dlabel entity_fog_alpha -.space 4 - -dlabel entity_fog_dist_min -.space 4 - -dlabel entity_fog_dist_max -.space 4 - -dlabel D_80154394 -.space 0x0000000c - -dlabel gWorldWorkerList -.space 0x00000040 - -dlabel gBattleWorkerList -.space 0x00000040 - -dlabel gCurrentWorkerListPtr -.space 4 - -dlabel D_80154424 -.space 0x0000000c - -dlabel gMessageBuffers -.space 0x00000800 - -dlabel gMessagePrinters -.space 0x00001008 - -dlabel gMessageMsgVars -.space 0x00000060 - -dlabel D_80155C98 -.space 8 - -dlabel gMessageWindowProjMatrix -.space 0x00000080 - -dlabel D_80155D20 -.space 4 - -dlabel D_8015DD24 -.space 0x00000050 - -dlabel msg_drawState -.space 4 - -dlabel D_8015DD78 -.space 8 - -dlabel UnusedItemPhysicsScriptID -.space 4 - -dlabel ItemEntityAlternatingSpawn -.space 4 - -dlabel ItemEntityRenderGroup -.space 4 - -dlabel CoinSparkleCenterX -.space 2 - -dlabel CoinSparkleCenterY -.space 2 - -dlabel CoinSparkleCenterZ -.space 2 - -dlabel pad_ItemEntity -.space 0x000000E - -dlabel WorldItemEntities -.space 0x00000400 - -dlabel BattleItemEntities -.space 0x00000400 - -dlabel gCurrentItemEntities -.space 4 - -dlabel isPickingUpItem -.space 2 - -dlabel ItemSpawnWithinPlayerPickupDelay -.space 2 - -dlabel D_801565A8 -.space 4 - -dlabel D_801565AC -.space 4 - -dlabel ItemPickupMenu -.space 0x00000330 - -dlabel ItemPickupIconID -.space 4 - -dlabel ItemPickupStateDelay -.space 4 - -dlabel ThrowAwayMenuIdx -.space 4 - -dlabel ThrowAwayItemID -.space 4 - -dlabel ItemPickupGotOutline -.space 4 - -dlabel GotItemTutorialPrinter -.space 4 - -dlabel GotItemTutorialClosed -.space 4 - -dlabel D_801568FC -.space 4 - -dlabel screen_overlay_frontType -.space 4 - -dlabel screen_overlay_frontZoom -.space 4 - -dlabel screen_overlay_backType -.space 4 - -dlabel screen_overlay_backZoom -.space 4 - -dlabel D_80156910 -.space 0x00000010 - -dlabel ImgFXCurrentTexture -.space 0x00000028 - -dlabel ImgFXVtxBuffers -.space 8 - -dlabel imgfx_vtxBuf -.space 4 - -dlabel ImgFXInstances -.space 4 - -dlabel D_80156958 -.space 8 - -dlabel D_80156960 -.space 8 - -dlabel D_80156968 -.space 8 - -dlabel D_80156970 -.space 0x00000010 - -dlabel ImgFXAnimHeaders -.space 0x000005a0 - -dlabel ImgFXDataCache -.space 0x00000040 - -dlabel gHudElementsWorld -.space 0x00000500 - -dlabel gHudElementsBattle -.space 0x00000500 - -dlabel gHudElements -.space 4 - -dlabel gHudElementCacheBufferWorld -.space 4 - -dlabel gHudElementCacheSizeWorld -.space 4 - -dlabel D_8015796C -.space 4 - -dlabel gHudElementCacheTableRasterWorld -.space 0x00000600 - -dlabel gHudElementCacheTablePaletteWorld -.space 0x00000600 - -dlabel gHudElementCacheBufferBattle -.space 4 - -dlabel gHudElementCacheSizeBattle -.space 4 - -dlabel D_80158578 -.space 8 - -dlabel gHudElementCacheTableRasterBattle -.space 0x00000600 - -dlabel gHudElementCacheTablePaletteBattle -.space 0x00000600 - -dlabel D_80159180 -.space 0x00000010 - -dlabel wTriggerList -.space 0x00000100 - -dlabel bTriggerList -.space 0x00000100 - -dlabel gCurrentTriggerListPtr -.space 4 - -dlabel D_80159394 -.space 0x0000000c - -dlabel gBackgroundPalette -.space 0x00000200 - -dlabel gBackroundLastScrollValue -.space 0x00000020 - -dlabel wSpriteShadingProfile -.space 0x000000b0 - -dlabel bSpriteShadingProfile -.space 0x000000b0 - -dlabel wSpriteShadingProfileAux -.space 0x000000b0 - -dlabel bSpriteShadingProfileAux -.space 0x000000b0 - -dlabel SpriteShadingPalette -.space 0x00000020 - -dlabel wEnvSounds -.space 0x00000118 - -dlabel bEnvSounds -.space 0x00000118 - -dlabel gCurrentEnvSounds -.space 4 - -dlabel SfxReverbMode -.space 4 - -dlabel D_80159AD8 -.space 8 - -dlabel MusicDefaultVolume -.space 2 - -dlabel MusicTargetVolume -.space 2 - -dlabel MusicMaxVolume -.space 2 - -dlabel MusicCurrentVolume -.space 2 - -dlabel D_80159AE8 -.space 8 - -dlabel gMusicSettings -.space 0x00000060 - -dlabel D_80159B50 -.space 0x00000200 - -dlabel gWindows -.space 0x00000800 - -dlabel gCollisionStatus -.space 0x00000028 - -dlabel gCurrentHiddenPanels -.space 0x10 - -.space 8 - -dlabel TextureHandles -.space 0x00002200 - -dlabel ScreenOverlays -.space 0x00000030 - -dlabel AmbientSoundData -.space 0x00000010 - -dlabel CreateEntityVarArgBuffer -.space 0x00000010 - -dlabel D_8015C7E0 -.space 0x20 - -dlabel D_8015C800 -.space 0x7800 - -dlabel D_80164000 -.space 0x32C60 - -#endif diff --git a/ver/us/asm/os/padding.s b/ver/us/asm/os/padding.s deleted file mode 100644 index 772ba0fe9b..0000000000 --- a/ver/us/asm/os/padding.s +++ /dev/null @@ -1,10 +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 .text - -.space 0x10 diff --git a/ver/us/asm/os/parameters.s b/ver/us/asm/os/parameters.s deleted file mode 100644 index 73d6bcc454..0000000000 --- a/ver/us/asm/os/parameters.s +++ /dev/null @@ -1,37 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers - -.section .text, "ax" - -.globl leoBootID -leoBootID = 0x800001a0 - -.globl osTvType -osTvType = 0x80000300 - -.globl osRomType -osRomType = 0x80000304 - -.globl osRomBase -osRomBase = 0x80000308 - -.globl osResetType -osResetType = 0x8000030C - -.globl osCicId -osCicId = 0x80000310 - -.globl osVersion -osVersion = 0x80000314 - -.globl osMemSize -osMemSize = 0x80000318 - -.globl osAppNMIBuffer -osAppNMIBuffer = 0x8000031C - -.fill 0x60 diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index f7f17dbab1..02a2aaf1e1 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -26,6 +26,7 @@ options: undefined_syms_auto_path: ver/us/undefined_syms_auto.txt ld_wildcard_sections: True ld_use_symbolic_vram_addresses: False + hasm_in_src_path: True vram_classes: # Main - { name: main, vram: 0x80025C00 } @@ -80,15 +81,15 @@ segments: start: 0x0040 vram: 0xA4000040 subsegments: - - [0x0040, asm, boot] + - [0x0040, hasm, boot/ipl3_boot] - [0x0B70, bin, rspboot_font] - name: main type: code start: 0x1000 vram_class: main subsegments: - - [auto, hasm, bss] - - [auto, hasm, entry_point] + - [auto, hasm, boot/entry_point] + - [auto, c, bss/main_pre_bss] - [auto, c, is_debug, -g -fforce-addr] - [auto, c, main_pre] - [auto, c, main] @@ -338,7 +339,9 @@ segments: - [auto, hasm, os/decode_yay0] - [auto, c, os/osFlash] - [0x4AC90, pm_effect_loads, effect_loads] + - [auto, c, bss/main_post_bss] - [auto, c, battle/battle] + - [auto, c, battle/battle_bss] - [0x4E5A0, bin, n_aspMain_text] - start: 0x4F200 type: .data @@ -381,7 +384,7 @@ segments: start: 0x759B0 vram_class: engine1 subsegments: - - [auto, hasm, bss2] + - [auto, c, bss/engine1_pre_bss] - [auto, c, npc_collision] - [auto, c, 77480] - [auto, c, 7B440] @@ -392,11 +395,11 @@ segments: - [auto, c, world/actions] # DUMMY ROM - [auto, c, world/partners] - [auto, c, global_hud_scripts] - - [auto, hasm, bss2_2] - [auto, c, 891b0_len_fb0] - [auto, c, 8a160_len_700] - [auto, c, 8a860_len_3f30] - [auto, c, draw_box] + - [auto, c, bss/engine1_post_bss] - start: 0x919B0 type: .data name: global_hud_scripts @@ -815,7 +818,7 @@ segments: start: 0xA5DD0 vram_class: engine2 subsegments: - - [auto, hasm, bss3] + - [auto, c, bss/engine2_pre_bss] - [auto, c, entity] - [auto, c, game_states] - [auto, c, model] @@ -838,6 +841,7 @@ segments: - [auto, c, sprite_shading] - [auto, c, audio/sfx] - [auto, c, audio/e0b30_len_b80] + - [auto, c, bss/engine2_post_bss] - start: 0xE2DF0 type: .data name: screen_overlays From e342a33a20c677b7a7d7b932269ea8800f170043 Mon Sep 17 00:00:00 2001 From: HailSanta <53960937+HailSanta@users.noreply.github.com> Date: Wed, 6 Mar 2024 02:32:00 -0500 Subject: [PATCH 04/14] star rod dx upstreaming (#1177) * so far * leftover * first batch * part zwei * item name changes * misspelling * comments * THE * fix pal * muurgle --------- Co-authored-by: HailSanta --- .gitignore | 20 +-- include/common_structs.h | 10 +- include/entity.h | 20 ++- include/functions.h | 26 +++- include/npc.h | 3 +- include/saved_flag_names.h | 2 +- include/script_api/macros.h | 6 +- include/variables.h | 4 +- src/77480.c | 108 +++++++-------- src/7BB60.c | 38 +++--- src/891b0_len_fb0.c | 12 +- src/battle/16C8E0.c | 8 +- src/bss/engine1_pre_bss.c | 2 +- src/collision.c | 16 +-- src/encounter.c | 2 +- src/entity/Block.c | 12 +- src/entity/default/BombableRock.c | 2 +- src/entity/jan_iwa/Plants1.c | 18 +-- src/evt/demo_api.c | 25 ++-- src/evt/evt.c | 2 +- src/evt/f8f60_len_1560.c | 6 +- src/evt/map_api.c | 10 +- src/evt/player_api.c | 2 +- src/evt/script_list.c | 62 ++++----- src/item_entity_scripts.yaml | 4 +- src/item_hud_scripts.yaml | 4 +- src/item_table.yaml | 44 +++--- src/move_table.yaml | 110 +++++++-------- src/npc_collision.c | 68 +++++----- src/recipes.yaml | 6 +- src/state_pause.c | 8 +- src/trigger.c | 8 +- src/world/action/hammer.c | 34 ++--- src/world/action/hit_fire.c | 2 +- src/world/action/knockback.c | 2 +- src/world/action/slide.c | 6 +- src/world/action/step_up.c | 2 +- src/world/action/use_munchlesia.c | 2 +- src/world/action/use_spinning_flower.c | 12 +- .../area_dgb/dgb_09/dgb_09_3_breakable.c | 2 +- src/world/area_dgb/dgb_12/dgb_12_3_spikes.c | 2 +- src/world/area_dro/dro_01/dro_01_3_npc.c | 32 ++--- src/world/area_dro/dro_01/dro_01_7_foliage.c | 2 +- src/world/area_dro/dro_02/dro_02_5_npc.c | 90 +++++++----- src/world/area_flo/flo_03/flo_03_4_foliage.c | 2 +- src/world/area_flo/flo_07/flo_07_3_npc.c | 2 +- src/world/area_flo/flo_08/flo_08_3_main.c | 2 +- src/world/area_flo/flo_08/flo_08_5_foliage.c | 2 +- src/world/area_flo/flo_09/flo_09_4_foliage.c | 6 +- src/world/area_flo/flo_10/flo_10_7_foliage.c | 2 +- src/world/area_flo/flo_14/flo_14_2_main.c | 2 +- src/world/area_flo/flo_16/flo_16_2_main.c | 2 +- src/world/area_flo/flo_17/flo_17_2_main.c | 2 +- src/world/area_flo/flo_18/flo_18_2_main.c | 2 +- src/world/area_flo/flo_18/flo_18_3_machine.c | 8 +- src/world/area_flo/flo_18/flo_18_4_npc.c | 8 +- src/world/area_flo/flo_22/flo_22_5_foliage.c | 4 +- src/world/area_flo/flo_24/flo_24_3_foliage.c | 2 +- src/world/area_flo/flo_25/flo_25_5_foliage.c | 2 +- src/world/area_hos/hos_03/hos_03_5_foliage.c | 4 +- src/world/area_hos/hos_05/hos_05_3_misc.c | 8 +- .../area_hos/hos_06/hos_06_5_merluvlee.c | 8 +- src/world/area_hos/hos_06/hos_06_6_chest.c | 4 +- .../area_isk/isk_04/isk_04_3_obstructions.c | 2 +- src/world/area_isk/isk_05/isk_05_2_entity.c | 2 +- src/world/area_isk/isk_07/isk_07_2_entity.c | 2 +- src/world/area_isk/isk_08/isk_08_3_entity.c | 2 +- src/world/area_isk/isk_10/isk_10_3_bombable.c | 4 +- src/world/area_isk/isk_13/isk_13_2_entity.c | 2 +- src/world/area_isk/isk_14/isk_14_2_entity.c | 2 +- src/world/area_iwa/iwa_00/iwa_00_2_entity.c | 2 +- src/world/area_iwa/iwa_10/iwa_10_5_entity.c | 2 +- src/world/area_jan/jan_00/jan_00_5_foliage.c | 2 +- src/world/area_jan/jan_01/jan_01_5_foliage.c | 14 +- src/world/area_jan/jan_02/jan_02_5_foliage.c | 8 +- src/world/area_jan/jan_03/jan_03_4_npc.c | 2 +- src/world/area_jan/jan_03/jan_03_7_foliage.c | 2 +- src/world/area_jan/jan_04/jan_04_4_npc.c | 2 +- src/world/area_jan/jan_04/jan_04_6_trees.c | 6 +- src/world/area_jan/jan_05/jan_05_5_npc.c | 13 +- src/world/area_jan/jan_05/jan_05_6_trees.c | 6 +- src/world/area_jan/jan_06/jan_06_4_trees.c | 4 +- src/world/area_jan/jan_07/jan_07_4_trees.c | 2 +- src/world/area_jan/jan_08/jan_08_5_npc.c | 37 ++++- src/world/area_jan/jan_08/jan_08_6_trees.c | 6 +- src/world/area_jan/jan_09/jan_09_3_npc.c | 12 +- src/world/area_jan/jan_09/jan_09_4_trees.c | 6 +- src/world/area_jan/jan_10/jan_10_5_trees.c | 2 +- src/world/area_jan/jan_12/jan_12_3_trees.c | 4 +- src/world/area_jan/jan_13/jan_13_2_puzzle.c | 4 +- src/world/area_jan/jan_13/jan_13_3_trees.c | 4 +- src/world/area_jan/jan_14/jan_14_3_trees.c | 10 +- src/world/area_jan/jan_15/jan_15_3_trees.c | 4 +- src/world/area_jan/jan_22/jan_22_2_main.c | 2 +- src/world/area_jan/jan_22/jan_22_7_trees.c | 4 +- src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c | 2 +- src/world/area_kkj/kkj_10/kkj_10_2_entity.c | 2 +- src/world/area_kkj/kkj_11/kkj_11_2_entity.c | 2 +- src/world/area_kkj/kkj_12/kkj_12_2_npc.c | 2 +- src/world/area_kkj/kkj_17/kkj_17_2_entity.c | 4 +- src/world/area_kkj/kkj_17/kkj_17_3_chest.c | 2 +- src/world/area_kkj/kkj_18/kkj_18_4_gourmet.c | 2 +- src/world/area_kmr/kmr_02/kmr_02_5_entity.c | 2 +- src/world/area_kmr/kmr_02/kmr_02_8_foliage.c | 2 +- src/world/area_kmr/kmr_03/kmr_03_5_foliage.c | 2 +- src/world/area_kmr/kmr_04/kmr_04_5_foliage.c | 6 +- src/world/area_kmr/kmr_05/kmr_05_5_foliage.c | 2 +- src/world/area_kmr/kmr_10/kmr_10_5_foliage.c | 2 +- src/world/area_kmr/kmr_11/kmr_11_7_foliage.c | 4 +- .../area_kmr/kmr_20/kmr_20_4_documents.c | 16 +-- src/world/area_kmr/kmr_20/kmr_20_6_trees.c | 2 +- src/world/area_kpa/kpa_11/kpa_11_2_main.c | 2 +- src/world/area_kpa/kpa_12/kpa_12_2_main.c | 2 +- src/world/area_kpa/kpa_13/kpa_13_2_main.c | 2 +- src/world/area_kpa/kpa_133/kpa_133_2_main.c | 2 +- src/world/area_kpa/kpa_14/kpa_14_2_main.c | 2 +- src/world/area_kpa/kpa_16/kpa_16_2_main.c | 2 +- src/world/area_kpa/kpa_17/kpa_17_3_main.c | 2 +- src/world/area_kpa/kpa_60/kpa_60_2_entity.c | 2 +- src/world/area_kpa/kpa_60/kpa_60_3_main.c | 2 +- src/world/area_kpa/kpa_62/kpa_62_2_entity.c | 2 +- src/world/area_kpa/kpa_62/kpa_62_3_main.c | 2 +- src/world/area_kpa/kpa_91/kpa_91_3_npc.c | 4 +- src/world/area_kpa/kpa_91/kpa_91_4_entity.c | 4 +- src/world/area_kpa/kpa_95/kpa_95_2_entity.c | 4 +- src/world/area_kpa/kpa_95/kpa_95_4_npc.c | 4 +- src/world/area_kzn/kzn_02/kzn_02_1_main.c | 2 +- src/world/area_kzn/kzn_06/kzn_06_1_main.c | 2 +- src/world/area_kzn/kzn_06/kzn_06_2_entity.c | 2 +- src/world/area_kzn/kzn_07/kzn_07_2_main.c | 2 +- src/world/area_kzn/kzn_07/kzn_07_3_entity.c | 2 +- src/world/area_kzn/kzn_08/kzn_08_1_main.c | 2 +- src/world/area_kzn/kzn_11/kzn_11_1_main.c | 2 +- src/world/area_kzn/kzn_18/kzn_18_1_main.c | 2 +- src/world/area_kzn/kzn_20/kzn_20_2_main.c | 4 +- src/world/area_kzn/kzn_22/kzn_22_2_main.c | 2 +- src/world/area_mac/mac_01/mac_01_13_foliage.c | 4 +- src/world/area_mac/mac_02/mac_02_4_foliage.c | 10 +- src/world/area_mac/mac_03/mac_03_6_foliage.c | 6 +- src/world/area_mac/mac_04/mac_04_4_foliage.c | 6 +- src/world/area_mim/mim_01/mim_01_4_hint.c | 6 +- src/world/area_mim/mim_03/mim_03_4_hint.c | 6 +- src/world/area_mim/mim_06/mim_06_4_hint.c | 6 +- src/world/area_nok/nok_01/nok_01_8_foliage.c | 2 +- src/world/area_nok/nok_02/nok_02_9_foliage.c | 2 +- src/world/area_nok/nok_12/nok_12_5_foliage.c | 2 +- src/world/area_nok/nok_15/nok_15_2_main.c | 2 +- src/world/area_nok/nok_15/nok_15_5_foliage.c | 2 +- src/world/area_obk/obk_02/obk_02_4_bombable.c | 2 +- src/world/area_obk/obk_06/obk_06_3_bombable.c | 2 +- .../area_omo/omo_02/omo_02_5_barricade.c | 2 +- src/world/area_omo/omo_11/omo_11_4_entity.c | 2 +- src/world/area_omo/omo_12/omo_12_3_npc.c | 2 +- src/world/area_pra/common/Reflection.inc.c | 12 +- src/world/area_pra/pra_09/pra_09_2_main.c | 2 +- src/world/area_pra/pra_13/pra_13_2_main.c | 4 +- src/world/area_pra/pra_14/pra_14_2_main.c | 4 +- src/world/area_pra/pra_33/pra_33_2_main.c | 2 +- src/world/area_pra/pra_35/pra_35_2_main.c | 2 +- src/world/area_sam/sam_02/sam_02_2_main.c | 4 +- src/world/area_sam/sam_04/sam_04_2_main.c | 10 +- src/world/area_sam/sam_06/sam_06_2_main.c | 10 +- .../area_sam/sam_07/sam_07_4_frozen_pit.c | 4 +- src/world/area_sam/sam_10/sam_10_4_stairs.c | 2 +- src/world/area_sam/sam_11/sam_11_2_main.c | 6 +- src/world/area_sam/sam_11/sam_11_6_pond.c | 5 +- src/world/area_sbk/sbk_06/sbk_06_3_foliage.c | 2 +- src/world/area_sbk/sbk_14/sbk_14_2_entity.c | 8 +- src/world/area_sbk/sbk_16/sbk_16_2_foliage.c | 4 +- src/world/area_sbk/sbk_23/sbk_23_2_entity.c | 12 +- src/world/area_sbk/sbk_24/sbk_24_4_foliage.c | 6 +- src/world/area_sbk/sbk_25/sbk_25_3_foliage.c | 4 +- src/world/area_sbk/sbk_26/sbk_26_3_foliage.c | 2 +- src/world/area_sbk/sbk_30/sbk_30_4_foliage.c | 2 +- src/world/area_sbk/sbk_33/sbk_33_1_entity.c | 4 +- src/world/area_sbk/sbk_34/sbk_34_3_foliage.c | 2 +- src/world/area_sbk/sbk_35/sbk_35_3_foliage.c | 6 +- src/world/area_sbk/sbk_36/sbk_36_2_foliage.c | 18 +-- src/world/area_sbk/sbk_41/sbk_41_2_entity.c | 4 +- src/world/area_sbk/sbk_46/sbk_46_3_foliage.c | 6 +- src/world/area_sbk/sbk_54/sbk_54_2_entity.c | 8 +- src/world/area_sbk/sbk_55/sbk_55_3_foliage.c | 2 +- src/world/area_sbk/sbk_56/sbk_56_3_foliage.c | 20 +-- src/world/area_sbk/sbk_66/sbk_66_3_foliage.c | 6 +- src/world/area_tik/tik_05/tik_05_4_entity.c | 4 +- src/world/area_tik/tik_14/tik_14_4_entity.c | 2 +- src/world/area_tik/tik_15/tik_15_3_entity.c | 2 +- src/world/area_tik/tik_20/tik_20_2_main.c | 2 +- src/world/area_trd/trd_02/trd_02_1_main.c | 2 +- src/world/area_trd/trd_03/trd_03_1_main.c | 4 +- src/world/area_trd/trd_05/trd_05_1_main.c | 2 +- src/world/area_trd/trd_06/trd_06_1_main.c | 2 +- .../area_trd/trd_07/trd_07_3_magic_doors.c | 8 +- src/world/area_trd/trd_09/trd_09_2_entity.c | 2 +- src/world/common/complete/Quizmo.inc.c | 34 ++--- src/world/common/enemy/HeartPlant.inc.c | 9 +- src/world/common/enemy/HurtPlant.inc.c | 10 +- src/world/common/enemy/MBush.inc.c | 9 +- src/world/common/enemy/SpearGuy_Wander.inc.c | 7 - src/world/common/enemy/ai/FlyingAI.inc.c | 8 +- src/world/common/npc/Dryite.h | 128 +++++++++--------- src/world/common/npc/Mouser.h | 128 +++++++++--------- .../dead/area_flo/flo_03/flo_03_4_foliage.c | 2 +- src/world/dead/area_flo/flo_07/flo_07_3_npc.c | 2 +- .../dead/area_flo/flo_08/flo_08_3_main.c | 2 +- .../dead/area_flo/flo_08/flo_08_5_foliage.c | 2 +- .../dead/area_flo/flo_09/flo_09_4_foliage.c | 6 +- .../dead/area_flo/flo_10/flo_10_7_foliage.c | 2 +- .../dead/area_flo/flo_14/flo_14_2_main.c | 2 +- .../dead/area_flo/flo_16/flo_16_2_main.c | 2 +- .../dead/area_flo/flo_17/flo_17_2_main.c | 2 +- .../dead/area_flo/flo_18/flo_18_2_main.c | 2 +- .../dead/area_flo/flo_18/flo_18_3_machine.c | 8 +- src/world/dead/area_flo/flo_18/flo_18_4_npc.c | 8 +- .../dead/area_kzn/kzn_11/kzn_11_1_main.c | 2 +- .../dead/area_kzn/kzn_18/kzn_18_1_main.c | 2 +- .../dead/area_kzn/kzn_20/kzn_20_2_main.c | 4 +- .../dead/area_kzn/kzn_22/kzn_22_2_main.c | 2 +- src/world/partner/bombette.c | 6 +- src/world/partner/kooper.c | 1 - src/world/partner/lakilester.c | 2 +- src/world/partner/parakarry.c | 10 +- src/world/partner/sushie.c | 12 +- src/world/partners.c | 2 +- src/world/script_api/push_blocks.c | 6 +- tools/build/item_data.py | 2 +- tools/old/saved_flag_renames.txt | 2 +- ver/ique/symbol_addrs.txt | 2 +- ver/jp/symbol_addrs.txt | 22 +-- ver/pal/undefined_syms.txt | 8 +- ver/us/symbol_addrs.txt | 32 ++--- 231 files changed, 1012 insertions(+), 973 deletions(-) diff --git a/.gitignore b/.gitignore index 3a9a53c61e..3d48315268 100644 --- a/.gitignore +++ b/.gitignore @@ -52,24 +52,10 @@ build/ *.sbn # Star Rod -/sprite/SpriteTable.xml -/mod.cfg -/tools/star-rod -/editor -/logs -/out -dump +.starrod +/ver/us/dump *.backup -crash.xml -/audio/* -/sprite/* -/battle/* -/globals/* -/map/* -/world/* -/image/* -/strings/* -/res/* +*.crash /tools/Yay0compress /tools/n64crc diff --git a/include/common_structs.h b/include/common_structs.h index 5ec023cadb..69440fbe9e 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -381,7 +381,7 @@ typedef struct Trigger { /* 0x04 */ s32 varIndex; /* 0x08 */ union { /* */ s32 colliderID; - /* */ Vec4f* pos; + /* */ struct BombTrigger* blast; /* */ } location; /* 0x0C */ s32 (*onActivateFunc)(struct Trigger*); /* 0x10 */ EvtScript* onTriggerEvt; @@ -1758,15 +1758,9 @@ typedef struct LavaReset { typedef struct BombTrigger { /* 0x00 */ Vec3f pos; - /* 0x0C */ s32 radius; // effective 'size' of the object, usually set to zero because bombettes explosion radius is large enough + /* 0x0C */ f32 diameter; // effective 'size' of the object, usually set to zero because bombettes explosion radius is large enough } BombTrigger; // size = 0x10; -// the use of this is a bug in sam_11 -typedef struct BombTriggerF { - /* 0x00 */ Vec3f pos; - /* 0x0C */ f32 radius; -} BombTriggerF; // size = 0x10; - typedef struct AnimatedModel { /* 0x00 */ s32 animModelID; /* 0x04 */ Vec3f pos; diff --git a/include/entity.h b/include/entity.h index 26e0e69e17..df326a047f 100644 --- a/include/entity.h +++ b/include/entity.h @@ -6,7 +6,7 @@ typedef s32 EntityScript[]; typedef s32 EntityModelScript[]; -extern s32 CreateEntityVarArgBuffer[4]; +extern s32 CreateEntityVarArgBuffer[]; enum { ENTITY_SCRIPT_OP_End, @@ -360,9 +360,7 @@ typedef struct SpinningFlowerData { /* 0x14 */ f32 spinSpeed; /* 0x18 */ s32 unk_18; /* 0x1C */ char unk_1C[0x0C]; - /* 0x28 */ s16 unk_28; - /* 0x2A */ s16 unk_2A; - /* 0x2C */ s16 unk_2C; + /* 0x28 */ Vec3s pos; /* 0x30 */ Mtx unk_30; } SpinningFlowerData; // size = 0x70 @@ -399,16 +397,16 @@ extern EntityBlueprint Entity_InertRedBlock; extern EntityBlueprint Entity_BrickBlock; extern EntityBlueprint Entity_MulticoinBlock; extern EntityBlueprint Entity_Hammer1Block; -extern EntityBlueprint Entity_Hammer1Block_WideX; -extern EntityBlueprint Entity_Hammer1Block_WideZ; +extern EntityBlueprint Entity_Hammer1BlockWideX; +extern EntityBlueprint Entity_Hammer1BlockWideZ; extern EntityBlueprint Entity_Hammer1BlockTiny; extern EntityBlueprint Entity_Hammer2Block; -extern EntityBlueprint Entity_Hammer2Block_WideX; -extern EntityBlueprint Entity_Hammer2Block_WideZ; +extern EntityBlueprint Entity_Hammer2BlockWideX; +extern EntityBlueprint Entity_Hammer2BlockWideZ; extern EntityBlueprint Entity_Hammer2BlockTiny; extern EntityBlueprint Entity_Hammer3Block; -extern EntityBlueprint Entity_Hammer3Block_WideX; -extern EntityBlueprint Entity_Hammer3Block_WideZ; +extern EntityBlueprint Entity_Hammer3BlockWideX; +extern EntityBlueprint Entity_Hammer3BlockWideZ; extern EntityBlueprint Entity_Hammer3BlockTiny; extern EntityBlueprint Entity_PushBlock; extern EntityBlueprint Entity_PowBlock; @@ -433,7 +431,7 @@ extern EntityBlueprint Entity_PadlockRedFace; extern EntityBlueprint Entity_PadlockBlueFace; extern EntityBlueprint Entity_BoardedFloor; extern EntityBlueprint Entity_BombableRock; -extern EntityBlueprint Entity_BombableRock2; +extern EntityBlueprint Entity_BombableRockWide; extern EntityBlueprint Entity_Tweester; extern EntityBlueprint Entity_StarBoxLauncher; extern EntityBlueprint Entity_CymbalPlant; diff --git a/include/functions.h b/include/functions.h index b50c919774..8594e8dc5e 100644 --- a/include/functions.h +++ b/include/functions.h @@ -248,8 +248,8 @@ s32 phys_can_player_interact(void); void ai_enemy_play_sound(Npc* npc, s32 arg1, s32 arg2); -s32 player_test_move_without_slipping(PlayerStatus*, f32*, f32*, f32*, f32, f32, s32*); -s32 player_test_move_with_slipping(PlayerStatus* playerStatus, f32* posX, f32* posY, f32* posZ, f32 speed, f32 heading); +HitID player_test_move_without_slipping(PlayerStatus*, f32*, f32*, f32*, f32, f32, s32*); +HitID player_test_move_with_slipping(PlayerStatus* playerStatus, f32* posX, f32* posY, f32* posZ, f32 speed, f32 heading); s32 evt_get_variable(Evt* script, Bytecode var); s32 evt_set_variable(Evt* script, Bytecode var, s32 value); @@ -274,6 +274,24 @@ s32 test_ray_zones(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 d f32* hitDepth, f32* nx, f32* ny, f32* nz); s32 test_ray_colliders(s32 ignoreFlags, f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32* hitX, f32* hitY, f32* hitZ, f32* hitDepth, f32* hitNx, f32* hitNy, f32* hitNz); + +/// Test a general ray from a given starting position and direction against all entities. +/// If one is hit, returns the position and normal of the hit and the length along the ray on the output params. +/// All output params are invalid when a value of `NO_COLLIDER` is returned. +/// @param startX origin x position of the ray +/// @param startY origin y position of the ray +/// @param startZ origin z position of the ray +/// @param dirX normalized x direction of the ray +/// @param dirY normalized y direction of the ray +/// @param dirZ normalized z direction of the ray +/// @param[out] hitX normalized x position of the hit +/// @param[out] hitY normalized y position of the hit +/// @param[out] hitZ normalized z position of the hit +/// @param[in,out] hitDepth as input, maximum length of the ray; as output, distance along the ray of the hit +/// @param[out] hitNx x normal direction of the hit +/// @param[out] hitNy y normal direction of the hit +/// @param[out] hitNz z normal direction of the hit +/// @returns entity index or `NO_COLLIDER` is none is hit s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32* hitX, f32* hitY, f32* hitZ, f32* hitDepth, f32* hitNx, f32* hitNy, f32* hitNz); @@ -402,9 +420,9 @@ PlayerData* get_player_data(void); b32 npc_raycast_down_around(s32, f32*, f32*, f32*, f32*, f32, f32); b32 npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth); s32 npc_raycast_up(s32, f32*, f32*, f32*, f32*); -s32 npc_raycast_up_corners(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth, f32 yaw, f32 radius); +HitID npc_raycast_up_corners(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth, f32 yaw, f32 radius); s32 player_raycast_up_corners(PlayerStatus*, f32*, f32*, f32*, f32*, f32); -s32 player_raycast_below_cam_relative(PlayerStatus* playerStatus, f32* outX, f32* outY, f32* outZ, f32* outLength, +HitID player_raycast_below_cam_relative(PlayerStatus* playerStatus, f32* outX, f32* outY, f32* outZ, f32* outLength, f32* hitRx, f32* hitRz, f32* hitDirX, f32* hitDirZ); b32 npc_test_move_taller_with_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32); b32 npc_test_move_simple_with_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32); diff --git a/include/npc.h b/include/npc.h index c860816ecd..3c3e58dcf4 100644 --- a/include/npc.h +++ b/include/npc.h @@ -155,7 +155,7 @@ typedef struct NpcSettings { typedef struct ItemDrop { /* 0x00 */ s16 item; /* 0x02 */ s16 weight; - /* 0x04 */ s16 unk_04; + /* 0x04 */ s16 flagIdx; } ItemDrop; // size = 0x06 /// @brief Describes heart/flower drop chances after defeating an Npc in the overworld. @@ -239,7 +239,6 @@ typedef struct { typedef union { EnemyTerritoryWander wander; EnemyTerritoryPatrol patrol; - s32 temp[48]; // TODO: remove when old map data is replaced char PADDING[0xC0]; } EnemyTerritory; // size = 0xC0 diff --git a/include/saved_flag_names.h b/include/saved_flag_names.h index a9a2e4b170..c0e0caed83 100644 --- a/include/saved_flag_names.h +++ b/include/saved_flag_names.h @@ -404,7 +404,7 @@ enum GameFlags { GF_TIK03_ItemBlock_SnowmanDoll = GameFlag(0x190), GF_TIK03_ItemBlock_CoinA = GameFlag(0x191), GF_TIK03_ItemBlock_CoinB = GameFlag(0x192), - GF_TIK05_Chest_PowerSmash1 = GameFlag(0x193), + GF_TIK05_Chest_PowerSmash = GameFlag(0x193), GF_TIK07_Item_StarPiece = GameFlag(0x194), GF_TIK10_HiddenItem_CoinA = GameFlag(0x195), GF_TIK10_HiddenItem_CoinB = GameFlag(0x196), diff --git a/include/script_api/macros.h b/include/script_api/macros.h index a0b47752f6..de355624f2 100644 --- a/include/script_api/macros.h +++ b/include/script_api/macros.h @@ -43,14 +43,14 @@ #define EVT_LIMIT -270000000 // TODO better name // This fixes an issue with fixed point numbers not being correct. Potentially a truncation vs round difference. -#define Float_ROUND(x) ((x) >=0 ? (f64)((x) + 0.9) : (f64)(x)) -#define Float(DOUBLE) ((Bytecode)Float_ROUND(((DOUBLE) * 1024.0f)) - EVT_FIXED_OFFSET) +#define FLOAT_ROUND(x) ((x) >=0 ? (f64)((x) + 0.9) : (f64)(x)) +#define Float(DOUBLE) ((Bytecode)FLOAT_ROUND(((DOUBLE) * 1024.0f)) - EVT_FIXED_OFFSET) /// Progammatically converts Float --> f32 #define EVT_FIXED_TO_FLOAT(x) ({f32 var = (x) + EVT_FIXED_OFFSET; var /= 1024.0f; var;}) /// Progammatically converts f32 --> Float -#define Float_TO_FIXED(x) (((x) * 1024.0f) + -EVT_FIXED_OFFSET) +#define FLOAT_TO_FIXED(x) (((x) * 1024.0f) + -EVT_FIXED_OFFSET) /// Address/pointer constant. #define Ref(sym) ((Bytecode) &(sym)) diff --git a/include/variables.h b/include/variables.h index 163a17f527..5274c463af 100644 --- a/include/variables.h +++ b/include/variables.h @@ -60,8 +60,8 @@ extern char wMapTexName[]; extern char wMapHitName[]; extern char wMapShapeName[]; extern char wMapBgName[]; -extern u8 D_802D9D70; // player alpha1 copy? -extern u8 D_802D9D71; // player alpha2 copy? +extern u8 ReflectWallPrevAlpha; // player alpha1 copy? +extern u8 ReflectFloorPrevAlpha; // player alpha2 copy? extern DisplayContext D_80164000[2]; diff --git a/src/77480.c b/src/77480.c index 87ef4de087..b1ab1ead96 100644 --- a/src/77480.c +++ b/src/77480.c @@ -41,9 +41,9 @@ extern f32 D_800F7B48; extern s32 D_800F7B4C; extern s32 WorldTattleInteractionID; -s32 player_raycast_down(f32*, f32*, f32*, f32*); -s32 player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length); -s32 player_raycast_general(s32, f32, f32, f32, f32, f32, f32, f32*, f32*, f32*, f32*, f32*, f32*, f32*); +HitID player_raycast_down(f32*, f32*, f32*, f32*); +HitID player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length); +HitID player_raycast_general(s32, f32, f32, f32, f32, f32, f32, f32*, f32*, f32*, f32*, f32*, f32*, f32*); void player_get_slip_vector(f32* outX, f32* outY, f32 x, f32 y, f32 nX, f32 nY); void phys_update_standard(void); void phys_update_lava_reset(void); @@ -68,7 +68,7 @@ void appendGfx_player_spin(void* data); void update_player_shadow(void); s32 partner_use_ability(void); -s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, f32* outLength, f32* hitRx, f32* hitRz, +HitID player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, f32* outLength, f32* hitRx, f32* hitRz, f32* hitDirX, f32* hitDirZ) { f32 x, y, z, length; f32 inputX, inputY, inputZ, inputLength; @@ -77,7 +77,7 @@ s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, f32 temp_f20; f32 cosTemp; f32 sinTemp; - s32 hitObjectID; + s32 hitID; s32 ret; *hitRx = 0.0f; @@ -97,9 +97,9 @@ s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, y = inputY; z = inputZ + cosTemp; length = inputLength; - hitObjectID = player_raycast_down(&x, &y, &z, &length); + hitID = player_raycast_down(&x, &y, &z, &length); ret = NO_COLLIDER; - if (hitObjectID >= 0 && length <= fabsf(*outLength)) { + if (hitID > NO_COLLIDER && length <= fabsf(*outLength)) { *hitRx = -gGameStatusPtr->playerGroundTraceAngles.x; *hitRz = -gGameStatusPtr->playerGroundTraceAngles.z; *outX = x; @@ -108,15 +108,15 @@ s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, *outLength = length; *hitDirX = sinTemp; *hitDirZ = cosTemp; - ret = hitObjectID; + ret = hitID; } x = inputX - sinTemp; y = inputY; z = inputZ - cosTemp; length = inputLength; - hitObjectID = player_raycast_down(&x, &y, &z, &length); - if (hitObjectID >= 0 && length <= fabsf(*outLength)) { + hitID = player_raycast_down(&x, &y, &z, &length); + if (hitID > NO_COLLIDER && length <= fabsf(*outLength)) { *hitRx = -gGameStatusPtr->playerGroundTraceAngles.x; *hitRz = -gGameStatusPtr->playerGroundTraceAngles.z; *outX = x; @@ -125,15 +125,15 @@ s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, *outLength = length; *hitDirX = -sinTemp; *hitDirZ = -cosTemp; - ret = hitObjectID; + ret = hitID; } x = inputX + cosTemp; y = inputY; z = inputZ + sinTemp; length = inputLength; - hitObjectID = player_raycast_down(&x, &y, &z, &length); - if (hitObjectID >= 0 && length <= fabsf(*outLength)) { + hitID = player_raycast_down(&x, &y, &z, &length); + if (hitID > NO_COLLIDER && length <= fabsf(*outLength)) { *hitRx = -gGameStatusPtr->playerGroundTraceAngles.x; *hitRz = -gGameStatusPtr->playerGroundTraceAngles.z; *outX = x; @@ -142,15 +142,15 @@ s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, *outLength = length; *hitDirX = sinTemp; *hitDirZ = cosTemp; - ret = hitObjectID; + ret = hitID; } x = inputX - cosTemp; y = inputY; z = inputZ - sinTemp; length = inputLength; - hitObjectID = player_raycast_down(&x, &y, &z, &length); - if (hitObjectID >= 0 && length <= fabsf(*outLength)) { + hitID = player_raycast_down(&x, &y, &z, &length); + if (hitID > NO_COLLIDER && length <= fabsf(*outLength)) { *hitRx = -gGameStatusPtr->playerGroundTraceAngles.x; *hitRz = -gGameStatusPtr->playerGroundTraceAngles.z; *outX = x; @@ -159,15 +159,15 @@ s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, *outLength = length; *hitDirX = -sinTemp; *hitDirZ = -cosTemp; - ret = hitObjectID; + ret = hitID; } x = inputX; y = inputY; z = inputZ; length = inputLength; - hitObjectID = player_raycast_down(&x, &y, &z, &length); - if (hitObjectID >= 0 && length <= fabsf(*outLength)) { + hitID = player_raycast_down(&x, &y, &z, &length); + if (hitID > NO_COLLIDER && length <= fabsf(*outLength)) { *hitRx = -gGameStatusPtr->playerGroundTraceAngles.x; *hitRz = -gGameStatusPtr->playerGroundTraceAngles.z; *outX = x; @@ -176,10 +176,10 @@ s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, *outLength = length; *hitDirX = 0.0f; *hitDirZ = 0.0f; - ret = hitObjectID; + ret = hitID; } - if (ret < 0) { + if (ret <= NO_COLLIDER) { *outX = x; *outY = y; *outZ = z; @@ -188,7 +188,7 @@ s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ, return ret; } -s32 player_raycast_below_cam_relative(PlayerStatus* playerStatus, f32* outX, f32* outY, f32* outZ, f32* outLength, +HitID player_raycast_below_cam_relative(PlayerStatus* playerStatus, f32* outX, f32* outY, f32* outZ, f32* outLength, f32* hitRx, f32* hitRz, f32* hitDirX, f32* hitDirZ) { f32 yaw = 0.0f; @@ -200,7 +200,7 @@ s32 player_raycast_below_cam_relative(PlayerStatus* playerStatus, f32* outX, f32 outX, outY, outZ, outLength, hitRx, hitRz, hitDirX, hitDirZ); } -s32 player_raycast_down(f32* x, f32* y, f32* z, f32* length) { +HitID player_raycast_down(f32* x, f32* y, f32* z, f32* length) { f32 hitX; f32 hitY; f32 hitZ; @@ -214,7 +214,7 @@ s32 player_raycast_down(f32* x, f32* y, f32* z, f32* length) { hitDepth = *length; entityID = test_ray_entities(*x, *y, *z, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); - if (entityID >= 0) { + if (entityID > NO_COLLIDER) { entity = get_entity_by_index(entityID); if (entity->alpha < 255) { entity->collisionTimer = 4; @@ -225,11 +225,11 @@ s32 player_raycast_down(f32* x, f32* y, f32* z, f32* length) { } colliderID = test_ray_colliders(COLLIDER_FLAG_IGNORE_PLAYER, *x, *y, *z, 0, -1.0f, 0, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { ret = colliderID; } - if (ret >= 0) { + if (ret > NO_COLLIDER) { *length = hitDepth; *x = hitX; *y = hitY; @@ -250,7 +250,7 @@ s32 player_raycast_down(f32* x, f32* y, f32* z, f32* length) { return ret; } -s32 player_raycast_up_corners(PlayerStatus* player, f32* posX, f32* posY, f32* posZ, f32* hitDepth, f32 yaw) { +HitID player_raycast_up_corners(PlayerStatus* player, f32* posX, f32* posY, f32* posZ, f32* hitDepth, f32 yaw) { f32 startX; f32 startY; f32 startZ; @@ -280,28 +280,28 @@ s32 player_raycast_up_corners(PlayerStatus* player, f32* posX, f32* posY, f32* p ret = NO_COLLIDER; hitID = player_raycast_up_corner(&startX, &startY, &startZ, &depth); - if (hitID < 0) { + if (hitID <= NO_COLLIDER) { startX = x - deltaX; startY = y; startZ = z - deltaZ; hitID = player_raycast_up_corner(&startX, &startY, &startZ, &depth); } - if (hitID < 0) { + if (hitID <= NO_COLLIDER) { startX = x + deltaZ; startY = y; startZ = z + deltaX; hitID = player_raycast_up_corner(&startX, &startY, &startZ, &depth); } - if (hitID < 0) { + if (hitID <= NO_COLLIDER) { startX = x - deltaZ; startY = y; startZ = z - deltaX; hitID = player_raycast_up_corner(&startX, &startY, &startZ, &depth); } - if (hitID >= 0) { + if (hitID > NO_COLLIDER) { *posX = startX; *posY = startY; *posZ = startZ; @@ -309,7 +309,7 @@ s32 player_raycast_up_corners(PlayerStatus* player, f32* posX, f32* posY, f32* p ret = hitID; } - if (ret < 0) { + if (ret <= NO_COLLIDER) { *posX = startX; *posY = startY; *posZ = startZ; @@ -319,7 +319,7 @@ s32 player_raycast_up_corners(PlayerStatus* player, f32* posX, f32* posY, f32* p return ret; } -s32 player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length) { +HitID player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length) { f32 hitX; f32 hitY; f32 hitZ; @@ -342,7 +342,7 @@ s32 player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length) { sz2 = sz = *z; hitDepth = *length; hitID = test_ray_colliders(COLLIDER_FLAG_IGNORE_PLAYER, sx, sy, sz, 0.0f, 1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); - if (hitID >= 0 && *length > hitDepth) { + if (hitID > NO_COLLIDER && *length > hitDepth) { *length = hitDepth; ret = hitID; *x = sx = sx2; @@ -355,7 +355,7 @@ s32 player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length) { sx = sx2; sy = sy2; sz = sz2; - if (hitID >= 0 && *length > hitDepth) { + if (hitID > NO_COLLIDER && *length > hitDepth) { get_entity_by_index(hitID); ret = hitID | COLLISION_WITH_ENTITY_BIT; *length = hitDepth; @@ -367,7 +367,7 @@ s32 player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length) { return ret; } -s32 player_test_lateral_overlap(s32 mode, PlayerStatus* playerStatus, f32* x, f32* y, f32* z, f32 length, f32 yaw) { +HitID player_test_lateral_overlap(s32 mode, PlayerStatus* playerStatus, f32* x, f32* y, f32* z, f32 length, f32 yaw) { f32 sinTheta; f32 cosTheta; f32 hitX; @@ -412,7 +412,7 @@ s32 player_test_lateral_overlap(s32 mode, PlayerStatus* playerStatus, f32* x, f3 targetDz = length * cosTheta; } - if (hitID >= 0) { + if (hitID > NO_COLLIDER) { originalDepth = length + radius; if (hitDepth <= originalDepth) { depthDiff = hitDepth - originalDepth; @@ -431,7 +431,7 @@ s32 player_test_lateral_overlap(s32 mode, PlayerStatus* playerStatus, f32* x, f3 return ret; } -s32 player_raycast_general(s32 mode, f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32* hitX, +HitID player_raycast_general(s32 mode, f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32* hitX, f32* hitY, f32* hitZ, f32* hitDepth, f32*hitNx, f32* hitNy, f32* hitNz) { f32 nAngleX; f32 nAngleZ; @@ -444,7 +444,7 @@ s32 player_raycast_general(s32 mode, f32 startX, f32 startY, f32 startZ, f32 dir entityID = test_ray_entities(startX, startY, startZ, dirX, dirY, dirZ, hitX, hitY, hitZ, hitDepth, hitNx, hitNy, hitNz); ret = NO_COLLIDER; - if (entityID >= 0) { + if (entityID > NO_COLLIDER) { entity = get_entity_by_index(entityID); if (entity->alpha < 255) { entity->collisionTimer = 0; @@ -470,11 +470,11 @@ s32 player_raycast_general(s32 mode, f32 startX, f32 startY, f32 startZ, f32 dir colliderID = test_ray_colliders(ignoreFlags, startX, startY, startZ, dirX, dirY, dirZ, hitX, hitY, hitZ, hitDepth, hitNx, hitNy, hitNz); - if (ret < 0) { + if (ret <= NO_COLLIDER) { ret = colliderID; } - if (ret >= 0) { + if (ret > NO_COLLIDER) { nAngleZ = 180.0f - atan2(0, 0, *hitNz * 100.0, *hitNy * 100.0); nAngleX = 180.0f - atan2(0, 0, *hitNx * 100.0, *hitNy * 100.0); @@ -486,7 +486,7 @@ s32 player_raycast_general(s32 mode, f32 startX, f32 startY, f32 startZ, f32 dir return ret; } -s32 player_test_move_without_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f32* z, f32 length, f32 yaw, s32* hasClimbableStep) { +HitID player_test_move_without_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f32* z, f32 length, f32 yaw, s32* hasClimbableStep) { f32 sinTheta; f32 cosTheta; f32 hitX; @@ -503,7 +503,7 @@ s32 player_test_move_without_slipping(PlayerStatus* playerStatus, f32* x, f32* y f32 depthDiff; f32 height; s32 ret; - s32 raycastID; + s32 hitID; f32 targetDx; f32 targetDz; f32 dx, dz; @@ -518,8 +518,8 @@ s32 player_test_move_without_slipping(PlayerStatus* playerStatus, f32* x, f32* y dx = radius * sinTheta; ret = NO_COLLIDER; - raycastID = player_raycast_general(PLAYER_COLLISION_0, *x, *y + 0.1, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); - if (raycastID >= 0 && hitDepth <= depth) { + hitID = player_raycast_general(PLAYER_COLLISION_0, *x, *y + 0.1, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); + if (hitID > NO_COLLIDER && hitDepth <= depth) { *hasClimbableStep = TRUE; } @@ -527,19 +527,19 @@ s32 player_test_move_without_slipping(PlayerStatus* playerStatus, f32* x, f32* y hitDepth = depth; dz = radius * cosTheta; - raycastID = player_raycast_general(PLAYER_COLLISION_0, *x, *y + height, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); + hitID = player_raycast_general(PLAYER_COLLISION_0, *x, *y + height, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); targetDx = 0.0f; targetDz = 0.0f; - if ((raycastID >= 0) && (hitDepth <= depth)) { + if (hitID > NO_COLLIDER && hitDepth <= depth) { depthDiff = hitDepth - depth; dx = depthDiff * sinTheta; dz = depthDiff * cosTheta; player_get_slip_vector(&slipDx, &slipDz, 0.0f, 0.0f, hitNx, hitNz); *x += dx + slipDx; *z += dz + slipDz; - ret = raycastID; + ret = hitID; } *x += targetDx; *z += targetDz; @@ -553,7 +553,7 @@ void player_get_slip_vector(f32* outX, f32* outY, f32 x, f32 y, f32 nX, f32 nY) *outY = (y - projectionLength * nY) * 0.5f; } -s32 player_test_move_with_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f32* z, f32 length, f32 yaw) { +HitID player_test_move_with_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f32* z, f32 length, f32 yaw) { f32 sinTheta; f32 cosTheta; f32 hitX; @@ -587,7 +587,7 @@ s32 player_test_move_with_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f targetDz = length * cosTheta; hitID = player_raycast_general(PLAYER_COLLISION_0, *x, *y + height, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); - if (hitID >= 0 && (depthDiff = hitDepth, depthDiff <= length + radius)) { + if (hitID > NO_COLLIDER && (depthDiff = hitDepth, depthDiff <= length + radius)) { depthDiff -= (length + radius); dx = depthDiff * sinTheta; dz = depthDiff * cosTheta; @@ -598,7 +598,7 @@ s32 player_test_move_with_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f } else { height = playerStatus->colliderHeight * 0.75; hitID = player_raycast_general(PLAYER_COLLISION_0, *x, *y + height, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); - if (hitID >= 0 && (depthDiff = hitDepth, depthDiff <= length + radius)) { + if (hitID > NO_COLLIDER && (depthDiff = hitDepth, depthDiff <= length + radius)) { depthDiff -= (length + radius); dx = depthDiff * sinTheta; dz = depthDiff * cosTheta; @@ -747,7 +747,7 @@ void phys_update_standard(void) { collision_main_lateral(); collision_check_player_overlaps(); - if (collision_main_above() < 0 && playerStatus->timeInAir == 0 && + if (collision_main_above() <= NO_COLLIDER && playerStatus->timeInAir == 0 && playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) { collision_lateral_peach(); } @@ -1218,7 +1218,7 @@ void check_for_interactables(void) { if (curInteraction == NO_COLLIDER) { s32 floor = gCollisionStatus.curFloor; - if ((floor >= 0) && (floor & COLLISION_WITH_ENTITY_BIT)) { + if (floor > NO_COLLIDER && (floor & COLLISION_WITH_ENTITY_BIT)) { phi_s2 = 1; curInteraction = floor; switch (get_entity_type(floor)) { @@ -1277,7 +1277,7 @@ void check_for_interactables(void) { } playerStatus->interactingWithID = curInteraction; - if ((phi_s2 == 0) || curInteraction >= 0 && get_entity_by_index(curInteraction)->flags & ENTITY_FLAG_SHOWS_INSPECT_PROMPT) { + if ((phi_s2 == 0) || curInteraction > NO_COLLIDER && get_entity_by_index(curInteraction)->flags & ENTITY_FLAG_SHOWS_INSPECT_PROMPT) { if (playerStatus->actionState == ACTION_STATE_IDLE || playerStatus->actionState == ACTION_STATE_WALK || playerStatus->actionState == ACTION_STATE_RUN) { playerStatus->animFlags |= PA_FLAG_INTERACT_PROMPT_AVAILABLE; func_800EF3D4(2); diff --git a/src/7BB60.c b/src/7BB60.c index 08fd6f0708..ac3c0db241 100644 --- a/src/7BB60.c +++ b/src/7BB60.c @@ -6,7 +6,7 @@ CollisionStatus gCollisionStatus; f32 D_8010C928; f32 JumpedOnSwitchX; f32 JumpedOnSwitchZ; -f32 D_8010C984; +f32 StepUpLastYaw; extern f32 GravityParamsStartJump[]; @@ -92,7 +92,7 @@ s32 collision_main_above(void) { hitResult = player_raycast_up_corners(playerStatus, &x, &y, &z, &sp2C, moveAngle); collisionStatus->curCeiling = hitResult; - if (hitResult >= 0) { + if (hitResult > NO_COLLIDER) { if (playerStatus->actionState != ACTION_STATE_FALLING && playerStatus->actionState != ACTION_STATE_STEP_DOWN && collisionStatus->curFloor <= NO_COLLIDER @@ -153,7 +153,7 @@ void handle_jumping_land_on_switch(void) { groundPosY = player_check_collision_below(player_fall_distance(), &colliderID); player_handle_floor_collider_type(colliderID); playerStatus->pos.y = groundPosY; - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) { anim = ANIM_Mario1_Land; } else { @@ -339,7 +339,7 @@ void player_handle_floor_collider_type(s32 colliderID) { PlayerStatus* playerStatus = &gPlayerStatus; PartnerStatus* partnerStatus = &gPartnerStatus; - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { s32 surfaceType = get_collider_flags(colliderID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; switch (surfaceType) { case SURFACE_TYPE_WATER: @@ -481,8 +481,8 @@ f32 player_check_collision_below(f32 offset, s32* colliderID) { s32 hit = *colliderID = player_raycast_below_cam_relative(&gPlayerStatus, &x, &y, &z, &outLength, &sp38, &sp3C, &sp40, &sp44); - if (hit < 0) { - if (offset >= 0.0f && collisionStatus->curCeiling >= 0) { + if (hit <= NO_COLLIDER) { + if (offset >= 0.0f && collisionStatus->curCeiling > NO_COLLIDER) { return playerStatus->pos.y; } y = playerStatus->pos.y + offset; @@ -673,7 +673,7 @@ void collision_main_lateral(void) { playerZ = playerStatus->pos.z; result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, playerStatus->colliderDiameter * 0.5f, playerStatus->targetYaw); - if (speed == 0.0f && result < 0) { + if (speed == 0.0f && result <= NO_COLLIDER) { yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; sin_cos_rad(DEG_TO_RAD(yaw2 + 180.0f), &sinTheta, &cosTheta); playerX = playerStatus->pos.x + (sinTheta * playerStatus->colliderDiameter * 0.5f); @@ -697,7 +697,7 @@ void collision_main_lateral(void) { if (speed > 4.0f) { result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, 4.0f, yaw2); - if (result < 0) { + if (result <= NO_COLLIDER) { result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, speed - 4.0f, yaw2); } collisionStatus->pushingAgainstWall = result; @@ -717,15 +717,15 @@ void collision_main_lateral(void) { yaw = clamp_angle(yaw2 + 35.0); test2 = player_test_lateral_overlap(PLAYER_COLLISION_0, playerStatus, &test2X, &test2Z, &test2Y, 0.0f, yaw); - if (test1 < 0) { - if (test2 < 0) { + if (test1 <= NO_COLLIDER) { + if (test2 <= NO_COLLIDER) { playerStatus->pos.x = playerX; playerStatus->pos.z = playerZ; } else { playerStatus->pos.x = test1X; playerStatus->pos.z = test1Z; } - } else if (test2 < 0) { + } else if (test2 <= NO_COLLIDER) { playerStatus->pos.x = test2X; playerStatus->pos.z = test2Y; } @@ -736,7 +736,7 @@ void collision_main_lateral(void) { } else { yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; } - if (collision_check_player_intersecting_world(0, 0, yaw2) < 0) { + if (collision_check_player_intersecting_world(0, 0, yaw2) <= NO_COLLIDER) { collision_check_player_intersecting_world(1, playerStatus->colliderHeight * 0.75f, yaw2); } } @@ -778,7 +778,7 @@ s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 yaw) { hitID2 = hitID; } - if (hitID2 >= 0) { + if (hitID2 > NO_COLLIDER) { ret = hitID2; } gPlayerStatusPtr = gPlayerStatusPtr; @@ -802,7 +802,7 @@ s32 func_800E4404(s32 mode, s32 arg1, f32 arg2, f32* outX, f32* outY, f32* outZ) f32 z = *outZ; s32 hitID = player_test_lateral_overlap(mode, gPlayerStatusPtr, &x, &y, &z, 0, angle); - if (hitID >= 0) { + if (hitID > NO_COLLIDER) { ret = hitID; } @@ -903,7 +903,7 @@ void phys_main_collision_below(void) { if (playerStatus->timeInAir == 0) { collisionStatus->curFloor = colliderID; } - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { playerStatus->groundAnglesXZ.x = hitDirX; playerStatus->groundAnglesXZ.y = hitDirZ; } @@ -924,7 +924,7 @@ void phys_main_collision_below(void) { (phys_adjust_cam_on_landing(), !phys_should_player_be_sliding()) || (set_action_state(ACTION_STATE_SLIDING), (playerStatus->actionState != ACTION_STATE_SLIDING)))) { - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { s32 surfaceType = get_collider_flags(colliderID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; switch (surfaceType) { case SURFACE_TYPE_SPIKES: @@ -964,7 +964,7 @@ void phys_main_collision_below(void) { } else { set_action_state(ACTION_STATE_STEP_UP); D_8010C928 = playerY; - D_8010C984 = playerStatus->targetYaw; + StepUpLastYaw = playerStatus->targetYaw; } } else { playerStatus->pos.y = playerY; @@ -1081,7 +1081,7 @@ void collision_lateral_peach(void) { // If there was a climbable step in this direction, but no wall, we can climb up it if (climbableStep - && wall < 0 + && wall <= NO_COLLIDER && playerStatus->actionState != ACTION_STATE_STEP_UP_PEACH && playerStatus->curSpeed != 0.0f ) { @@ -1157,7 +1157,7 @@ s32 phys_check_interactable_collision(void) { z = playerStatus->pos.z; ret = player_test_move_with_slipping(playerStatus, &x, &y, &z, playerStatus->colliderDiameter * 0.5f, yaw); - if (ret < 0 && playerStatus->curSpeed == 0.0f) { + if (ret <= NO_COLLIDER && playerStatus->curSpeed == 0.0f) { yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; x = playerStatus->pos.x; y = playerStatus->pos.y; diff --git a/src/891b0_len_fb0.c b/src/891b0_len_fb0.c index d6eeb497b6..0f5596c107 100644 --- a/src/891b0_len_fb0.c +++ b/src/891b0_len_fb0.c @@ -26,8 +26,8 @@ s32 D_801094A8 = 0; s16 D_801094AC = 4; s16 D_801094AE = 4; -BSS s32 D_8010CFF0; -BSS s32 D_8010CFF4; +BSS s32 PrevTimeInAir; +BSS s32 LandedTimeInAir; void func_800EFD00(void) { } @@ -48,10 +48,10 @@ void handle_floor_behavior(void) { } if (playerStatus->actionState == ACTION_STATE_LAND && playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { - D_8010CFF4 = D_8010CFF0; + LandedTimeInAir = PrevTimeInAir; } - D_8010CFF0 = playerStatus->timeInAir; + PrevTimeInAir = playerStatus->timeInAir; switch (colliderType) { case SURFACE_TYPE_FLOWERS: @@ -88,7 +88,7 @@ void surface_standard_behavior(void) { if (playerStatus->actionState == ACTION_STATE_LAND && (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) && - D_8010CFF4 >= 10) + LandedTimeInAir >= 10) { x = playerStatus->pos.x; y = playerStatus->pos.y + 0.0f; @@ -222,7 +222,7 @@ void surface_cloud_behavior(void) { if (((playerStatus->actionState == ACTION_STATE_LAND && (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED)) || ((playerStatus->actionState == ACTION_STATE_SPIN_POUND || playerStatus->actionState == ACTION_STATE_TORNADO_POUND) && (playerStatus->flags & PS_FLAG_SPECIAL_LAND))) && - D_8010CFF4 >= 10) + LandedTimeInAir >= 10) { fx_cloud_puff( playerStatus->pos.x, diff --git a/src/battle/16C8E0.c b/src/battle/16C8E0.c index d9663cc05d..0228cb0d8b 100644 --- a/src/battle/16C8E0.c +++ b/src/battle/16C8E0.c @@ -97,7 +97,7 @@ EvtScript BtlBringPartnerOut = { }; extern HudScript HES_HPBar; -extern HudScript HES_Item_SmallStarPoint; +extern HudScript HES_SmallStarPoint; extern HudScript HES_Item_StarPoint; extern HudScript HES_StatusSPShine; @@ -218,7 +218,7 @@ void initialize_battle(void) { } for (i = 0; i < ARRAY_COUNT(BtlStarPointOnesHIDs); i++) { - hudElemID = BtlStarPointOnesHIDs[i] = hud_element_create(&HES_Item_SmallStarPoint); + hudElemID = BtlStarPointOnesHIDs[i] = hud_element_create(&HES_SmallStarPoint); hud_element_set_flags(hudElemID, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED); hud_element_set_render_depth(hudElemID, 20); } @@ -1049,8 +1049,8 @@ void btl_update_starpoints_display(void) { for (i = 0; i < ones; i++) { id = BtlStarPointOnesHIDs[i]; - if (hud_element_get_script(id) != &HES_Item_SmallStarPoint) { - hud_element_set_script(id, &HES_Item_SmallStarPoint); + if (hud_element_get_script(id) != &HES_SmallStarPoint) { + hud_element_set_script(id, &HES_SmallStarPoint); } hud_element_clear_flags(id, 2); hud_element_set_render_pos(id, posX, posY); diff --git a/src/bss/engine1_pre_bss.c b/src/bss/engine1_pre_bss.c index 15274228d1..8cb7078904 100644 --- a/src/bss/engine1_pre_bss.c +++ b/src/bss/engine1_pre_bss.c @@ -30,7 +30,7 @@ BSS s32 NpcHitQueryBehindLeftY; BSS s32 NpcHitQueryColliderID; BSS f32 JumpedOnSwitchZ; BSS s32 PlayerRunStateTime; -BSS f32 D_8010C984; +BSS f32 StepUpLastYaw; BSS s32 D_8010C988; BSS s32 NpcHitQueryAheadCollider; BSS f32 PlayerNormalPitch; diff --git a/src/collision.c b/src/collision.c index 821104fb64..928ff61444 100644 --- a/src/collision.c +++ b/src/collision.c @@ -834,7 +834,7 @@ s32 test_ray_colliders(s32 ignoreFlags, f32 startX, f32 startY, f32 startZ, f32 } } - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { *hitX = gCollisionPointX; *hitY = gCollisionPointY; *hitZ = gCollisionPointZ; @@ -883,7 +883,7 @@ s32 test_ray_zones(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 d } } - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { *hitX = gCollisionPointX; *hitY = gCollisionPointY; *hitZ = gCollisionPointZ; @@ -929,12 +929,6 @@ f32 test_ray_collider_horizontal(s32 ignoreFlags, s32 colliderID, f32 x, f32 y, return ret; } -enum { - ENTITY_TEST_ANY = 0, - ENTITY_TEST_DOWN = 1, - ENTITY_TEST_LATERAL = 2, -}; - s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32* hitX, f32* hitY, f32* hitZ, f32* hitDepth, f32* hitNx, f32* hitNy, f32* hitNz) { f32 hitDepthDown, hitDepthHoriz; @@ -952,6 +946,12 @@ s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f3 f32 dist, dist2; ColliderTriangle *triangle = &entityTriangle; + enum { + ENTITY_TEST_ANY = 0, + ENTITY_TEST_DOWN = 1, + ENTITY_TEST_LATERAL = 2, + }; + entityIndex = -1; type = ENTITY_TEST_ANY; hitDepthDown = hitDepthHoriz = *hitDepth; diff --git a/src/encounter.c b/src/encounter.c index ef95f48633..af15ca7617 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -84,7 +84,7 @@ EnemyDrops DefaultEnemyDrops = { { .item = ITEM_MUSHROOM, .weight = 50, - .unk_04 = -1, + .flagIdx = -1, }, }, .heartDrops = { diff --git a/src/entity/Block.c b/src/entity/Block.c index ac44dcaed4..7e4be396c2 100644 --- a/src/entity/Block.c +++ b/src/entity/Block.c @@ -629,7 +629,7 @@ EntityBlueprint Entity_Hammer1Block = { .aabbSize = { 50, 50, 50 } }; -EntityBlueprint Entity_Hammer1Block_WideX = { +EntityBlueprint Entity_Hammer1BlockWideX = { .flags = ENTITY_FLAG_4000 | ENTITY_FLAG_FIXED_SHADOW_SIZE | ENTITY_FLAG_80, .typeDataSize = sizeof(BlockData), .renderCommandList = Entity_Hammer1Block_RenderScript, @@ -642,7 +642,7 @@ EntityBlueprint Entity_Hammer1Block_WideX = { .aabbSize = { 100, 50, 50 } }; -EntityBlueprint Entity_Hammer1Block_WideZ = { +EntityBlueprint Entity_Hammer1BlockWideZ = { .flags = ENTITY_FLAG_4000 | ENTITY_FLAG_FIXED_SHADOW_SIZE | ENTITY_FLAG_80, .typeDataSize = sizeof(BlockData), .renderCommandList = Entity_Hammer1Block_RenderScript, @@ -681,7 +681,7 @@ EntityBlueprint Entity_Hammer2Block = { .aabbSize = { 50, 50, 50 } }; -EntityBlueprint Entity_Hammer2Block_WideX = { +EntityBlueprint Entity_Hammer2BlockWideX = { .flags = ENTITY_FLAG_4000 | ENTITY_FLAG_FIXED_SHADOW_SIZE | ENTITY_FLAG_80, .typeDataSize = sizeof(BlockData), .renderCommandList = Entity_Hammer2Block_RenderScript, @@ -694,7 +694,7 @@ EntityBlueprint Entity_Hammer2Block_WideX = { .aabbSize = { 100, 50, 50 } }; -EntityBlueprint Entity_Hammer2Block_WideZ = { +EntityBlueprint Entity_Hammer2BlockWideZ = { .flags = ENTITY_FLAG_4000 | ENTITY_FLAG_FIXED_SHADOW_SIZE | ENTITY_FLAG_80, .typeDataSize = sizeof(BlockData), .renderCommandList = Entity_Hammer2Block_RenderScript, @@ -733,7 +733,7 @@ EntityBlueprint Entity_Hammer3Block = { .aabbSize = { 50, 50, 50 } }; -EntityBlueprint Entity_Hammer3Block_WideX = { +EntityBlueprint Entity_Hammer3BlockWideX = { .flags = ENTITY_FLAG_4000 | ENTITY_FLAG_FIXED_SHADOW_SIZE | ENTITY_FLAG_80, .typeDataSize = sizeof(BlockData), .renderCommandList = Entity_Hammer3Block_RenderScript, @@ -746,7 +746,7 @@ EntityBlueprint Entity_Hammer3Block_WideX = { .aabbSize = { 100, 50, 50 } }; -EntityBlueprint Entity_Hammer3Block_WideZ = { +EntityBlueprint Entity_Hammer3BlockWideZ = { .flags = ENTITY_FLAG_4000 | ENTITY_FLAG_FIXED_SHADOW_SIZE | ENTITY_FLAG_80, .typeDataSize = sizeof(BlockData), .renderCommandList = Entity_Hammer3Block_RenderScript, diff --git a/src/entity/default/BombableRock.c b/src/entity/default/BombableRock.c index d36b5f6f76..ca5cabe7f9 100644 --- a/src/entity/default/BombableRock.c +++ b/src/entity/default/BombableRock.c @@ -260,7 +260,7 @@ EntityBlueprint Entity_BombableRock = { .aabbSize = { 50, 50, 50 } }; -EntityBlueprint Entity_BombableRock2 = { +EntityBlueprint Entity_BombableRockWide = { .flags = 0, .typeDataSize = sizeof(BombableRockData), .renderCommandList = Entity_BombableRock_RenderScript, diff --git a/src/entity/jan_iwa/Plants1.c b/src/entity/jan_iwa/Plants1.c index 6b7a266011..d97284c9a6 100644 --- a/src/entity/jan_iwa/Plants1.c +++ b/src/entity/jan_iwa/Plants1.c @@ -22,9 +22,9 @@ extern Gfx Entity_SpinningFlower_Render[]; BSS f32 D_802BCE20; BSS f32 D_802BCE24[3]; // unused -BSS u16 D_802BCE30; -BSS u16 D_802BCE32; -BSS u16 D_802BCE34; +BSS u16 FlowerGoalPositionY; +BSS u16 FlowerGoalPositionZ; +BSS u16 FlowerGoalPositionX; void entity_SpinningFlower_setupGfx(s32 entityIndex) { Entity* entity = get_entity_by_index(entityIndex); @@ -59,9 +59,9 @@ void func_802BB000_E2D930(Entity* entity) { if (playerStatus->actionState == ACTION_STATE_RIDE) { playerStatus->animFlags |= PA_FLAG_INTERRUPT_USE_PARTNER; } else if (playerStatus->actionState != ACTION_STATE_USE_SPINNING_FLOWER) { - D_802BCE34 = data->unk_28; - D_802BCE30 = data->unk_2A; - D_802BCE32 = data->unk_2C; + FlowerGoalPositionX = data->pos.x; + FlowerGoalPositionY = data->pos.y; + FlowerGoalPositionZ = data->pos.z; set_action_state(ACTION_STATE_USE_SPINNING_FLOWER); } } @@ -131,9 +131,9 @@ void entity_SpinningFlower_init(Entity* entity) { z = entity->pos.z; } - data->unk_28 = x; - data->unk_2A = y; - data->unk_2C = z; + data->pos.x = x; + data->pos.y = y; + data->pos.z = z; data->state = 0; entity->renderSetupFunc = entity_SpinningFlower_setupGfx; } diff --git a/src/evt/demo_api.c b/src/evt/demo_api.c index 2f1f61267c..42f63de298 100644 --- a/src/evt/demo_api.c +++ b/src/evt/demo_api.c @@ -7,8 +7,8 @@ extern Addr sprite_shading_profiles_ROM_START; #endif // TODO: not sure where these go -u8 D_802D9D70 = 254; -u8 D_802D9D71 = 254; +u8 ReflectWallPrevAlpha = 254; +u8 ReflectFloorPrevAlpha = 254; u16 StarShrineLightBeamAlpha = 255; extern s32 gSpriteShadingHeader[2]; @@ -106,27 +106,22 @@ API_CALLABLE(DemoSetButtons) { API_CALLABLE(DemoJoystickRadial) { GameStatus** gameStatus = &gGameStatusPtr; - f32 a; - f32 b; - s32* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - a = evt_get_float_variable(script, *thisPos++); - b = evt_get_float_variable(script, *thisPos++); + f32 mag = evt_get_float_variable(script, *args++); + f32 ang = evt_get_float_variable(script, *args++); - (*gameStatus)->demoStickX = a * sin_deg(b); - (*gameStatus)->demoStickY = a * cos_deg(b); + (*gameStatus)->demoStickX = mag * sin_deg(ang); + (*gameStatus)->demoStickY = mag * cos_deg(ang); return ApiStatus_DONE2; } API_CALLABLE(DemoJoystickXY) { GameStatus** gameStatus = &gGameStatusPtr; - f32 x; - f32 y; - s32* thisPos = script->ptrReadPos; - - x = evt_get_float_variable(script, *thisPos++); - y = evt_get_float_variable(script, *thisPos++); + Bytecode* args = script->ptrReadPos; + f32 x = evt_get_float_variable(script, *args++); + f32 y = evt_get_float_variable(script, *args++); (*gameStatus)->demoStickX = x; (*gameStatus)->demoStickY = y; diff --git a/src/evt/evt.c b/src/evt/evt.c index beea879858..7fbfddcd1d 100644 --- a/src/evt/evt.c +++ b/src/evt/evt.c @@ -21,7 +21,7 @@ f32 evt_fixed_var_to_float(Bytecode scriptVar) { } Bytecode evt_float_to_fixed_var(f32 value) { - // not equivalent to hte Float_TO_FIXED() macro due to the s32 cast + // not equivalent to the FLOAT_TO_FIXED() macro due to the s32 cast // occuring *before* the add here and *after* the add in the macro return (s32)(value * 1024.0f) + -EVT_FIXED_OFFSET; } diff --git a/src/evt/f8f60_len_1560.c b/src/evt/f8f60_len_1560.c index 058bfa7887..de55a61ed4 100644 --- a/src/evt/f8f60_len_1560.c +++ b/src/evt/f8f60_len_1560.c @@ -433,9 +433,9 @@ API_CALLABLE(GetNextPathPos) { } get_path_position(alpha, &pos, path->numVectors, path->lengths, path->staticVectorList, path->vectors); - script->varTable[1] = (pos.x * 1024.0f) + -2.3e8f; - script->varTable[2] = (pos.y * 1024.0f) + -2.3e8f; - script->varTable[3] = (pos.z * 1024.0f) + -2.3e8f; + script->varTable[1] = FLOAT_TO_FIXED(pos.x); + script->varTable[2] = FLOAT_TO_FIXED(pos.y); + script->varTable[3] = FLOAT_TO_FIXED(pos.z); if (path->timeElapsed < path->timeLeft) { path->timeElapsed = path->timeElapsed + 1; diff --git a/src/evt/map_api.c b/src/evt/map_api.c index 1d54022383..6205dec89d 100644 --- a/src/evt/map_api.c +++ b/src/evt/map_api.c @@ -346,13 +346,13 @@ API_CALLABLE(MakeTransformGroup) { API_CALLABLE(SetTransformGroupEnabled) { Bytecode* args = script->ptrReadPos; - u16 var1 = evt_get_variable(script, *args++); - s32 var2 = evt_get_variable(script, *args++); + u16 modelID = evt_get_variable(script, *args++); + s32 enable = evt_get_variable(script, *args++); - if (var2 != 0) { - enable_transform_group(var1); + if (enable) { + enable_transform_group(modelID); } else { - disable_transform_group(var1); + disable_transform_group(modelID); } return ApiStatus_DONE2; } diff --git a/src/evt/player_api.c b/src/evt/player_api.c index 28e179a55d..feae679228 100644 --- a/src/evt/player_api.c +++ b/src/evt/player_api.c @@ -326,7 +326,7 @@ ApiStatus player_jump(Evt* script, s32 isInitialCall, s32 mode) { yTemp = player_check_collision_below(playerNpc->jumpVel, &colliderID); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { playerStatus->pos.y = yTemp; player_handle_floor_collider_type(colliderID); handle_floor_behavior(); diff --git a/src/evt/script_list.c b/src/evt/script_list.c index 7203cd43ed..6b2a74b1e6 100644 --- a/src/evt/script_list.c +++ b/src/evt/script_list.c @@ -1,9 +1,9 @@ #include "common.h" #include "hud_element.h" -s32 gStaticScriptCounter = 1; -s32 gIsUpdatingScripts = 0; -f32 gGlobalTimeSpace = 1.0f; +s32 UniqueScriptCounter = 1; +s32 IsUpdatingScripts = FALSE; +f32 GlobalTimeRate = 1.0f; // script_list BSS u32* gMapFlags; @@ -186,7 +186,7 @@ void clear_script_list(void) { gNumScripts = 0; gScriptListCount = 0; - gIsUpdatingScripts = 0; + IsUpdatingScripts = FALSE; for (i = 0; i < MAX_MAPVARS; i++) { gMapVars[i] = 0; @@ -212,7 +212,7 @@ void init_script_list(void) { } gNumScripts = 0; - gIsUpdatingScripts = 0; + IsUpdatingScripts = FALSE; init_virtual_entity_list(); init_model_animators(); @@ -266,7 +266,7 @@ Evt* start_script(EvtScript* source, s32 priority, s32 flags) { newScript->blockingParent = NULL; newScript->childScript = NULL; newScript->parentScript = NULL; - newScript->id = gStaticScriptCounter++; + newScript->id = UniqueScriptCounter++; newScript->owner1.actorID = -1; newScript->owner2.npcID = -1; newScript->loopDepth = -1; @@ -275,7 +275,7 @@ Evt* start_script(EvtScript* source, s32 priority, s32 flags) { newScript->ptrSavedPos = NULL; newScript->frameCounter = 0.0f; newScript->unk_158 = 0; - newScript->timeScale = gGlobalTimeSpace; + newScript->timeScale = GlobalTimeRate; scriptListCount = 0; @@ -289,7 +289,7 @@ Evt* start_script(EvtScript* source, s32 priority, s32 flags) { find_script_labels(newScript); - if (gIsUpdatingScripts && (newScript->stateFlags & EVT_FLAG_RUN_IMMEDIATELY)) { + if (IsUpdatingScripts && (newScript->stateFlags & EVT_FLAG_RUN_IMMEDIATELY)) { scriptListCount = gScriptListCount++; gScriptIndexList[scriptListCount] = curScriptIndex; gScriptIdList[scriptListCount] = newScript->id; @@ -297,8 +297,8 @@ Evt* start_script(EvtScript* source, s32 priority, s32 flags) { suspend_frozen_scripts(newScript); - if (gStaticScriptCounter == 0) { - gStaticScriptCounter = 1; + if (UniqueScriptCounter == 0) { + UniqueScriptCounter = 1; } return newScript; @@ -331,7 +331,7 @@ Evt* start_script_in_group(EvtScript* source, u8 priority, u8 flags, u8 groupFla newScript->stateFlags = flags | EVT_FLAG_ACTIVE; newScript->curOpcode = EVT_OP_INTERNAL_FETCH; newScript->priority = priority; - newScript->id = gStaticScriptCounter++; + newScript->id = UniqueScriptCounter++; newScript->ptrNextLine = (Bytecode*)source; newScript->ptrFirstLine = (Bytecode*)source; newScript->ptrCurLine = (Bytecode*)source; @@ -347,7 +347,7 @@ Evt* start_script_in_group(EvtScript* source, u8 priority, u8 flags, u8 groupFla newScript->ptrSavedPos = 0; newScript->frameCounter = 0.0f; newScript->unk_158 = 0; - newScript->timeScale = gGlobalTimeSpace; + newScript->timeScale = GlobalTimeRate; scriptListCount = 0; for (i = 0; i < ARRAY_COUNT(newScript->varTable); i++) { @@ -359,7 +359,7 @@ Evt* start_script_in_group(EvtScript* source, u8 priority, u8 flags, u8 groupFla find_script_labels(newScript); - if (gIsUpdatingScripts && (newScript->stateFlags & EVT_FLAG_RUN_IMMEDIATELY)) { + if (IsUpdatingScripts && (newScript->stateFlags & EVT_FLAG_RUN_IMMEDIATELY)) { scriptListCount = gScriptListCount++; gScriptIndexList[scriptListCount] = curScriptIndex; gScriptIdList[scriptListCount] = newScript->id; @@ -368,7 +368,7 @@ Evt* start_script_in_group(EvtScript* source, u8 priority, u8 flags, u8 groupFla suspend_frozen_scripts(newScript); - tempCounter = &gStaticScriptCounter; + tempCounter = &UniqueScriptCounter; if (*tempCounter == 0) { *tempCounter = 1; } @@ -407,7 +407,7 @@ Evt* start_child_script(Evt* parentScript, EvtScript* source, s32 flags) { child->childScript = NULL; child->parentScript = NULL; child->priority = parentScript->priority + 1; - child->id = gStaticScriptCounter++; + child->id = UniqueScriptCounter++; child->owner1 = parentScript->owner1; child->owner2 = parentScript->owner2; child->loopDepth = -1; @@ -416,7 +416,7 @@ Evt* start_child_script(Evt* parentScript, EvtScript* source, s32 flags) { child->ptrSavedPos = NULL; child->array = parentScript->array; child->flagArray = parentScript->flagArray; - child->timeScale = gGlobalTimeSpace; + child->timeScale = GlobalTimeRate; child->frameCounter = 0.0f; child->unk_158 = 0; @@ -431,7 +431,7 @@ Evt* start_child_script(Evt* parentScript, EvtScript* source, s32 flags) { } find_script_labels(child); - if (gIsUpdatingScripts) { + if (IsUpdatingScripts) { scriptListCount = gScriptListCount++; gScriptIndexList[scriptListCount] = curScriptIndex; gScriptIdList[scriptListCount] = child->id; @@ -439,8 +439,8 @@ Evt* start_child_script(Evt* parentScript, EvtScript* source, s32 flags) { suspend_frozen_scripts(child); - if (gStaticScriptCounter == 0) { - gStaticScriptCounter = 1; + if (UniqueScriptCounter == 0) { + UniqueScriptCounter = 1; } return child; @@ -475,7 +475,7 @@ Evt* func_802C39F8(Evt* parentScript, Bytecode* nextLine, s32 newState) { child->parentScript = parentScript; child->childScript = NULL; child->priority = parentScript->priority; - child->id = gStaticScriptCounter++; + child->id = UniqueScriptCounter++; child->owner1.actorID = parentScript->owner1.actorID; child->owner2.npcID = parentScript->owner2.npcID; child->loopDepth = -1; @@ -484,7 +484,7 @@ Evt* func_802C39F8(Evt* parentScript, Bytecode* nextLine, s32 newState) { child->ptrSavedPos = NULL; child->array = parentScript->array; child->flagArray = parentScript->flagArray; - child->timeScale = gGlobalTimeSpace; + child->timeScale = GlobalTimeRate; child->frameCounter = 0.0f; child->unk_158 = 0; @@ -499,14 +499,14 @@ Evt* func_802C39F8(Evt* parentScript, Bytecode* nextLine, s32 newState) { } find_script_labels(child); - if (gIsUpdatingScripts) { + if (IsUpdatingScripts) { scriptListCount = gScriptListCount++; gScriptIndexList[scriptListCount] = curScriptIndex; gScriptIdList[scriptListCount] = child->id; } - if (gStaticScriptCounter == 0) { - gStaticScriptCounter = 1; + if (UniqueScriptCounter == 0) { + UniqueScriptCounter = 1; } suspend_frozen_scripts(child); @@ -547,7 +547,7 @@ Evt* func_802C3C10(Evt* script, Bytecode* line, s32 arg2) { script->childScript = NULL; script->frameCounter = 0.0f; script->unk_158 = 0; - script->timeScale = gGlobalTimeSpace; + script->timeScale = GlobalTimeRate; find_script_labels(script); suspend_frozen_scripts(script); @@ -569,7 +569,7 @@ Evt* restart_script(Evt* script) { script->frameCounter = 0; script->unk_158 = 0; - script->timeScale = gGlobalTimeSpace; + script->timeScale = GlobalTimeRate; find_script_labels(script); suspend_frozen_scripts(script); @@ -584,7 +584,7 @@ void update_scripts(void) { return; } - gIsUpdatingScripts = TRUE; + IsUpdatingScripts = TRUE; sort_scripts(); for (i = 0; i < gScriptListCount; i++) { @@ -620,7 +620,7 @@ void update_scripts(void) { } } } - gIsUpdatingScripts = FALSE; + IsUpdatingScripts = FALSE; } // Does nothing, is cursed @@ -744,15 +744,15 @@ void set_script_priority(Evt* script, s32 priority) { } void set_script_timescale(Evt* script, f32 timescale) { - script->timeScale = timescale * gGlobalTimeSpace; + script->timeScale = timescale * GlobalTimeRate; } void set_global_timespace(f32 timeScale) { - gGlobalTimeSpace = timeScale; + GlobalTimeRate = timeScale; } f32 get_global_timespace(void) { - return gGlobalTimeSpace; + return GlobalTimeRate; } void set_script_group(Evt* script, s32 groupFlags) { diff --git a/src/item_entity_scripts.yaml b/src/item_entity_scripts.yaml index 15a2ee4f50..dbd6cc5593 100644 --- a/src/item_entity_scripts.yaml +++ b/src/item_entity_scripts.yaml @@ -106,8 +106,8 @@ - { name: Letter, template: STANDARD, icon: key/Letter } - { name: Unused_089, template: STANDARD, icon: key/LongLetter } - { name: Unused_08A, template: STANDARD, icon: key/TealLetter } -- { name: Unused_08B, template: STANDARD, icon: key/Postcard } -- { name: Unused_08C, template: STANDARD, icon: key/EmptyBook } +- { name: Postcard, template: STANDARD, icon: key/Postcard } +- { name: EmptyBook, template: STANDARD, icon: key/EmptyBook } - { name: Unused_08D, template: STANDARD, icon: unused/item_08D } - { name: Unused_08E, template: STANDARD, icon: unused/item_08E } - { name: Unused_08F, template: STANDARD, icon: unused/item_08F } diff --git a/src/item_hud_scripts.yaml b/src/item_hud_scripts.yaml index 539ccc1952..7dc3defd87 100644 --- a/src/item_hud_scripts.yaml +++ b/src/item_hud_scripts.yaml @@ -105,8 +105,8 @@ - { priority: 136, name: Letter, template: STANDARD_ITEM, icon: key/Letter, pair: true } - { priority: 137, name: Unused_089, template: STANDARD_ITEM, icon: key/LongLetter, pair: true } - { priority: 138, name: Unused_08A, template: STANDARD_ITEM, icon: key/TealLetter, pair: true } -- { priority: 139, name: Unused_08B, template: STANDARD_ITEM, icon: key/Postcard, pair: true } -- { priority: 140, name: Unused_08C, template: STANDARD_ITEM, icon: key/EmptyBook, pair: true } +- { priority: 139, name: Postcard, template: STANDARD_ITEM, icon: key/Postcard, pair: true } +- { priority: 140, name: EmptyBook, template: STANDARD_ITEM, icon: key/EmptyBook, pair: true } - { priority: 141, name: Unused_08D, template: STANDARD_ITEM, icon: unused/item_08D, pair: true } - { priority: 142, name: Unused_08E, template: STANDARD_ITEM, icon: unused/item_08E, pair: true } - { priority: 143, name: Unused_08F, template: STANDARD_ITEM, icon: unused/item_08F, pair: true } diff --git a/src/item_table.yaml b/src/item_table.yaml index eee569c65e..b8e37a4eef 100644 --- a/src/item_table.yaml +++ b/src/item_table.yaml @@ -1588,7 +1588,7 @@ moveID: MOVE_NONE potencyA: 0 potencyB: 0 -- PeachKey1: +- PeachKey: category: KEY nameMsg: MSG_ItemName_PeachKey fullDescMsg: MSG_ItemFullDesc_PeachKey @@ -1798,7 +1798,7 @@ moveID: MOVE_NONE potencyA: 0 potencyB: 0 -- PeachKey2: +- UnusedPeachKey: category: KEY nameMsg: MSG_ItemName_PeachKey fullDescMsg: MSG_ItemFullDesc_PeachKey @@ -1828,7 +1828,7 @@ moveID: MOVE_NONE potencyA: 0 potencyB: 0 -- PrisonKey1: +- PrisonKey: category: KEY nameMsg: MSG_ItemName_PrisonKey fullDescMsg: MSG_ItemFullDesc_PrisonKey @@ -1873,7 +1873,7 @@ moveID: MOVE_NONE potencyA: 0 potencyB: 0 -- PrisonKey2: +- UnusedPrisonKey1: category: KEY nameMsg: MSG_ItemName_PrisonKey fullDescMsg: MSG_ItemFullDesc_PrisonKey @@ -1888,7 +1888,7 @@ moveID: MOVE_NONE potencyA: 0 potencyB: 0 -- PrisonKey3: +- UnusedPrisonKey2: category: KEY nameMsg: MSG_ItemName_PrisonKey fullDescMsg: MSG_ItemFullDesc_PrisonKey @@ -1903,7 +1903,7 @@ moveID: MOVE_NONE potencyA: 0 potencyB: 0 -- PrisonKey4: +- UnusedPrisonKey3: category: KEY nameMsg: MSG_ItemName_PrisonKey fullDescMsg: MSG_ItemFullDesc_PrisonKey @@ -3268,7 +3268,7 @@ moveID: MOVE_NONE potencyA: 15 potencyB: 15 -- JellyShroom1: +- JellyShroom: category: CONSUMABLE nameMsg: MSG_ItemName_JellyShroom fullDescMsg: MSG_ItemFullDesc_JellyShroom @@ -3283,7 +3283,7 @@ moveID: MOVE_NONE potencyA: 5 potencyB: 50 -- JellyShroom2: +- UnusedJellyShroom1: category: UNUSED nameMsg: MSG_ItemName_JellyShroom fullDescMsg: MSG_ItemFullDesc_JellyShroom @@ -3298,7 +3298,7 @@ moveID: MOVE_NONE potencyA: 5 potencyB: 50 -- JellyShroom3: +- UnusedJellyShroom2: category: UNUSED nameMsg: MSG_ItemName_JellyShroom fullDescMsg: MSG_ItemFullDesc_JellyShroom @@ -3313,7 +3313,7 @@ moveID: MOVE_NONE potencyA: 5 potencyB: 50 -- JellyShroom4: +- UnusedJellyShroom3: category: UNUSED nameMsg: MSG_ItemName_JellyShroom fullDescMsg: MSG_ItemFullDesc_JellyShroom @@ -3328,7 +3328,7 @@ moveID: MOVE_NONE potencyA: 5 potencyB: 50 -- JellyShroom5: +- UnusedJellyShroom4: category: UNUSED nameMsg: MSG_ItemName_JellyShroom fullDescMsg: MSG_ItemFullDesc_JellyShroom @@ -3343,7 +3343,7 @@ moveID: MOVE_NONE potencyA: 5 potencyB: 50 -- JellyShroom6: +- UnusedJellyShroom5: category: UNUSED nameMsg: MSG_ItemName_JellyShroom fullDescMsg: MSG_ItemFullDesc_JellyShroom @@ -4378,7 +4378,7 @@ moveID: MOVE_MEGA_JUMP potencyA: 0 potencyB: 0 -- PowerSmash1: +- PowerSmash: category: BADGE nameMsg: MSG_ItemName_PowerSmash fullDescMsg: MSG_ItemFullDesc_PowerSmash @@ -4423,7 +4423,7 @@ moveID: MOVE_MEGA_SMASH potencyA: 0 potencyB: 0 -- PowerSmash2: +- UnusedPowerSmash1: category: BADGE nameMsg: MSG_ItemName_PowerSmash fullDescMsg: MSG_ItemFullDesc_PowerSmash @@ -4438,7 +4438,7 @@ moveID: MOVE_MEGA_SMASH potencyA: 0 potencyB: 0 -- PowerSmash3: +- UnusedPowerSmash2: category: BADGE nameMsg: MSG_ItemName_PowerSmash fullDescMsg: MSG_ItemFullDesc_PowerSmash @@ -4453,7 +4453,7 @@ moveID: MOVE_MEGA_SMASH potencyA: 0 potencyB: 0 -- DeepFocus1: +- DeepFocusA: category: BADGE nameMsg: MSG_ItemName_DeepFocus fullDescMsg: MSG_ItemFullDesc_DeepFocus @@ -4588,7 +4588,7 @@ moveID: MOVE_EARTHQUAKE_JUMP potencyA: 0 potencyB: 0 -- DeepFocus2: +- DeepFocusB: category: BADGE nameMsg: MSG_ItemName_DeepFocus fullDescMsg: MSG_ItemFullDesc_DeepFocus @@ -4603,7 +4603,7 @@ moveID: MOVE_DEEP_FOCUS potencyA: 0 potencyB: 0 -- DeepFocus3: +- DeepFocusC: category: BADGE nameMsg: MSG_ItemName_DeepFocus fullDescMsg: MSG_ItemFullDesc_DeepFocus @@ -5053,7 +5053,7 @@ moveID: MOVE_HEALTHY_HEALTHY potencyA: 0 potencyB: 0 -- AttackFX_F2: +- UnusedAttackFX_1: category: BADGE nameMsg: MSG_ItemName_AttackFXF fullDescMsg: MSG_ItemFullDesc_AttackFXF @@ -5068,7 +5068,7 @@ moveID: MOVE_ATTACK_FX_F potencyA: 0 potencyB: 0 -- AttackFX_F3: +- UnusedAttackFX_2: category: BADGE nameMsg: MSG_ItemName_AttackFXF fullDescMsg: MSG_ItemFullDesc_AttackFXF @@ -5083,7 +5083,7 @@ moveID: MOVE_ATTACK_FX_F potencyA: 0 potencyB: 0 -- AttackFX_F4: +- UnusedAttackFX_3: category: BADGE nameMsg: MSG_ItemName_AttackFXF fullDescMsg: MSG_ItemFullDesc_AttackFXF @@ -5098,7 +5098,7 @@ moveID: MOVE_ATTACK_FX_F potencyA: 0 potencyB: 0 -- AttackFX_F5: +- UnusedAttackFX_4: category: BADGE nameMsg: MSG_ItemName_AttackFXF fullDescMsg: MSG_ItemFullDesc_AttackFXF diff --git a/src/move_table.yaml b/src/move_table.yaml index 5bb6438165..dba4b52076 100644 --- a/src/move_table.yaml +++ b/src/move_table.yaml @@ -1,25 +1,25 @@ - None: - nameMsg: 0 - fullDescMsg: 0 - shortDescMsg: 0 + nameMsg: MSG_NONE + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [] category: MOVE_TYPE_NONE actionTip: NONE costFP: 0 costBP: 0 - Unused_01: - nameMsg: 0 - fullDescMsg: 0 - shortDescMsg: 0 + nameMsg: MSG_NONE + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_2 ] category: MOVE_TYPE_NONE actionTip: NONE costFP: 0 costBP: 0 - Unused_02: - nameMsg: 0 - fullDescMsg: 0 - shortDescMsg: 0 + nameMsg: MSG_NONE + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_PLAYER ] category: MOVE_TYPE_NONE actionTip: NONE @@ -27,7 +27,7 @@ costBP: 0 - Hammer1: nameMsg: MSG_Menus_Hammer - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_ItemShortDesc_Hammer flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_GROUND, TARGET_FLAG_SMASH_LIKE, TARGET_FLAG_NOT_BEHIND, TARGET_FLAG_ALLOW_TARGET_ONLY ] category: MOVE_TYPE_HAMMER @@ -54,8 +54,8 @@ costBP: 0 - FirstStrikeHammer: nameMsg: MSG_Menus_Hammer - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_GROUND, TARGET_FLAG_SMASH_LIKE, TARGET_FLAG_NOT_BEHIND, TARGET_FLAG_ALLOW_TARGET_ONLY ] category: MOVE_TYPE_HAMMER actionTip: BTL_MSG_ACTION_TIP_HOLD_LEFT_TIMED @@ -261,8 +261,8 @@ costBP: 0 - FirstStrikeJump: nameMsg: MSG_Menus_Jump - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_80, TARGET_FLAG_JUMP_LIKE, TARGET_FLAG_NOT_BELOW, TARGET_FLAG_ALLOW_TARGET_ONLY, TARGET_FLAG_NO_CEILING ] category: MOVE_TYPE_JUMP actionTip: BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING @@ -468,7 +468,7 @@ costBP: 3 - Items: nameMsg: MSG_Menus_Items - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_Action_UseItem flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_GROUND, TARGET_FLAG_ALLOW_TARGET_ONLY ] category: MOVE_TYPE_ITEMS @@ -495,8 +495,8 @@ costBP: 3 - Unused_37: nameMsg: (s32) "つうじょう" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [] category: MOVE_TYPE_SWITCH actionTip: NONE @@ -513,8 +513,8 @@ costBP: 4 - Unused_39: nameMsg: (s32) "つうじょう" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_GROUND, TARGET_FLAG_ALLOW_TARGET_ONLY ] category: MOVE_TYPE_6 actionTip: NONE @@ -522,8 +522,8 @@ costBP: 0 - Unused_3A: nameMsg: (s32) "つうじょう" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [] category: MOVE_TYPE_ATTACK_UP actionTip: NONE @@ -567,8 +567,8 @@ costBP: 2 - Unused_3F: nameMsg: (s32) "つうじょう" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_GROUND, TARGET_FLAG_ALLOW_TARGET_ONLY ] category: MOVE_TYPE_DEFENSE_UP actionTip: NONE @@ -675,8 +675,8 @@ costBP: 1 - Unused_4B: nameMsg: (s32) "つうじょう" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [] category: MOVE_TYPE_9 actionTip: NONE @@ -729,8 +729,8 @@ costBP: 5 - Unused_51: nameMsg: (s32) "つうじょう" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_GROUND, TARGET_FLAG_ALLOW_TARGET_ONLY ] category: MOVE_TYPE_NONE actionTip: NONE @@ -999,8 +999,8 @@ costBP: 1 - Unused_FinalGoompa: nameMsg: (s32) "ファイナルクリジイ" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_2 ] category: MOVE_TYPE_NONE actionTip: NONE @@ -1008,8 +1008,8 @@ costBP: 1 - Unused_FinalBobomb: nameMsg: (s32) "ファイナルボムヘイ" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_2 ] category: MOVE_TYPE_NONE actionTip: NONE @@ -1071,7 +1071,7 @@ costBP: 3 - Focus: nameMsg: MSG_Menus_StarPower_Focus - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_Focus flags: [ TARGET_FLAG_OVERRIDE ] category: MOVE_TYPE_STAR_POWER @@ -1080,7 +1080,7 @@ costBP: 0 - Refresh: nameMsg: MSG_Menus_StarPower_Refresh - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_Refresh flags: [ TARGET_FLAG_PLAYER ] category: MOVE_TYPE_STAR_POWER @@ -1089,7 +1089,7 @@ costBP: 1 - Lullaby: nameMsg: MSG_Menus_StarPower_Lullaby - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_Lullaby flags: [ TARGET_FLAG_2, TARGET_FLAG_PRIMARY_ONLY ] category: MOVE_TYPE_STAR_POWER @@ -1098,7 +1098,7 @@ costBP: 1 - StarStorm: nameMsg: MSG_Menus_StarPower_StarStorm - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_StarStorm flags: [ TARGET_FLAG_2, TARGET_FLAG_PRIMARY_ONLY ] category: MOVE_TYPE_STAR_POWER @@ -1107,7 +1107,7 @@ costBP: 2 - ChillOutMove: nameMsg: MSG_Menus_StarPower_ChillOut - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_ChillOut flags: [ TARGET_FLAG_2, TARGET_FLAG_PRIMARY_ONLY ] category: MOVE_TYPE_STAR_POWER @@ -1116,7 +1116,7 @@ costBP: 2 - Smooch: nameMsg: MSG_Menus_StarPower_Smooch - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_Smooch flags: [ TARGET_FLAG_PLAYER ] category: MOVE_TYPE_STAR_POWER @@ -1125,7 +1125,7 @@ costBP: 3 - TimeOut: nameMsg: MSG_Menus_StarPower_TimeOut - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_TimeOut flags: [ TARGET_FLAG_2, TARGET_FLAG_PRIMARY_ONLY ] category: MOVE_TYPE_STAR_POWER @@ -1134,7 +1134,7 @@ costBP: 2 - UpAndAway: nameMsg: MSG_Menus_StarPower_UpAndAway - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_UpAndAway flags: [ TARGET_FLAG_2, TARGET_FLAG_PRIMARY_ONLY ] category: MOVE_TYPE_STAR_POWER @@ -1143,7 +1143,7 @@ costBP: 2 - StarBeam: nameMsg: MSG_Menus_StarPower_StarBeam - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_StarBeam flags: [ TARGET_FLAG_2, TARGET_FLAG_PRIMARY_ONLY ] category: MOVE_TYPE_STAR_POWER @@ -1152,7 +1152,7 @@ costBP: 0 - PeachBeam: nameMsg: MSG_Menus_StarPower_PeachBeam - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_PeachBeam flags: [ TARGET_FLAG_2, TARGET_FLAG_PRIMARY_ONLY ] category: MOVE_TYPE_STAR_POWER @@ -1161,7 +1161,7 @@ costBP: 0 - PeachFocus: nameMsg: MSG_Menus_StarPower_Peach_Focus - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_Focus flags: [ TARGET_FLAG_PARTNER ] category: MOVE_TYPE_STAR_POWER @@ -1170,7 +1170,7 @@ costBP: 0 - TwinkDash: nameMsg: MSG_Menus_StarPower_Twink_Dash - fullDescMsg: 0 + fullDescMsg: MSG_NONE shortDescMsg: MSG_Menus_StarPowerDesc_Focus flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_2, TARGET_FLAG_PRIMARY_ONLY ] category: MOVE_TYPE_STAR_POWER @@ -1395,8 +1395,8 @@ costBP: 0 - Unused_LoneFool1: nameMsg: (s32) "ひとりぼけ" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_2 ] category: MOVE_TYPE_PARTNER actionTip: BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING @@ -1404,8 +1404,8 @@ costBP: 0 - Unused_LoneFool2: nameMsg: (s32) "ひとりぼけ" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_2 ] category: MOVE_TYPE_PARTNER actionTip: BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING @@ -1413,8 +1413,8 @@ costBP: 0 - Unused_LoneFool3: nameMsg: (s32) "ひとりぼけ" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_2 ] category: MOVE_TYPE_PARTNER actionTip: BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING @@ -1422,8 +1422,8 @@ costBP: 0 - Unused_Mumble: nameMsg: (s32) "むにゃむにゃ" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_GROUND ] category: MOVE_TYPE_PARTNER actionTip: BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING @@ -1431,8 +1431,8 @@ costBP: 0 - Unused_Preach: nameMsg: (s32) "せっきょう" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_2 ] category: MOVE_TYPE_PARTNER actionTip: BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING @@ -1440,8 +1440,8 @@ costBP: 0 - Unused_Awakening: nameMsg: (s32) "かくせい" - fullDescMsg: 0 - shortDescMsg: 0 + fullDescMsg: MSG_NONE + shortDescMsg: MSG_NONE flags: [ TARGET_FLAG_SELECT_ONE, TARGET_FLAG_2 ] category: MOVE_TYPE_PARTNER actionTip: BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING diff --git a/src/npc_collision.c b/src/npc_collision.c index 08d13e5639..79388645ac 100644 --- a/src/npc_collision.c +++ b/src/npc_collision.c @@ -9,7 +9,8 @@ s32 NpcHitQueryColliderID; PlayerStatus* gPlayerStatusPtr = &gPlayerStatus; // maybe wPlayerStatus -s32 npc_raycast_down(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32* hitDepth) { +// not used outside this file +HitID npc_raycast_down(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32* hitDepth) { f32 cHitX; f32 cHitY; f32 cHitZ; @@ -35,7 +36,7 @@ s32 npc_raycast_down(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32 colliderID = test_ray_colliders(ignoreFlags, sx, sy, sz, 0.0f, -1.0f, 0.0f, &cHitX, &cHitY, &cHitZ, &cHitDepth, &cHitNx, &cHitNy, &cHitNz); if (!(ignoreFlags & COLLISION_IGNORE_ENTITIES)) { entityID = test_ray_entities(*startX, *startY, *startZ, 0.0f, -1.0f, 0.0f, &eHitX, &eHitY, &eHitZ, &eHitDepth, &eHitNx, &eHitNy, &eHitNz); - if (entityID >= 0) { + if (entityID > NO_COLLIDER) { colliderID = entityID | COLLISION_WITH_ENTITY_BIT; if (eHitDepth < cHitDepth) { cHitDepth = eHitDepth; @@ -47,7 +48,7 @@ s32 npc_raycast_down(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32 cHitNz = eHitNz; } } - if (colliderID < 0) { + if (colliderID <= NO_COLLIDER) { return colliderID; } } @@ -57,7 +58,7 @@ s32 npc_raycast_down(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32 *startY = cHitY; *startZ = cHitZ; - if (colliderID < 0) { + if (colliderID <= NO_COLLIDER) { return colliderID; } @@ -71,6 +72,7 @@ s32 npc_raycast_down(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32 return colliderID; } +// used specifically for partners b32 npc_raycast_down_around(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth, f32 yaw, f32 radius) { f32 startX; f32 startY; @@ -110,7 +112,7 @@ b32 npc_raycast_down_around(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f3 originalDepth = depth = minDepth; colliderID = npc_raycast_down(ignoreFlags, &startX, &startY, &startZ, &depth); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { if (depth <= minDepth) { hitYAhead = startY; NpcHitQueryColliderID = colliderID; @@ -133,7 +135,7 @@ b32 npc_raycast_down_around(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f3 depth = originalDepth; colliderID = npc_raycast_down(ignoreFlags, &startX, &startY, &startZ, &depth); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { if (depth <= minDepth) { hitYBehindRight = startY; NpcHitQueryColliderID = colliderID; @@ -156,7 +158,7 @@ b32 npc_raycast_down_around(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f3 depth = originalDepth; colliderID = npc_raycast_down(ignoreFlags, &startX, &startY, &startZ, &depth); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { if (depth <= minDepth) { hitYBehindLeft = startY; NpcHitQueryColliderID = colliderID; @@ -180,6 +182,7 @@ b32 npc_raycast_down_around(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f3 return FALSE; } +// used for non-partner NPCs b32 npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth) { f32 startX; f32 startY; @@ -226,7 +229,7 @@ b32 npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32 originalDepth = depth = minDepth; colliderID = npc_raycast_down(ignoreFlags, &startX, &startY, &startZ, &depth); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { if (depth <= minDepth) { hitYAhead = startY; NpcHitQueryColliderID = colliderID; @@ -249,7 +252,7 @@ b32 npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32 depth = originalDepth; colliderID = npc_raycast_down(ignoreFlags, &startX, &startY, &startZ, &depth); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { if (depth <= minDepth) { hitYBehind = startY; NpcHitQueryColliderID = colliderID; @@ -301,7 +304,7 @@ s32 npc_raycast_up(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32* if (!(ignoreFlags & COLLISION_IGNORE_ENTITIES)) { entityID = test_ray_entities(sx, sy, sz, 0.0f, 1.0f, 0.0f, &eHitX, &eHitY, &eHitZ, &eHitDepth, &eHitNx, &eHitNy, &eHitNz); ret = entityID | COLLISION_WITH_ENTITY_BIT; - if (entityID >= 0) { + if (entityID > NO_COLLIDER) { cHitDepth = eHitDepth; cHitX = eHitX; cHitY = eHitY; @@ -314,7 +317,7 @@ s32 npc_raycast_up(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32* } } - if (ret < 0) { + if (ret <= NO_COLLIDER) { // TODO find better match colliderID = FALSE; return colliderID; @@ -348,7 +351,7 @@ s32 npc_raycast_up_corner(s32 ignoreFlags, f32* x, f32* y, f32* z, f32* length) sz2 = sz = *z; hitDepth = *length; colliderID = test_ray_colliders(ignoreFlags, sx, sy, sz, 0.0f, 1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); - if (colliderID >= 0 && *length > hitDepth) { + if (colliderID > NO_COLLIDER && *length > hitDepth) { *length = hitDepth; ret = colliderID; *x = sx = sx2; @@ -361,7 +364,7 @@ s32 npc_raycast_up_corner(s32 ignoreFlags, f32* x, f32* y, f32* z, f32* length) sx = sx2; sy = sy2; sz = sz2; - if (entityID >= 0 && *length > hitDepth) { + if (entityID > NO_COLLIDER && *length > hitDepth) { ret = entityID | COLLISION_WITH_ENTITY_BIT; *length = hitDepth; *x = sx; @@ -372,7 +375,7 @@ s32 npc_raycast_up_corner(s32 ignoreFlags, f32* x, f32* y, f32* z, f32* length) return ret; } -s32 npc_raycast_up_corners(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth, f32 yaw, f32 radius) { +HitID npc_raycast_up_corners(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth, f32 yaw, f32 radius) { f32 startX; f32 startY; f32 startZ; @@ -402,28 +405,28 @@ s32 npc_raycast_up_corners(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32 ret = NO_COLLIDER; hitID = npc_raycast_up_corner(ignoreFlags, &startX, &startY, &startZ, &depth); - if (hitID < 0) { + if (hitID <= NO_COLLIDER) { startX = x - deltaX; startY = y; startZ = z - deltaZ; hitID = npc_raycast_up_corner(ignoreFlags, &startX, &startY, &startZ, &depth); } - if (hitID < 0) { + if (hitID <= NO_COLLIDER) { startX = x + deltaZ; startY = y; startZ = z + deltaX; hitID = npc_raycast_up_corner(ignoreFlags, &startX, &startY, &startZ, &depth); } - if (hitID < 0) { + if (hitID <= NO_COLLIDER) { startX = x - deltaZ; startY = y; startZ = z - deltaX; hitID = npc_raycast_up_corner(ignoreFlags, &startX, &startY, &startZ, &depth); } - if (hitID >= 0) { + if (hitID > NO_COLLIDER) { *posX = startX; *posY = startY; *posZ = startZ; @@ -431,7 +434,7 @@ s32 npc_raycast_up_corners(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32 ret = hitID; } - if (ret < 0) { + if (ret <= NO_COLLIDER) { *posX = startX; *posY = startY; *posZ = startZ; @@ -450,7 +453,7 @@ s32 npc_raycast_general(s32 flags, f32 startX, f32 startY, f32 startZ, f32 dirX, if (flags & COLLISION_ONLY_ENTITIES) { entityID = test_ray_entities(startX, startY, startZ, dirX, dirY, dirZ, hitX, hitY, hitZ, outDepth, hitNx, hitNy, hitNz); - if (entityID >= 0) { + if (entityID > NO_COLLIDER) { ret = entityID | COLLISION_WITH_ENTITY_BIT; } } else { @@ -462,7 +465,7 @@ s32 npc_raycast_general(s32 flags, f32 startX, f32 startY, f32 startZ, f32 dirX, entityID = test_ray_entities(startX, startY, startZ, dirX, dirY, dirZ, hitX, hitY, hitZ, outDepth, hitNx, hitNy, hitNz); - if (entityID >= 0) { + if (entityID > NO_COLLIDER) { ret = entityID | COLLISION_WITH_ENTITY_BIT; } @@ -479,7 +482,7 @@ void npc_get_slip_vector(f32* outX, f32* outZ, f32 aX, f32 aZ, f32 bX, f32 bZ) { *outZ = (aZ - (dotProduct * bZ)) * 0.5f; } -s32 npc_test_move_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, f32 length, f32 yaw, f32 radius) { +HitID npc_test_move_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, f32 length, f32 yaw, f32 radius) { f32 outX, outY; f32 bX, bZ; f32 hitNy; @@ -506,7 +509,7 @@ s32 npc_test_move_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, f32 len 0.0f, inverseOutCosTheta, &hitX, &hitY, &hitZ, &hitDepth, &bX, &hitNy, &bZ); phi_s5 = FALSE; - if (raycastHitID >= 0 && hitDepth <= temp_f22) { + if (raycastHitID > NO_COLLIDER && hitDepth <= temp_f22) { temp_f0 = atan2(0.0f, 0.0f, sqrtf(SQ(bX) + SQ(bZ)), -hitNy); if (temp_f0 > 60.0f && temp_f0 < 90.0f) { phi_s5 = TRUE; @@ -552,7 +555,7 @@ s32 npc_test_move_without_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, f32 hitID = npc_raycast_general(ignoreFlags, *x - (radius * dirY * 0.5f), *y, *z - (radius * cosTheta * 0.5f), dirY, 0.0f, cosTheta, &hitX, &hitY, &hitZ, &depth, &hitNx, &hitNy, &hitNz); - if (hitID >= 0 && depth <= originalDepth) { + if (hitID > NO_COLLIDER && depth <= originalDepth) { f32 depthDiff = depth - originalDepth; f32 cosThetaTemp = cosTheta; // needed to match @@ -575,11 +578,11 @@ b32 npc_test_move_taller_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, s32 ret; radius *= 0.5f; - if (npc_test_move_with_slipping(ignoreFlags, &xTemp, &yTemp, &zTemp, fabsf(length), yaw, radius) < 0) { + if (npc_test_move_with_slipping(ignoreFlags, &xTemp, &yTemp, &zTemp, fabsf(length), yaw, radius) <= NO_COLLIDER) { xTemp = *x; yTemp = *y + 10.01f; zTemp = *z; - ret = npc_test_move_with_slipping(ignoreFlags, &xTemp, &yTemp, &zTemp, fabsf(length), yaw, radius) >= 0; + ret = npc_test_move_with_slipping(ignoreFlags, &xTemp, &yTemp, &zTemp, fabsf(length), yaw, radius) > NO_COLLIDER; *x = xTemp; *z = zTemp; } else { @@ -600,7 +603,7 @@ b32 npc_test_move_simple_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, *x = tempX; *z = tempZ; - return hitID >= 0; + return hitID > NO_COLLIDER; } b32 npc_test_move_simple_without_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, f32 length, f32 yaw, f32 height, @@ -613,11 +616,12 @@ b32 npc_test_move_simple_without_slipping(s32 ignoreFlags, f32* x, f32* y, f32* *x = tempX; *z = tempZ; - return hitID >= 0; + return hitID > NO_COLLIDER; } // traces lateral collision at position +10, +15, +20, and one unit below height // returns number of traces that hit +// used for partner NPCs s32 npc_test_move_complex_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, f32 length, f32 yaw, f32 height, f32 radius) { f32 startX; @@ -630,7 +634,7 @@ s32 npc_test_move_complex_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, startX = *x; startY = *y + height - 1.0f; startZ = *z; - if (npc_test_move_with_slipping(ignoreFlags, &startX, &startY, &startZ, fabsf(length), yaw, radius) >= 0) { + if (npc_test_move_with_slipping(ignoreFlags, &startX, &startY, &startZ, fabsf(length), yaw, radius) > NO_COLLIDER) { *x = startX; *z = startZ; ret = 4; @@ -639,7 +643,7 @@ s32 npc_test_move_complex_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, startX = *x; startY = *y + 20.0f; startZ = *z; - if (npc_test_move_with_slipping(ignoreFlags, &startX, &startY, &startZ, fabsf(length), yaw, radius) >= 0) { + if (npc_test_move_with_slipping(ignoreFlags, &startX, &startY, &startZ, fabsf(length), yaw, radius) > NO_COLLIDER) { *x = startX; *z = startZ; ret = 3; @@ -648,7 +652,7 @@ s32 npc_test_move_complex_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, startX = *x; startY = *y + 15.01f; startZ = *z; - if (npc_test_move_with_slipping(ignoreFlags, &startX, &startY, &startZ, fabsf(length), yaw, radius) >= 0) { + if (npc_test_move_with_slipping(ignoreFlags, &startX, &startY, &startZ, fabsf(length), yaw, radius) > NO_COLLIDER) { *x = startX; *z = startZ; ret = 2; @@ -660,7 +664,7 @@ s32 npc_test_move_complex_with_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, hitID = npc_test_move_with_slipping(ignoreFlags, &startX, &startY, &startZ, fabsf(length), yaw, radius); *x = startX; *z = startZ; - if (hitID >= 0) { + if (hitID > NO_COLLIDER) { ret = 1; } diff --git a/src/recipes.yaml b/src/recipes.yaml index c01072c2ee..c0389174ea 100644 --- a/src/recipes.yaml +++ b/src/recipes.yaml @@ -21,7 +21,7 @@ Products: - [ ITEM_BLAND_MEAL, QUALITY_GOOD ] - [ ITEM_HONEY_SHROOM, QUALITY_OK ] - [ ITEM_MAPLE_SHROOM, QUALITY_OK ] - - [ ITEM_JELLY_SHROOM1, QUALITY_OK ] + - [ ITEM_JELLY_SHROOM, QUALITY_OK ] - [ ITEM_LIFE_SHROOM, QUALITY_OK ] - [ ITEM_VOLT_SHROOM, QUALITY_OK ] - [ ITEM_SLEEPY_SHEEP, QUALITY_ODD ] @@ -118,7 +118,7 @@ DoubleRecipes: - [ ITEM_MUSHROOM, ITEM_FIRE_FLOWER, ITEM_HOT_SHROOM ] - [ ITEM_MUSHROOM, ITEM_HONEY_SYRUP, ITEM_HONEY_SHROOM ] - [ ITEM_MUSHROOM, ITEM_MAPLE_SYRUP, ITEM_MAPLE_SHROOM ] - - [ ITEM_MUSHROOM, ITEM_JAMMIN_JELLY, ITEM_JELLY_SHROOM1 ] + - [ ITEM_MUSHROOM, ITEM_JAMMIN_JELLY, ITEM_JELLY_SHROOM ] - [ ITEM_MUSHROOM, ITEM_GOOMNUT, ITEM_VOLT_SHROOM ] - [ ITEM_MUSHROOM, ITEM_KOOPA_LEAF, ITEM_VOLT_SHROOM ] - [ ITEM_MUSHROOM, ITEM_DRIED_PASTA, ITEM_BLAND_MEAL ] @@ -347,7 +347,7 @@ CookingRecords: - [ ITEM_MAPLE_SHROOM, GF_MAC02_DiscoveredRecipe_27 ] - [ ITEM_BOILED_EGG, GF_MAC02_DiscoveredRecipe_28 ] - [ ITEM_YOSHI_COOKIE, GF_MAC02_DiscoveredRecipe_29 ] - - [ ITEM_JELLY_SHROOM1, GF_MAC02_DiscoveredRecipe_2A ] + - [ ITEM_JELLY_SHROOM, GF_MAC02_DiscoveredRecipe_2A ] - [ ITEM_TASTY_TONIC, GF_MAC02_DiscoveredRecipe_2B ] - [ ITEM_DIZZY_DIAL, GF_MAC02_DiscoveredRecipe_2C ] - [ ITEM_SUPER_SODA, GF_MAC02_DiscoveredRecipe_2D ] diff --git a/src/state_pause.c b/src/state_pause.c index 295f7ecd18..db55030dff 100644 --- a/src/state_pause.c +++ b/src/state_pause.c @@ -27,7 +27,7 @@ u16* pause_frameBuffers[] = { gFrameBuf0, gFrameBuf1, gFrameBuf2 }; extern ShapeFile gMapShapeData; -NUPiOverlaySegment D_8007795C = { +NUPiOverlaySegment PauseOverlaySegment = { .romStart = pause_ROM_START, .romEnd = pause_ROM_END, .ramStart = pause_VRAM, @@ -105,7 +105,7 @@ void state_step_pause(void) { SavedReverbMode = sfx_get_reverb_mode(); sfx_set_reverb_mode(0); bgm_quiet_max_volume(); - nuPiReadRomOverlay(&D_8007795C); + nuPiReadRomOverlay(&PauseOverlaySegment); pause_init(); gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME; } @@ -143,7 +143,7 @@ void state_step_unpause(void) { MapConfig* mapConfig; void* mapShape; s32 assetSize; - + switch (StepPauseState) { case 0: case 1: @@ -210,7 +210,7 @@ void state_step_unpause(void) { set_time_freeze_mode(TIME_FREEZE_PARTIAL); StepPauseState = 3; gPlayerStatus.prevAlpha = gPlayerStatus.curAlpha - 1; - D_802D9D71 = D_802D9D70 + 1; + ReflectFloorPrevAlpha = ReflectWallPrevAlpha + 1; update_encounters(); update_npcs(); diff --git a/src/trigger.c b/src/trigger.c index fbfaa1335d..b89a31016c 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -190,19 +190,19 @@ void update_triggers(void) { } if (listTrigger->flags & TRIGGER_POINT_BOMB) { - Vec4f* triggerPos; + BombTrigger* bombPos; f32 dist; if (collisionStatus->bombetteExploded < 0) { continue; } - triggerPos = listTrigger->location.pos; - dist = dist3D(triggerPos->x, triggerPos->y, triggerPos->z, + bombPos = listTrigger->location.blast; + dist = dist3D(bombPos->pos.x, bombPos->pos.y, bombPos->pos.z, collisionStatus->bombetteExplosionPos.x, collisionStatus->bombetteExplosionPos.y, collisionStatus->bombetteExplosionPos.z); - if ((triggerPos->yaw * 0.5f) + 50.0f < dist) { + if ((bombPos->diameter * 0.5f) + 50.0f < dist) { continue; } } diff --git a/src/world/action/hammer.c b/src/world/action/hammer.c index 5aa4aafa30..1a17f93cf7 100644 --- a/src/world/action/hammer.c +++ b/src/world/action/hammer.c @@ -73,7 +73,7 @@ void action_hammer_play_hit_fx(s32 hitID) { sinTheta = sin_rad(theta) * 25.0f; cosTheta = cos_rad(theta) * -25.0f; - if (hitID < 0) { + if (hitID <= NO_COLLIDER) { numParticles = 6; x = playerStatus->pos.x + sinTheta; y = playerStatus->pos.y; @@ -146,7 +146,7 @@ s32 func_802B62A4_E25174(void) { y = playerY; z = playerZ - (outCosTheta * i); ret = player_test_lateral_overlap(PLAYER_COLLISION_3, playerStatus, &x, &y, &z, 4.0f, yaw); - if (ret >= 0) { + if (ret > NO_COLLIDER) { HammerHit->hitPos.x = x; HammerHit->hitPos.y = y; HammerHit->hitPos.z = z; @@ -173,7 +173,7 @@ s32 func_802B62A4_E25174(void) { z = playerZ - (outCosTheta * i); ret = player_test_lateral_overlap(PLAYER_COLLISION_3, playerStatus, &x, &y, &z, 4.0f, yaw); - if (ret >= 0) { + if (ret > NO_COLLIDER) { HammerHit->hitPos.x = x; HammerHit->hitPos.y = y; HammerHit->hitPos.z = z; @@ -182,7 +182,7 @@ s32 func_802B62A4_E25174(void) { } } - if (ret >= 0 && (ret & COLLISION_WITH_ENTITY_BIT)) { + if (ret > NO_COLLIDER && (ret & COLLISION_WITH_ENTITY_BIT)) { s32 hammerLevel = gPlayerData.hammerLevel; switch (get_entity_type(ret)) { @@ -245,21 +245,21 @@ void action_update_hammer(void) { if (gPlayerData.hammerLevel == 2) { soundID = SOUND_HAMMER_SWING_3; anim = ANIM_MarioW1_Smash3_Hit; - if (HammerHit->hitID < 0) { + if (HammerHit->hitID <= NO_COLLIDER) { soundID = SOUND_HAMMER_SWING_3; anim = ANIM_MarioW1_Smash3_Miss; } } else if (gPlayerData.hammerLevel == 1) { soundID = SOUND_HAMMER_SWING_2; anim = ANIM_MarioW1_Smash2_Hit; - if (HammerHit->hitID < 0) { + if (HammerHit->hitID <= NO_COLLIDER) { soundID = SOUND_HAMMER_SWING_2; anim = ANIM_MarioW1_Smash2_Miss; } } else { soundID = SOUND_HAMMER_SWING_1; anim = ANIM_MarioW1_Smash1_Hit; - if (HammerHit->hitID < 0) { + if (HammerHit->hitID <= NO_COLLIDER) { soundID = SOUND_HAMMER_SWING_1; anim = ANIM_MarioW1_Smash1_Miss; } @@ -326,14 +326,14 @@ void func_802B6820_E256F0(void) { result = player_test_lateral_overlap(PLAYER_COLLISION_3, playerStatus, &x, &y, &z, 4.0f, yaw); if (HammerHit->unk_14 == 0) { collisionStatus->lastWallHammered = result; - if (result >= 0) { + if (result > NO_COLLIDER) { if (result & COLLISION_WITH_ENTITY_BIT) { get_entity_by_index(result)->collisionTimer = 0; } } } - if (result >= 0) { + if (result > NO_COLLIDER) { break; } } @@ -357,14 +357,14 @@ void func_802B6820_E256F0(void) { result = player_test_lateral_overlap(PLAYER_COLLISION_3, playerStatus, &x, &y, &z, 4.0f, yaw); if (HammerHit->unk_14 == 0) { collisionStatus->lastWallHammered = result; - if (result >= 0) { + if (result > NO_COLLIDER) { if (result & COLLISION_WITH_ENTITY_BIT) { get_entity_by_index(result)->collisionTimer = 0; } } } - if (result >= 0) { + if (result > NO_COLLIDER) { break; } } @@ -383,27 +383,27 @@ void func_802B6820_E256F0(void) { action_hammer_play_hit_fx(HammerHit->hitID); - if (collisionStatus->lastWallHammered >= 0 && (collisionStatus->lastWallHammered & COLLISION_WITH_ENTITY_BIT)) { + if (collisionStatus->lastWallHammered > NO_COLLIDER && (collisionStatus->lastWallHammered & COLLISION_WITH_ENTITY_BIT)) { get_entity_by_index(collisionStatus->lastWallHammered)->collisionTimer = 0; playerStatus->flags |= PS_FLAG_HAMMER_CHECK; - } else if (HammerHit->hitID < 0) { + } else if (HammerHit->hitID <= NO_COLLIDER) { playerStatus->flags |= PS_FLAG_HAMMER_CHECK; } - if (HammerHit->hitID < 0 && gPlayerData.hammerLevel >= 2) { + if (HammerHit->hitID <= NO_COLLIDER && gPlayerData.hammerLevel >= 2) { gCurrentHiddenPanels.tryFlipTrigger = TRUE; gCurrentHiddenPanels.flipTriggerPosY = playerStatus->pos.y; } } - if (playerStatus->actionSubstate == SUBSTATE_HAMMER_0 && result >= 0 && HammerHit->unk_14 == 0) { + if (playerStatus->actionSubstate == SUBSTATE_HAMMER_0 && result > NO_COLLIDER && HammerHit->unk_14 == 0) { playerStatus->actionSubstate++; } - if (playerStatus->actionSubstate == SUBSTATE_HAMMER_1 && result < 0) { + if (playerStatus->actionSubstate == SUBSTATE_HAMMER_1 && result <= NO_COLLIDER) { playerStatus->actionSubstate = SUBSTATE_HAMMER_2; } HammerHit->timer++; - if (result >= 0) { + if (result > NO_COLLIDER) { HammerHit->unk_14 = 1; } if (HammerHit->timer == 6) { diff --git a/src/world/action/hit_fire.c b/src/world/action/hit_fire.c index fc5d78d061..762ea8a066 100644 --- a/src/world/action/hit_fire.c +++ b/src/world/action/hit_fire.c @@ -55,7 +55,7 @@ void action_update_hit_fire(void) { s32 colliderID; playerStatus->pos.y = player_check_collision_below(player_fall_distance(), &colliderID); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { colliderID = get_collider_flags(colliderID); //TODO surfaceType set_action_state(ACTION_STATE_LAND); playerStatus->blinkTimer = 60; diff --git a/src/world/action/knockback.c b/src/world/action/knockback.c index 0840700ae9..9cacb7f1d8 100644 --- a/src/world/action/knockback.c +++ b/src/world/action/knockback.c @@ -58,7 +58,7 @@ void action_update_knockback(void) { playerStatus->pos.y = player_check_collision_below(player_fall_distance(), &colliderID); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { colliderID = get_collider_flags(colliderID); //TODO surfaceType set_action_state(ACTION_STATE_LAND); } diff --git a/src/world/action/slide.c b/src/world/action/slide.c index d47e40f8ef..1fc0262b03 100644 --- a/src/world/action/slide.c +++ b/src/world/action/slide.c @@ -86,7 +86,7 @@ void action_update_sliding(void) { posY = playerStatus->pos.y + (playerStatus->colliderHeight * 0.5f); hitID = player_raycast_below_cam_relative(playerStatus, &posX, &posY, &posZ, &depth, &hitRx, &hitRy, &hitDirX, &hitDirZ); D_802B6798 = hitRy; - if (hitID >= 0) { + if (hitID > NO_COLLIDER) { collisionStatus = &gCollisionStatus; surfaceType = get_collider_flags(hitID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (surfaceType == SURFACE_TYPE_SLIDE) { @@ -113,7 +113,7 @@ void action_update_sliding(void) { posZ = playerStatus->pos.z; posY = playerStatus->pos.y + (playerStatus->colliderHeight * 0.5f); hitID = player_raycast_below_cam_relative(playerStatus, &posX, &posY, &posZ, &depth, &hitRx, &hitRy, &hitDirX, &hitDirZ); - if (hitID >= 0) { + if (hitID > NO_COLLIDER) { speed = playerStatus->curSpeed / 3.0f; if (speed < 0.01) { playerStatus->curSpeed = 0.0f; @@ -147,7 +147,7 @@ void action_update_sliding(void) { playerStatus->curSpeed = 0.0f; } playerStatus->pos.y = player_check_collision_below(player_fall_distance(), &hitID); - if (hitID >= 0) { + if (hitID > NO_COLLIDER) { SlideLaunchSpeed = -1; suggest_player_anim_always_forward(ANIM_MarioW2_Collapse); sfx_play_sound_at_player(SOUND_TRIP, SOUND_SPACE_DEFAULT); diff --git a/src/world/action/step_up.c b/src/world/action/step_up.c index 4a8705ba97..bf03822c09 100644 --- a/src/world/action/step_up.c +++ b/src/world/action/step_up.c @@ -67,7 +67,7 @@ void action_update_step_up(void) { playerStatus->pos.y += playerStatus->gravityIntegrator[0]; } - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { if (playerStatus->prevActionState != ACTION_STATE_SPIN) { set_action_state(playerStatus->prevActionState); } else { diff --git a/src/world/action/use_munchlesia.c b/src/world/action/use_munchlesia.c index 345e27f2fc..0f8778805e 100644 --- a/src/world/action/use_munchlesia.c +++ b/src/world/action/use_munchlesia.c @@ -58,7 +58,7 @@ void action_update_use_munchlesia(void) { gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; hitPosY = player_check_collision_below(Munchlesia_LaunchVelocity, &colliderID); - if (colliderID >= 0) { + if (colliderID > NO_COLLIDER) { sfx_play_sound_at_player(SOUND_TRIP, SOUND_SPACE_DEFAULT); suggest_player_anim_always_forward(ANIM_MarioW2_Collapse); playerStatus->pos.y = hitPosY; diff --git a/src/world/action/use_spinning_flower.c b/src/world/action/use_spinning_flower.c index 0031f079a6..a1cfa60a6a 100644 --- a/src/world/action/use_spinning_flower.c +++ b/src/world/action/use_spinning_flower.c @@ -12,9 +12,9 @@ BSS f32 SpinningFlower_AngleToCenter; BSS f32 D_802B6EF0; BSS f32 D_802B6EF4; -extern s16 D_802BCE30; -extern s16 D_802BCE32; -extern s16 D_802BCE34; +extern s16 FlowerGoalPositionY; +extern s16 FlowerGoalPositionZ; +extern s16 FlowerGoalPositionX; enum { SUBSTATE_ATTRACT = 1, @@ -221,11 +221,11 @@ void action_update_use_spinning_flower(void) { gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; - distToCenter = fabsf(dist2D(D_802BCE34, D_802BCE32, playerStatus->pos.x, playerStatus->pos.z)); + distToCenter = fabsf(dist2D(FlowerGoalPositionX, FlowerGoalPositionZ, playerStatus->pos.x, playerStatus->pos.z)); if (distToCenter > 40.0f) { - if (D_802BCE30 + 30 < playerStatus->pos.y) { + if (FlowerGoalPositionY + 30 < playerStatus->pos.y) { playerStatus->actionSubstate++; // SUBSTATE_ASCEND_B - inputAngle = atan2(playerStatus->pos.x, playerStatus->pos.z, D_802BCE34, D_802BCE32); + inputAngle = atan2(playerStatus->pos.x, playerStatus->pos.z, FlowerGoalPositionX, FlowerGoalPositionZ); sin_cos_rad(DEG_TO_RAD(inputAngle), &dx, &dz); playerStatus->curStateTime = 64; SpinningFlower_AngleToCenter = inputAngle; diff --git a/src/world/area_dgb/dgb_09/dgb_09_3_breakable.c b/src/world/area_dgb/dgb_09/dgb_09_3_breakable.c index fc4bbe9c30..4f1d44676e 100644 --- a/src/world/area_dgb/dgb_09/dgb_09_3_breakable.c +++ b/src/world/area_dgb/dgb_09/dgb_09_3_breakable.c @@ -3,7 +3,7 @@ BombTrigger N(BombPos_Wall) = { .pos = { 300.0f, 0.0f, 88.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BlastWall) = { diff --git a/src/world/area_dgb/dgb_12/dgb_12_3_spikes.c b/src/world/area_dgb/dgb_12/dgb_12_3_spikes.c index e7e34e34e6..1d34559125 100644 --- a/src/world/area_dgb/dgb_12/dgb_12_3_spikes.c +++ b/src/world/area_dgb/dgb_12/dgb_12_3_spikes.c @@ -2,7 +2,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o200, .pos = { -503.0, 0.0, -63.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_SetupSpikes) = { diff --git a/src/world/area_dro/dro_01/dro_01_3_npc.c b/src/world/area_dro/dro_01/dro_01_3_npc.c index edc8ea824a..cf766b84f9 100644 --- a/src/world/area_dro/dro_01/dro_01_3_npc.c +++ b/src/world/area_dro/dro_01/dro_01_3_npc.c @@ -266,22 +266,22 @@ NpcData N(PassiveNPCs)[] = { .flags = ENEMY_FLAG_PASSIVE | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING | ENEMY_FLAG_NO_SHADOW_RAYCAST, .drops = NO_DROPS, .animations = { - ANIM_Musician_Composer_Idle, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, - ANIM_Musician_Composer_Still, + .idle = ANIM_Musician_Composer_Idle, + .walk = ANIM_Musician_Composer_Still, + .run = ANIM_Musician_Composer_Still, + .chase = ANIM_Musician_Composer_Still, + .anim_4 = ANIM_Musician_Composer_Still, + .anim_5 = ANIM_Musician_Composer_Still, + .death = ANIM_Musician_Composer_Still, + .hit = ANIM_Musician_Composer_Still, + .anim_8 = ANIM_Musician_Composer_Still, + .anim_9 = ANIM_Musician_Composer_Still, + .anim_A = ANIM_Musician_Composer_Still, + .anim_B = ANIM_Musician_Composer_Still, + .anim_C = ANIM_Musician_Composer_Still, + .anim_D = ANIM_Musician_Composer_Still, + .anim_E = ANIM_Musician_Composer_Still, + .anim_F = ANIM_Musician_Composer_Still, }, .tattle = MSG_NpcTattle_Composer, }, diff --git a/src/world/area_dro/dro_01/dro_01_7_foliage.c b/src/world/area_dro/dro_01/dro_01_7_foliage.c index a7aafdd6e6..8f45efaf9f 100644 --- a/src/world/area_dro/dro_01/dro_01_7_foliage.c +++ b/src/world/area_dro/dro_01/dro_01_7_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 120.0f, 0.0f, -43.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_dro/dro_02/dro_02_5_npc.c b/src/world/area_dro/dro_02/dro_02_5_npc.c index ca3baefdba..5bbd20ec71 100644 --- a/src/world/area_dro/dro_02/dro_02_5_npc.c +++ b/src/world/area_dro/dro_02/dro_02_5_npc.c @@ -360,28 +360,39 @@ NpcData N(PassiveNPCs)[] = { .id = NPC_Archeologist, .pos = { -320.0f, 0.0f, -14.0f }, .yaw = 90, - .territory = { .temp = { -303, 0, 22, 146, 38, -32767, 1, 0, 0, 0, 0, 0, 0, 1 }}, + .territory = { + .wander = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .wanderShape = SHAPE_RECT, + .centerPos = { -303, 0, 22 }, + .wanderSize = { 146, 38 }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { 0, 0, 0 }, + .detectSize = { 0 }, + } + }, .init = &N(EVS_NpcInit_Archeologist), .settings = &N(NpcSettings_Archeologist), .flags = ENEMY_FLAG_PASSIVE | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING | ENEMY_FLAG_NO_SHADOW_RAYCAST, .drops = NO_DROPS, .animations = { - ANIM_Archeologist_Idle, - ANIM_Archeologist_Walk, - ANIM_Archeologist_Run, - ANIM_Archeologist_Run, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, - ANIM_Archeologist_Idle, + .idle = ANIM_Archeologist_Idle, + .walk = ANIM_Archeologist_Walk, + .run = ANIM_Archeologist_Run, + .chase = ANIM_Archeologist_Run, + .anim_4 = ANIM_Archeologist_Idle, + .anim_5 = ANIM_Archeologist_Idle, + .death = ANIM_Archeologist_Idle, + .hit = ANIM_Archeologist_Idle, + .anim_8 = ANIM_Archeologist_Idle, + .anim_9 = ANIM_Archeologist_Idle, + .anim_A = ANIM_Archeologist_Idle, + .anim_B = ANIM_Archeologist_Idle, + .anim_C = ANIM_Archeologist_Idle, + .anim_D = ANIM_Archeologist_Idle, + .anim_E = ANIM_Archeologist_Idle, + .anim_F = ANIM_Archeologist_Idle, }, .tattle = MSG_NpcTattle_Archeologist, }, @@ -389,7 +400,18 @@ NpcData N(PassiveNPCs)[] = { .id = NPC_Dryite_01, .pos = { -20.0f, 0.0f, 40.0f }, .yaw = 270, - .territory = { .temp = { -20, 0, 40, 60, 0, -32767, 0, 0, 0, 0, 0, 0, 0, 1 }}, + .territory = { + .wander = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .wanderShape = SHAPE_CYLINDER, + .centerPos = { -20, 0, 40 }, + .wanderSize = { 60, 0 }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { 0, 0, 0 }, + .detectSize = { 0, 0 }, + } + }, .init = &N(EVS_NpcInit_MrE), .settings = &N(NpcSettings_Dryite_Wander), .flags = ENEMY_FLAG_PASSIVE | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING | ENEMY_FLAG_NO_SHADOW_RAYCAST, @@ -428,22 +450,22 @@ NpcData N(PassiveNPCs)[] = { .flags = ENEMY_FLAG_PASSIVE | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING | ENEMY_FLAG_NO_SHADOW_RAYCAST, .drops = NO_DROPS, .animations = { - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Walk, - ANIM_WorldMerlee_Run, - ANIM_WorldMerlee_Run, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, - ANIM_WorldMerlee_Idle, + .idle = ANIM_WorldMerlee_Idle, + .walk = ANIM_WorldMerlee_Walk, + .run = ANIM_WorldMerlee_Run, + .chase = ANIM_WorldMerlee_Run, + .anim_4 = ANIM_WorldMerlee_Idle, + .anim_5 = ANIM_WorldMerlee_Idle, + .death = ANIM_WorldMerlee_Idle, + .hit = ANIM_WorldMerlee_Idle, + .anim_8 = ANIM_WorldMerlee_Idle, + .anim_9 = ANIM_WorldMerlee_Idle, + .anim_A = ANIM_WorldMerlee_Idle, + .anim_B = ANIM_WorldMerlee_Idle, + .anim_C = ANIM_WorldMerlee_Idle, + .anim_D = ANIM_WorldMerlee_Idle, + .anim_E = ANIM_WorldMerlee_Idle, + .anim_F = ANIM_WorldMerlee_Idle, }, .tattle = MSG_NpcTattle_Merlee, }, diff --git a/src/world/area_flo/flo_03/flo_03_4_foliage.c b/src/world/area_flo/flo_03/flo_03_4_foliage.c index 0a707f59a3..5c20190664 100644 --- a/src/world/area_flo/flo_03/flo_03_4_foliage.c +++ b/src/world/area_flo/flo_03/flo_03_4_foliage.c @@ -31,7 +31,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -208.0f, 0.0f, -182.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_flo/flo_07/flo_07_3_npc.c b/src/world/area_flo/flo_07/flo_07_3_npc.c index cfcb3a2995..d7244955f7 100644 --- a/src/world/area_flo/flo_07/flo_07_3_npc.c +++ b/src/world/area_flo/flo_07/flo_07_3_npc.c @@ -220,7 +220,7 @@ ShakeTreeConfig N(ShakeTree_CrystalTree) = { BombTrigger N(BombPos_CrystalTree) = { .pos = { -309.0f, 0.0f, 31.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_flo/flo_08/flo_08_3_main.c b/src/world/area_flo/flo_08/flo_08_3_main.c index 223579f441..bba11f8346 100644 --- a/src/world/area_flo/flo_08/flo_08_3_main.c +++ b/src/world/area_flo/flo_08/flo_08_3_main.c @@ -22,7 +22,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o158, .pos = { -540.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o132, .pos = { 60.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o223, .pos = { 60.0, 0.0, 50.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_flo/flo_08/flo_08_5_foliage.c b/src/world/area_flo/flo_08/flo_08_5_foliage.c index 7955e91f6e..1310cb101f 100644 --- a/src/world/area_flo/flo_08/flo_08_5_foliage.c +++ b/src/world/area_flo/flo_08/flo_08_5_foliage.c @@ -31,7 +31,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 391.0f, 0.0f, -102.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_flo/flo_09/flo_09_4_foliage.c b/src/world/area_flo/flo_09/flo_09_4_foliage.c index 24467e8022..84e75bc725 100644 --- a/src/world/area_flo/flo_09/flo_09_4_foliage.c +++ b/src/world/area_flo/flo_09/flo_09_4_foliage.c @@ -65,7 +65,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -200.0f, 0.0f, 1.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o4, MODEL_o5); @@ -79,7 +79,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 0.0f, 0.0f, 1.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o14, MODEL_o15); @@ -93,7 +93,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 200.0f, 0.0f, 1.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_flo/flo_10/flo_10_7_foliage.c b/src/world/area_flo/flo_10/flo_10_7_foliage.c index c5c8957ffe..030e3b063d 100644 --- a/src/world/area_flo/flo_10/flo_10_7_foliage.c +++ b/src/world/area_flo/flo_10/flo_10_7_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 137.0f, 0.0f, -283.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_flo/flo_14/flo_14_2_main.c b/src/world/area_flo/flo_14/flo_14_2_main.c index b1aae776cb..9875188688 100644 --- a/src/world/area_flo/flo_14/flo_14_2_main.c +++ b/src/world/area_flo/flo_14/flo_14_2_main.c @@ -30,7 +30,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o153, .pos = { 410.0, 60.0, -95.0 }}, { .colliderID = COLLIDER_o154, .pos = { 550.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o158, .pos = { -50.0, 0.0, 110.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_flo/flo_16/flo_16_2_main.c b/src/world/area_flo/flo_16/flo_16_2_main.c index c4e311c5fd..3f6c7e5101 100644 --- a/src/world/area_flo/flo_16/flo_16_2_main.c +++ b/src/world/area_flo/flo_16/flo_16_2_main.c @@ -19,7 +19,7 @@ EvtScript N(EVS_BindExitTriggers) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o190, .pos = { -310.0, 0.0, 0.0 }}, { .colliderID = COLLIDER_o191, .pos = { 305.0, 100.0, 0.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_flo/flo_17/flo_17_2_main.c b/src/world/area_flo/flo_17/flo_17_2_main.c index 02922295c2..afa493f82c 100644 --- a/src/world/area_flo/flo_17/flo_17_2_main.c +++ b/src/world/area_flo/flo_17/flo_17_2_main.c @@ -38,7 +38,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o129, .pos = { 280.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o134, .pos = { 525.0, 0.0, -70.0 }}, { .colliderID = COLLIDER_o133, .pos = { 525.0, 0.0, 50.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_flo/flo_18/flo_18_2_main.c b/src/world/area_flo/flo_18/flo_18_2_main.c index de0d0f4656..a0f214ca5b 100644 --- a/src/world/area_flo/flo_18/flo_18_2_main.c +++ b/src/world/area_flo/flo_18/flo_18_2_main.c @@ -20,7 +20,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o138, .pos = { -200.0, 0.0, 120.0 }}, { .colliderID = COLLIDER_o140, .pos = { 0.0, 0.0, 120.0 }}, { .colliderID = COLLIDER_o142, .pos = { 170.0, 0.0, 120.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_flo/flo_18/flo_18_3_machine.c b/src/world/area_flo/flo_18/flo_18_3_machine.c index ce12b7e1e2..22b35d02bb 100644 --- a/src/world/area_flo/flo_18/flo_18_3_machine.c +++ b/src/world/area_flo/flo_18/flo_18_3_machine.c @@ -625,22 +625,22 @@ EvtScript N(EVS_DamageMachine) = { BombTrigger N(Machine_BombTrigger_01) = { .pos = { 5.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Machine_BombTrigger_02) = { .pos = { -5.0f, 0.0f, -20.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Machine_BombTrigger_03) = { .pos = { 50.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Machine_BombTrigger_04) = { .pos = { 105.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupMachine) = { diff --git a/src/world/area_flo/flo_18/flo_18_4_npc.c b/src/world/area_flo/flo_18/flo_18_4_npc.c index 1195f9e588..b86444fff5 100644 --- a/src/world/area_flo/flo_18/flo_18_4_npc.c +++ b/src/world/area_flo/flo_18/flo_18_4_npc.c @@ -467,22 +467,22 @@ EvtScript N(EVS_BombReaction_Lakitu_03) = { BombTrigger N(Npc_BombTrigger_01) = { .pos = { 5.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Npc_BombTrigger_02) = { .pos = { -5.0f, 0.0f, -20.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Npc_BombTrigger_03) = { .pos = { 50.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Npc_BombTrigger_04) = { .pos = { 105.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupMachineDamageReactions) = { diff --git a/src/world/area_flo/flo_22/flo_22_5_foliage.c b/src/world/area_flo/flo_22/flo_22_5_foliage.c index 5aab6d3694..f0940b2213 100644 --- a/src/world/area_flo/flo_22/flo_22_5_foliage.c +++ b/src/world/area_flo/flo_22/flo_22_5_foliage.c @@ -10,7 +10,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 93.0f, 0.0f, -89.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_TrunkModels) = FOLIAGE_MODEL_LIST(MODEL_o52, MODEL_o53, MODEL_o55); @@ -21,7 +21,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 150.0f, 0.0f, 135.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_flo/flo_24/flo_24_3_foliage.c b/src/world/area_flo/flo_24/flo_24_3_foliage.c index 0bd9750165..30d443f8f8 100644 --- a/src/world/area_flo/flo_24/flo_24_3_foliage.c +++ b/src/world/area_flo/flo_24/flo_24_3_foliage.c @@ -31,7 +31,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 1.0f, 0.0f, -192.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_flo/flo_25/flo_25_5_foliage.c b/src/world/area_flo/flo_25/flo_25_5_foliage.c index 1652b4eb30..8be6466c87 100644 --- a/src/world/area_flo/flo_25/flo_25_5_foliage.c +++ b/src/world/area_flo/flo_25/flo_25_5_foliage.c @@ -31,7 +31,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -388.0f, 0.0f, -92.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_hos/hos_03/hos_03_5_foliage.c b/src/world/area_hos/hos_03/hos_03_5_foliage.c index 06178d116e..3d9787787a 100644 --- a/src/world/area_hos/hos_03/hos_03_5_foliage.c +++ b/src/world/area_hos/hos_03/hos_03_5_foliage.c @@ -124,7 +124,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -629.0f, 35.0f, 296.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o43, MODEL_o44, MODEL_o45); @@ -146,7 +146,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -488.0f, 35.0f, 324.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_hos/hos_05/hos_05_3_misc.c b/src/world/area_hos/hos_05/hos_05_3_misc.c index cd4e42cc43..56233a3311 100644 --- a/src/world/area_hos/hos_05/hos_05_3_misc.c +++ b/src/world/area_hos/hos_05/hos_05_3_misc.c @@ -35,10 +35,10 @@ API_CALLABLE(N(func_80240690_A2A8D0)) { angle = (script->varTable[1] * 180.0f) / PI; magnitude = (rand_int(10) / vt2) + 3.0f; - script->varTable[10] = Float_TO_FIXED(magnitude * cos_rad(angle)); - script->varTable[11] = Float_TO_FIXED(rand_int(15) + 5); - script->varTable[12] = Float_TO_FIXED(magnitude * sin_rad(angle)); - script->varTable[13] = Float_TO_FIXED((f32)(rand_int(10) + 10) * -0.05); + script->varTable[10] = FLOAT_TO_FIXED(magnitude * cos_rad(angle)); + script->varTable[11] = FLOAT_TO_FIXED(rand_int(15) + 5); + script->varTable[12] = FLOAT_TO_FIXED(magnitude * sin_rad(angle)); + script->varTable[13] = FLOAT_TO_FIXED((f32)(rand_int(10) + 10) * -0.05); return ApiStatus_DONE2; } diff --git a/src/world/area_hos/hos_06/hos_06_5_merluvlee.c b/src/world/area_hos/hos_06/hos_06_5_merluvlee.c index bf55c01686..50481a5798 100644 --- a/src/world/area_hos/hos_06/hos_06_5_merluvlee.c +++ b/src/world/area_hos/hos_06/hos_06_5_merluvlee.c @@ -34,7 +34,7 @@ BadgeHint N(BadgeHintData)[] = { { MSG_MerluvleeHint_PowerBounce, ITEM_POWER_BOUNCE, STORY_CH1_SPOTTED_BY_KOOPA_BROS }, { MSG_MerluvleeHint_DizzyStomp, ITEM_DIZZY_STOMP, STORY_CH5_ENTERED_MT_LAVA_LAVA }, { MSG_MerluvleeHint_MegaJump, ITEM_MEGA_JUMP, STORY_CH7_MAYOR_MURDER_MYSTERY }, - { MSG_MerluvleeHint_PowerSmash, ITEM_POWER_SMASH1, STORY_CH2_GOT_SUPER_HAMMER }, + { MSG_MerluvleeHint_PowerSmash, ITEM_POWER_SMASH, STORY_CH2_GOT_SUPER_HAMMER }, { MSG_MerluvleeHint_SmashCharge, ITEM_SMASH_CHARGE, STORY_CH1_SPOTTED_BY_KOOPA_BROS }, { MSG_MerluvleeHint_SuperSmashCharge, ITEM_S_SMASH_CHG, STORY_CH5_RETURNED_TO_TOAD_TOWN }, { MSG_MerluvleeHint_SpinSmash, ITEM_SPIN_SMASH, STORY_CH3_STAR_SPRIT_DEPARTED }, @@ -48,9 +48,9 @@ BadgeHint N(BadgeHintData)[] = { { MSG_MerluvleeHint_QuickChange, ITEM_QUICK_CHANGE, STORY_CH3_GOT_SUPER_BOOTS }, { MSG_MerluvleeHint_Refund, ITEM_REFUND, STORY_CH1_SPOTTED_BY_KOOPA_BROS }, { MSG_MerluvleeHint_TripleDip, ITEM_TRIPLE_DIP, STORY_CH7_RAISED_FROZEN_STAIRS }, - { MSG_MerluvleeHint_DeepFocus1, ITEM_DEEP_FOCUS1, STORY_CH2_STAR_SPRIT_DEPARTED }, - { MSG_MerluvleeHint_DeepFocus2, ITEM_DEEP_FOCUS2, STORY_CH4_FOUND_HIDDEN_DOOR }, - { MSG_MerluvleeHint_DeepFocus3, ITEM_DEEP_FOCUS3, STORY_CH8_REACHED_BOWSERS_CASTLE }, + { MSG_MerluvleeHint_DeepFocus1, ITEM_DEEP_FOCUS_A, STORY_CH2_STAR_SPRIT_DEPARTED }, + { MSG_MerluvleeHint_DeepFocus2, ITEM_DEEP_FOCUS_B, STORY_CH4_FOUND_HIDDEN_DOOR }, + { MSG_MerluvleeHint_DeepFocus3, ITEM_DEEP_FOCUS_C, STORY_CH8_REACHED_BOWSERS_CASTLE }, { MSG_MerluvleeHint_HPPlus1, ITEM_HP_PLUS_A, STORY_CH3_INVITED_TO_BOOS_MANSION }, { MSG_MerluvleeHint_HPPlus2, ITEM_HP_PLUS_B, STORY_REQ_ANY_TIME }, { MSG_MerluvleeHint_FPPlus1, ITEM_FP_PLUS_A, STORY_CH3_INVITED_TO_BOOS_MANSION }, diff --git a/src/world/area_hos/hos_06/hos_06_6_chest.c b/src/world/area_hos/hos_06/hos_06_6_chest.c index 6ce3311b36..9af1627faa 100644 --- a/src/world/area_hos/hos_06/hos_06_6_chest.c +++ b/src/world/area_hos/hos_06/hos_06_6_chest.c @@ -32,7 +32,7 @@ EvtScript N(EVS_Chest_ShowGotItem) = { s32 N(ChestItems)[] = { ITEM_POWER_RUSH, ITEM_SHOOTING_STAR, - ITEM_DEEP_FOCUS1, + ITEM_DEEP_FOCUS_A, ITEM_LAST_STAND, ITEM_JAMMIN_JELLY, }; @@ -188,7 +188,7 @@ EvtScript N(EVS_Interact_MagicChest_Mario) = { CaseEq(0) Call(ShowMessageAtScreenPos, MSG_Menus_00D4, 160, 40) CaseOrEq(ITEM_POWER_RUSH) - CaseOrEq(ITEM_DEEP_FOCUS1) + CaseOrEq(ITEM_DEEP_FOCUS_A) CaseOrEq(ITEM_LAST_STAND) SetGroup(EVT_GROUP_00) Call(SetTimeFreezeMode, TIME_FREEZE_FULL) diff --git a/src/world/area_isk/isk_04/isk_04_3_obstructions.c b/src/world/area_isk/isk_04/isk_04_3_obstructions.c index 135532f03b..5024cbaa5d 100644 --- a/src/world/area_isk/isk_04/isk_04_3_obstructions.c +++ b/src/world/area_isk/isk_04/isk_04_3_obstructions.c @@ -10,7 +10,7 @@ s32 N(ItemList_RuinsKey)[] = { BombTrigger N(BombPos_Wall) = { .pos = { 510.0f, 25.0f, -184.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_OnBlast_Wall) = { diff --git a/src/world/area_isk/isk_05/isk_05_2_entity.c b/src/world/area_isk/isk_05/isk_05_2_entity.c index 1747c96e9b..0bf7f2153f 100644 --- a/src/world/area_isk/isk_05/isk_05_2_entity.c +++ b/src/world/area_isk/isk_05/isk_05_2_entity.c @@ -11,7 +11,7 @@ EvtScript N(D_80242210_97FCE0) = { EvtScript N(EVS_MakeEntities) = { Call(MakeItemEntity, ITEM_PYRAMID_STONE, 316, 82, -481, ITEM_SPAWN_MODE_KEY, GF_ISK05_Item_PyramidStone) IfEq(GF_ISK05_Hammer2Block, FALSE) - Call(MakeEntity, Ref(Entity_Hammer2Block_WideX), 431, 0, -478, 45, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Hammer2BlockWideX), 431, 0, -478, 45, MAKE_ENTITY_END) Call(AssignScript, Ref(N(D_80242210_97FCE0))) EndIf PlayEffect(EFFECT_FLAME, FX_FLAME_RED, 415, 196, -290, Float(0.3), LVar0) diff --git a/src/world/area_isk/isk_07/isk_07_2_entity.c b/src/world/area_isk/isk_07/isk_07_2_entity.c index 01e5b8b119..27e4e3fe7c 100644 --- a/src/world/area_isk/isk_07/isk_07_2_entity.c +++ b/src/world/area_isk/isk_07/isk_07_2_entity.c @@ -20,7 +20,7 @@ EvtScript N(EVS_MakeEntities) = { Set(MV_LockEntityID, LVar0) EndIf IfEq(GF_ISK07_Hammer2Block, FALSE) - Call(MakeEntity, Ref(Entity_Hammer2Block_WideX), 470, -250, 270, 150, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Hammer2BlockWideX), 470, -250, 270, 150, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_SmashBlock_Stone))) EndIf IfEq(GF_ISK07_OpenedSarcophagi, FALSE) diff --git a/src/world/area_isk/isk_08/isk_08_3_entity.c b/src/world/area_isk/isk_08/isk_08_3_entity.c index 6c7db83d95..59b8847261 100644 --- a/src/world/area_isk/isk_08/isk_08_3_entity.c +++ b/src/world/area_isk/isk_08/isk_08_3_entity.c @@ -12,7 +12,7 @@ EvtScript N(EVS_SetupFlames) = { BombTrigger N(BombPos_Wall) = { .pos = { -569.0f, -520.0f, 207.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_OnBlast_Wall) = { diff --git a/src/world/area_isk/isk_10/isk_10_3_bombable.c b/src/world/area_isk/isk_10/isk_10_3_bombable.c index 3c97cdbe6d..c2f44d9784 100644 --- a/src/world/area_isk/isk_10/isk_10_3_bombable.c +++ b/src/world/area_isk/isk_10/isk_10_3_bombable.c @@ -3,12 +3,12 @@ BombTrigger N(BombPos_UpperWall) = { .pos = { -593.0f, -520.0f, 104.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(BombPos_LowerWall) = { .pos = { -569.0f, -780.0f, -99.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_OnBlast_UpperWall) = { diff --git a/src/world/area_isk/isk_13/isk_13_2_entity.c b/src/world/area_isk/isk_13/isk_13_2_entity.c index 5faea5afe7..82466b3293 100644 --- a/src/world/area_isk/isk_13/isk_13_2_entity.c +++ b/src/world/area_isk/isk_13/isk_13_2_entity.c @@ -11,7 +11,7 @@ EvtScript N(EVS_OnSmash_Block) = { EvtScript N(EVS_MakeEntities) = { Call(MakeItemEntity, ITEM_LUNAR_STONE, 460, -568, -342, ITEM_SPAWN_MODE_KEY, GF_ISK13_Item_LunarStone) IfEq(GF_ISK13_Hammer2Block, FALSE) - Call(MakeEntity, Ref(Entity_Hammer2Block_WideX), 568, -650, -302, 25, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Hammer2BlockWideX), 568, -650, -302, 25, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_OnSmash_Block))) EndIf PlayEffect(EFFECT_FLAME, FX_FLAME_RED, 415, -453, -291, Float(0.3), LVar0) diff --git a/src/world/area_isk/isk_14/isk_14_2_entity.c b/src/world/area_isk/isk_14/isk_14_2_entity.c index db6c9ff465..4b55bd7b8d 100644 --- a/src/world/area_isk/isk_14/isk_14_2_entity.c +++ b/src/world/area_isk/isk_14/isk_14_2_entity.c @@ -12,7 +12,7 @@ EvtScript N(EVS_OnSmash_Block) = { EvtScript N(EVS_MakeEntities) = { Call(MakeItemEntity, ITEM_DIAMOND_STONE, -389, -698, -424, ITEM_SPAWN_MODE_KEY, GF_ISK14_Item_DiamondStone) IfEq(GF_ISK14_Hammer2Block, FALSE) - Call(MakeEntity, Ref(Entity_Hammer2Block_WideX), -507, -780, -396, 143, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Hammer2BlockWideX), -507, -780, -396, 143, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_OnSmash_Block))) EndIf PlayEffect(EFFECT_FLAME, FX_FLAME_RED, -459, -583, -214, Float(0.3), LVar0) diff --git a/src/world/area_iwa/iwa_00/iwa_00_2_entity.c b/src/world/area_iwa/iwa_00/iwa_00_2_entity.c index 42fc013fc0..e2b52795ab 100644 --- a/src/world/area_iwa/iwa_00/iwa_00_2_entity.c +++ b/src/world/area_iwa/iwa_00/iwa_00_2_entity.c @@ -9,7 +9,7 @@ EvtScript N(EVS_OnSmashBlock) = { EvtScript N(EVS_MakeEntities) = { IfEq(GF_IWA01_Hammer1Block, FALSE) - Call(MakeEntity, Ref(Entity_Hammer1Block_WideZ), 900, -30, 220, 0, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Hammer1BlockWideZ), 900, -30, 220, 0, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_OnSmashBlock))) EndIf Call(MakeItemEntity, ITEM_COIN, 405, 25, 25, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_IWA00_Item_CoinA) diff --git a/src/world/area_iwa/iwa_10/iwa_10_5_entity.c b/src/world/area_iwa/iwa_10/iwa_10_5_entity.c index 37d7b86357..6e8babd9cc 100644 --- a/src/world/area_iwa/iwa_10/iwa_10_5_entity.c +++ b/src/world/area_iwa/iwa_10/iwa_10_5_entity.c @@ -13,7 +13,7 @@ EvtScript N(EVS_OnSmashBlock) = { EvtScript N(EVS_MakeEntities) = { IfEq(GF_IWA10_Hammer1Block, FALSE) - Call(MakeEntity, Ref(Entity_Hammer2Block_WideZ), -1040, 160, -425, 0, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Hammer2BlockWideZ), -1040, 160, -425, 0, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_OnSmashBlock))) EndIf EVT_MAKE_SUPER_BLOCK(-1350, 220, -210, 0) diff --git a/src/world/area_jan/jan_00/jan_00_5_foliage.c b/src/world/area_jan/jan_00/jan_00_5_foliage.c index 206e28114c..accb7d447c 100644 --- a/src/world/area_jan/jan_00/jan_00_5_foliage.c +++ b/src/world/area_jan/jan_00/jan_00_5_foliage.c @@ -26,7 +26,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(D_80247A1C_B27F5C) = { .pos = { 481.0f, 0.0f, -165.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_80247A2C) = { diff --git a/src/world/area_jan/jan_01/jan_01_5_foliage.c b/src/world/area_jan/jan_01/jan_01_5_foliage.c index e7978909b9..e7e576775d 100644 --- a/src/world/area_jan/jan_01/jan_01_5_foliage.c +++ b/src/world/area_jan/jan_01/jan_01_5_foliage.c @@ -12,7 +12,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 160.0f, 0.0f, -287.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o85, MODEL_o86); @@ -38,7 +38,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -628.0f, 0.0f, -95.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o79, MODEL_o80); @@ -64,7 +64,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { -391.0f, 0.0f, -135.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree4_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o82, MODEL_o83); @@ -90,7 +90,7 @@ ShakeTreeConfig N(ShakeTree_Tree4) = { BombTrigger N(BombPos_Tree4) = { .pos = { -341.0f, 0.0f, -115.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree5_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o88, MODEL_o89); @@ -116,7 +116,7 @@ ShakeTreeConfig N(ShakeTree_Tree5) = { BombTrigger N(BombPos_Tree5) = { .pos = { 68.0f, 0.0f, -155.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree6_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o104, MODEL_o105); @@ -142,7 +142,7 @@ ShakeTreeConfig N(ShakeTree_Tree6) = { BombTrigger N(BombPos_Tree6) = { .pos = { 251.0f, 0.0f, -135.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree7_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o113, MODEL_o114); @@ -187,7 +187,7 @@ ShakeTreeConfig N(ShakeTree_Tree7B) = { BombTrigger N(BombPos_Tree7) = { .pos = { 431.0f, 0.0f, -155.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_jan/jan_02/jan_02_5_foliage.c b/src/world/area_jan/jan_02/jan_02_5_foliage.c index b89d298b0d..50ec265016 100644 --- a/src/world/area_jan/jan_02/jan_02_5_foliage.c +++ b/src/world/area_jan/jan_02/jan_02_5_foliage.c @@ -12,7 +12,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -220.0f, 15.0f, 292.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o260, MODEL_o261); @@ -38,7 +38,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -586.0f, 0.0f, -215.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o281, MODEL_o282); @@ -65,7 +65,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 581.0f, 0.0f, -240.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree4_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o257); @@ -78,7 +78,7 @@ ShakeTreeConfig N(ShakeTree_Tree4) = { BombTrigger N(BombPos_Tree4) = { .pos = { -636.0f, 0.0f, -235.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_jan/jan_03/jan_03_4_npc.c b/src/world/area_jan/jan_03/jan_03_4_npc.c index 4503b738c8..ea3c19fe45 100644 --- a/src/world/area_jan/jan_03/jan_03_4_npc.c +++ b/src/world/area_jan/jan_03/jan_03_4_npc.c @@ -86,7 +86,7 @@ s32 N(FoodItemList)[] = { ITEM_BLAND_MEAL, ITEM_HONEY_SHROOM, ITEM_MAPLE_SHROOM, - ITEM_JELLY_SHROOM1, + ITEM_JELLY_SHROOM, ITEM_SHROOM_CAKE, ITEM_SHROOM_STEAK, ITEM_HONEY_SUPER, diff --git a/src/world/area_jan/jan_03/jan_03_7_foliage.c b/src/world/area_jan/jan_03/jan_03_7_foliage.c index d0f4e544ed..912d8f5aaf 100644 --- a/src/world/area_jan/jan_03/jan_03_7_foliage.c +++ b/src/world/area_jan/jan_03/jan_03_7_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 576.0f, 0.0f, -135.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_jan/jan_04/jan_04_4_npc.c b/src/world/area_jan/jan_04/jan_04_4_npc.c index abf5501486..e32d0c0310 100644 --- a/src/world/area_jan/jan_04/jan_04_4_npc.c +++ b/src/world/area_jan/jan_04/jan_04_4_npc.c @@ -124,7 +124,7 @@ EvtScript N(EVS_Sushie_ShoutAtChildren) = { BombTrigger N(BombPos_SushieTree) = { .pos = { 30.0f, 0.0f, -110.0f }, - .radius = 0.0f + .diameter = 0.0f }; #include "world/common/util/ChangeNpcToPartner.inc.c" diff --git a/src/world/area_jan/jan_04/jan_04_6_trees.c b/src/world/area_jan/jan_04/jan_04_6_trees.c index 811b557afc..69cd4c5f45 100644 --- a/src/world/area_jan/jan_04/jan_04_6_trees.c +++ b/src/world/area_jan/jan_04/jan_04_6_trees.c @@ -23,7 +23,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -447.0f, 0.0f, -145.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o101, MODEL_o102, MODEL_o103, MODEL_o104, MODEL_o105); @@ -59,7 +59,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 367.0f, 0.0f, -260.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o63, MODEL_o64, MODEL_o65, MODEL_o66, MODEL_o67); @@ -81,7 +81,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 30.0f, 0.0f, -110.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_05/jan_05_5_npc.c b/src/world/area_jan/jan_05/jan_05_5_npc.c index 908d6f6ffb..6b964a05ba 100644 --- a/src/world/area_jan/jan_05/jan_05_5_npc.c +++ b/src/world/area_jan/jan_05/jan_05_5_npc.c @@ -283,7 +283,11 @@ NpcData N(NpcData_SpearGuy)[] = { } }, .flags = ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING, - SPEAR_GUY_WANDER_NPC_DATA + .settings = &N(NpcSettings_SpearGuy_Wander), + .drops = SPEAR_GUY_DROPS, + .animations = SPEAR_GUY_ANIMS, + .extraAnimations = N(ExtraAnims_SpearGuy), + .aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION, }, SPEAR_GUY_HITBOX(NPC_SpearGuy_Hitbox) }; @@ -303,7 +307,12 @@ NpcData N(NpcData_HurtPlant) = { .id = NPC_HurtPlant, .pos = { 375.0f, 0.0f, 260.0f }, .yaw = 270, - HURT_PLANT_NPC_DATA + .settings = &N(NpcSettings_HurtPlant), + .flags = HURT_PLANT_FLAGS, + .drops = HURT_PLANT_DROPS, + .animations = HURT_PLANT_ANIMS, + .extraAnimations = N(ExtraAnims_HurtPlant), + .tattle = MSG_NpcTattle_HeartPlant, }; NpcData N(NpcData_MBush) = { diff --git a/src/world/area_jan/jan_05/jan_05_6_trees.c b/src/world/area_jan/jan_05/jan_05_6_trees.c index f91e6e66d1..b6df55e3c5 100644 --- a/src/world/area_jan/jan_05/jan_05_6_trees.c +++ b/src/world/area_jan/jan_05/jan_05_6_trees.c @@ -43,7 +43,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 127.0f, 0.0f, -420.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o89, MODEL_o90, MODEL_o91, MODEL_o92, MODEL_o93); @@ -78,7 +78,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 442.0f, 0.0f, -165.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o83, MODEL_o84, MODEL_o85, MODEL_o86, MODEL_o87); @@ -100,7 +100,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { -270.0f, 0.0f, -310.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_06/jan_06_4_trees.c b/src/world/area_jan/jan_06/jan_06_4_trees.c index a85ef094ad..81f274e7b8 100644 --- a/src/world/area_jan/jan_06/jan_06_4_trees.c +++ b/src/world/area_jan/jan_06/jan_06_4_trees.c @@ -37,7 +37,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -285.0f, 0.0f, -360.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_g36); @@ -59,7 +59,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 452.0f, 0.0f, -135.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_07/jan_07_4_trees.c b/src/world/area_jan/jan_07/jan_07_4_trees.c index 5875ed3b0e..6668bc685d 100644 --- a/src/world/area_jan/jan_07/jan_07_4_trees.c +++ b/src/world/area_jan/jan_07/jan_07_4_trees.c @@ -36,7 +36,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -192.0f, 0.0f, -105.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_08/jan_08_5_npc.c b/src/world/area_jan/jan_08/jan_08_5_npc.c index 90bdda186e..9336effb30 100644 --- a/src/world/area_jan/jan_08/jan_08_5_npc.c +++ b/src/world/area_jan/jan_08/jan_08_5_npc.c @@ -159,7 +159,11 @@ NpcData N(NpcData_SpearGuy)[] = { } }, .flags = ENEMY_FLAG_IGNORE_ENTITY_COLLISION, - SPEAR_GUY_WANDER_NPC_DATA + .settings = &N(NpcSettings_SpearGuy_Wander), + .drops = SPEAR_GUY_DROPS, + .animations = SPEAR_GUY_ANIMS, + .extraAnimations = N(ExtraAnims_SpearGuy), + .aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION, }, SPEAR_GUY_HITBOX(NPC_SpearGuy_Hitbox) }; @@ -168,14 +172,23 @@ NpcData N(NpcData_HurtPlant) = { .id = NPC_HurtPlant, .pos = { 400.0f, 0.0f, 235.0f }, .yaw = 270, - HURT_PLANT_NPC_DATA + .settings = &N(NpcSettings_HurtPlant), + .flags = HURT_PLANT_FLAGS, + .drops = HURT_PLANT_DROPS, + .animations = HURT_PLANT_ANIMS, + .extraAnimations = N(ExtraAnims_HurtPlant), + .tattle = MSG_NpcTattle_HeartPlant, }; NpcData N(NpcData_MBush_01) = { .id = NPC_MBush_01, .pos = { -407.0f, 0.0f, -42.0f }, .yaw = 90, - MBUSH_NPC_DATA + .settings = &N(NpcSettings_MBush), + .flags = MBUSH_FLAGS, + .drops = MBUSH_DROPS, + .animations = MBUSH_ANIMS, + .tattle = MSG_NpcTattle_MBush, .init = &N(EVS_NpcInit_MBush_01), }; @@ -183,21 +196,33 @@ NpcData N(NpcData_MBush_02) = { .id = NPC_MBush_02, .pos = { -120.0f, 0.0f, -395.0f }, .yaw = 90, - MBUSH_NPC_DATA + .settings = &N(NpcSettings_MBush), + .flags = MBUSH_FLAGS, + .drops = MBUSH_DROPS, + .animations = MBUSH_ANIMS, + .tattle = MSG_NpcTattle_MBush, }; NpcData N(NpcData_HeartPlant_01) = { .id = NPC_HeartPlant_01, .pos = { -219.0f, 0.0f, 420.0f }, .yaw = 270, - HEART_PLANT_NPC_DATA + .settings = &N(NpcSettings_HeartPlant), + .flags = HEART_PLANT_FLAGS, + .drops = NO_DROPS, + .animations = HEART_PLANT_ANIMS, + .tattle = MSG_NpcTattle_HeartPlant, }; NpcData N(NpcData_HeartPlant_02) = { .id = NPC_HeartPlant_02, .pos = { -157.0f, 0.0f, 452.0f }, .yaw = 270, - HEART_PLANT_NPC_DATA + .settings = &N(NpcSettings_HeartPlant), + .flags = HEART_PLANT_FLAGS, + .drops = NO_DROPS, + .animations = HEART_PLANT_ANIMS, + .tattle = MSG_NpcTattle_HeartPlant, }; NpcData N(NpcData_YoshiKid) = { diff --git a/src/world/area_jan/jan_08/jan_08_6_trees.c b/src/world/area_jan/jan_08/jan_08_6_trees.c index 490865a411..3b2ab2f378 100644 --- a/src/world/area_jan/jan_08/jan_08_6_trees.c +++ b/src/world/area_jan/jan_08/jan_08_6_trees.c @@ -23,7 +23,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -357.0f, 0.0f, -270.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o138, MODEL_o139, MODEL_o140, MODEL_o141, MODEL_o142); @@ -58,7 +58,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -145.0f, 0.0f, -460.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o150, MODEL_o151, MODEL_o152, MODEL_o153, MODEL_o154); @@ -93,7 +93,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 341.0f, 0.0f, -124.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_09/jan_09_3_npc.c b/src/world/area_jan/jan_09/jan_09_3_npc.c index 368c845b8e..4f9069c610 100644 --- a/src/world/area_jan/jan_09/jan_09_3_npc.c +++ b/src/world/area_jan/jan_09/jan_09_3_npc.c @@ -33,14 +33,22 @@ NpcData N(NpcData_MBush_01) = { .id = NPC_MBush_01, .pos = { 335.0f, 0.0f, -40.0f }, .yaw = 90, - MBUSH_NPC_DATA + .settings = &N(NpcSettings_MBush), + .flags = MBUSH_FLAGS, + .drops = MBUSH_DROPS, + .animations = MBUSH_ANIMS, + .tattle = MSG_NpcTattle_MBush, }; NpcData N(NpcData_MBush_02) = { .id = NPC_MBush_02, .pos = { 415.0f, 0.0f, -65.0f }, .yaw = 90, - MBUSH_NPC_DATA + .settings = &N(NpcSettings_MBush), + .flags = MBUSH_FLAGS, + .drops = MBUSH_DROPS, + .animations = MBUSH_ANIMS, + .tattle = MSG_NpcTattle_MBush, }; NpcGroupList N(DefaultNPCs) = { diff --git a/src/world/area_jan/jan_09/jan_09_4_trees.c b/src/world/area_jan/jan_09/jan_09_4_trees.c index 0bc64ff1df..14d798bd09 100644 --- a/src/world/area_jan/jan_09/jan_09_4_trees.c +++ b/src/world/area_jan/jan_09/jan_09_4_trees.c @@ -23,7 +23,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -421.0f, 0.0f, -234.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o136, MODEL_o137, MODEL_o138, MODEL_o139, MODEL_o140); @@ -58,7 +58,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 14.0f, 90.0f, -459.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o130, MODEL_o131, MODEL_o132, MODEL_o133, MODEL_o134); @@ -93,7 +93,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 455.0f, 0.0f, -150.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_10/jan_10_5_trees.c b/src/world/area_jan/jan_10/jan_10_5_trees.c index 979c96edb3..51cf544d87 100644 --- a/src/world/area_jan/jan_10/jan_10_5_trees.c +++ b/src/world/area_jan/jan_10/jan_10_5_trees.c @@ -43,7 +43,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -557.0f, 0.0f, 29.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_12/jan_12_3_trees.c b/src/world/area_jan/jan_12/jan_12_3_trees.c index 650d422c26..abb344c570 100644 --- a/src/world/area_jan/jan_12/jan_12_3_trees.c +++ b/src/world/area_jan/jan_12/jan_12_3_trees.c @@ -36,7 +36,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -214.0f, 30.0f, -111.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o65, MODEL_o66, MODEL_o67); @@ -58,7 +58,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 360.0f, 0.0f, -95.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_13/jan_13_2_puzzle.c b/src/world/area_jan/jan_13/jan_13_2_puzzle.c index 509633b197..a892961321 100644 --- a/src/world/area_jan/jan_13/jan_13_2_puzzle.c +++ b/src/world/area_jan/jan_13/jan_13_2_puzzle.c @@ -28,8 +28,8 @@ void N(setup_gfx_geyser)(void) { } API_CALLABLE(N(GetRatioFromPercent)) { - script->varTable[2] = Float_TO_FIXED(script->varTable[1] / 100.0f); - script->varTable[3] = Float_TO_FIXED(script->varTable[1] / 100.0f); + script->varTable[2] = FLOAT_TO_FIXED(script->varTable[1] / 100.0f); + script->varTable[3] = FLOAT_TO_FIXED(script->varTable[1] / 100.0f); return ApiStatus_DONE2; } diff --git a/src/world/area_jan/jan_13/jan_13_3_trees.c b/src/world/area_jan/jan_13/jan_13_3_trees.c index bffe7cd59a..b06c060439 100644 --- a/src/world/area_jan/jan_13/jan_13_3_trees.c +++ b/src/world/area_jan/jan_13/jan_13_3_trees.c @@ -36,7 +36,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -348.0f, 0.0f, -107.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o50, MODEL_o51, MODEL_o52); @@ -58,7 +58,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 304.0f, 0.0f, -111.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_14/jan_14_3_trees.c b/src/world/area_jan/jan_14/jan_14_3_trees.c index 1cf2885f8f..c8c88e8566 100644 --- a/src/world/area_jan/jan_14/jan_14_3_trees.c +++ b/src/world/area_jan/jan_14/jan_14_3_trees.c @@ -23,7 +23,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -348.0f, 0.0f, -107.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o65, MODEL_o67); @@ -45,7 +45,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -194.0f, 0.0f, -11.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o69, MODEL_o70, MODEL_o71); @@ -67,7 +67,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 14.0f, 0.0f, -91.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree4_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o57, MODEL_o58, MODEL_o59); @@ -89,7 +89,7 @@ ShakeTreeConfig N(ShakeTree_Tree4) = { BombTrigger N(BombPos_Tree4) = { .pos = { 404.0f, 0.0f, -91.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree5_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o73, MODEL_o75); @@ -111,7 +111,7 @@ ShakeTreeConfig N(ShakeTree_Tree5) = { BombTrigger N(BombPos_Tree5) = { .pos = { 511.0f, 0.0f, -7.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_15/jan_15_3_trees.c b/src/world/area_jan/jan_15/jan_15_3_trees.c index c850cae87b..7f0ad3b563 100644 --- a/src/world/area_jan/jan_15/jan_15_3_trees.c +++ b/src/world/area_jan/jan_15/jan_15_3_trees.c @@ -23,7 +23,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -94.0f, 0.0f, -102.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o65, MODEL_o66, MODEL_o67); @@ -58,7 +58,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 204.0f, 0.0f, -101.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_jan/jan_22/jan_22_2_main.c b/src/world/area_jan/jan_22/jan_22_2_main.c index a1a1b72e81..4a22bef9be 100644 --- a/src/world/area_jan/jan_22/jan_22_2_main.c +++ b/src/world/area_jan/jan_22/jan_22_2_main.c @@ -76,7 +76,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o70, .pos = { 750.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o119, .pos = { 960.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o276, .pos = { 960.0, 0.0, 50.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(D_8024202C_B861AC) = { diff --git a/src/world/area_jan/jan_22/jan_22_7_trees.c b/src/world/area_jan/jan_22/jan_22_7_trees.c index 169ceaebdf..f5863a8d90 100644 --- a/src/world/area_jan/jan_22/jan_22_7_trees.c +++ b/src/world/area_jan/jan_22/jan_22_7_trees.c @@ -30,7 +30,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -385.0f, 0.0f, -39.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o93); @@ -43,7 +43,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -328.0f, 0.0f, -123.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c b/src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c index 89869df995..08c0bb6179 100644 --- a/src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c +++ b/src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c @@ -85,7 +85,7 @@ API_CALLABLE(N(GetEffectiveTongueOffset)) { percent = 100.0f; } amplitude = (amplitude * percent) / 100.0f; - script->varTable[0] = Float_TO_FIXED(amplitude); + script->varTable[0] = FLOAT_TO_FIXED(amplitude); return ApiStatus_DONE2; } diff --git a/src/world/area_kkj/kkj_10/kkj_10_2_entity.c b/src/world/area_kkj/kkj_10/kkj_10_2_entity.c index c7f4c4c399..cb0f9c3997 100644 --- a/src/world/area_kkj/kkj_10/kkj_10_2_entity.c +++ b/src/world/area_kkj/kkj_10/kkj_10_2_entity.c @@ -4,7 +4,7 @@ #include "world/common/todo/RemovePadlock.inc.c" s32 N(PeachKeyList)[] = { - ITEM_PEACH_KEY1, + ITEM_PEACH_KEY, ITEM_NONE }; diff --git a/src/world/area_kkj/kkj_11/kkj_11_2_entity.c b/src/world/area_kkj/kkj_11/kkj_11_2_entity.c index 8acd131415..27033825e6 100644 --- a/src/world/area_kkj/kkj_11/kkj_11_2_entity.c +++ b/src/world/area_kkj/kkj_11/kkj_11_2_entity.c @@ -2,7 +2,7 @@ #include "entity.h" s32 N(PeachKeyList)[] = { - ITEM_PEACH_KEY1, + ITEM_PEACH_KEY, ITEM_NONE }; diff --git a/src/world/area_kkj/kkj_12/kkj_12_2_npc.c b/src/world/area_kkj/kkj_12/kkj_12_2_npc.c index cc1fe18f19..e85a277aed 100644 --- a/src/world/area_kkj/kkj_12/kkj_12_2_npc.c +++ b/src/world/area_kkj/kkj_12/kkj_12_2_npc.c @@ -97,7 +97,7 @@ EvtScript N(EVS_NpcInteract_Koopatrol_02) = { Call(AdjustCam, CAM_DEFAULT, Float(5.0 / DT), 0, Float(350.0), Float(15.0), Float(-7.0)) Call(SpeakToPlayer, NPC_SELF, ANIM_WorldKoopatrol_Anim09, ANIM_WorldKoopatrol_Anim02, 0, MSG_Peach_0144) Wait(10 * DT) - Set(LVar0, ITEM_PEACH_KEY1) + Set(LVar0, ITEM_PEACH_KEY) Call(ShowGotItem, LVar0, TRUE, 0) Call(AddKeyItem, LVar0) Set(GF_KKJ11_TrickedGuard, TRUE) diff --git a/src/world/area_kkj/kkj_17/kkj_17_2_entity.c b/src/world/area_kkj/kkj_17/kkj_17_2_entity.c index e8f3cfc5fb..219cb451a4 100644 --- a/src/world/area_kkj/kkj_17/kkj_17_2_entity.c +++ b/src/world/area_kkj/kkj_17/kkj_17_2_entity.c @@ -9,13 +9,13 @@ EvtScript N(EVS_AutoRemoveDeepFocus) = { Wait(1) EndLoop Wait(10) - Call(RemoveBadge, ITEM_DEEP_FOCUS1) + Call(RemoveBadge, ITEM_DEEP_FOCUS_A) Return End }; EvtScript N(EVS_MakeEntities) = { - Call(MakeItemEntity, ITEM_DEEP_FOCUS1, 100, 0, -30, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_KKJ17_Item_DeepFocus) + Call(MakeItemEntity, ITEM_DEEP_FOCUS_A, 100, 0, -30, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_KKJ17_Item_DeepFocus) IfLt(GB_StoryProgress, STORY_CH8_REACHED_PEACHS_CASTLE) IfEq(GF_KKJ17_Item_DeepFocus, FALSE) Exec(N(EVS_AutoRemoveDeepFocus)) diff --git a/src/world/area_kkj/kkj_17/kkj_17_3_chest.c b/src/world/area_kkj/kkj_17/kkj_17_3_chest.c index 9cb7bd01b3..bf8f9ae7c9 100644 --- a/src/world/area_kkj/kkj_17/kkj_17_3_chest.c +++ b/src/world/area_kkj/kkj_17/kkj_17_3_chest.c @@ -31,7 +31,7 @@ EvtScript N(EVS_Chest_ShowGotItem) = { s32 N(ChestItems)[] = { ITEM_POWER_RUSH, ITEM_SHOOTING_STAR, - ITEM_DEEP_FOCUS1, + ITEM_DEEP_FOCUS_A, ITEM_LAST_STAND, ITEM_JAMMIN_JELLY, }; diff --git a/src/world/area_kkj/kkj_18/kkj_18_4_gourmet.c b/src/world/area_kkj/kkj_18/kkj_18_4_gourmet.c index e31b951724..0795d04c49 100644 --- a/src/world/area_kkj/kkj_18/kkj_18_4_gourmet.c +++ b/src/world/area_kkj/kkj_18/kkj_18_4_gourmet.c @@ -447,7 +447,7 @@ EvtScript N(EVS_Scene_GiveKitchenKey) = { Call(SpeakToPlayer, NPC_GourmetGuy, ANIM_GourmetGuy_Talk, ANIM_GourmetGuy_Idle, 5, MSG_Peach_009F) Call(SetNpcAnimation, NPC_GourmetGuy, ANIM_GourmetGuy_Inspect) Wait(30 * DT) - Set(LVar0, ITEM_PEACH_KEY1) + Set(LVar0, ITEM_PEACH_KEY) Call(ShowGotItem, LVar0, TRUE, 0) Call(AddKeyItem, LVar0) Set(GF_KKJ18_GourmetGuy_GaveKey, TRUE) diff --git a/src/world/area_kmr/kmr_02/kmr_02_5_entity.c b/src/world/area_kmr/kmr_02/kmr_02_5_entity.c index bc75a86b58..fc48c95ed8 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_5_entity.c +++ b/src/world/area_kmr/kmr_02/kmr_02_5_entity.c @@ -124,7 +124,7 @@ EvtScript N(EVS_MakeEntities) = { Switch(GB_StoryProgress) CaseLt(STORY_CH0_GATE_CRUSHED) CaseLt(STORY_CH0_SMASHED_GATE_BLOCK) - Call(MakeEntity, Ref(Entity_Hammer1Block_WideX), 326, 0, 261, 270, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Hammer1BlockWideX), 326, 0, 261, 270, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_OnSmash_GateBlock))) CaseLt(STORY_CH0_TWINK_GAVE_LUCKY_STAR) Call(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt2, COLLIDER_FLAGS_UPPER_MASK) diff --git a/src/world/area_kmr/kmr_02/kmr_02_8_foliage.c b/src/world/area_kmr/kmr_02/kmr_02_8_foliage.c index cf97d334d7..a5d1e04b53 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_8_foliage.c +++ b/src/world/area_kmr/kmr_02/kmr_02_8_foliage.c @@ -91,7 +91,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 387.0f, 0.0f, 92.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_kmr/kmr_03/kmr_03_5_foliage.c b/src/world/area_kmr/kmr_03/kmr_03_5_foliage.c index c9b464000c..35281ebd90 100644 --- a/src/world/area_kmr/kmr_03/kmr_03_5_foliage.c +++ b/src/world/area_kmr/kmr_03/kmr_03_5_foliage.c @@ -55,7 +55,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -42.0f, 0.0f, -13.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_kmr/kmr_04/kmr_04_5_foliage.c b/src/world/area_kmr/kmr_04/kmr_04_5_foliage.c index 0292630322..53d7bcef0a 100644 --- a/src/world/area_kmr/kmr_04/kmr_04_5_foliage.c +++ b/src/world/area_kmr/kmr_04/kmr_04_5_foliage.c @@ -365,7 +365,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -352.0f, 0.0f, 10.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o194); @@ -400,7 +400,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -92.0f, 0.0f, -295.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_OnShakeTree3) = { @@ -454,7 +454,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 248.0f, 0.0f, -122.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_kmr/kmr_05/kmr_05_5_foliage.c b/src/world/area_kmr/kmr_05/kmr_05_5_foliage.c index ae00a8c455..a176fb09e8 100644 --- a/src/world/area_kmr/kmr_05/kmr_05_5_foliage.c +++ b/src/world/area_kmr/kmr_05/kmr_05_5_foliage.c @@ -61,7 +61,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 488.0f, 245.0f, -196.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_kmr/kmr_10/kmr_10_5_foliage.c b/src/world/area_kmr/kmr_10/kmr_10_5_foliage.c index abf300e425..4e6a9010c4 100644 --- a/src/world/area_kmr/kmr_10/kmr_10_5_foliage.c +++ b/src/world/area_kmr/kmr_10/kmr_10_5_foliage.c @@ -36,7 +36,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 328.0f, 10.0f, -36.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_kmr/kmr_11/kmr_11_7_foliage.c b/src/world/area_kmr/kmr_11/kmr_11_7_foliage.c index cdb32dea4f..b56c02f713 100644 --- a/src/world/area_kmr/kmr_11/kmr_11_7_foliage.c +++ b/src/world/area_kmr/kmr_11/kmr_11_7_foliage.c @@ -77,7 +77,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -665.0f, 0.0f, -149.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o458); @@ -112,7 +112,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 320.0f, 0.0f, -496.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_kmr/kmr_20/kmr_20_4_documents.c b/src/world/area_kmr/kmr_20/kmr_20_4_documents.c index 4299604e42..19e508de07 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_4_documents.c +++ b/src/world/area_kmr/kmr_20/kmr_20_4_documents.c @@ -11,10 +11,10 @@ #define SET_PACKED_FLAG(base, i) \ get_global_byte((i / 8) + EVT_INDEX_OF_GAME_BYTE(base)) | (1 << (i % 8)) -extern HudScript HES_Item_Unused_08B; -extern HudScript HES_Item_Unused_08B_disabled; -extern HudScript HES_Item_Unused_08C; -extern HudScript HES_Item_Unused_08C_disabled; +extern HudScript HES_Item_Postcard; +extern HudScript HES_Item_Postcard_disabled; +extern HudScript HES_Item_EmptyBook; +extern HudScript HES_Item_EmptyBook_disabled; BSS PopupMenu N(ChooseDocumentPopupMenu); BSS IMG_BIN N(LetterBackgroundImg)[0x3D86] ALIGNED(16); @@ -168,7 +168,7 @@ API_CALLABLE(N(ReadLetters)){ } if (cond) { - menu->ptrIcon[numEntries] = &HES_Item_Unused_08B; + menu->ptrIcon[numEntries] = &HES_Item_Postcard; menu->userIndex[numEntries] = i; menu->enabled[numEntries] = TRUE; menu->nameMsg[numEntries] = N(LetterSenderStringIDs)[i]; @@ -178,7 +178,7 @@ API_CALLABLE(N(ReadLetters)){ menu->value[numEntries] = 0; if (temp) { menu->value[numEntries] = 1; - menu->ptrIcon[numEntries] = &HES_Item_Unused_08B_disabled; + menu->ptrIcon[numEntries] = &HES_Item_Postcard_disabled; } numEntries++; } @@ -349,7 +349,7 @@ API_CALLABLE(N(ReadDiary)){ numEntries = 0; for (i = 0; i < ARRAY_COUNT(N(DiaryStoryRequirements)); i++) { if (evt_get_variable(NULL, GB_StoryProgress) >= N(DiaryStoryRequirements)[i]) { - menu->ptrIcon[numEntries] = &HES_Item_Unused_08C; + menu->ptrIcon[numEntries] = &HES_Item_EmptyBook; menu->userIndex[numEntries] = i; menu->enabled[numEntries] = TRUE; menu->nameMsg[numEntries] = 0; @@ -359,7 +359,7 @@ API_CALLABLE(N(ReadDiary)){ menu->value[numEntries] = 0; if (flags) { menu->value[numEntries] = 1; - menu->ptrIcon[numEntries] = &HES_Item_Unused_08C_disabled; + menu->ptrIcon[numEntries] = &HES_Item_EmptyBook_disabled; } numEntries++; } diff --git a/src/world/area_kmr/kmr_20/kmr_20_6_trees.c b/src/world/area_kmr/kmr_20/kmr_20_6_trees.c index 4af0bbf2ff..ad9ee2d2b0 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_6_trees.c +++ b/src/world/area_kmr/kmr_20/kmr_20_6_trees.c @@ -23,7 +23,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -106.0f, 0.0f, 201.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupTrees) = { diff --git a/src/world/area_kpa/kpa_11/kpa_11_2_main.c b/src/world/area_kpa/kpa_11/kpa_11_2_main.c index 93e727c1cd..d5c901faf7 100644 --- a/src/world/area_kpa/kpa_11/kpa_11_2_main.c +++ b/src/world/area_kpa/kpa_11/kpa_11_2_main.c @@ -64,7 +64,7 @@ EvtScript N(D_80240F84_A53844) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o1234, .pos = { 1400.0, 30.0, -325.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kpa/kpa_12/kpa_12_2_main.c b/src/world/area_kpa/kpa_12/kpa_12_2_main.c index 3ffa1124f0..b980b9c263 100644 --- a/src/world/area_kpa/kpa_12/kpa_12_2_main.c +++ b/src/world/area_kpa/kpa_12/kpa_12_2_main.c @@ -67,7 +67,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o175, .pos = { 700.0, 30.0, -150.0 }}, { .colliderID = COLLIDER_o144, .pos = { 855.0, 30.0, -100.0 }}, { .colliderID = COLLIDER_o305, .pos = { 1445.0, 30.0, -135.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kpa/kpa_13/kpa_13_2_main.c b/src/world/area_kpa/kpa_13/kpa_13_2_main.c index ab2f25f229..1bc9f2bd10 100644 --- a/src/world/area_kpa/kpa_13/kpa_13_2_main.c +++ b/src/world/area_kpa/kpa_13/kpa_13_2_main.c @@ -43,7 +43,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o1066, .pos = { 1655.0, 30.0, -175.0 }}, { .colliderID = COLLIDER_o1068, .pos = { 1755.0, 30.0, -175.0 }}, { .colliderID = COLLIDER_o1042, .pos = { 1860.0, 30.0, -120.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kpa/kpa_133/kpa_133_2_main.c b/src/world/area_kpa/kpa_133/kpa_133_2_main.c index 54298bab27..47c57d5b89 100644 --- a/src/world/area_kpa/kpa_133/kpa_133_2_main.c +++ b/src/world/area_kpa/kpa_133/kpa_133_2_main.c @@ -42,7 +42,7 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(BombPos_Wall) = { .pos = { 388.0f, 240.0f, -25.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BlastWall) = { diff --git a/src/world/area_kpa/kpa_14/kpa_14_2_main.c b/src/world/area_kpa/kpa_14/kpa_14_2_main.c index d54528986e..91a821a572 100644 --- a/src/world/area_kpa/kpa_14/kpa_14_2_main.c +++ b/src/world/area_kpa/kpa_14/kpa_14_2_main.c @@ -100,7 +100,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o198, .pos = { 1400.0, 30.0, -135.0 }}, { .colliderID = COLLIDER_o200, .pos = { 1590.0, 30.0, -90.0 }}, { .colliderID = COLLIDER_o199, .pos = { 1940.0, 30.0, -135.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Touch_LeftOfLavaFall) = { diff --git a/src/world/area_kpa/kpa_16/kpa_16_2_main.c b/src/world/area_kpa/kpa_16/kpa_16_2_main.c index 9c9b887400..ce60e86c05 100644 --- a/src/world/area_kpa/kpa_16/kpa_16_2_main.c +++ b/src/world/area_kpa/kpa_16/kpa_16_2_main.c @@ -102,7 +102,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o197, .pos = { 470.0, 30.0, -30.0 }}, { .colliderID = COLLIDER_o202, .pos = { 470.0, 30.0, -30.0 }}, { .colliderID = COLLIDER_o785, .pos = { 500.0, 230.0, -140.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kpa/kpa_17/kpa_17_3_main.c b/src/world/area_kpa/kpa_17/kpa_17_3_main.c index ef062b5b4d..b39d202a08 100644 --- a/src/world/area_kpa/kpa_17/kpa_17_3_main.c +++ b/src/world/area_kpa/kpa_17/kpa_17_3_main.c @@ -35,7 +35,7 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(BombPos_Wall) = { .pos = { 1186.0f, 30.0f, -562.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kpa/kpa_60/kpa_60_2_entity.c b/src/world/area_kpa/kpa_60/kpa_60_2_entity.c index 70646f4834..3e76d21bc1 100644 --- a/src/world/area_kpa/kpa_60/kpa_60_2_entity.c +++ b/src/world/area_kpa/kpa_60/kpa_60_2_entity.c @@ -43,7 +43,7 @@ EvtScript N(EVS_MakeEntities) = { Else BindTrigger(Ref(N(EVS_ExitDoor_kpa_70_0)), TRIGGER_WALL_PRESS_A, COLLIDER_deilittn, 1, 0) EndIf - Call(MakeEntity, Ref(Entity_RedBlock), -532, 145, -59, 0, ITEM_DEEP_FOCUS3, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_RedBlock), -532, 145, -59, 0, ITEM_DEEP_FOCUS_C, MAKE_ENTITY_END) Call(AssignBlockFlag, GF_KPA62_BadgeBlock_DeepFocus3) Return End diff --git a/src/world/area_kpa/kpa_60/kpa_60_3_main.c b/src/world/area_kpa/kpa_60/kpa_60_3_main.c index f452844d12..51ab6e7513 100644 --- a/src/world/area_kpa/kpa_60/kpa_60_3_main.c +++ b/src/world/area_kpa/kpa_60/kpa_60_3_main.c @@ -195,7 +195,7 @@ EvtScript N(EVS_TexPan_Lava) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o1559, .pos = { -455.0, -15.0, 35.0 }}, { .colliderID = COLLIDER_o1560, .pos = { -545.0, 10.0, 15.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kpa/kpa_62/kpa_62_2_entity.c b/src/world/area_kpa/kpa_62/kpa_62_2_entity.c index 84751c0c9b..13155c7da2 100644 --- a/src/world/area_kpa/kpa_62/kpa_62_2_entity.c +++ b/src/world/area_kpa/kpa_62/kpa_62_2_entity.c @@ -43,7 +43,7 @@ EvtScript N(EVS_MakeEntities) = { Else BindTrigger(Ref(N(EVS_ExitDoors_kpa_70_0)), TRIGGER_WALL_PRESS_A, COLLIDER_deilittn, 1, 0) EndIf - Call(MakeEntity, Ref(Entity_RedBlock), -532, 145, -59, 0, ITEM_DEEP_FOCUS3, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_RedBlock), -532, 145, -59, 0, ITEM_DEEP_FOCUS_C, MAKE_ENTITY_END) Call(AssignBlockFlag, GF_KPA62_BadgeBlock_DeepFocus3) Return End diff --git a/src/world/area_kpa/kpa_62/kpa_62_3_main.c b/src/world/area_kpa/kpa_62/kpa_62_3_main.c index 6b32397ce7..f19fdd1b22 100644 --- a/src/world/area_kpa/kpa_62/kpa_62_3_main.c +++ b/src/world/area_kpa/kpa_62/kpa_62_3_main.c @@ -198,7 +198,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o1559, .pos = { -455.0, -15.0, 35.0 }}, { .colliderID = COLLIDER_o1560, .pos = { -545.0, 10.0, 15.0 }}, { .colliderID = COLLIDER_o1692, .pos = { -426.0, -35.0, 70.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kpa/kpa_91/kpa_91_3_npc.c b/src/world/area_kpa/kpa_91/kpa_91_3_npc.c index 610eda52ba..9f4113aff3 100644 --- a/src/world/area_kpa/kpa_91/kpa_91_3_npc.c +++ b/src/world/area_kpa/kpa_91/kpa_91_3_npc.c @@ -206,13 +206,13 @@ EvtScript N(EVS_NpcDefeat_Koopatrol) = { CaseEq(OUTCOME_PLAYER_WON) Set(GF_KPA91_Defeated_Guard, TRUE) Call(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) - Call(MakeItemEntity, ITEM_PRISON_KEY1, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, GF_KPA91_Item_PrisonKey1) + Call(MakeItemEntity, ITEM_PRISON_KEY, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, GF_KPA91_Item_PrisonKey1) Call(DoNpcDefeat) CaseEq(OUTCOME_PLAYER_FLED) CaseEq(OUTCOME_ENEMY_FLED) Set(GF_KPA91_Defeated_Guard, TRUE) Call(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) - Call(MakeItemEntity, ITEM_PRISON_KEY1, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, GF_KPA91_Item_PrisonKey1) + Call(MakeItemEntity, ITEM_PRISON_KEY, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, GF_KPA91_Item_PrisonKey1) Call(SetEnemyFlagBits, NPC_SELF, ENEMY_FLAG_FLED, 1) Call(RemoveNpc, NPC_SELF) EndSwitch diff --git a/src/world/area_kpa/kpa_91/kpa_91_4_entity.c b/src/world/area_kpa/kpa_91/kpa_91_4_entity.c index 2afe3e1672..b7445ddd11 100644 --- a/src/world/area_kpa/kpa_91/kpa_91_4_entity.c +++ b/src/world/area_kpa/kpa_91/kpa_91_4_entity.c @@ -5,7 +5,7 @@ #include "world/common/todo/GetEntityPosition.inc.c" s32 N(KeyList_PrisonCell)[] = { - ITEM_PRISON_KEY1, + ITEM_PRISON_KEY, ITEM_NONE }; @@ -44,7 +44,7 @@ EvtScript N(EVS_MakeEntities) = { BindTrigger(Ref(N(EVS_OpenCellDoor)), TRIGGER_WALL_PRESS_A, COLLIDER_deilittn, 1, 0) EndIf IfEq(GF_KPA91_Defeated_Guard, TRUE) - Call(MakeItemEntity, ITEM_PRISON_KEY1, 60, 0, 55, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_KPA91_Item_PrisonKey1) + Call(MakeItemEntity, ITEM_PRISON_KEY, 60, 0, 55, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_KPA91_Item_PrisonKey1) EndIf Return End diff --git a/src/world/area_kpa/kpa_95/kpa_95_2_entity.c b/src/world/area_kpa/kpa_95/kpa_95_2_entity.c index 20e16c9ba6..d5dfa2567a 100644 --- a/src/world/area_kpa/kpa_95/kpa_95_2_entity.c +++ b/src/world/area_kpa/kpa_95/kpa_95_2_entity.c @@ -5,7 +5,7 @@ #include "world/common/todo/GetEntityPosition.inc.c" s32 N(KeyList_PrisonCell)[] = { - ITEM_PRISON_KEY1, + ITEM_PRISON_KEY, ITEM_NONE }; @@ -44,7 +44,7 @@ EvtScript N(EVS_MakeEntities) = { BindTrigger(Ref(N(EVS_OpenCellDoor)), TRIGGER_WALL_PRESS_A, COLLIDER_deilittn, 1, 0) EndIf IfEq(GF_KPA95_Defeated_Guard, TRUE) - Call(MakeItemEntity, ITEM_PRISON_KEY1, -70, 0, 55, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_KPA95_Item_PrisonKey1) + Call(MakeItemEntity, ITEM_PRISON_KEY, -70, 0, 55, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_KPA95_Item_PrisonKey1) EndIf Return End diff --git a/src/world/area_kpa/kpa_95/kpa_95_4_npc.c b/src/world/area_kpa/kpa_95/kpa_95_4_npc.c index e02bd668e9..7eca9add47 100644 --- a/src/world/area_kpa/kpa_95/kpa_95_4_npc.c +++ b/src/world/area_kpa/kpa_95/kpa_95_4_npc.c @@ -207,13 +207,13 @@ EvtScript N(EVS_NpcDefeat_Koopatrol) = { CaseEq(OUTCOME_PLAYER_WON) Set(GF_KPA95_Defeated_Guard, TRUE) Call(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) - Call(MakeItemEntity, ITEM_PRISON_KEY1, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, GF_KPA95_Item_PrisonKey1) + Call(MakeItemEntity, ITEM_PRISON_KEY, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, GF_KPA95_Item_PrisonKey1) Call(DoNpcDefeat) CaseEq(OUTCOME_PLAYER_FLED) CaseEq(OUTCOME_ENEMY_FLED) Set(GF_KPA95_Defeated_Guard, TRUE) Call(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) - Call(MakeItemEntity, ITEM_PRISON_KEY1, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, GF_KPA95_Item_PrisonKey1) + Call(MakeItemEntity, ITEM_PRISON_KEY, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, GF_KPA95_Item_PrisonKey1) Call(SetEnemyFlagBits, NPC_SELF, ENEMY_FLAG_FLED, 1) Call(RemoveNpc, NPC_SELF) EndSwitch diff --git a/src/world/area_kzn/kzn_02/kzn_02_1_main.c b/src/world/area_kzn/kzn_02/kzn_02_1_main.c index 4d1f914ea7..015435c0c6 100644 --- a/src/world/area_kzn/kzn_02/kzn_02_1_main.c +++ b/src/world/area_kzn/kzn_02/kzn_02_1_main.c @@ -93,7 +93,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o78, .pos = { 250.0, 20.0, 15.0 }}, { .colliderID = COLLIDER_o83, .pos = { 790.0, 20.0, 0.0 }}, { .colliderID = COLLIDER_o84, .pos = { 790.0, 20.0, 0.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kzn/kzn_06/kzn_06_1_main.c b/src/world/area_kzn/kzn_06/kzn_06_1_main.c index 084e45dd37..3a2bfafccd 100644 --- a/src/world/area_kzn/kzn_06/kzn_06_1_main.c +++ b/src/world/area_kzn/kzn_06/kzn_06_1_main.c @@ -46,7 +46,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o394, .pos = { -210.0, 75.0, 100.0 }}, { .colliderID = COLLIDER_o440, .pos = { 60.0, 75.0, 100.0 }}, { .colliderID = COLLIDER_o437, .pos = { 60.0, 75.0, 100.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kzn/kzn_06/kzn_06_2_entity.c b/src/world/area_kzn/kzn_06/kzn_06_2_entity.c index 6743d5a12f..8b1b2f6401 100644 --- a/src/world/area_kzn/kzn_06/kzn_06_2_entity.c +++ b/src/world/area_kzn/kzn_06/kzn_06_2_entity.c @@ -14,7 +14,7 @@ EvtScript N(EVS_MakeEntities) = { Call(MakeEntity, Ref(Entity_HiddenYellowBlock), 325, 205, -30, 0, ITEM_LIFE_SHROOM, MAKE_ENTITY_END) Call(AssignBlockFlag, GF_KZN06_HiddenItem_LifeShroom) IfEq(GF_KZN06_Hammer3Block, FALSE) - Call(MakeEntity, Ref(Entity_Hammer3Block_WideZ), 385, 5, 180, 0, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Hammer3BlockWideZ), 385, 5, 180, 0, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_OnBreakBlock))) EndIf IfLt(GB_StoryProgress, STORY_CH5_LAVA_STREAM_BLOCKED) diff --git a/src/world/area_kzn/kzn_07/kzn_07_2_main.c b/src/world/area_kzn/kzn_07/kzn_07_2_main.c index b6b0855acf..ea29f4d33a 100644 --- a/src/world/area_kzn/kzn_07/kzn_07_2_main.c +++ b/src/world/area_kzn/kzn_07/kzn_07_2_main.c @@ -47,7 +47,7 @@ EvtScript N(EVS_SetupTexPanners) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o365, .pos = { 120.0, 0.0, 100.0 }}, { .colliderID = COLLIDER_o411, .pos = { -120.0, 0.0, 100.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kzn/kzn_07/kzn_07_3_entity.c b/src/world/area_kzn/kzn_07/kzn_07_3_entity.c index fdeae6e80d..ca7636125f 100644 --- a/src/world/area_kzn/kzn_07/kzn_07_3_entity.c +++ b/src/world/area_kzn/kzn_07/kzn_07_3_entity.c @@ -37,7 +37,7 @@ EvtScript N(EVS_MakeEntities) = { Call(AssignChestFlag, GF_KZN07_GiantChest) Exec(N(EVS_MonitorChestStatus)) IfEq(GF_KZN07_Hammer3Block, FALSE) - Call(MakeEntity, Ref(Entity_Hammer3Block_WideZ), 175, 35, -185, 0, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Hammer3BlockWideZ), 175, 35, -185, 0, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_OnBreakBlock))) EndIf Call(CreatePushBlockGrid, 0, 15, 5, -62, 0, 35, 0) diff --git a/src/world/area_kzn/kzn_08/kzn_08_1_main.c b/src/world/area_kzn/kzn_08/kzn_08_1_main.c index 3ab878eca4..e8ab5e512a 100644 --- a/src/world/area_kzn/kzn_08/kzn_08_1_main.c +++ b/src/world/area_kzn/kzn_08/kzn_08_1_main.c @@ -98,7 +98,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o322, .pos = { -10.0, 0.0, 100.0 }}, { .colliderID = COLLIDER_o446, .pos = { -10.0, 0.0, 100.0 }}, { .colliderID = COLLIDER_o454, .pos = { -90.0, 0.0, -45.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; // unused diff --git a/src/world/area_kzn/kzn_11/kzn_11_1_main.c b/src/world/area_kzn/kzn_11/kzn_11_1_main.c index a01926b545..2ceba2a6dd 100644 --- a/src/world/area_kzn/kzn_11/kzn_11_1_main.c +++ b/src/world/area_kzn/kzn_11/kzn_11_1_main.c @@ -49,7 +49,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o211, .pos = { -400.0, 20.0, 0.0 }}, { .colliderID = COLLIDER_o212, .pos = { 230.0, 20.0, 0.0 }}, { .colliderID = COLLIDER_o83, .pos = { 790.0, 20.0, 0.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_kzn/kzn_18/kzn_18_1_main.c b/src/world/area_kzn/kzn_18/kzn_18_1_main.c index 0b83900dff..ff8482ec8f 100644 --- a/src/world/area_kzn/kzn_18/kzn_18_1_main.c +++ b/src/world/area_kzn/kzn_18/kzn_18_1_main.c @@ -52,7 +52,7 @@ EvtScript N(EVS_StartTexPanners_Lava) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o382, .pos = { 50.0, 200.0, -185.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_EnterMap) = { diff --git a/src/world/area_kzn/kzn_20/kzn_20_2_main.c b/src/world/area_kzn/kzn_20/kzn_20_2_main.c index aa269bfdca..c488795198 100644 --- a/src/world/area_kzn/kzn_20/kzn_20_2_main.c +++ b/src/world/area_kzn/kzn_20/kzn_20_2_main.c @@ -30,7 +30,7 @@ EvtScript N(EVS_UpdateTexPan_Lava) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o919, .pos = { -30.0, 125.0, -15.0 }}, { .colliderID = COLLIDER_o870, .pos = { 30.0, 150.0, 0.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_DetermineLavaLevel) = { @@ -149,7 +149,7 @@ EvtScript N(EVS_UpdateLavaWaves) = { BombTrigger N(WeakWallBombTrigger) = { .pos = { 175.0, 150.0, 15.0 }, - .radius = 0.0 + .diameter = 0.0 }; EvtScript N(EVS_OnBreakWall) = { diff --git a/src/world/area_kzn/kzn_22/kzn_22_2_main.c b/src/world/area_kzn/kzn_22/kzn_22_2_main.c index e3b97e4679..d16e6bdb98 100644 --- a/src/world/area_kzn/kzn_22/kzn_22_2_main.c +++ b/src/world/area_kzn/kzn_22/kzn_22_2_main.c @@ -133,7 +133,7 @@ EvtScript N(EVS_UpdateLavaLevel) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o582, .pos = { 200.0, 150.0, 180.0 }}, { .colliderID = COLLIDER_o357, .pos = { 200.0, 150.0, 180.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_mac/mac_01/mac_01_13_foliage.c b/src/world/area_mac/mac_01/mac_01_13_foliage.c index cdc28af48a..ae5ad6ac51 100644 --- a/src/world/area_mac/mac_01/mac_01_13_foliage.c +++ b/src/world/area_mac/mac_01/mac_01_13_foliage.c @@ -35,7 +35,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -512.0f, 20.0f, -154.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o115); @@ -57,7 +57,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -157.0f, 20.0f, -458.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_mac/mac_02/mac_02_4_foliage.c b/src/world/area_mac/mac_02/mac_02_4_foliage.c index 36f402679e..2f1efa71ee 100644 --- a/src/world/area_mac/mac_02/mac_02_4_foliage.c +++ b/src/world/area_mac/mac_02/mac_02_4_foliage.c @@ -21,7 +21,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 98.0f, 20.0f, -531.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o115); @@ -43,7 +43,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -323.0f, 20.0f, -190.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o415); @@ -65,7 +65,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 598.0f, 0.0f, -67.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(UnusedTree_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o419); @@ -87,7 +87,7 @@ ShakeTreeConfig N(ShakeTree_UnusedTree) = { BombTrigger N(BombPos_UnusedTree) = { .pos = { -608.0f, 20.0f, -156.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree4_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o414); @@ -109,7 +109,7 @@ ShakeTreeConfig N(ShakeTree_Tree4) = { BombTrigger N(BombPos_Tree4) = { .pos = { 351.0f, 20.0f, 555.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_mac/mac_03/mac_03_6_foliage.c b/src/world/area_mac/mac_03/mac_03_6_foliage.c index ef940a2f8f..4161f15346 100644 --- a/src/world/area_mac/mac_03/mac_03_6_foliage.c +++ b/src/world/area_mac/mac_03/mac_03_6_foliage.c @@ -60,7 +60,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 79.0f, 20.0f, -504.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o238); @@ -82,7 +82,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 554.0f, 20.0f, -289.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o239); @@ -106,7 +106,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { //@bug x-position should be -265 BombTrigger N(BombPos_Tree3) = { .pos = { 265.0f, 20.0f, -535.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_mac/mac_04/mac_04_4_foliage.c b/src/world/area_mac/mac_04/mac_04_4_foliage.c index 957b3481ee..6faff5cb19 100644 --- a/src/world/area_mac/mac_04/mac_04_4_foliage.c +++ b/src/world/area_mac/mac_04/mac_04_4_foliage.c @@ -21,7 +21,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 470.0f, 20.0f, -242.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o290); @@ -43,7 +43,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 50.0f, 20.0f, -141.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o288); @@ -65,7 +65,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { -293.0f, 20.0f, 86.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_mim/mim_01/mim_01_4_hint.c b/src/world/area_mim/mim_01/mim_01_4_hint.c index bc35edd959..526eef71a7 100644 --- a/src/world/area_mim/mim_01/mim_01_4_hint.c +++ b/src/world/area_mim/mim_01/mim_01_4_hint.c @@ -12,9 +12,9 @@ API_CALLABLE(N(GetFlowerNormal)) { N(GetFirstTriangleNormal)(mdl->modelNode->displayData->displayList, &x, &y, &z); - evt_set_variable(script, *args++, Float_TO_FIXED(x)); - evt_set_variable(script, *args++, Float_TO_FIXED(y)); - evt_set_variable(script, *args++, Float_TO_FIXED(z)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(x)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(y)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(z)); return ApiStatus_DONE2; } diff --git a/src/world/area_mim/mim_03/mim_03_4_hint.c b/src/world/area_mim/mim_03/mim_03_4_hint.c index e1108c02cd..ed5b04c142 100644 --- a/src/world/area_mim/mim_03/mim_03_4_hint.c +++ b/src/world/area_mim/mim_03/mim_03_4_hint.c @@ -12,9 +12,9 @@ API_CALLABLE(N(GetFlowerNormal)) { N(GetFirstTriangleNormal)(mdl->modelNode->displayData->displayList, &x, &y, &z); - evt_set_variable(script, *args++, Float_TO_FIXED(x)); - evt_set_variable(script, *args++, Float_TO_FIXED(y)); - evt_set_variable(script, *args++, Float_TO_FIXED(z)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(x)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(y)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(z)); return ApiStatus_DONE2; } diff --git a/src/world/area_mim/mim_06/mim_06_4_hint.c b/src/world/area_mim/mim_06/mim_06_4_hint.c index 4f38d8dd67..f23453ad80 100644 --- a/src/world/area_mim/mim_06/mim_06_4_hint.c +++ b/src/world/area_mim/mim_06/mim_06_4_hint.c @@ -12,9 +12,9 @@ API_CALLABLE(N(GetFlowerNormal)) { N(GetFirstTriangleNormal)(mdl->modelNode->displayData->displayList, &x, &y, &z); - evt_set_variable(script, *args++, Float_TO_FIXED(x)); - evt_set_variable(script, *args++, Float_TO_FIXED(y)); - evt_set_variable(script, *args++, Float_TO_FIXED(z)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(x)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(y)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(z)); return ApiStatus_DONE2; } diff --git a/src/world/area_nok/nok_01/nok_01_8_foliage.c b/src/world/area_nok/nok_01/nok_01_8_foliage.c index c2d20d7604..3edf8f3a50 100644 --- a/src/world/area_nok/nok_01/nok_01_8_foliage.c +++ b/src/world/area_nok/nok_01/nok_01_8_foliage.c @@ -184,7 +184,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 198.0f, 0.0f, 147.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_nok/nok_02/nok_02_9_foliage.c b/src/world/area_nok/nok_02/nok_02_9_foliage.c index d25c8a618f..ace1a01403 100644 --- a/src/world/area_nok/nok_02/nok_02_9_foliage.c +++ b/src/world/area_nok/nok_02/nok_02_9_foliage.c @@ -121,7 +121,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 443.0f, 0.0f, 68.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_nok/nok_12/nok_12_5_foliage.c b/src/world/area_nok/nok_12/nok_12_5_foliage.c index c3b847b1c7..886f9f665b 100644 --- a/src/world/area_nok/nok_12/nok_12_5_foliage.c +++ b/src/world/area_nok/nok_12/nok_12_5_foliage.c @@ -13,7 +13,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -422.0f, 0.0f, -120.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_nok/nok_15/nok_15_2_main.c b/src/world/area_nok/nok_15/nok_15_2_main.c index b474dea927..8e76355931 100644 --- a/src/world/area_nok/nok_15/nok_15_2_main.c +++ b/src/world/area_nok/nok_15/nok_15_2_main.c @@ -9,7 +9,7 @@ EvtScript N(EVS_ExitWalk_trd_00_4) = EVT_EXIT_WALK_NOK(60, nok_15_ENTRY_2, "trd_ BombTrigger N(BombPos_Wall) = { .pos = { -26.0f, 0.0f, -531.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BlastWall) = { diff --git a/src/world/area_nok/nok_15/nok_15_5_foliage.c b/src/world/area_nok/nok_15/nok_15_5_foliage.c index fc4cfc9d09..9447754aff 100644 --- a/src/world/area_nok/nok_15/nok_15_5_foliage.c +++ b/src/world/area_nok/nok_15/nok_15_5_foliage.c @@ -26,7 +26,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -592.0f, 0.0f, -118.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_obk/obk_02/obk_02_4_bombable.c b/src/world/area_obk/obk_02/obk_02_4_bombable.c index 4f337cb57c..7121717127 100644 --- a/src/world/area_obk/obk_02/obk_02_4_bombable.c +++ b/src/world/area_obk/obk_02/obk_02_4_bombable.c @@ -3,7 +3,7 @@ BombTrigger N(BombPos_Wall) = { .pos = { 237.0f, -210.0f, 53.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_OnBlast_Wall) = { diff --git a/src/world/area_obk/obk_06/obk_06_3_bombable.c b/src/world/area_obk/obk_06/obk_06_3_bombable.c index 62adf3b6b4..a0859b4eb1 100644 --- a/src/world/area_obk/obk_06/obk_06_3_bombable.c +++ b/src/world/area_obk/obk_06/obk_06_3_bombable.c @@ -3,7 +3,7 @@ BombTrigger N(BombPos_Wall) = { .pos = { -237.0f, 0.0f, 50.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_OnBlast_Wall) = { diff --git a/src/world/area_omo/omo_02/omo_02_5_barricade.c b/src/world/area_omo/omo_02/omo_02_5_barricade.c index ee951a4ec0..a6ae7fc0d9 100644 --- a/src/world/area_omo/omo_02/omo_02_5_barricade.c +++ b/src/world/area_omo/omo_02/omo_02_5_barricade.c @@ -180,7 +180,7 @@ API_CALLABLE(N(AnimateBarricadeParts)) { BombTrigger N(BombPos_Barricade) = { .pos = { -520.0f, 0.0f, 0.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_Scene_BreakBarricade) = { diff --git a/src/world/area_omo/omo_11/omo_11_4_entity.c b/src/world/area_omo/omo_11/omo_11_4_entity.c index c081453dac..ac7b736390 100644 --- a/src/world/area_omo/omo_11/omo_11_4_entity.c +++ b/src/world/area_omo/omo_11/omo_11_4_entity.c @@ -16,7 +16,7 @@ EvtScript N(EVS_MakeEntities) = { Call(AssignBlockFlag, GF_OMO11_HiddenItem_SnowmanDoll) Call(MakeEntity, Ref(Entity_YellowBlock), -100, 60, -45, 0, ITEM_COIN, MAKE_ENTITY_END) Call(AssignBlockFlag, GF_OMO11_ItemBlock_CoinB) - Call(MakeEntity, Ref(Entity_HiddenRedBlock), -150, 60, -45, 0, ITEM_DEEP_FOCUS2, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_HiddenRedBlock), -150, 60, -45, 0, ITEM_DEEP_FOCUS_B, MAKE_ENTITY_END) Call(AssignBlockFlag, GF_OMO11_HiddenBadge_DeepFocus2) Call(MakeEntity, Ref(Entity_YellowBlock), -200, 60, -45, 0, ITEM_COIN, MAKE_ENTITY_END) Call(AssignBlockFlag, GF_OMO11_ItemBlock_CoinA) diff --git a/src/world/area_omo/omo_12/omo_12_3_npc.c b/src/world/area_omo/omo_12/omo_12_3_npc.c index 3b60013a1d..4f23506832 100644 --- a/src/world/area_omo/omo_12/omo_12_3_npc.c +++ b/src/world/area_omo/omo_12/omo_12_3_npc.c @@ -188,7 +188,7 @@ Vec3f N(WattLeftFlightPath)[] = { BombTrigger N(BombPos_Lantern_Unused) = { .pos = { 0.0f, 0.0f, 20.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_Scene_ReleaseWatt) = { diff --git a/src/world/area_pra/common/Reflection.inc.c b/src/world/area_pra/common/Reflection.inc.c index b0d65a0baf..625c2bd1a7 100644 --- a/src/world/area_pra/common/Reflection.inc.c +++ b/src/world/area_pra/common/Reflection.inc.c @@ -95,7 +95,7 @@ void N(worker_reflect_player_wall)(void) { spr_update_player_sprite(PLAYER_SPRITE_AUX2, anim, 1.0f); if (!(playerStatus->flags & PS_FLAG_SPINNING)) { - if (playerStatus->curAlpha != D_802D9D70) { + if (playerStatus->curAlpha != ReflectWallPrevAlpha) { if (playerStatus->curAlpha < 254) { renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; set_player_imgfx_comp(PLAYER_SPRITE_AUX2, -1, IMGFX_SET_ALPHA, 0, 0, 0, playerStatus->curAlpha, 0); @@ -104,10 +104,10 @@ void N(worker_reflect_player_wall)(void) { set_player_imgfx_comp(PLAYER_SPRITE_AUX2, -1, IMGFX_CLEAR, 0, 0, 0, 0, 0); } } - D_802D9D70 = playerStatus->curAlpha; + ReflectWallPrevAlpha = playerStatus->curAlpha; } else { renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; - D_802D9D70 = 0; + ReflectWallPrevAlpha = 0; } renderTaskPtr->renderMode = renderMode; @@ -170,7 +170,7 @@ void N(worker_reflect_player_floor)(void) { spr_update_player_sprite(PLAYER_SPRITE_AUX1, playerStatus->trueAnimation, 1.0f); if (!(playerStatus->flags & PS_FLAG_SPINNING)) { - if (playerStatus->curAlpha != D_802D9D71) { + if (playerStatus->curAlpha != ReflectFloorPrevAlpha) { if (playerStatus->curAlpha < 254) { renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; set_player_imgfx_comp(PLAYER_SPRITE_AUX1, -1, IMGFX_SET_ALPHA, 0, 0, 0, playerStatus->curAlpha, 0); @@ -179,10 +179,10 @@ void N(worker_reflect_player_floor)(void) { set_player_imgfx_comp(PLAYER_SPRITE_AUX1, -1, IMGFX_CLEAR, 0, 0, 0, 0, 0); } } - D_802D9D71 = playerStatus->curAlpha; + ReflectFloorPrevAlpha = playerStatus->curAlpha; } else { renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; - D_802D9D71 = 0; + ReflectFloorPrevAlpha = 0; } renderTaskPtr->renderMode = renderMode; diff --git a/src/world/area_pra/pra_09/pra_09_2_main.c b/src/world/area_pra/pra_09/pra_09_2_main.c index e7f61d7ff3..79d69acd9c 100644 --- a/src/world/area_pra/pra_09/pra_09_2_main.c +++ b/src/world/area_pra/pra_09/pra_09_2_main.c @@ -52,7 +52,7 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(BombPos_Wall) = { .pos = { 487.0f, 0.0f, 80.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BlastWall) = { diff --git a/src/world/area_pra/pra_13/pra_13_2_main.c b/src/world/area_pra/pra_13/pra_13_2_main.c index 5960015d6e..8ebd3a6d0b 100644 --- a/src/world/area_pra/pra_13/pra_13_2_main.c +++ b/src/world/area_pra/pra_13/pra_13_2_main.c @@ -118,12 +118,12 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(BombPos_NearWall) = { .pos = { 487.0f, 0.0f, 80.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(BombPos_FarWall) = { .pos = { 487.0f, 0.0f, -80.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BlastWall_Near) = { diff --git a/src/world/area_pra/pra_14/pra_14_2_main.c b/src/world/area_pra/pra_14/pra_14_2_main.c index 2fe0289950..d1f56219b2 100644 --- a/src/world/area_pra/pra_14/pra_14_2_main.c +++ b/src/world/area_pra/pra_14/pra_14_2_main.c @@ -23,12 +23,12 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(BombPos_WallA) = { .pos = { 13.0f, 0.0f, 70.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(BombPos_WallB) = { .pos = { 13.0f, 0.0f, -70.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BlastWallA) = { diff --git a/src/world/area_pra/pra_33/pra_33_2_main.c b/src/world/area_pra/pra_33/pra_33_2_main.c index 38a7f80b7e..9fcb29adee 100644 --- a/src/world/area_pra/pra_33/pra_33_2_main.c +++ b/src/world/area_pra/pra_33/pra_33_2_main.c @@ -79,7 +79,7 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(BombPos_Wall) = { .pos = { 487.0f, 0.0f, -80.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BlastWall) = { diff --git a/src/world/area_pra/pra_35/pra_35_2_main.c b/src/world/area_pra/pra_35/pra_35_2_main.c index a5525367c6..e0c4dc68a5 100644 --- a/src/world/area_pra/pra_35/pra_35_2_main.c +++ b/src/world/area_pra/pra_35/pra_35_2_main.c @@ -79,7 +79,7 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(D_802432A8_D904F8) = { .pos = { 13.0f, 0.0f, -80.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(D_802432B8_D90508) = { diff --git a/src/world/area_sam/sam_02/sam_02_2_main.c b/src/world/area_sam/sam_02/sam_02_2_main.c index 6a2d11f5a1..277b416b30 100644 --- a/src/world/area_sam/sam_02/sam_02_2_main.c +++ b/src/world/area_sam/sam_02/sam_02_2_main.c @@ -17,7 +17,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 230.0f, 20.0f, -370.0f }, - .radius = 0.0f + .diameter = 0.0f }; //@bug model count is 2, but only one is supplied. the extra comma is needed. @@ -30,7 +30,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 264.0f, 24.0f, 316.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_ExitWalk_sam_01_0) = EVT_EXIT_WALK(60, sam_02_ENTRY_0, "sam_01", sam_01_ENTRY_0); diff --git a/src/world/area_sam/sam_04/sam_04_2_main.c b/src/world/area_sam/sam_04/sam_04_2_main.c index 3f603d728c..a7d3a0563f 100644 --- a/src/world/area_sam/sam_04/sam_04_2_main.c +++ b/src/world/area_sam/sam_04/sam_04_2_main.c @@ -99,7 +99,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -411.0f, 0.0f, 163.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_TrunkModels) = FOLIAGE_MODEL_LIST(MODEL_miki2); @@ -119,7 +119,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 426.0f, 0.0f, -105.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree4_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_ki4); @@ -132,7 +132,7 @@ ShakeTreeConfig N(ShakeTree_Tree4) = { BombTrigger N(BombPos_Tree4) = { .pos = { 315.0f, 0.0f, -115.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree5_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_ki5); @@ -145,7 +145,7 @@ ShakeTreeConfig N(ShakeTree_Tree5) = { BombTrigger N(BombPos_Tree5) = { .pos = { 314.0f, 0.0f, -114.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree6_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_ki6); @@ -158,7 +158,7 @@ ShakeTreeConfig N(ShakeTree_Tree6) = { BombTrigger N(BombPos_Tree6) = { .pos = { -294.0f, 0.0f, -213.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_Main) = { diff --git a/src/world/area_sam/sam_06/sam_06_2_main.c b/src/world/area_sam/sam_06/sam_06_2_main.c index c6a5900c6d..2413065cfe 100644 --- a/src/world/area_sam/sam_06/sam_06_2_main.c +++ b/src/world/area_sam/sam_06/sam_06_2_main.c @@ -15,7 +15,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -185.0f, 90.0f, -225.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_ki3); @@ -28,7 +28,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -451.0f, 60.0f, 80.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_ki5b); @@ -41,7 +41,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { -405.0f, 0.0f, 228.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree4_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_ki6b); @@ -54,7 +54,7 @@ ShakeTreeConfig N(ShakeTree_Tree4) = { BombTrigger N(BombPos_Tree4) = { .pos = { 291.0f, 0.0f, 385.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree5_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_ki10); @@ -67,7 +67,7 @@ ShakeTreeConfig N(ShakeTree_Tree5) = { BombTrigger N(BombPos_Tree5) = { .pos = { 108.0f, 83.0f, 115.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_ExitWalk_sam_05_1) = EVT_EXIT_WALK(60, sam_06_ENTRY_0, "sam_05", sam_05_ENTRY_1); diff --git a/src/world/area_sam/sam_07/sam_07_4_frozen_pit.c b/src/world/area_sam/sam_07/sam_07_4_frozen_pit.c index 78041a6114..366499f332 100644 --- a/src/world/area_sam/sam_07/sam_07_4_frozen_pit.c +++ b/src/world/area_sam/sam_07/sam_07_4_frozen_pit.c @@ -232,9 +232,9 @@ EvtScript N(EVS_UseGreenSwitch) = { End }; -BombTriggerF N(BombPos_Ice) = { +BombTrigger N(BombPos_Ice) = { .pos = { -940.0f, -130.0f, -75.0f }, - .radius = 60.0f + .diameter = 60.0f }; EvtScript N(EVS_SetupPit) = { diff --git a/src/world/area_sam/sam_10/sam_10_4_stairs.c b/src/world/area_sam/sam_10/sam_10_4_stairs.c index 83994eb358..3666e14a5a 100644 --- a/src/world/area_sam/sam_10/sam_10_4_stairs.c +++ b/src/world/area_sam/sam_10/sam_10_4_stairs.c @@ -207,7 +207,7 @@ EvtScript N(EVS_ItemPrompt_StarStoneSocket) = { BombTrigger N(BombPos_Wall) = { .pos = { 337.0f, -20.0f, -103.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BlastWall) = { diff --git a/src/world/area_sam/sam_11/sam_11_2_main.c b/src/world/area_sam/sam_11/sam_11_2_main.c index 16e9b71cc5..b1000e2685 100644 --- a/src/world/area_sam/sam_11/sam_11_2_main.c +++ b/src/world/area_sam/sam_11/sam_11_2_main.c @@ -21,7 +21,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 447.0f, 0.0f, -144.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o192); @@ -34,7 +34,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -440.0f, 0.0f, -178.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o190); @@ -47,7 +47,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { -450.0f, 0.0f, -80.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_ExitWalk_sam_02_1) = { diff --git a/src/world/area_sam/sam_11/sam_11_6_pond.c b/src/world/area_sam/sam_11/sam_11_6_pond.c index c729deaa2f..665a35e6bf 100644 --- a/src/world/area_sam/sam_11/sam_11_6_pond.c +++ b/src/world/area_sam/sam_11/sam_11_6_pond.c @@ -433,10 +433,9 @@ EvtScript N(EVS_TouchPond_After) = { End }; -// @bug radius is f32 here, should be s32 -BombTriggerF N(BombTrigger_Pond) = { +BombTrigger N(BombTrigger_Pond) = { .pos = { 0.0f, -10.0f, 220.0f }, - .radius = 300.0 + .diameter = 300.0 }; EvtScript N(EVS_SetupPond) = { diff --git a/src/world/area_sbk/sbk_06/sbk_06_3_foliage.c b/src/world/area_sbk/sbk_06/sbk_06_3_foliage.c index 5b8a1e029d..d42a4f0b3c 100644 --- a/src/world/area_sbk/sbk_06/sbk_06_3_foliage.c +++ b/src/world/area_sbk/sbk_06/sbk_06_3_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 228.0f, 0.0f, -306.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_14/sbk_14_2_entity.c b/src/world/area_sbk/sbk_14/sbk_14_2_entity.c index cefb461f64..6325512972 100644 --- a/src/world/area_sbk/sbk_14/sbk_14_2_entity.c +++ b/src/world/area_sbk/sbk_14/sbk_14_2_entity.c @@ -1,7 +1,7 @@ #include "sbk_14.h" #include "entity.h" -TweesterPath N(D_80240440_936B20) = { +TweesterPath N(DefaultTweesterPath) = { -65, 0, 217, -262, 0, -64, 57, 0, -286, @@ -9,8 +9,8 @@ TweesterPath N(D_80240440_936B20) = { TWEESTER_PATH_LOOP }; -TweesterPath* N(D_80240474_936B54)[] = { - &N(D_80240440_936B20), +TweesterPath* N(TweesterPaths)[] = { + &N(DefaultTweesterPath), PTR_LIST_END }; @@ -24,7 +24,7 @@ EvtScript N(D_8024047C_936B5C) = { }; EvtScript N(EVS_MakeEntities) = { - Call(MakeEntity, Ref(Entity_Tweester), 327, 0, 8, 0, Ref(N(D_80240474_936B54)), MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_Tweester), 327, 0, 8, 0, Ref(N(TweesterPaths)), MAKE_ENTITY_END) Call(AssignScript, Ref(N(D_8024047C_936B5C))) Call(MakeEntity, Ref(Entity_MulticoinBlock), 0, 60, -100, 0, MAKE_ENTITY_END) Call(AssignBlockFlag, GF_SBK14_MultiCoinBrick) diff --git a/src/world/area_sbk/sbk_16/sbk_16_2_foliage.c b/src/world/area_sbk/sbk_16/sbk_16_2_foliage.c index d40e5b031f..c1eb1f6eac 100644 --- a/src/world/area_sbk/sbk_16/sbk_16_2_foliage.c +++ b/src/world/area_sbk/sbk_16/sbk_16_2_foliage.c @@ -12,7 +12,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -351.0f, 0.0f, -101.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o58); @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 228.0f, 0.0f, -306.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_23/sbk_23_2_entity.c b/src/world/area_sbk/sbk_23/sbk_23_2_entity.c index b7628351b1..450683c5a4 100644 --- a/src/world/area_sbk/sbk_23/sbk_23_2_entity.c +++ b/src/world/area_sbk/sbk_23/sbk_23_2_entity.c @@ -1,7 +1,7 @@ #include "sbk_23.h" #include "entity.h" -TweesterPath N(D_802403C0_93AB20) = { +TweesterPath N(DefaultTweesterPath) = { -65, 0, 217, -262, 0, -64, 57, 0, -286, @@ -9,12 +9,12 @@ TweesterPath N(D_802403C0_93AB20) = { TWEESTER_PATH_LOOP }; -TweesterPath* N(D_802403F4_93AB54)[] = { - &N(D_802403C0_93AB20), +TweesterPath* N(TweesterPaths)[] = { + &N(DefaultTweesterPath), PTR_LIST_END }; -EvtScript N(D_802403FC_93AB5C) = { +EvtScript N(EVS_GotoMap_sbk_14_4) = { Call(DisablePlayerInput, TRUE) Call(DisablePlayerPhysics, TRUE) Call(GotoMap, Ref("sbk_14"), sbk_14_ENTRY_4) @@ -24,8 +24,8 @@ EvtScript N(D_802403FC_93AB5C) = { }; EvtScript N(EVS_MakeEntities) = { - Call(MakeEntity, Ref(Entity_Tweester), 327, 0, 8, 0, Ref(N(D_802403F4_93AB54)), MAKE_ENTITY_END) - Call(AssignScript, Ref(N(D_802403FC_93AB5C))) + Call(MakeEntity, Ref(Entity_Tweester), 327, 0, 8, 0, Ref(N(TweesterPaths)), MAKE_ENTITY_END) + Call(AssignScript, Ref(N(EVS_GotoMap_sbk_14_4))) Return End }; diff --git a/src/world/area_sbk/sbk_24/sbk_24_4_foliage.c b/src/world/area_sbk/sbk_24/sbk_24_4_foliage.c index b779e47c34..5d7b4ba32e 100644 --- a/src/world/area_sbk/sbk_24/sbk_24_4_foliage.c +++ b/src/world/area_sbk/sbk_24/sbk_24_4_foliage.c @@ -12,7 +12,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 265.0f, 0.0f, -146.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o56); @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 401.0f, 0.0f, -119.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o58); @@ -38,7 +38,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 362.0f, 0.0f, -234.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_25/sbk_25_3_foliage.c b/src/world/area_sbk/sbk_25/sbk_25_3_foliage.c index dca40cf343..e7b0c66dbb 100644 --- a/src/world/area_sbk/sbk_25/sbk_25_3_foliage.c +++ b/src/world/area_sbk/sbk_25/sbk_25_3_foliage.c @@ -12,7 +12,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -398.0f, 0.0f, -104.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o60); @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -238.0f, 0.0f, -179.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_26/sbk_26_3_foliage.c b/src/world/area_sbk/sbk_26/sbk_26_3_foliage.c index fe49f92d6a..89003ef40c 100644 --- a/src/world/area_sbk/sbk_26/sbk_26_3_foliage.c +++ b/src/world/area_sbk/sbk_26/sbk_26_3_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -178.0f, 0.0f, 164.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_30/sbk_30_4_foliage.c b/src/world/area_sbk/sbk_30/sbk_30_4_foliage.c index 73a71d4df3..7663beb362 100644 --- a/src/world/area_sbk/sbk_30/sbk_30_4_foliage.c +++ b/src/world/area_sbk/sbk_30/sbk_30_4_foliage.c @@ -31,7 +31,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree) = { .pos = { 266.0f, 0.0f, -209.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_33/sbk_33_1_entity.c b/src/world/area_sbk/sbk_33/sbk_33_1_entity.c index 6f2c977757..64cde82406 100644 --- a/src/world/area_sbk/sbk_33/sbk_33_1_entity.c +++ b/src/world/area_sbk/sbk_33/sbk_33_1_entity.c @@ -14,7 +14,7 @@ TweesterPath* N(TweesterPaths)[] = { PTR_LIST_END }; -EvtScript N(D_802400FC_945ACC) = { +EvtScript N(EVS_GotoMap_sbk_24_4) = { Call(DisablePlayerInput, TRUE) Call(DisablePlayerPhysics, TRUE) Call(GotoMap, Ref("sbk_24"), sbk_24_ENTRY_4) @@ -27,7 +27,7 @@ EvtScript N(EVS_MakeEntities) = { Call(MakeEntity, Ref(Entity_HiddenPanel), 0, 0, 225, 0, MODEL_stage, MAKE_ENTITY_END) Call(AssignPanelFlag, GF_SBK33_HiddenPanel) Call(MakeEntity, Ref(Entity_Tweester), 327, 0, 8, 0, Ref(N(TweesterPaths)), MAKE_ENTITY_END) - Call(AssignScript, Ref(N(D_802400FC_945ACC))) + Call(AssignScript, Ref(N(EVS_GotoMap_sbk_24_4))) Return End }; diff --git a/src/world/area_sbk/sbk_34/sbk_34_3_foliage.c b/src/world/area_sbk/sbk_34/sbk_34_3_foliage.c index e0713c2829..238b6b3631 100644 --- a/src/world/area_sbk/sbk_34/sbk_34_3_foliage.c +++ b/src/world/area_sbk/sbk_34/sbk_34_3_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 131.0f, 0.0f, -89.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_35/sbk_35_3_foliage.c b/src/world/area_sbk/sbk_35/sbk_35_3_foliage.c index 6800076e43..10f4f4d7b5 100644 --- a/src/world/area_sbk/sbk_35/sbk_35_3_foliage.c +++ b/src/world/area_sbk/sbk_35/sbk_35_3_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -398.0f, 0.0f, 104.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o59); @@ -38,7 +38,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -108.0f, 0.0f, -406.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o61); @@ -51,7 +51,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 211.0f, 0.0f, -111.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_36/sbk_36_2_foliage.c b/src/world/area_sbk/sbk_36/sbk_36_2_foliage.c index ebf084a1a1..8957ae616b 100644 --- a/src/world/area_sbk/sbk_36/sbk_36_2_foliage.c +++ b/src/world/area_sbk/sbk_36/sbk_36_2_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -422.0f, 0.0f, 91.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o71); @@ -51,7 +51,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -322.0f, 0.0f, -111.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o75); @@ -64,7 +64,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { -244.0f, 0.0f, 77.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree4_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o69); @@ -77,7 +77,7 @@ ShakeTreeConfig N(ShakeTree_Tree4) = { BombTrigger N(BombPos_Tree4) = { .pos = { -128.0f, 0.0f, -111.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree5_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o57); @@ -90,7 +90,7 @@ ShakeTreeConfig N(ShakeTree_Tree5) = { BombTrigger N(BombPos_Tree5) = { .pos = { 58.0f, 0.0f, 101.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree6_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o59); @@ -116,7 +116,7 @@ ShakeTreeConfig N(ShakeTree_Tree6) = { BombTrigger N(BombPos_Tree6) = { .pos = { 158.0f, 0.0f, -101.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree7_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o67); @@ -129,7 +129,7 @@ ShakeTreeConfig N(ShakeTree_Tree7) = { BombTrigger N(BombPos_Tree7) = { .pos = { 236.0f, 0.0f, 87.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree8_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o63); @@ -142,7 +142,7 @@ ShakeTreeConfig N(ShakeTree_Tree8) = { BombTrigger N(BombPos_Tree8) = { .pos = { 351.0f, 0.0f, -101.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree9_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o65); @@ -169,7 +169,7 @@ ShakeTreeConfig N(ShakeTree_Tree9) = { BombTrigger N(BombPos_Tree9) = { .pos = { 438.0f, 0.0f, 101.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_41/sbk_41_2_entity.c b/src/world/area_sbk/sbk_41/sbk_41_2_entity.c index 4be25b161e..6c2d6198d6 100644 --- a/src/world/area_sbk/sbk_41/sbk_41_2_entity.c +++ b/src/world/area_sbk/sbk_41/sbk_41_2_entity.c @@ -14,7 +14,7 @@ TweesterPath* N(TweesterPaths)[] = { PTR_LIST_END }; -EvtScript N(EVS_RideTweester) = { +EvtScript N(EVS_GotoMap_sbk_32_4) = { Call(DisablePlayerInput, TRUE) Call(DisablePlayerPhysics, TRUE) Call(GotoMap, Ref("sbk_32"), sbk_32_ENTRY_4) @@ -25,7 +25,7 @@ EvtScript N(EVS_RideTweester) = { EvtScript N(EVS_MakeEntities) = { Call(MakeEntity, Ref(Entity_Tweester), 327, 0, 8, 0, Ref(N(TweesterPaths)), MAKE_ENTITY_END) - Call(AssignScript, Ref(N(EVS_RideTweester))) + Call(AssignScript, Ref(N(EVS_GotoMap_sbk_32_4))) Return End }; diff --git a/src/world/area_sbk/sbk_46/sbk_46_3_foliage.c b/src/world/area_sbk/sbk_46/sbk_46_3_foliage.c index e7294d5118..be3db02067 100644 --- a/src/world/area_sbk/sbk_46/sbk_46_3_foliage.c +++ b/src/world/area_sbk/sbk_46/sbk_46_3_foliage.c @@ -12,7 +12,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -228.0f, 0.0f, -306.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o64); @@ -38,7 +38,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { -178.0f, 0.0f, 164.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o60); @@ -51,7 +51,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 351.0f, 0.0f, -101.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_54/sbk_54_2_entity.c b/src/world/area_sbk/sbk_54/sbk_54_2_entity.c index 81da2498ec..26ca29dc3c 100644 --- a/src/world/area_sbk/sbk_54/sbk_54_2_entity.c +++ b/src/world/area_sbk/sbk_54/sbk_54_2_entity.c @@ -1,7 +1,7 @@ #include "sbk_54.h" #include "entity.h" -TweesterPath N(TweesterPath1) = { +TweesterPath N(DefaultTweesterPath) = { -65, 0, 217, -262, 0, -64, 57, 0, -286, @@ -10,11 +10,11 @@ TweesterPath N(TweesterPath1) = { }; TweesterPath* N(TweesterPaths)[] = { - &N(TweesterPath1), + &N(DefaultTweesterPath), PTR_LIST_END }; -EvtScript N(EVS_RideTweester) = { +EvtScript N(EVS_GotoMap_sbk_45_4) = { Call(DisablePlayerInput, TRUE) Call(DisablePlayerPhysics, TRUE) Call(GotoMap, Ref("sbk_45"), sbk_45_ENTRY_4) @@ -25,7 +25,7 @@ EvtScript N(EVS_RideTweester) = { EvtScript N(EVS_MakeEntities) = { Call(MakeEntity, Ref(Entity_Tweester), 327, 0, 8, 0, Ref(N(TweesterPaths)), MAKE_ENTITY_END) - Call(AssignScript, Ref(N(EVS_RideTweester))) + Call(AssignScript, Ref(N(EVS_GotoMap_sbk_45_4))) Return End }; diff --git a/src/world/area_sbk/sbk_55/sbk_55_3_foliage.c b/src/world/area_sbk/sbk_55/sbk_55_3_foliage.c index 508b22ec98..647432656c 100644 --- a/src/world/area_sbk/sbk_55/sbk_55_3_foliage.c +++ b/src/world/area_sbk/sbk_55/sbk_55_3_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 77.0f, 0.0f, -126.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_56/sbk_56_3_foliage.c b/src/world/area_sbk/sbk_56/sbk_56_3_foliage.c index 7b1418390f..da6fde6821 100644 --- a/src/world/area_sbk/sbk_56/sbk_56_3_foliage.c +++ b/src/world/area_sbk/sbk_56/sbk_56_3_foliage.c @@ -26,7 +26,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -259.0f, 0.0f, -160.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_ki); @@ -53,7 +53,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 171.0f, 0.0f, -291.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o52); @@ -79,7 +79,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { -436.0f, 0.0f, 224.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree4_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_y_ha); @@ -92,7 +92,7 @@ ShakeTreeConfig N(ShakeTree_Tree4) = { BombTrigger N(BombPos_Tree4) = { .pos = { -320.0f, 0.0f, -21.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree5_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o54); @@ -105,7 +105,7 @@ ShakeTreeConfig N(ShakeTree_Tree5) = { BombTrigger N(BombPos_Tree5) = { .pos = { -242.0f, 0.0f, 88.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree6_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o56); @@ -118,7 +118,7 @@ ShakeTreeConfig N(ShakeTree_Tree6) = { BombTrigger N(BombPos_Tree6) = { .pos = { -203.0f, 0.0f, -214.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree7_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o58); @@ -131,7 +131,7 @@ ShakeTreeConfig N(ShakeTree_Tree7) = { BombTrigger N(BombPos_Tree7) = { .pos = { -101.0f, 0.0f, -376.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree8_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o60); @@ -144,7 +144,7 @@ ShakeTreeConfig N(ShakeTree_Tree8) = { BombTrigger N(BombPos_Tree8) = { .pos = { 104.0f, 0.0f, -386.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree9_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o62); @@ -170,7 +170,7 @@ ShakeTreeConfig N(ShakeTree_Tree9) = { BombTrigger N(BombPos_Tree9) = { .pos = { 266.0f, 0.0f, 124.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree10_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o64); @@ -183,7 +183,7 @@ ShakeTreeConfig N(ShakeTree_Tree10) = { BombTrigger N(BombPos_Tree10) = { .pos = { 362.0f, 0.0f, -74.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_sbk/sbk_66/sbk_66_3_foliage.c b/src/world/area_sbk/sbk_66/sbk_66_3_foliage.c index 6f49b76e86..d7971f7ae2 100644 --- a/src/world/area_sbk/sbk_66/sbk_66_3_foliage.c +++ b/src/world/area_sbk/sbk_66/sbk_66_3_foliage.c @@ -12,7 +12,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombTrigger_Tree1) = { .pos = { -326.0f, 0.0f, -204.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o58); @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombTrigger_Tree2) = { .pos = { 116.0f, 0.0f, -394.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o56); @@ -51,7 +51,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombTrigger_Tree3) = { .pos = { 398.0f, 0.0f, -116.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/area_tik/tik_05/tik_05_4_entity.c b/src/world/area_tik/tik_05/tik_05_4_entity.c index d71f0f0022..1ddd1a6deb 100644 --- a/src/world/area_tik/tik_05/tik_05_4_entity.c +++ b/src/world/area_tik/tik_05/tik_05_4_entity.c @@ -54,11 +54,11 @@ EvtScript N(EVS_BreakBlock_DropSpring) = { End }; -EvtScript N(EVS_OpenChest) = EVT_OPEN_CHEST_BADGE(ITEM_POWER_SMASH1, GF_TIK05_Chest_PowerSmash1); +EvtScript N(EVS_OpenChest) = EVT_OPEN_CHEST_BADGE(ITEM_POWER_SMASH, GF_TIK05_Chest_PowerSmash); EvtScript N(EVS_MakeEntities) = { Call(MakeEntity, Ref(Entity_Chest), -185, 60, -25, 0, 0, MAKE_ENTITY_END) - Call(AssignChestFlag, GF_TIK05_Chest_PowerSmash1) + Call(AssignChestFlag, GF_TIK05_Chest_PowerSmash) Call(AssignScript, Ref(N(EVS_OpenChest))) Call(MakeEntity, Ref(Entity_BrickBlock), 25, 50, 0, 0, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_BreakBlock_DropSpring))) diff --git a/src/world/area_tik/tik_14/tik_14_4_entity.c b/src/world/area_tik/tik_14/tik_14_4_entity.c index badf6bfb0c..ebbea0de69 100644 --- a/src/world/area_tik/tik_14/tik_14_4_entity.c +++ b/src/world/area_tik/tik_14/tik_14_4_entity.c @@ -4,7 +4,7 @@ BombTrigger N(BombPos_Wall) = { .pos = { 35.0f, 0.0f, 45.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_OnBlast_Wall) = { diff --git a/src/world/area_tik/tik_15/tik_15_3_entity.c b/src/world/area_tik/tik_15/tik_15_3_entity.c index 4f355a2249..f578575523 100644 --- a/src/world/area_tik/tik_15/tik_15_3_entity.c +++ b/src/world/area_tik/tik_15/tik_15_3_entity.c @@ -4,7 +4,7 @@ BombTrigger N(BombPos_Wall) = { .pos = { -230.0f, -10.0f, 0.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_OnBlast_Wall) = { diff --git a/src/world/area_tik/tik_20/tik_20_2_main.c b/src/world/area_tik/tik_20/tik_20_2_main.c index 4a8ee89d38..b711b5122c 100644 --- a/src/world/area_tik/tik_20/tik_20_2_main.c +++ b/src/world/area_tik/tik_20/tik_20_2_main.c @@ -27,7 +27,7 @@ EvtScript N(EVS_BindExitTriggers) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_yuka, .pos = { -190.0, 30.0, -85.0 }}, { .colliderID = COLLIDER_yuka2, .pos = { 200.0, 30.0, -70.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; #define DROPLET_MODEL MODEL_sizuku diff --git a/src/world/area_trd/trd_02/trd_02_1_main.c b/src/world/area_trd/trd_02/trd_02_1_main.c index 03a2486b59..7299edb557 100644 --- a/src/world/area_trd/trd_02/trd_02_1_main.c +++ b/src/world/area_trd/trd_02/trd_02_1_main.c @@ -120,7 +120,7 @@ EvtScript N(EVS_Scene_LowerStairs) = { BombTrigger N(D_8024240C_9A33EC) = { .pos = { 255.0f, 50.0f, -80.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(D_8024241C_9A33FC) = { diff --git a/src/world/area_trd/trd_03/trd_03_1_main.c b/src/world/area_trd/trd_03/trd_03_1_main.c index 9fc069f3a3..3c1bd5168e 100644 --- a/src/world/area_trd/trd_03/trd_03_1_main.c +++ b/src/world/area_trd/trd_03/trd_03_1_main.c @@ -76,12 +76,12 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(BombPos_MiddleCell) = { .pos = { -160.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(BombPos_RightCell) = { .pos = { 360.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BombWall_MiddleCell) = { diff --git a/src/world/area_trd/trd_05/trd_05_1_main.c b/src/world/area_trd/trd_05/trd_05_1_main.c index d4913e0a92..abd4509feb 100644 --- a/src/world/area_trd/trd_05/trd_05_1_main.c +++ b/src/world/area_trd/trd_05/trd_05_1_main.c @@ -56,7 +56,7 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(BombPos_Wall) = { .pos = { 300.0f, 0.0f, 0.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BombWall) = { diff --git a/src/world/area_trd/trd_06/trd_06_1_main.c b/src/world/area_trd/trd_06/trd_06_1_main.c index 1cfaab2fb4..8708a52ef1 100644 --- a/src/world/area_trd/trd_06/trd_06_1_main.c +++ b/src/world/area_trd/trd_06/trd_06_1_main.c @@ -41,7 +41,7 @@ EvtScript N(EVS_EnterMap) = { BombTrigger N(BombPos_CellWall) = { .pos = { 160.0f, 0.0f, 160.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_BombWall_Cell) = { diff --git a/src/world/area_trd/trd_07/trd_07_3_magic_doors.c b/src/world/area_trd/trd_07/trd_07_3_magic_doors.c index 8b9add7f76..108e24974d 100644 --- a/src/world/area_trd/trd_07/trd_07_3_magic_doors.c +++ b/src/world/area_trd/trd_07/trd_07_3_magic_doors.c @@ -7,10 +7,10 @@ API_CALLABLE(N(GetPointsWithCamRelativeOffset)) { f32 posZ = evt_get_float_variable(script, *args++); f32 angle = evt_get_float_variable(script, *args++); - script->varTable[0] = Float_TO_FIXED(posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 270.0f)) * 1000.0f)); - script->varTable[1] = Float_TO_FIXED(posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 270.0f)) * 1000.0f)); - script->varTable[2] = Float_TO_FIXED(posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 90.0f)) * 1000.0f)); - script->varTable[3] = Float_TO_FIXED(posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 90.0f)) * 1000.0f)); + script->varTable[0] = FLOAT_TO_FIXED(posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 270.0f)) * 1000.0f)); + script->varTable[1] = FLOAT_TO_FIXED(posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 270.0f)) * 1000.0f)); + script->varTable[2] = FLOAT_TO_FIXED(posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 90.0f)) * 1000.0f)); + script->varTable[3] = FLOAT_TO_FIXED(posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 90.0f)) * 1000.0f)); return ApiStatus_DONE2; } diff --git a/src/world/area_trd/trd_09/trd_09_2_entity.c b/src/world/area_trd/trd_09/trd_09_2_entity.c index 7d13cff945..119ecc4f37 100644 --- a/src/world/area_trd/trd_09/trd_09_2_entity.c +++ b/src/world/area_trd/trd_09/trd_09_2_entity.c @@ -9,7 +9,7 @@ EvtScript N(EVS_BombRock) = { EvtScript N(EVS_MakeEntities) = { IfEq(GF_TRD09_BombedRock, FALSE) - Call(MakeEntity, Ref(Entity_BombableRock2), -470, -75, 139, 0, MAKE_ENTITY_END) + Call(MakeEntity, Ref(Entity_BombableRockWide), -470, -75, 139, 0, MAKE_ENTITY_END) Call(AssignScript, Ref(N(EVS_BombRock))) EndIf Call(MakeEntity, Ref(Entity_HeartBlock), 1400, -15, 135, 0, MAKE_ENTITY_END) diff --git a/src/world/common/complete/Quizmo.inc.c b/src/world/common/complete/Quizmo.inc.c index 3dfc464536..6d4236aba4 100644 --- a/src/world/common/complete/Quizmo.inc.c +++ b/src/world/common/complete/Quizmo.inc.c @@ -11,22 +11,22 @@ #define QUIZMO_ANIMS \ { \ - ANIM_ChuckQuizmo_Idle, \ - ANIM_ChuckQuizmo_Walk, \ - ANIM_ChuckQuizmo_Run, \ - ANIM_ChuckQuizmo_Run, \ - ANIM_ChuckQuizmo_Idle, \ - ANIM_ChuckQuizmo_Idle, \ - ANIM_ChuckQuizmo_Still, \ - ANIM_ChuckQuizmo_Still, \ - ANIM_ChuckQuizmo_Run, \ - ANIM_ChuckQuizmo_Run, \ - ANIM_ChuckQuizmo_Run, \ - ANIM_ChuckQuizmo_Run, \ - ANIM_ChuckQuizmo_Run, \ - ANIM_ChuckQuizmo_Run, \ - ANIM_ChuckQuizmo_Run, \ - ANIM_ChuckQuizmo_Run, \ + .idle = ANIM_ChuckQuizmo_Idle, \ + .walk = ANIM_ChuckQuizmo_Walk, \ + .run = ANIM_ChuckQuizmo_Run, \ + .chase = ANIM_ChuckQuizmo_Run, \ + .anim_4 = ANIM_ChuckQuizmo_Idle, \ + .anim_5 = ANIM_ChuckQuizmo_Idle, \ + .death = ANIM_ChuckQuizmo_Still, \ + .hit = ANIM_ChuckQuizmo_Still, \ + .anim_8 = ANIM_ChuckQuizmo_Run, \ + .anim_9 = ANIM_ChuckQuizmo_Run, \ + .anim_A = ANIM_ChuckQuizmo_Run, \ + .anim_B = ANIM_ChuckQuizmo_Run, \ + .anim_C = ANIM_ChuckQuizmo_Run, \ + .anim_D = ANIM_ChuckQuizmo_Run, \ + .anim_E = ANIM_ChuckQuizmo_Run, \ + .anim_F = ANIM_ChuckQuizmo_Run, \ } extern s16 MessagePlural; @@ -455,7 +455,7 @@ API_CALLABLE(N(Quizmo_GetCamVfov)) { Bytecode* args = script->ptrReadPos; s32 cameraID = evt_get_variable(script, *args++); - evt_set_variable(script, *args++, Float_TO_FIXED(gCameras[cameraID].vfov)); + evt_set_variable(script, *args++, FLOAT_TO_FIXED(gCameras[cameraID].vfov)); return ApiStatus_DONE2; } diff --git a/src/world/common/enemy/HeartPlant.inc.c b/src/world/common/enemy/HeartPlant.inc.c index 227caf662c..1edda0d3c4 100644 --- a/src/world/common/enemy/HeartPlant.inc.c +++ b/src/world/common/enemy/HeartPlant.inc.c @@ -48,9 +48,6 @@ NpcSettings N(NpcSettings_HeartPlant) = { .onInteract = &N(EVS_NpcInteract_HeartPlant), }; -#define HEART_PLANT_NPC_DATA \ - .settings = &N(NpcSettings_HeartPlant), \ - .flags = ENEMY_FLAG_PASSIVE | ENEMY_FLAG_4 | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING | ENEMY_FLAG_8000 | ENEMY_FLAG_400000, \ - .drops = NO_DROPS, \ - .animations = HEART_PLANT_ANIMS, \ - .tattle = MSG_NpcTattle_HeartPlant, \ +#define HEART_PLANT_FLAGS \ + ENEMY_FLAG_PASSIVE | ENEMY_FLAG_4 | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | \ + ENEMY_FLAG_FLYING | ENEMY_FLAG_8000 | ENEMY_FLAG_400000 diff --git a/src/world/common/enemy/HurtPlant.inc.c b/src/world/common/enemy/HurtPlant.inc.c index bfc881c9ea..74c1e205b5 100644 --- a/src/world/common/enemy/HurtPlant.inc.c +++ b/src/world/common/enemy/HurtPlant.inc.c @@ -67,10 +67,6 @@ AnimID N(ExtraAnims_HurtPlant)[] = { ANIM_LIST_END }; -#define HURT_PLANT_NPC_DATA \ - .settings = &N(NpcSettings_HurtPlant), \ - .flags = ENEMY_FLAG_PASSIVE | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING | ENEMY_FLAG_8000 | ENEMY_FLAG_400000, \ - .drops = HURT_PLANT_DROPS, \ - .animations = HURT_PLANT_ANIMS, \ - .extraAnimations = N(ExtraAnims_HurtPlant), \ - .tattle = MSG_NpcTattle_HeartPlant, \ +#define HURT_PLANT_FLAGS \ + ENEMY_FLAG_PASSIVE | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | \ + ENEMY_FLAG_FLYING | ENEMY_FLAG_8000 | ENEMY_FLAG_400000 diff --git a/src/world/common/enemy/MBush.inc.c b/src/world/common/enemy/MBush.inc.c index 93378293e3..2fe3606096 100644 --- a/src/world/common/enemy/MBush.inc.c +++ b/src/world/common/enemy/MBush.inc.c @@ -95,9 +95,6 @@ NpcSettings N(NpcSettings_MBush) = { .onDefeat = &N(EVS_NpcDefeat_MBush), }; -#define MBUSH_NPC_DATA \ - .settings = &N(NpcSettings_MBush), \ - .flags = ENEMY_FLAG_PASSIVE | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING | ENEMY_FLAG_8000 | ENEMY_FLAG_400000, \ - .drops = MBUSH_DROPS, \ - .animations = MBUSH_ANIMS, \ - .tattle = MSG_NpcTattle_MBush, \ +#define MBUSH_FLAGS \ + ENEMY_FLAG_PASSIVE | ENEMY_FLAG_IGNORE_WORLD_COLLISION | ENEMY_FLAG_IGNORE_ENTITY_COLLISION | \ + ENEMY_FLAG_FLYING | ENEMY_FLAG_8000 | ENEMY_FLAG_400000 diff --git a/src/world/common/enemy/SpearGuy_Wander.inc.c b/src/world/common/enemy/SpearGuy_Wander.inc.c index 189ff242d9..05e0b70113 100644 --- a/src/world/common/enemy/SpearGuy_Wander.inc.c +++ b/src/world/common/enemy/SpearGuy_Wander.inc.c @@ -90,10 +90,3 @@ NpcSettings N(NpcSettings_SpearGuy_Hitbox) = { .onDefeat = &N(EVS_NpcDefeat_SpearGuy_Hitbox), .actionFlags = AI_ACTION_08, }; - -#define SPEAR_GUY_WANDER_NPC_DATA \ - .settings = &N(NpcSettings_SpearGuy_Wander), \ - .drops = SPEAR_GUY_DROPS, \ - .animations = SPEAR_GUY_ANIMS, \ - .extraAnimations = N(ExtraAnims_SpearGuy), \ - .aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION, \ diff --git a/src/world/common/enemy/ai/FlyingAI.inc.c b/src/world/common/enemy/ai/FlyingAI.inc.c index 23f2fbbede..2d427a3c20 100644 --- a/src/world/common/enemy/ai/FlyingAI.inc.c +++ b/src/world/common/enemy/ai/FlyingAI.inc.c @@ -207,19 +207,19 @@ void N(FlyingAI_Loiter)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo if (enemy->varTable[1] > 0) { f32 undulateAmplitude = (f32)enemy->varTable[1] / 100.0; f32 undulateAmount = sin_deg(enemy->varTable[2]); - s32 hitResult; + s32 hasCollision; if (npc->flags & NPC_FLAG_FLYING) { - hitResult = FALSE; + hasCollision = FALSE; } else { posX = npc->pos.x; posY = npc->pos.y; posZ = npc->pos.z; posW = 1000.0f; - hitResult = npc_raycast_down_sides(npc->collisionChannel, &posX, &posY, &posZ, &posW); + hasCollision = npc_raycast_down_sides(npc->collisionChannel, &posX, &posY, &posZ, &posW); } - if (hitResult) { + if (hasCollision) { npc->pos.y = posY + hoverHeight + (undulateAmount * undulateAmplitude); } else { npc->pos.y = temp_f26 + (undulateAmount * undulateAmplitude); diff --git a/src/world/common/npc/Dryite.h b/src/world/common/npc/Dryite.h index 0d5e5dfda8..7d8887a304 100644 --- a/src/world/common/npc/Dryite.h +++ b/src/world/common/npc/Dryite.h @@ -3,80 +3,80 @@ #define DRYITE_GREEN_ANIMS \ { \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Walk, \ - ANIM_Dryite_Green_Run, \ - ANIM_Dryite_Green_Run, \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Still, \ - ANIM_Dryite_Green_Still, \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Idle, \ - ANIM_Dryite_Green_Idle, \ + .idle = ANIM_Dryite_Green_Idle, \ + .walk = ANIM_Dryite_Green_Walk, \ + .run = ANIM_Dryite_Green_Run, \ + .chase = ANIM_Dryite_Green_Run, \ + .anim_4 = ANIM_Dryite_Green_Idle, \ + .anim_5 = ANIM_Dryite_Green_Idle, \ + .death = ANIM_Dryite_Green_Still, \ + .hit = ANIM_Dryite_Green_Still, \ + .anim_8 = ANIM_Dryite_Green_Idle, \ + .anim_9 = ANIM_Dryite_Green_Idle, \ + .anim_A = ANIM_Dryite_Green_Idle, \ + .anim_B = ANIM_Dryite_Green_Idle, \ + .anim_C = ANIM_Dryite_Green_Idle, \ + .anim_D = ANIM_Dryite_Green_Idle, \ + .anim_E = ANIM_Dryite_Green_Idle, \ + .anim_F = ANIM_Dryite_Green_Idle, \ } #define DRYITE_BROWN_ANIMS \ { \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Walk, \ - ANIM_Dryite_Brown_Run, \ - ANIM_Dryite_Brown_Run, \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Still, \ - ANIM_Dryite_Brown_Still, \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Idle, \ - ANIM_Dryite_Brown_Idle, \ + .idle = ANIM_Dryite_Brown_Idle, \ + .walk = ANIM_Dryite_Brown_Walk, \ + .run = ANIM_Dryite_Brown_Run, \ + .chase = ANIM_Dryite_Brown_Run, \ + .anim_4 = ANIM_Dryite_Brown_Idle, \ + .anim_5 = ANIM_Dryite_Brown_Idle, \ + .death = ANIM_Dryite_Brown_Still, \ + .hit = ANIM_Dryite_Brown_Still, \ + .anim_8 = ANIM_Dryite_Brown_Idle, \ + .anim_9 = ANIM_Dryite_Brown_Idle, \ + .anim_A = ANIM_Dryite_Brown_Idle, \ + .anim_B = ANIM_Dryite_Brown_Idle, \ + .anim_C = ANIM_Dryite_Brown_Idle, \ + .anim_D = ANIM_Dryite_Brown_Idle, \ + .anim_E = ANIM_Dryite_Brown_Idle, \ + .anim_F = ANIM_Dryite_Brown_Idle, \ } #define DRYITE_BLUE_ANIMS \ { \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Walk, \ - ANIM_Dryite_Blue_Run, \ - ANIM_Dryite_Blue_Run, \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Still, \ - ANIM_Dryite_Blue_Still, \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Idle, \ - ANIM_Dryite_Blue_Idle, \ + .idle = ANIM_Dryite_Blue_Idle, \ + .walk = ANIM_Dryite_Blue_Walk, \ + .run = ANIM_Dryite_Blue_Run, \ + .chase = ANIM_Dryite_Blue_Run, \ + .anim_4 = ANIM_Dryite_Blue_Idle, \ + .anim_5 = ANIM_Dryite_Blue_Idle, \ + .death = ANIM_Dryite_Blue_Still, \ + .hit = ANIM_Dryite_Blue_Still, \ + .anim_8 = ANIM_Dryite_Blue_Idle, \ + .anim_9 = ANIM_Dryite_Blue_Idle, \ + .anim_A = ANIM_Dryite_Blue_Idle, \ + .anim_B = ANIM_Dryite_Blue_Idle, \ + .anim_C = ANIM_Dryite_Blue_Idle, \ + .anim_D = ANIM_Dryite_Blue_Idle, \ + .anim_E = ANIM_Dryite_Blue_Idle, \ + .anim_F = ANIM_Dryite_Blue_Idle, \ } #define DRYITE_YELLOW_ANIMS \ { \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Walk, \ - ANIM_Dryite_Yellow_Run, \ - ANIM_Dryite_Yellow_Run, \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Still, \ - ANIM_Dryite_Yellow_Still, \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Idle, \ - ANIM_Dryite_Yellow_Idle, \ + .idle = ANIM_Dryite_Yellow_Idle, \ + .walk = ANIM_Dryite_Yellow_Walk, \ + .run = ANIM_Dryite_Yellow_Run, \ + .chase = ANIM_Dryite_Yellow_Run, \ + .anim_4 = ANIM_Dryite_Yellow_Idle, \ + .anim_5 = ANIM_Dryite_Yellow_Idle, \ + .death = ANIM_Dryite_Yellow_Still, \ + .hit = ANIM_Dryite_Yellow_Still, \ + .anim_8 = ANIM_Dryite_Yellow_Idle, \ + .anim_9 = ANIM_Dryite_Yellow_Idle, \ + .anim_A = ANIM_Dryite_Yellow_Idle, \ + .anim_B = ANIM_Dryite_Yellow_Idle, \ + .anim_C = ANIM_Dryite_Yellow_Idle, \ + .anim_D = ANIM_Dryite_Yellow_Idle, \ + .anim_E = ANIM_Dryite_Yellow_Idle, \ + .anim_F = ANIM_Dryite_Yellow_Idle, \ } diff --git a/src/world/common/npc/Mouser.h b/src/world/common/npc/Mouser.h index 75455a3886..786f1dec81 100644 --- a/src/world/common/npc/Mouser.h +++ b/src/world/common/npc/Mouser.h @@ -6,80 +6,80 @@ #define MOUSER_BLUE_ANIMS \ { \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Run, \ - ANIM_Mouser_Blue_Run, \ - ANIM_Mouser_Blue_Run, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ - ANIM_Mouser_Blue_Idle, \ + .idle = ANIM_Mouser_Blue_Idle, \ + .walk = ANIM_Mouser_Blue_Run, \ + .run = ANIM_Mouser_Blue_Run, \ + .chase = ANIM_Mouser_Blue_Run, \ + .anim_4 = ANIM_Mouser_Blue_Idle, \ + .anim_5 = ANIM_Mouser_Blue_Idle, \ + .death = ANIM_Mouser_Blue_Idle, \ + .hit = ANIM_Mouser_Blue_Idle, \ + .anim_8 = ANIM_Mouser_Blue_Idle, \ + .anim_9 = ANIM_Mouser_Blue_Idle, \ + .anim_A = ANIM_Mouser_Blue_Idle, \ + .anim_B = ANIM_Mouser_Blue_Idle, \ + .anim_C = ANIM_Mouser_Blue_Idle, \ + .anim_D = ANIM_Mouser_Blue_Idle, \ + .anim_E = ANIM_Mouser_Blue_Idle, \ + .anim_F = ANIM_Mouser_Blue_Idle, \ } #define MOUSER_PURPLE_ANIMS \ { \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Run, \ - ANIM_Mouser_Purple_Run, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ - ANIM_Mouser_Purple_Idle, \ + .idle = ANIM_Mouser_Purple_Idle, \ + .walk = ANIM_Mouser_Purple_Run, \ + .run = ANIM_Mouser_Purple_Run, \ + .chase = ANIM_Mouser_Purple_Idle, \ + .anim_4 = ANIM_Mouser_Purple_Idle, \ + .anim_5 = ANIM_Mouser_Purple_Idle, \ + .death = ANIM_Mouser_Purple_Idle, \ + .hit = ANIM_Mouser_Purple_Idle, \ + .anim_8 = ANIM_Mouser_Purple_Idle, \ + .anim_9 = ANIM_Mouser_Purple_Idle, \ + .anim_A = ANIM_Mouser_Purple_Idle, \ + .anim_B = ANIM_Mouser_Purple_Idle, \ + .anim_C = ANIM_Mouser_Purple_Idle, \ + .anim_D = ANIM_Mouser_Purple_Idle, \ + .anim_E = ANIM_Mouser_Purple_Idle, \ + .anim_F = ANIM_Mouser_Purple_Idle, \ } #define MOUSTAFA_ANIMS \ { \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Run, \ - ANIM_Moustafa_Run, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ - ANIM_Moustafa_Idle, \ + .idle = ANIM_Moustafa_Idle, \ + .walk = ANIM_Moustafa_Idle, \ + .run = ANIM_Moustafa_Run, \ + .chase = ANIM_Moustafa_Run, \ + .anim_4 = ANIM_Moustafa_Idle, \ + .anim_5 = ANIM_Moustafa_Idle, \ + .death = ANIM_Moustafa_Idle, \ + .hit = ANIM_Moustafa_Idle, \ + .anim_8 = ANIM_Moustafa_Idle, \ + .anim_9 = ANIM_Moustafa_Idle, \ + .anim_A = ANIM_Moustafa_Idle, \ + .anim_B = ANIM_Moustafa_Idle, \ + .anim_C = ANIM_Moustafa_Idle, \ + .anim_D = ANIM_Moustafa_Idle, \ + .anim_E = ANIM_Moustafa_Idle, \ + .anim_F = ANIM_Moustafa_Idle, \ } #define DISGUISED_MOUSTAFA_ANIMS \ { \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ - ANIM_DisguisedMoustafa_Idle, \ + .idle = ANIM_DisguisedMoustafa_Idle, \ + .walk = ANIM_DisguisedMoustafa_Idle, \ + .run = ANIM_DisguisedMoustafa_Idle, \ + .chase = ANIM_DisguisedMoustafa_Idle, \ + .anim_4 = ANIM_DisguisedMoustafa_Idle, \ + .anim_5 = ANIM_DisguisedMoustafa_Idle, \ + .death = ANIM_DisguisedMoustafa_Idle, \ + .hit = ANIM_DisguisedMoustafa_Idle, \ + .anim_8 = ANIM_DisguisedMoustafa_Idle, \ + .anim_9 = ANIM_DisguisedMoustafa_Idle, \ + .anim_A = ANIM_DisguisedMoustafa_Idle, \ + .anim_B = ANIM_DisguisedMoustafa_Idle, \ + .anim_C = ANIM_DisguisedMoustafa_Idle, \ + .anim_D = ANIM_DisguisedMoustafa_Idle, \ + .anim_E = ANIM_DisguisedMoustafa_Idle, \ + .anim_F = ANIM_DisguisedMoustafa_Idle, \ } diff --git a/src/world/dead/area_flo/flo_03/flo_03_4_foliage.c b/src/world/dead/area_flo/flo_03/flo_03_4_foliage.c index 0a707f59a3..5c20190664 100644 --- a/src/world/dead/area_flo/flo_03/flo_03_4_foliage.c +++ b/src/world/dead/area_flo/flo_03/flo_03_4_foliage.c @@ -31,7 +31,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -208.0f, 0.0f, -182.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/dead/area_flo/flo_07/flo_07_3_npc.c b/src/world/dead/area_flo/flo_07/flo_07_3_npc.c index 960fc853e8..eafe6202ee 100644 --- a/src/world/dead/area_flo/flo_07/flo_07_3_npc.c +++ b/src/world/dead/area_flo/flo_07/flo_07_3_npc.c @@ -220,7 +220,7 @@ ShakeTreeConfig N(ShakeTree_CrystalTree) = { BombTrigger N(BombPos_CrystalTree) = { .pos = { -309.0f, 0.0f, 31.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/dead/area_flo/flo_08/flo_08_3_main.c b/src/world/dead/area_flo/flo_08/flo_08_3_main.c index 170fb456d7..8bf3ce1a43 100644 --- a/src/world/dead/area_flo/flo_08/flo_08_3_main.c +++ b/src/world/dead/area_flo/flo_08/flo_08_3_main.c @@ -22,7 +22,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o158, .pos = { -540.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o132, .pos = { 60.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o223, .pos = { 60.0, 0.0, 50.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/dead/area_flo/flo_08/flo_08_5_foliage.c b/src/world/dead/area_flo/flo_08/flo_08_5_foliage.c index 7955e91f6e..1310cb101f 100644 --- a/src/world/dead/area_flo/flo_08/flo_08_5_foliage.c +++ b/src/world/dead/area_flo/flo_08/flo_08_5_foliage.c @@ -31,7 +31,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 391.0f, 0.0f, -102.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/dead/area_flo/flo_09/flo_09_4_foliage.c b/src/world/dead/area_flo/flo_09/flo_09_4_foliage.c index 24467e8022..84e75bc725 100644 --- a/src/world/dead/area_flo/flo_09/flo_09_4_foliage.c +++ b/src/world/dead/area_flo/flo_09/flo_09_4_foliage.c @@ -65,7 +65,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { -200.0f, 0.0f, 1.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree2_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o4, MODEL_o5); @@ -79,7 +79,7 @@ ShakeTreeConfig N(ShakeTree_Tree2) = { BombTrigger N(BombPos_Tree2) = { .pos = { 0.0f, 0.0f, 1.0f }, - .radius = 0.0f + .diameter = 0.0f }; FoliageModelList N(Tree3_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o14, MODEL_o15); @@ -93,7 +93,7 @@ ShakeTreeConfig N(ShakeTree_Tree3) = { BombTrigger N(BombPos_Tree3) = { .pos = { 200.0f, 0.0f, 1.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/dead/area_flo/flo_10/flo_10_7_foliage.c b/src/world/dead/area_flo/flo_10/flo_10_7_foliage.c index c5c8957ffe..030e3b063d 100644 --- a/src/world/dead/area_flo/flo_10/flo_10_7_foliage.c +++ b/src/world/dead/area_flo/flo_10/flo_10_7_foliage.c @@ -25,7 +25,7 @@ ShakeTreeConfig N(ShakeTree_Tree1) = { BombTrigger N(BombPos_Tree1) = { .pos = { 137.0f, 0.0f, -283.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupFoliage) = { diff --git a/src/world/dead/area_flo/flo_14/flo_14_2_main.c b/src/world/dead/area_flo/flo_14/flo_14_2_main.c index b1aae776cb..9875188688 100644 --- a/src/world/dead/area_flo/flo_14/flo_14_2_main.c +++ b/src/world/dead/area_flo/flo_14/flo_14_2_main.c @@ -30,7 +30,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o153, .pos = { 410.0, 60.0, -95.0 }}, { .colliderID = COLLIDER_o154, .pos = { 550.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o158, .pos = { -50.0, 0.0, 110.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/dead/area_flo/flo_16/flo_16_2_main.c b/src/world/dead/area_flo/flo_16/flo_16_2_main.c index c4e311c5fd..3f6c7e5101 100644 --- a/src/world/dead/area_flo/flo_16/flo_16_2_main.c +++ b/src/world/dead/area_flo/flo_16/flo_16_2_main.c @@ -19,7 +19,7 @@ EvtScript N(EVS_BindExitTriggers) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o190, .pos = { -310.0, 0.0, 0.0 }}, { .colliderID = COLLIDER_o191, .pos = { 305.0, 100.0, 0.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/dead/area_flo/flo_17/flo_17_2_main.c b/src/world/dead/area_flo/flo_17/flo_17_2_main.c index f008fb92d5..d23be7430f 100644 --- a/src/world/dead/area_flo/flo_17/flo_17_2_main.c +++ b/src/world/dead/area_flo/flo_17/flo_17_2_main.c @@ -38,7 +38,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o129, .pos = { 280.0, 0.0, 50.0 }}, { .colliderID = COLLIDER_o134, .pos = { 525.0, 0.0, -70.0 }}, { .colliderID = COLLIDER_o133, .pos = { 525.0, 0.0, 50.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/dead/area_flo/flo_18/flo_18_2_main.c b/src/world/dead/area_flo/flo_18/flo_18_2_main.c index de0d0f4656..a0f214ca5b 100644 --- a/src/world/dead/area_flo/flo_18/flo_18_2_main.c +++ b/src/world/dead/area_flo/flo_18/flo_18_2_main.c @@ -20,7 +20,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o138, .pos = { -200.0, 0.0, 120.0 }}, { .colliderID = COLLIDER_o140, .pos = { 0.0, 0.0, 120.0 }}, { .colliderID = COLLIDER_o142, .pos = { 170.0, 0.0, 120.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/dead/area_flo/flo_18/flo_18_3_machine.c b/src/world/dead/area_flo/flo_18/flo_18_3_machine.c index 53c23f5b17..96b1c77e90 100644 --- a/src/world/dead/area_flo/flo_18/flo_18_3_machine.c +++ b/src/world/dead/area_flo/flo_18/flo_18_3_machine.c @@ -628,22 +628,22 @@ EvtScript N(EVS_DamageMachine) = { BombTrigger N(Machine_BombTrigger_01) = { .pos = { 5.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Machine_BombTrigger_02) = { .pos = { -5.0f, 0.0f, -20.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Machine_BombTrigger_03) = { .pos = { 50.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Machine_BombTrigger_04) = { .pos = { 105.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupMachine) = { diff --git a/src/world/dead/area_flo/flo_18/flo_18_4_npc.c b/src/world/dead/area_flo/flo_18/flo_18_4_npc.c index b55861e133..3ba8201a52 100644 --- a/src/world/dead/area_flo/flo_18/flo_18_4_npc.c +++ b/src/world/dead/area_flo/flo_18/flo_18_4_npc.c @@ -467,22 +467,22 @@ EvtScript N(EVS_BombReaction_Lakitu_03) = { BombTrigger N(Npc_BombTrigger_01) = { .pos = { 5.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Npc_BombTrigger_02) = { .pos = { -5.0f, 0.0f, -20.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Npc_BombTrigger_03) = { .pos = { 50.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; BombTrigger N(Npc_BombTrigger_04) = { .pos = { 105.0f, 0.0f, -10.0f }, - .radius = 0.0f + .diameter = 0.0f }; EvtScript N(EVS_SetupMachineDamageReactions) = { diff --git a/src/world/dead/area_kzn/kzn_11/kzn_11_1_main.c b/src/world/dead/area_kzn/kzn_11/kzn_11_1_main.c index d7062e29fa..5ecc049ee5 100644 --- a/src/world/dead/area_kzn/kzn_11/kzn_11_1_main.c +++ b/src/world/dead/area_kzn/kzn_11/kzn_11_1_main.c @@ -49,7 +49,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o211, .pos = { -400.0, 20.0, 0.0 }}, { .colliderID = COLLIDER_o212, .pos = { 230.0, 20.0, 0.0 }}, { .colliderID = COLLIDER_o83, .pos = { 790.0, 20.0, 0.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/dead/area_kzn/kzn_18/kzn_18_1_main.c b/src/world/dead/area_kzn/kzn_18/kzn_18_1_main.c index 857626c5f9..e5df608a28 100644 --- a/src/world/dead/area_kzn/kzn_18/kzn_18_1_main.c +++ b/src/world/dead/area_kzn/kzn_18/kzn_18_1_main.c @@ -52,7 +52,7 @@ EvtScript N(EVS_StartTexPanners_Lava) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o382, .pos = { 50.0, 200.0, -185.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_EnterMap) = { diff --git a/src/world/dead/area_kzn/kzn_20/kzn_20_2_main.c b/src/world/dead/area_kzn/kzn_20/kzn_20_2_main.c index aa269bfdca..c488795198 100644 --- a/src/world/dead/area_kzn/kzn_20/kzn_20_2_main.c +++ b/src/world/dead/area_kzn/kzn_20/kzn_20_2_main.c @@ -30,7 +30,7 @@ EvtScript N(EVS_UpdateTexPan_Lava) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o919, .pos = { -30.0, 125.0, -15.0 }}, { .colliderID = COLLIDER_o870, .pos = { 30.0, 150.0, 0.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_DetermineLavaLevel) = { @@ -149,7 +149,7 @@ EvtScript N(EVS_UpdateLavaWaves) = { BombTrigger N(WeakWallBombTrigger) = { .pos = { 175.0, 150.0, 15.0 }, - .radius = 0.0 + .diameter = 0.0 }; EvtScript N(EVS_OnBreakWall) = { diff --git a/src/world/dead/area_kzn/kzn_22/kzn_22_2_main.c b/src/world/dead/area_kzn/kzn_22/kzn_22_2_main.c index 51742217b1..186ce20e99 100644 --- a/src/world/dead/area_kzn/kzn_22/kzn_22_2_main.c +++ b/src/world/dead/area_kzn/kzn_22/kzn_22_2_main.c @@ -133,7 +133,7 @@ EvtScript N(EVS_UpdateLavaLevel) = { LavaReset N(SafeFloorColliders)[] = { { .colliderID = COLLIDER_o582, .pos = { 200.0, 150.0, 180.0 }}, { .colliderID = COLLIDER_o357, .pos = { 200.0, 150.0, 180.0 }}, - { .colliderID = -1 } + { .colliderID = NO_COLLIDER } }; EvtScript N(EVS_Main) = { diff --git a/src/world/partner/bombette.c b/src/world/partner/bombette.c index 501ba389f0..b286df662d 100644 --- a/src/world/partner/bombette.c +++ b/src/world/partner/bombette.c @@ -600,7 +600,7 @@ s32 N(test_first_strike)(Npc* bombette, Npc* enemy) { f32 x, y, z, dist; f32 angle, distance; f32 enemyRadius, blastRadius; - s32 hitResult; + s32 hasCollision; s32 enemyHit; if (!N(IsBlasting)) { @@ -633,9 +633,9 @@ s32 N(test_first_strike)(Npc* bombette, Npc* enemy) { x = bombette->pos.x; y = bombette->pos.y; z = bombette->pos.z; - hitResult = npc_test_move_taller_with_slipping(0, &x, &y, &z, distance, angle, 35.0f, 2.0f); + hasCollision = npc_test_move_taller_with_slipping(0, &x, &y, &z, distance, angle, 35.0f, 2.0f); - if (hitResult) { + if (hasCollision) { return FALSE; } diff --git a/src/world/partner/kooper.c b/src/world/partner/kooper.c index 0884ee2c3f..a8284f5dad 100644 --- a/src/world/partner/kooper.c +++ b/src/world/partner/kooper.c @@ -8,7 +8,6 @@ s32 entity_try_partner_interaction_trigger(s32); s32 test_item_entity_position(f32, f32, f32, f32); -s32 npc_raycast_up_corner(s32 ignoreFlags, f32* x, f32* y, f32* z, f32* length); void fx_damage_stars(s32, f32, f32, f32, f32, f32, f32, s32); void auto_collect_item_entity(s32); diff --git a/src/world/partner/lakilester.c b/src/world/partner/lakilester.c index 5adb4cf861..b9e2b2588a 100644 --- a/src/world/partner/lakilester.c +++ b/src/world/partner/lakilester.c @@ -259,7 +259,7 @@ s32 N(can_dismount)(void) { temp = hitResult; //TODO find better match - if (outLength <= 16.0f && temp >= 0) { + if (outLength <= 16.0f && temp > NO_COLLIDER) { if (!(temp & COLLISION_WITH_ENTITY_BIT) || (entityType = get_entity_type(temp), !(entityType == ENTITY_TYPE_SIMPLE_SPRING || entityType == ENTITY_TYPE_SCRIPT_SPRING)) diff --git a/src/world/partner/parakarry.c b/src/world/partner/parakarry.c index 093a255b75..94e3d8e197 100644 --- a/src/world/partner/parakarry.c +++ b/src/world/partner/parakarry.c @@ -159,10 +159,10 @@ void N(try_cancel_tweester)(Npc* parakarry) { } } -s32 N(update_current_floor)(void) { +HitID N(update_current_floor)(void) { f32 x, y, z, length, hitRx, hitRz, hitDirX, hitDirZ; f32 colliderBaseHeight = gPlayerStatus.colliderHeight; - s32 hitResult; + HitID hitID; s32 surfaceType; x = gPlayerStatus.pos.x; @@ -170,17 +170,17 @@ s32 N(update_current_floor)(void) { z = gPlayerStatus.pos.z; length = colliderBaseHeight / 2.0f; - hitResult = player_raycast_below_cam_relative(&gPlayerStatus, &x, &y, &z, &length, &hitRx, + hitID = player_raycast_below_cam_relative(&gPlayerStatus, &x, &y, &z, &length, &hitRx, &hitRz, &hitDirX, &hitDirZ); - surfaceType = get_collider_flags(hitResult) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; + surfaceType = get_collider_flags(hitID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA) { gPlayerStatus.hazardType = HAZARD_TYPE_SPIKES; gPlayerStatus.flags |= PS_FLAG_HIT_FIRE; N(AbilityState) = AIR_LIFT_DROP; } - return hitResult; + return hitID; } API_CALLABLE(N(UseAbility)) { diff --git a/src/world/partner/sushie.c b/src/world/partner/sushie.c index 5a631703ff..bcf605244b 100644 --- a/src/world/partner/sushie.c +++ b/src/world/partner/sushie.c @@ -298,7 +298,7 @@ void N(update_riding_physics)(Npc* sushie) { y = sushie->moveToPos.y; z = sushie->pos.z; depth = (sushie->collisionHeight * 0.5f) + playerStatus->colliderHeight; - if (npc_raycast_up_corners(sushie->collisionChannel, &x, &y, &z, &depth, sushie->yaw, sushie->collisionDiameter * 0.3f) >= 0) { + if (npc_raycast_up_corners(sushie->collisionChannel, &x, &y, &z, &depth, sushie->yaw, sushie->collisionDiameter * 0.3f) > NO_COLLIDER) { sushie->moveToPos.y += (((sushie->moveToPos.y - y) + depth) - ((sushie->collisionHeight * 0.5f) + playerStatus->colliderHeight)) * 0.2f; if (N(DiveTime) % 9 == 0) { fx_rising_bubble(0, sushie->pos.x, sushie->moveToPos.y + (sushie->collisionHeight * 0.5f), sushie->pos.z, @@ -328,23 +328,23 @@ void N(update_riding_physics)(Npc* sushie) { } } -s32 N(test_ray_to_wall_center)(s32 unused, f32* x, f32* y, f32* z, f32 length, f32 radius, f32* yaw) { +HitID N(test_ray_to_wall_center)(s32 unused, f32* x, f32* y, f32* z, f32 length, f32 radius, f32* yaw) { f32 sinAngle, cosAngle, totalLength; f32 hitX, hitY, hitZ; f32 hitNx, hitNy, hitNz; - s32 hitResult; + HitID hitID; sin_cos_rad(DEG_TO_RAD(*yaw), &sinAngle, &cosAngle); cosAngle = -cosAngle; totalLength = radius + length; - hitResult = test_ray_colliders(COLLIDER_FLAG_IGNORE_PLAYER, *x, *y, *z, sinAngle, 0.0f, cosAngle, + hitID = test_ray_colliders(COLLIDER_FLAG_IGNORE_PLAYER, *x, *y, *z, sinAngle, 0.0f, cosAngle, &hitX, &hitY, &hitZ, &totalLength, &hitNx, &hitNy, &hitNz); - if (hitResult >= 0) { + if (hitID >= 0) { *yaw = atan2(0.0f, 0.0f, hitNx, hitNz); } - return hitResult; + return hitID; } API_CALLABLE(N(UseAbility)) { diff --git a/src/world/partners.c b/src/world/partners.c index 90110a0ec6..92e8740afd 100644 --- a/src/world/partners.c +++ b/src/world/partners.c @@ -1820,7 +1820,7 @@ void partner_flying_update_motion(Npc* partner) { z = partner->pos.z; hitDepth = partner->collisionHeight * 0.5f; - if (npc_raycast_up(0, &x, &y, &z, &hitDepth) != 0) { + if (npc_raycast_up(0, &x, &y, &z, &hitDepth)) { D_800F8020 = 1; wSavedPartnerPosX = partner->pos.x; wSavedPartnerPosY = partner->pos.y; diff --git a/src/world/script_api/push_blocks.c b/src/world/script_api/push_blocks.c index 5523e0067a..0d5da7731d 100644 --- a/src/world/script_api/push_blocks.c +++ b/src/world/script_api/push_blocks.c @@ -88,7 +88,7 @@ API_CALLABLE(FinishPushBlockMotion) { PushBlockGrid* grid = script->varTablePtr[10]; Entity* block = get_entity_by_index(script->varTable[11]); f32 hitX, hitY, hitZ, hitDepth; - s32 hitResult; + s32 hasCollision; s32 i, j; if (isInitialCall) { @@ -100,10 +100,10 @@ API_CALLABLE(FinishPushBlockMotion) { hitY = block->pos.y + 5.0f; hitDepth = 35.0f; - hitResult = npc_raycast_down_sides(0, &hitX, &hitY, &hitZ, &hitDepth); + hasCollision = npc_raycast_down_sides(0, &hitX, &hitY, &hitZ, &hitDepth); script->functionTemp[1] = hitDepth; - if (hitResult != 0 && hitDepth <= 6.0f) { + if (hasCollision && hitDepth <= 6.0f) { return ApiStatus_DONE2; } } diff --git a/tools/build/item_data.py b/tools/build/item_data.py index b6091e01a0..40cc6291b3 100644 --- a/tools/build/item_data.py +++ b/tools/build/item_data.py @@ -194,7 +194,7 @@ def generate_hud_scripts(fout: TextIOWrapper, hud_scripts: List[ItemHudScriptEnt fout.write("HudScript HES_Item_CoinSparkleE = HES_COIN_SPARKLE( 1, -8);\n") fout.write("HudScript HES_Item_CoinSparkleRandom = HES_TEMPLATE_COIN_SPARKLE();\n") elif entry.name == "StarPoint": - fout.write("HudScript HES_Item_SmallStarPoint = HES_TEMPLATE_SMALL_STAR_POINT();\n") + fout.write("HudScript HES_SmallStarPoint = HES_TEMPLATE_SMALL_STAR_POINT();\n") fout.write("\n") fout.write("s32 pad_after_item_hudscripts[] = { 0, 0 };\n") diff --git a/tools/old/saved_flag_renames.txt b/tools/old/saved_flag_renames.txt index c19eb086af..638ecefede 100644 --- a/tools/old/saved_flag_renames.txt +++ b/tools/old/saved_flag_renames.txt @@ -401,7 +401,7 @@ GameFlag(399) GF_TIK02_Chest_ShrinkStomp GameFlag(400) GF_TIK03_ItemBlock_SnowmanDoll GameFlag(401) GF_TIK03_ItemBlock_CoinA GameFlag(402) GF_TIK03_ItemBlock_CoinB -GameFlag(403) GF_TIK05_Chest_PowerSmash1 +GameFlag(403) GF_TIK05_Chest_PowerSmash GameFlag(404) GF_TIK07_Item_StarPiece GameFlag(405) GF_TIK10_HiddenItem_CoinA GameFlag(406) GF_TIK10_HiddenItem_CoinB diff --git a/ver/ique/symbol_addrs.txt b/ver/ique/symbol_addrs.txt index b9b5055f3e..7b845bf8ae 100644 --- a/ver/ique/symbol_addrs.txt +++ b/ver/ique/symbol_addrs.txt @@ -4087,7 +4087,7 @@ level_up_ROM_START = 0x7E7990; starpoint_ROM_START = 0x7F13D0; world_model_anim_kzn_01_ROM_START = 0x7FE390; -HES_Item_SmallStarPoint = 0x8007FD28; +HES_SmallStarPoint = 0x8007FD28; gMoveTable = 0x8008DCC0; nuGfxZBuffer = 0x800991A8; gCurrentStagePtr = 0x800DA444; diff --git a/ver/jp/symbol_addrs.txt b/ver/jp/symbol_addrs.txt index 26ec259f6e..410036585b 100644 --- a/ver/jp/symbol_addrs.txt +++ b/ver/jp/symbol_addrs.txt @@ -1023,9 +1023,9 @@ fx_water_fountain = 0x80071AF0; // type:func rom:0x4CEF0 fx_gather_energy_pink = 0x8006FF90; // type:func rom:0x4B390 fx_firework_rocket = 0x80072510; // type:func rom:0x4D910 fx_smoke_impact = 0x80070350; // type:func rom:0x4B750 -gStaticScriptCounter = 0x802D9CA0; // rom:0x101E40 -gIsUpdatingScripts = 0x802D9CA4; // rom:0x101E44 -gGlobalTimeSpace = 0x802D9CA8; // rom:0x101E48 +UniqueScriptCounter = 0x802D9CA0; // rom:0x101E40 +IsUpdatingScripts = 0x802D9CA4; // rom:0x101E44 +GlobalTimeRate = 0x802D9CA8; // rom:0x101E48 sort_scripts = 0x802C3000; // type:func rom:0xEB1A0 gScriptIdList = 0x802DAA98; gCurrentScriptListPtr = 0x802DA890; @@ -1587,8 +1587,8 @@ ShowSweat = 0x802D7E08; // type:func rom:0xFFFA8 ShowSleepBubble = 0x802D8028; // type:func rom:0x1001C8 SetSleepBubbleTimeLeft = 0x802D8248; // type:func rom:0x1003E8 PlayEffect = 0x802D829C; // type:func rom:0x10043C -D_802D9D70 = 0x802D9D70; // rom:0x101F10 -D_802D9D71 = 0x802D9D71; // rom:0x101F11 +ReflectWallPrevAlpha = 0x802D9D70; // rom:0x101F10 +ReflectFloorPrevAlpha = 0x802D9D71; // rom:0x101F11 StarShrineLightBeamAlpha = 0x802D9D72; // rom:0x101F12 SetSpriteShading = 0x802D9700; // type:func rom:0x1018A0 EnableSpriteShading = 0x802D9A3C; // type:func rom:0x101BDC @@ -1810,16 +1810,16 @@ Entity_InertRedBlock = 0x802E5050; // rom:0x10B930 Entity_BrickBlock = 0x802E5074; // rom:0x10B954 Entity_MulticoinBlock = 0x802E5098; // rom:0x10B978 Entity_Hammer1Block = 0x802E50BC; // rom:0x10B99C -Entity_Hammer1Block_WideX = 0x802E50E0; // rom:0x10B9C0 -Entity_Hammer1Block_WideZ = 0x802E5104; // rom:0x10B9E4 +Entity_Hammer1BlockWideX = 0x802E50E0; // rom:0x10B9C0 +Entity_Hammer1BlockWideZ = 0x802E5104; // rom:0x10B9E4 Entity_Hammer1BlockTiny = 0x802E5128; // rom:0x10BA08 Entity_Hammer2Block = 0x802E514C; // rom:0x10BA2C -Entity_Hammer2Block_WideX = 0x802E5170; // rom:0x10BA50 -Entity_Hammer2Block_WideZ = 0x802E5194; // rom:0x10BA74 +Entity_Hammer2BlockWideX = 0x802E5170; // rom:0x10BA50 +Entity_Hammer2BlockWideZ = 0x802E5194; // rom:0x10BA74 Entity_Hammer2BlockTiny = 0x802E51B8; // rom:0x10BA98 Entity_Hammer3Block = 0x802E51DC; // rom:0x10BABC -Entity_Hammer3Block_WideX = 0x802E5200; // rom:0x10BAE0 -Entity_Hammer3Block_WideZ = 0x802E5224; // rom:0x10BB04 +Entity_Hammer3BlockWideX = 0x802E5200; // rom:0x10BAE0 +Entity_Hammer3BlockWideZ = 0x802E5224; // rom:0x10BB04 Entity_Hammer3BlockTiny = 0x802E5248; // rom:0x10BB28 Entity_PushBlock = 0x802E526C; // rom:0x10BB4C Entity_PowBlock = 0x802E5290; // rom:0x10BB70 diff --git a/ver/pal/undefined_syms.txt b/ver/pal/undefined_syms.txt index 7f0d4289b5..881854150f 100644 --- a/ver/pal/undefined_syms.txt +++ b/ver/pal/undefined_syms.txt @@ -256,10 +256,10 @@ EnemyNpcHit = 0x80074310; EnemyNpcDefeat = 0x8007443C; gEffectTable = 0x8007B5B0; HES_Item_CoinSparkleRandom = 0x8007D364; -HES_Item_Unused_08B = 0x8007E698; -HES_Item_Unused_08B_disabled = 0x8007E6C8; -HES_Item_Unused_08C = 0x8007E6F8; -HES_Item_Unused_08C_disabled = 0x8007E728; +HES_Item_Postcard = 0x8007E698; +HES_Item_Postcard_disabled = 0x8007E6C8; +HES_Item_EmptyBook = 0x8007E6F8; +HES_Item_EmptyBook_disabled = 0x8007E728; gItemTable = 0x80083C80; gItemHudScripts = 0x80086A20; gItemEntityScripts = 0x8008A174; diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index b121f3530b..9631b49ef4 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -1387,7 +1387,7 @@ D_800778C0 = 0x800778C0; // rom:0x52CC0 D_800778C8 = 0x800778C8; // rom:0x52CC8 D_80077908 = 0x80077908; // rom:0x52D08 pause_frameBuffers = 0x80077950; // rom:0x52D50 -D_8007795C = 0x8007795C; // rom:0x52D5C +PauseOverlaySegment = 0x8007795C; // rom:0x52D5C fsFrameBuffers = 0x80077980; // rom:0x52D80 D_8007798C = 0x8007798C; // rom:0x52D8C IntroMessageIdx = 0x800779B0; // rom:0x52DB0 @@ -1472,7 +1472,7 @@ HES_Item_CoinSparkleD = 0x80080D94; // rom:0x5C194 HES_Item_CoinSparkleE = 0x80080EAC; // rom:0x5C2AC HES_Item_CoinSparkleRandom = 0x80080FC4; // rom:0x5C3C4 HES_Item_StarPoint = 0x80080FF0; // rom:0x5C3F0 -HES_Item_SmallStarPoint = 0x800810C8; // rom:0x5C4C8 +HES_SmallStarPoint = 0x800810C8; // rom:0x5C4C8 HES_Item_HeartPoint = 0x800811A0; // rom:0x5C5A0 HES_Item_FlowerPoint = 0x80081200; // rom:0x5C600 HES_Item_StarPiece = 0x80081260; // rom:0x5C660 @@ -1562,10 +1562,10 @@ HES_Item_Unused_089 = 0x80082238; // rom:0x5D638 HES_Item_Unused_089_disabled = 0x80082268; // rom:0x5D668 HES_Item_Unused_08A = 0x80082298; // rom:0x5D698 HES_Item_Unused_08A_disabled = 0x800822C8; // rom:0x5D6C8 -HES_Item_Unused_08B = 0x800822F8; // rom:0x5D6F8 -HES_Item_Unused_08B_disabled = 0x80082328; // rom:0x5D728 -HES_Item_Unused_08C = 0x80082358; // rom:0x5D758 -HES_Item_Unused_08C_disabled = 0x80082388; // rom:0x5D788 +HES_Item_Postcard = 0x800822F8; // rom:0x5D6F8 +HES_Item_Postcard_disabled = 0x80082328; // rom:0x5D728 +HES_Item_EmptyBook = 0x80082358; // rom:0x5D758 +HES_Item_EmptyBook_disabled = 0x80082388; // rom:0x5D788 HES_Item_Unused_08D = 0x800823B8; // rom:0x5D7B8 HES_Item_Unused_08D_disabled = 0x800823E8; // rom:0x5D7E8 HES_Item_Unused_08E = 0x80082418; // rom:0x5D818 @@ -2131,8 +2131,8 @@ IES_KootGlasses = 0x8008BDC4; // rom:0x671C4 IES_Letter = 0x8008BDE4; // rom:0x671E4 IES_Unused_089 = 0x8008BE04; // rom:0x67204 IES_Unused_08A = 0x8008BE24; // rom:0x67224 -IES_Unused_08B = 0x8008BE44; // rom:0x67244 -IES_Unused_08C = 0x8008BE64; // rom:0x67264 +IES_Postcard = 0x8008BE44; // rom:0x67244 +IES_EmptyBook = 0x8008BE64; // rom:0x67264 IES_Unused_08D = 0x8008BE84; // rom:0x67284 IES_Unused_08E = 0x8008BEA4; // rom:0x672A4 IES_Unused_08F = 0x8008BEC4; // rom:0x672C4 @@ -3781,7 +3781,7 @@ NpcHitQueryBehindLeftY = 0x8010C974; // rom:0xA5E24 NpcHitQueryColliderID = 0x8010C978; // rom:0xA5E28 JumpedOnSwitchZ = 0x8010C97C; // rom:0xA5E2C PlayerRunStateTime = 0x8010C980; // rom:0xA5E30 -D_8010C984 = 0x8010C984; // rom:0xA5E34 +StepUpLastYaw = 0x8010C984; // rom:0xA5E34 D_8010C988 = 0x8010C988; // rom:0xA5E38 NpcHitQueryAheadCollider = 0x8010C98C; // rom:0xA5E3C PlayerNormalPitch = 0x8010C990; // rom:0xA5E40 @@ -3828,8 +3828,8 @@ D_8010CFE0 = 0x8010CFE0; // rom:0xA6490 NextPartnerID = 0x8010CFE4; // rom:0xA6494 func_8010FD98 = 0x8010FD98; // type:func rom:0xA6498 wPartner = 0x8010CFEC; // rom:0xA649C -D_8010CFF0 = 0x8010CFF0; // rom:0xA64A0 -D_8010CFF4 = 0x8010CFF4; // rom:0xA64A4 +PrevTimeInAir = 0x8010CFF0; // rom:0xA64A0 +LandedTimeInAir = 0x8010CFF4; // rom:0xA64A4 D_8010CFF8 = 0x8010CFF8; // rom:0xA64A8 D_8010D000 = 0x8010D000; // rom:0xA64B0 D_8010D004 = 0x8010D004; // rom:0xA64B4 @@ -5520,17 +5520,17 @@ DemoReleaseButton = 0x802D9AF8; // type:func rom:0xFE4A8 DemoSetButtons = 0x802D9B34; // type:func rom:0xFE4E4 DemoJoystickRadial = 0x802D9B64; // type:func rom:0xFE514 DemoJoystickXY = 0x802D9C10; // type:func rom:0xFE5C0 -gStaticScriptCounter = 0x802D9CA0; // rom:0xFE650 -gIsUpdatingScripts = 0x802D9CA4; // rom:0xFE654 -gGlobalTimeSpace = 0x802D9CA8; // rom:0xFE658 +UniqueScriptCounter = 0x802D9CA0; // rom:0xFE650 +IsUpdatingScripts = 0x802D9CA4; // rom:0xFE654 +GlobalTimeRate = 0x802D9CA8; // rom:0xFE658 ShakeCam1 = 0x802D9CB0; // rom:0xFE660 ShakeCamX = 0x802D9CE8; // rom:0xFE698 playerNpc = 0x802D9D20; // rom:0xFE6D0 D_802D9D30 = 0x802D9D30; // rom:0xFE6E0 EVS_MusicEventMonitor = 0x802D9D34; // rom:0xFE6E4 EVS_UpdateMotionBlurParams = 0x802D9D50; // rom:0xFE700 -D_802D9D70 = 0x802D9D70; // rom:0xFE720 -D_802D9D71 = 0x802D9D71; // rom:0xFE721 +ReflectWallPrevAlpha = 0x802D9D70; // rom:0xFE720 +ReflectFloorPrevAlpha = 0x802D9D71; // rom:0xFE721 StarShrineLightBeamAlpha = 0x802D9D72; // rom:0xFE722 D_802D9D98 = 0x802D9D98; // rom:0xFE748 D_802D9DA8 = 0x802D9DA8; // rom:0xFE758 From ed46ab0c70b1ad24149da508a9a8ecaf1b5665c0 Mon Sep 17 00:00:00 2001 From: Rainchus Date: Wed, 6 Mar 2024 10:03:33 -0600 Subject: [PATCH 05/14] Unhardcode many for loop conditions (#1179) * suggest possible bgm name if it is not found * remove pointless () * run black * ...run updated black * unhardcode many for loop conditions * fix inconsistent RGBA_BUF_SIZE naming * requested macro changes --- include/effects.h | 22 ++++++---- include/entity.h | 22 +++++----- src/23680.c | 8 ++-- src/8a160_len_700.c | 2 +- src/audio/28910_len_5090.c | 4 +- src/audio/2e230_len_2190.c | 2 +- src/audio/e0b30_len_b80.c | 6 +-- src/audio/reverb.c | 4 +- src/background_gfx.c | 44 ++++++++++--------- src/battle/action_cmd/tidal_wave.c | 6 +-- src/battle/area/sam2/actor/monstar.c | 15 ++++--- src/battle/battle.h | 2 +- src/battle/btl_states_menus.c | 2 +- src/common/UpdateEnchantedBowserColors.inc.c | 15 ++++--- src/effects/firework_rocket.c | 4 +- src/effects/motion_blur_flame.c | 2 +- src/effects/quizmo_audience.c | 2 +- src/effects/sun.c | 2 +- src/entity/default/BoardedFloor.c | 2 +- src/evt/evt.c | 4 +- src/npc.c | 12 ++--- src/pause/pause_partners.c | 2 +- .../area_mac/mac_01/npc/post_office.inc.c | 2 +- src/world/area_sam/sam_05/sam_05_4_npc.c | 27 +++++++----- 24 files changed, 118 insertions(+), 95 deletions(-) diff --git a/include/effects.h b/include/effects.h index 8659712784..82242ab541 100644 --- a/include/effects.h +++ b/include/effects.h @@ -1370,15 +1370,17 @@ typedef struct RadiatingEnergyOrbFXData { /* 0x30 */ f32 unk_30; } RadiatingEnergyOrbFXData; // size = 0x34 +#define UNK_ARRAY_SIZE_1 4 + typedef struct MotionBlurFlameFXData { /* 0x00 */ s32 unk_00; /* 0x04 */ f32 unk_04; /* 0x08 */ f32 unk_08; /* 0x0C */ f32 unk_0C; /* 0x10 */ Vec3f pos; - /* 0x1C */ f32 unk_1C[4]; - /* 0x2C */ f32 unk_2C[4]; - /* 0x3C */ f32 unk_3C[4]; + /* 0x1C */ f32 unk_1C[UNK_ARRAY_SIZE_1]; + /* 0x2C */ f32 unk_2C[UNK_ARRAY_SIZE_1]; + /* 0x3C */ f32 unk_3C[UNK_ARRAY_SIZE_1]; /* 0x4C */ s32 unk_4C; /* 0x50 */ s32 unk_50; /* 0x54 */ s32 unk_54; @@ -2131,6 +2133,8 @@ typedef struct Effect75FXData { /* 0x7C */ f32 unk_7C; } Effect75FXData; // size = 0x80 +#define ROCKET_BUF_SIZE 4 + typedef struct FireworkRocketFXData { /* 0x00 */ s32 variation; /* 0x04 */ Vec3f pos; @@ -2148,12 +2152,12 @@ typedef struct FireworkRocketFXData { /* 0x44 */ f32 radius; /* 0x48 */ f32 maxRadius; /* 0x4C */ s32 isExploded; - /* 0x50 */ f32 rocketX[4]; - /* 0x60 */ f32 rocketY[4]; - /* 0x70 */ f32 rocketZ[4]; - /* 0x80 */ f32 rocketVelX[4]; - /* 0x90 */ f32 rocketVelY[4]; - /* 0xA0 */ f32 rocketVelZ[4]; + /* 0x50 */ f32 rocketX[ROCKET_BUF_SIZE]; + /* 0x60 */ f32 rocketY[ROCKET_BUF_SIZE]; + /* 0x70 */ f32 rocketZ[ROCKET_BUF_SIZE]; + /* 0x80 */ f32 rocketVelX[ROCKET_BUF_SIZE]; + /* 0x90 */ f32 rocketVelY[ROCKET_BUF_SIZE]; + /* 0xA0 */ f32 rocketVelZ[ROCKET_BUF_SIZE]; } FireworkRocketFXData; // size = 0xB0 typedef struct PeachStarBeamSpirit { diff --git a/include/entity.h b/include/entity.h index df326a047f..38b88d0001 100644 --- a/include/entity.h +++ b/include/entity.h @@ -263,19 +263,21 @@ typedef struct PadlockData { /* 0x18 */ Gfx* shackleGfx; } PadlockData; // size = 0x1C +#define FRAGMENT_BUF_SIZE 13 + typedef struct BoardedFloorData { /* 0x000 */ Gfx** fragmentsGfx; /* 0x004 */ f32 inititalY; - /* 0x008 */ s8 fragmentRebounds[13]; - /* 0x015 */ u8 fragmentMoveAngle[13]; - /* 0x022 */ u8 fragmentRotX[13]; - /* 0x02F */ u8 fragmentRotY[13]; - /* 0x03C */ u8 fragmentLateralSpeed[13]; - /* 0x04C */ f32 fragmentRotSpeed[13]; - /* 0x080 */ f32 fragmentPosX[13]; - /* 0x0B4 */ f32 fragmentPosY[13]; - /* 0x0E8 */ f32 fragmentPosZ[13]; - /* 0x11C */ f32 fragmentFallSpeed[13]; + /* 0x008 */ s8 fragmentRebounds[FRAGMENT_BUF_SIZE]; + /* 0x015 */ u8 fragmentMoveAngle[FRAGMENT_BUF_SIZE]; + /* 0x022 */ u8 fragmentRotX[FRAGMENT_BUF_SIZE]; + /* 0x02F */ u8 fragmentRotY[FRAGMENT_BUF_SIZE]; + /* 0x03C */ u8 fragmentLateralSpeed[FRAGMENT_BUF_SIZE]; + /* 0x04C */ f32 fragmentRotSpeed[FRAGMENT_BUF_SIZE]; + /* 0x080 */ f32 fragmentPosX[FRAGMENT_BUF_SIZE]; + /* 0x0B4 */ f32 fragmentPosY[FRAGMENT_BUF_SIZE]; + /* 0x0E8 */ f32 fragmentPosZ[FRAGMENT_BUF_SIZE]; + /* 0x11C */ f32 fragmentFallSpeed[FRAGMENT_BUF_SIZE]; } BoardedFloorData; // size = 0x150 typedef struct BombableRockData { diff --git a/src/23680.c b/src/23680.c index df99a530aa..dd88ff65a6 100644 --- a/src/23680.c +++ b/src/23680.c @@ -51,7 +51,7 @@ void spawn_drops(Enemy* enemy) { if (drops->itemDropChance > rand_int(100)) { tempMax = 0; - for (i = 0; i < 8; i++) { + for (i = 0; i < ARRAY_COUNT(drops->itemDrops) / 3; i++) { if (drops->itemDrops[3 * i] != 0) { tempMax += drops->itemDrops[3 * i + 1]; } else { @@ -63,7 +63,7 @@ void spawn_drops(Enemy* enemy) { dropCount = rand_int(tempMax); itemToDrop = ITEM_NONE; - for (i = 0; i < 8; i++) { + for (i = 0; i < ARRAY_COUNT(drops->itemDrops) / 3; i++) { if (drops->itemDrops[3 * i] == 0) { break; } @@ -122,7 +122,7 @@ void spawn_drops(Enemy* enemy) { itemToDrop = ITEM_NONE; fraction = playerData->curHP / (f32) playerData->curMaxHP; - for (i = 0; i < 8; i++) { + for (i = 0; i < ARRAY_COUNT(drops->itemDrops) / 3; i++) { attempts = drops->heartDrops[4 * i]; threshold = drops->heartDrops[4 * i + 1]; attempts /= 32767.0f; @@ -176,7 +176,7 @@ void spawn_drops(Enemy* enemy) { itemToDrop = ITEM_NONE; fraction = playerData->curFP / (f32) playerData->curMaxFP; - for (i = 0; i < 8; i++) { + for (i = 0; i < ARRAY_COUNT(drops->itemDrops) / 3; i++) { attempts = drops->flowerDrops[4 * i + 0]; threshold = drops->flowerDrops[4 * i + 1]; attempts /= 32767.0f; diff --git a/src/8a160_len_700.c b/src/8a160_len_700.c index 325de32812..ed10463d0a 100644 --- a/src/8a160_len_700.c +++ b/src/8a160_len_700.c @@ -72,7 +72,7 @@ void func_800F0D5C(void) { Unk8a160Outer* outer = &D_8010D000[0]; s32 i; - for (i = 0; i < 1; i++) { + for (i = 0; i < ARRAY_COUNT(D_8010D000); i++) { outer[i].subs[0].alive = FALSE; } } diff --git a/src/audio/28910_len_5090.c b/src/audio/28910_len_5090.c index 352d42d09e..1d9926d5ad 100644 --- a/src/audio/28910_len_5090.c +++ b/src/audio/28910_len_5090.c @@ -90,7 +90,7 @@ void au_bgm_update_main(BGMPlayer* player) { BGMDrumInfo* drum = &player->drumsInfo[i]; player->drums[i] = drum; } - for (; i < 12; i++) { + for (; i < ARRAY_COUNT(player->drums); i++) { player->drums[i] = player->drums[0]; } } else { @@ -1799,7 +1799,7 @@ void au_BGMCmd_FF(BGMPlayer* player, BGMPlayerTrack* track) { if (arg1 == 0) { if (track->unk_4E != 0) { track->unk_4E = 0; - for (i = 0; i < 16; i++) { + for (i = 0; i < ARRAY_COUNT(player->tracks); i++) { BGMPlayerTrack* otherTrack = &player->tracks[i]; if (player->proxMixVolume == 0x7F) { if (otherTrack->unk_4F != 0) { diff --git a/src/audio/2e230_len_2190.c b/src/audio/2e230_len_2190.c index df29e804e0..122b531ea5 100644 --- a/src/audio/2e230_len_2190.c +++ b/src/audio/2e230_len_2190.c @@ -79,7 +79,7 @@ void au_engine_init(s32 outputRate) { globals->unk_globals_6C[i].unk_5 = 0; } - for (i = 0; i < 4; i++) { + for (i = 0; i < ARRAY_COUNT(globals->effectChanges); i++) { globals->effectChanges[i].type = AU_FX_NONE; globals->effectChanges[i].changed = FALSE; } diff --git a/src/audio/e0b30_len_b80.c b/src/audio/e0b30_len_b80.c index 3ce47958dc..ca29a5c986 100644 --- a/src/audio/e0b30_len_b80.c +++ b/src/audio/e0b30_len_b80.c @@ -80,13 +80,13 @@ void bgm_reset_volume(void) { //TODO refactor out constants void bgm_update_music_settings(void) { - MusicSettings* music = &gMusicSettings[0]; + MusicSettings* music = gMusicSettings; s32 i = 0; s16 state2 = 2; s16 flag4 = MUSIC_SETTINGS_FLAG_4; s32 flags; - for (i; i < 2; i++, music++) { + for (i; i < ARRAY_COUNT(gMusicSettings); i++, music++) { switch (music->state) { case 0: break; @@ -360,7 +360,7 @@ s32 func_8014AD40(void) { MusicSettings* settings = gMusicSettings; s32 i; - for (i = 0; i < 2; i++, settings++) { + for (i = 0; i < ARRAY_COUNT(gMusicSettings); i++, settings++) { if (!(settings->flags & MUSIC_SETTINGS_FLAG_1)) { continue; } diff --git a/src/audio/reverb.c b/src/audio/reverb.c index 65c8d6e471..0876a17621 100644 --- a/src/audio/reverb.c +++ b/src/audio/reverb.c @@ -116,7 +116,7 @@ static void _init_lpfilter(AuLowPass* lp) { timeConstant = timeConstant >> 1; lp->fgain = SCALE - timeConstant; - for (i = 0; i < 8; i++) { + for (i = 0; i < ARRAY_COUNT(lp->fccoef) / 2; i++) { lp->fccoef[i] = 0; } @@ -125,7 +125,7 @@ static void _init_lpfilter(AuLowPass* lp) { // ith value is 16384 * (timeConstant / 16384)^(i-7) // ex: i = 9 --> timeConstant^2 / 16384 attenuation = ((f64)timeConstant / SCALE); - for (i = 9; i < 16; i++) { + for (i = 9; i < ARRAY_COUNT(lp->fccoef); i++) { attenuation *= ((f64)timeConstant /SCALE); lp->fccoef[i] = attenuation * SCALE; } diff --git a/src/background_gfx.c b/src/background_gfx.c index 5b277ef9d9..9bd45ea8ee 100644 --- a/src/background_gfx.c +++ b/src/background_gfx.c @@ -46,18 +46,19 @@ s32 gfx_frame_filter_pass_0(const u16* frameBuffer0, const u16* frameBuffer1, s3 } void gfx_frame_filter_pass_1(Color_RGBA8* filterBuf0, Color_RGBA8 filterBuf1, u16* out) { + #define RGBA_BUF_SIZE 32 Color_RGBA8 sp0; Color_RGBA8 sp8; Color_RGBA8 final; - u8 rs[0x20]; - u8 gs[0x20]; - u8 bs[0x20]; + u8 rs[RGBA_BUF_SIZE]; + u8 gs[RGBA_BUF_SIZE]; + u8 bs[RGBA_BUF_SIZE]; s32 i; sp8 = filterBuf1; sp0 = filterBuf1; - for (i = 0; i < ARRAY_COUNT(rs); i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { rs[i] = 0; gs[i] = 0; bs[i] = 0; @@ -71,13 +72,13 @@ void gfx_frame_filter_pass_1(Color_RGBA8* filterBuf0, Color_RGBA8 filterBuf1, u1 } } - for (i = 0; i < ARRAY_COUNT(rs); i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { if (rs[i] != 0) { rs[i]--; break; } } - for (; i < ARRAY_COUNT(rs); i++) { + for (; i < RGBA_BUF_SIZE; i++) { if (rs[i] != 0) { break; } @@ -86,13 +87,13 @@ void gfx_frame_filter_pass_1(Color_RGBA8* filterBuf0, Color_RGBA8 filterBuf1, u1 sp0.r = i; } - for (i = 0; i < ARRAY_COUNT(gs); i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { if (gs[i] != 0) { gs[i]--; break; } } - for (; i < ARRAY_COUNT(gs); i++) { + for (; i < RGBA_BUF_SIZE; i++) { if (gs[i] != 0) { break; } @@ -101,13 +102,13 @@ void gfx_frame_filter_pass_1(Color_RGBA8* filterBuf0, Color_RGBA8 filterBuf1, u1 sp0.g = i; } - for (i = 0; i < ARRAY_COUNT(bs); i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { if (bs[i] != 0) { bs[i]--; break; } } - for (; i < ARRAY_COUNT(bs); i++) { + for (; i < RGBA_BUF_SIZE; i++) { if (bs[i] != 0) { break; } @@ -116,7 +117,7 @@ void gfx_frame_filter_pass_1(Color_RGBA8* filterBuf0, Color_RGBA8 filterBuf1, u1 sp0.b = i; } - for (i = ARRAY_COUNT(rs) - 1; i >= 0; i--) { + for (i = RGBA_BUF_SIZE - 1; i >= 0; i--) { if (rs[i] != 0) { break; } @@ -125,7 +126,7 @@ void gfx_frame_filter_pass_1(Color_RGBA8* filterBuf0, Color_RGBA8 filterBuf1, u1 sp8.r = i; } - for (i = ARRAY_COUNT(gs) - 1; i >= 0; i--) { + for (i = RGBA_BUF_SIZE - 1; i >= 0; i--) { if (gs[i] != 0) { break; } @@ -134,7 +135,7 @@ void gfx_frame_filter_pass_1(Color_RGBA8* filterBuf0, Color_RGBA8 filterBuf1, u1 sp8.g = i; } - for (i = ARRAY_COUNT(bs) - 1; i >= 0; i--) { + for (i = RGBA_BUF_SIZE - 1; i >= 0; i--) { if (bs[i] != 0) { break; } @@ -152,17 +153,19 @@ void gfx_frame_filter_pass_1(Color_RGBA8* filterBuf0, Color_RGBA8 filterBuf1, u1 final.b = ((filterBuf1.b * filterBuf1.a) + (final.b * (8 - filterBuf1.a))) >> 3; *out = (final.r << 11) + (final.g << 6) + (final.b << 1) + 1; + #undef RGBA_BUF_SIZE } void func_80027600(Color_RGBA8* arg0, s16* out) { + #define RGBA_BUF_SIZE 32 Color_RGBA8 final; - u8 rs[0x20]; - u8 gs[0x20]; - u8 bs[0x20]; + u8 rs[RGBA_BUF_SIZE]; + u8 gs[RGBA_BUF_SIZE]; + u8 bs[RGBA_BUF_SIZE]; s32 i; s32 sum; - for (i = 0; i < ARRAY_COUNT(rs); i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { rs[i] = 0; gs[i] = 0; bs[i] = 0; @@ -175,7 +178,7 @@ void func_80027600(Color_RGBA8* arg0, s16* out) { } sum = 0; - for (i = 0; i < ARRAY_COUNT(rs); i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { sum += rs[i]; if (sum >= 5) { break; @@ -184,7 +187,7 @@ void func_80027600(Color_RGBA8* arg0, s16* out) { final.r = i; sum = 0; - for (i = 0; i < ARRAY_COUNT(gs); i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { sum += gs[i]; if (sum >= 5) { break; @@ -193,7 +196,7 @@ void func_80027600(Color_RGBA8* arg0, s16* out) { final.g = i; sum = 0; - for (i = 0; i < ARRAY_COUNT(bs); i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { sum += bs[i]; if (sum >= 5) { break; @@ -202,6 +205,7 @@ void func_80027600(Color_RGBA8* arg0, s16* out) { final.b = i; *out = (final.r << 11) + (final.g << 6) + (final.b << 1) + 1; + #undef RGBA_BUF_SIZE } void func_80027774(u16* frameBuffer0, u16* frameBuffer1, u16* zBuffer) { diff --git a/src/battle/action_cmd/tidal_wave.c b/src/battle/action_cmd/tidal_wave.c index 00b131a133..4455922d82 100644 --- a/src/battle/action_cmd/tidal_wave.c +++ b/src/battle/action_cmd/tidal_wave.c @@ -37,7 +37,7 @@ API_CALLABLE(N(init)) { hud_element_set_render_depth(id, 0); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED); - for (i = 1; i < 15; i++) { + for (i = 1; i < ARRAY_COUNT(actionCommandStatus->hudElements) - 1; i++) { id = hud_element_create(&HES_AButton); actionCommandStatus->hudElements[i] = id; hud_element_set_render_pos(id, actionCommandStatus->hudPosX, actionCommandStatus->hudPosY); @@ -298,7 +298,7 @@ void N(update)(void) { void N(draw)(void) { s32 i; - for (i = 1; i < 15; i++) { + for (i = 1; i < ARRAY_COUNT(gActionCommandStatus.hudElements) - 1; i++) { hud_element_draw_clipped(gActionCommandStatus.hudElements[i]); } } @@ -308,7 +308,7 @@ void N(free)(void) { hud_element_free(gActionCommandStatus.hudElements[0]); - for (i = 1; i < 15; i++) { + for (i = 1; i < ARRAY_COUNT(gActionCommandStatus.hudElements) - 1; i++) { hud_element_free(gActionCommandStatus.hudElements[i]); } } diff --git a/src/battle/area/sam2/actor/monstar.c b/src/battle/area/sam2/actor/monstar.c index 1cc95ed2f7..d4d71bfa38 100644 --- a/src/battle/area/sam2/actor/monstar.c +++ b/src/battle/area/sam2/actor/monstar.c @@ -158,12 +158,13 @@ ImgFXOverlayTexture N(MonstarDetailTexture) = { }; API_CALLABLE(N(UpdateMonstarImgFX)) { + #define RGBA_BUF_SIZE 20 ActorPart* part = get_actor_part(get_actor(script->owner1.actorID), 1); s32 i; - u8 colR[20]; - u8 colG[20]; - u8 colB[20]; - u8 colA[20]; + u8 colR[RGBA_BUF_SIZE]; + u8 colG[RGBA_BUF_SIZE]; + u8 colB[RGBA_BUF_SIZE]; + u8 colA[RGBA_BUF_SIZE]; if (isInitialCall) { script->functionTemp[1] = 0; @@ -178,17 +179,19 @@ API_CALLABLE(N(UpdateMonstarImgFX)) { script->functionTemp[1] %= 360; } - for (i = 0; i < 20; i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { colR[i] = (cosine(script->functionTemp[1] + i * 25) + 1.0) * 56.0; colG[i] = (cosine(script->functionTemp[1] + i * 25 + 45) + 1.0) * 56.0; colB[i] = (cosine(script->functionTemp[1] + i * 25 + 90) + 1.0) * 56.0; } - for (i = 0; i < 20; i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { set_npc_imgfx_comp(part->spriteInstanceID, 0, IMGFX_COLOR_BUF_SET_MODULATE, i, colR[i] << 0x18 | colG[i] << 0x10 | colB[i] << 8 | 255, 0, 255, 0); } return ApiStatus_BLOCK; + + #undef RGBA_BUF_SIZE } #include "common/Dist3D.inc.c" diff --git a/src/battle/battle.h b/src/battle/battle.h index 0c3b7ff677..52e11279e8 100644 --- a/src/battle/battle.h +++ b/src/battle/battle.h @@ -252,7 +252,7 @@ typedef struct PlayerCelebrationAnimOptions { /* 0x00 */ s16 randomChance; /* 0x02 */ s16 hpBasedChance; /* 0x04 */ s32 options[80]; -} PlayerCelebrationAnimOptions; // size = 0x8 +} PlayerCelebrationAnimOptions; // size = 0x144 #ifndef NO_EXTERN_VARIABLES diff --git a/src/battle/btl_states_menus.c b/src/battle/btl_states_menus.c index ba635b0ad9..14e8c9732e 100644 --- a/src/battle/btl_states_menus.c +++ b/src/battle/btl_states_menus.c @@ -4372,7 +4372,7 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_1: popupIndex = 0; - for (i = 1; i < 12; i++) { + for (i = 1; i < ARRAY_COUNT(PartnerIDFromMenuIndex); i++) { s32 partnerId = PartnerIDFromMenuIndex[i]; if (playerData->partners[partnerId].enabled) { popupProps = &gPartnerPopupProperties[partnerId]; diff --git a/src/common/UpdateEnchantedBowserColors.inc.c b/src/common/UpdateEnchantedBowserColors.inc.c index f8e0778857..132fe203be 100644 --- a/src/common/UpdateEnchantedBowserColors.inc.c +++ b/src/common/UpdateEnchantedBowserColors.inc.c @@ -8,12 +8,13 @@ #endif API_CALLABLE(N(UpdateEnchantedBowserColors)) { + #define RGBA_BUF_SIZE 20 Actor* actor = get_actor(script->owner1.actorID); ActorPart* part; s32 i, j; - u8 colR[20]; - u8 colG[20]; - u8 colB[20]; + u8 colR[RGBA_BUF_SIZE]; + u8 colG[RGBA_BUF_SIZE]; + u8 colB[RGBA_BUF_SIZE]; s32 colorRGBA; s32 temp; s32 lol; @@ -39,7 +40,7 @@ API_CALLABLE(N(UpdateEnchantedBowserColors)) { script->functionTemp[1] %= 360; } - for (j = 0; j < 20; j++) { + for (j = 0; j < RGBA_BUF_SIZE; j++) { colR[j] = (cosine(script->functionTemp[1] + j * 25 + 120) + 1.0) * 56.0; colG[j] = (cosine(script->functionTemp[1] + j * 25 + 60) + 1.0) * 56.0; colB[j] = (cosine(script->functionTemp[1] + j * 25 + 180) + 1.0) * 56.0; @@ -47,7 +48,7 @@ API_CALLABLE(N(UpdateEnchantedBowserColors)) { if (part->eventFlags & BOWSER_FLAG_TOCHECK) { - for (j = 0; j < 20; j++) { + for (j = 0; j < RGBA_BUF_SIZE; j++) { colorRGBA = colR[j] << 0x18 | colG[j] << 0x10 | colB[j] << 8 | 0xFF; for (i = 0; i < 10; i++) { set_npc_imgfx_comp(part->spriteInstanceID, i, IMGFX_COLOR_BUF_SET_MODULATE, j, colorRGBA, 0, 255, 0); @@ -56,7 +57,7 @@ API_CALLABLE(N(UpdateEnchantedBowserColors)) { return ApiStatus_BLOCK; } else { s32 opacity = 255; - for (j = 0; j < 20; j++) { + for (j = 0; j < RGBA_BUF_SIZE; j++) { colorRGBA = 255; for (i = 0; i < 10; i++) { // TODO find better match for opacity @@ -68,4 +69,6 @@ API_CALLABLE(N(UpdateEnchantedBowserColors)) { script->functionTemp[0] = 0; return ApiStatus_BLOCK; } + + #undef RGBA_BUF_SIZE } diff --git a/src/effects/firework_rocket.c b/src/effects/firework_rocket.c index bd9627ab65..735618c119 100644 --- a/src/effects/firework_rocket.c +++ b/src/effects/firework_rocket.c @@ -124,7 +124,7 @@ EffectInstance* firework_rocket_main(s32 variation, f32 centerX, f32 centerY, f3 data->unk_3C = 150; data->unk_40 = 255; - for (i = 0; i < 4; i++) { + for (i = 0; i < ROCKET_BUF_SIZE; i++) { data->rocketX[i] = data->pos.x; data->rocketY[i] = data->pos.y - 1000.0f; data->rocketZ[i] = data->pos.z; @@ -189,7 +189,7 @@ void firework_rocket_update(EffectInstance* effect) { data->rocketVelY[i] = (rand_int(10) - 5) * 0.1f; data->rocketVelZ[i] = (rand_int(10) - 5) * 0.1f; - for (i = 0; i < 4; i++) { + for (i = 0; i < ROCKET_BUF_SIZE; i++) { data->rocketX[i] += data->rocketVelX[i]; data->rocketY[i] += data->rocketVelY[i]; data->rocketZ[i] += data->rocketVelZ[i]; diff --git a/src/effects/motion_blur_flame.c b/src/effects/motion_blur_flame.c index 506e9b72ca..d21c29086d 100644 --- a/src/effects/motion_blur_flame.c +++ b/src/effects/motion_blur_flame.c @@ -157,7 +157,7 @@ void motion_blur_flame_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, D_E00A29D0[temp_a2]); - for (i = 0; i < 4; i++) { + for (i = 0; i < UNK_ARRAY_SIZE_1; i++) { f32 temp_f12 = data->unk_1C[i]; f32 temp_f14 = data->unk_2C[i]; f32 temp_f0 = data->unk_3C[i]; diff --git a/src/effects/quizmo_audience.c b/src/effects/quizmo_audience.c index 4e2f0f0e28..0d9e22277b 100644 --- a/src/effects/quizmo_audience.c +++ b/src/effects/quizmo_audience.c @@ -103,7 +103,7 @@ EffectInstance* quizmo_audience_main(s32 arg0, f32 posX, f32 posY, f32 posZ) { data->pos.z = posZ; data->lifeTime = 0; - for(i = 0; i < 10; i++) { + for (i = 0; i < ARRAY_COUNT(data->compState); i++) { data->compState[i] = 0; data->compX[i] = data->compY[i] = 0.0f; } diff --git a/src/effects/sun.c b/src/effects/sun.c index 4b171d9e73..4b74c5cd40 100644 --- a/src/effects/sun.c +++ b/src/effects/sun.c @@ -118,7 +118,7 @@ void sun_update(EffectInstance* effect) { } } - for (i = 0; i < 5; i++) { + for (i = 0; i < ARRAY_COUNT(data->texScrollAmt); i++) { data->texScrollAmt[i] -= 4.0 * ((sin_deg((time * 2 + (20 * i))) * 0.01) + 0.05) * sin_deg(((f32) time * 0.25) + (SQ(i) * 20)); diff --git a/src/entity/default/BoardedFloor.c b/src/entity/default/BoardedFloor.c index 199f8a1b5d..8867e32d24 100644 --- a/src/entity/default/BoardedFloor.c +++ b/src/entity/default/BoardedFloor.c @@ -21,7 +21,7 @@ void Entity_BoardedFloor_init_fragments(Entity* entity, Gfx** dlists, Mtx* matri entity->pos.y = data->inititalY; guTranslateF(mtxTrans, entity->pos.x, entity->pos.y, entity->pos.z); - for (i = 0; i < 12; i++) { + for (i = 0; i < FRAGMENT_BUF_SIZE - 1; i++) { guMtxL2F(mtxFragment, ENTITY_ADDR(entity, Mtx*, matrices++)); guMtxCatF(mtxTrans, mtxFragment, mtxFragment); data->fragmentPosX[i] = mtxFragment[3][0]; diff --git a/src/evt/evt.c b/src/evt/evt.c index 7fbfddcd1d..949afc5772 100644 --- a/src/evt/evt.c +++ b/src/evt/evt.c @@ -2040,14 +2040,14 @@ Bytecode* evt_find_label(Evt* script, s32 arg1) { return (Bytecode*) arg1; } - for (i = 0; i < 16; i++) { + for (i = 0; i < ARRAY_COUNT(script->labelIndices); i++) { if (script->labelIndices[i] == arg1) { ret = script->labelPositions[i]; break; } } - ASSERT(i < 16); + ASSERT(i < ARRAY_COUNT(script->labelIndices)); return ret; } diff --git a/src/npc.c b/src/npc.c index e09e22f5bd..13aa6fa88f 100644 --- a/src/npc.c +++ b/src/npc.c @@ -1963,9 +1963,10 @@ void npc_remove_decoration_glow_behind(Npc* npc, s32 idx) { } void npc_update_decoration_charged(Npc* npc, s32 idx) { - u8 rbuf[20]; - u8 gbuf[20]; - u8 bbuf[20]; + #define RGBA_BUF_SIZE 20 + u8 rbuf[RGBA_BUF_SIZE]; + u8 gbuf[RGBA_BUF_SIZE]; + u8 bbuf[RGBA_BUF_SIZE]; s32 color; s32 alpha; s32 i; @@ -1980,18 +1981,19 @@ void npc_update_decoration_charged(Npc* npc, s32 idx) { npc->decorationGlowPhase[idx] %= 360; } - for (i = 0; i < 20; i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { rbuf[i] = (cosine(npc->decorationGlowPhase[idx] + (25 * i)) + 1.0) * 80.0f; gbuf[i] = (cosine(npc->decorationGlowPhase[idx] + (25 * i) + 45) + 1.0) * 80.0f; bbuf[i] = (cosine(npc->decorationGlowPhase[idx] + (25 * i) + 90) + 1.0) * 80.0f; } alpha = 255; - for (i = 0; i < 20; i++) { + for (i = 0; i < RGBA_BUF_SIZE; i++) { color = (rbuf[i] << 24) | (gbuf[i] << 16) | (bbuf[i] << 8) | alpha; set_npc_imgfx_all(npc->spriteInstanceID, IMGFX_COLOR_BUF_SET_MODULATE, i, color, 0, 255, 0); } } + #undef RGBA_BUF_SIZE } void npc_remove_decoration_charged(Npc* npc, s32 idx) { diff --git a/src/pause/pause_partners.c b/src/pause/pause_partners.c index c20d1e09f6..00020419a9 100644 --- a/src/pause/pause_partners.c +++ b/src/pause/pause_partners.c @@ -418,7 +418,7 @@ void pause_partners_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 wid portraitOffsetX *= 0.01; portraitIndex = portraitScrollIndex; pause_partners_load_portrait(portraitIndex % gPausePartnersNumPartners); - for (i = 0; i < 2; portraitOffsetX += 150, i++) { + for (i = 0; i < ARRAY_COUNT(gPausePartnersPaletteBuffers); portraitOffsetX += 150, i++) { gSPDisplayList(gMainGfxPos++, &gPausePartnersDL); gDPLoadTLUT_pal256(gMainGfxPos++, gPausePartnersPaletteBuffers[i]); diff --git a/src/world/area_mac/mac_01/npc/post_office.inc.c b/src/world/area_mac/mac_01/npc/post_office.inc.c index b765b21e4d..d30769e2a4 100644 --- a/src/world/area_mac/mac_01/npc/post_office.inc.c +++ b/src/world/area_mac/mac_01/npc/post_office.inc.c @@ -91,7 +91,7 @@ API_CALLABLE(N(func_80245028_8058A8)) { if (isInitialCall) { numEntries = 0; - for (i = 1; i < 12; i++) { + for (i = 1; i < ARRAY_COUNT(PartnerIDFromMenuIndex); i++) { partnerID = PartnerIDFromMenuIndex[i]; if (playerData->partners[partnerID].enabled && partnerID != PARTNER_GOOMPA) { temp_s2 = &gPartnerPopupProperties[partnerID]; diff --git a/src/world/area_sam/sam_05/sam_05_4_npc.c b/src/world/area_sam/sam_05/sam_05_4_npc.c index 0834ac5e65..83dfcc7327 100644 --- a/src/world/area_sam/sam_05/sam_05_4_npc.c +++ b/src/world/area_sam/sam_05/sam_05_4_npc.c @@ -60,12 +60,13 @@ ImgFXOverlayTexture N(MonstarDetailTexture) = { }; API_CALLABLE(N(UpdateMonstarSpriteEffects)) { + #define RGBA_BUF_SIZE 20 Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - u8 sp20[20]; - u8 sp38[20]; - u8 sp50[20]; - u8 sp68[20]; + u8 rbuf[RGBA_BUF_SIZE]; + u8 gbuf[RGBA_BUF_SIZE]; + u8 bbuf[RGBA_BUF_SIZE]; + u8 abuf[RGBA_BUF_SIZE]; s32 i; if (isInitialCall) { @@ -84,13 +85,14 @@ API_CALLABLE(N(UpdateMonstarSpriteEffects)) { script->functionTemp[0] %= 360; } - for (i = 0; i < 20; i++) { - sp20[i] = (cosine(script->functionTemp[0] + (i * 25)) + 1.0) * 56.0; - sp38[i] = (cosine(script->functionTemp[0] + (i * 25) + 45) + 1.0) * 56.0; - sp50[i] = (cosine(script->functionTemp[0] + (i * 25) + 90) + 1.0) * 56.0; - sp68[i] = enemy->varTable[3]; + for (i = 0; i < RGBA_BUF_SIZE; i++) { + rbuf[i] = (cosine(script->functionTemp[0] + (i * 25)) + 1.0) * 56.0; + gbuf[i] = (cosine(script->functionTemp[0] + (i * 25) + 45) + 1.0) * 56.0; + bbuf[i] = (cosine(script->functionTemp[0] + (i * 25) + 90) + 1.0) * 56.0; + abuf[i] = enemy->varTable[3]; - set_npc_imgfx_comp(npc->spriteInstanceID, 0, IMGFX_COLOR_BUF_SET_MODULATE, i, (sp20[i] << 24) | (sp38[i] << 16) | (sp50[i] << 8) | sp68[i], 0, 255, 0); + set_npc_imgfx_comp(npc->spriteInstanceID, 0, IMGFX_COLOR_BUF_SET_MODULATE, i, + (rbuf[i] << 24) | (gbuf[i] << 16) | (bbuf[i] << 8) | abuf[i], 0, 255, 0); } if (enemy->varTable[3] == 255) { @@ -98,9 +100,12 @@ API_CALLABLE(N(UpdateMonstarSpriteEffects)) { set_npc_imgfx_comp(npc->spriteInstanceID, 1, IMGFX_OVERLAY, (s32) &N(MonstarDetailTexture), 255, 0, 255, 0); } else { npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; - set_npc_imgfx_comp(npc->spriteInstanceID, 1, IMGFX_OVERLAY, (s32) &N(MonstarDetailTexture), enemy->varTable[3], 0, enemy->varTable[3], 0); + set_npc_imgfx_comp(npc->spriteInstanceID, 1, IMGFX_OVERLAY, (s32) &N(MonstarDetailTexture), + enemy->varTable[3], 0, enemy->varTable[3], 0); } return ApiStatus_BLOCK; + + #undef RGBA_BUF_SIZE } API_CALLABLE(N(CheckSkipInput)) { From cbcbb94fc8f9482aa36350b06ccd04400f7e0cb6 Mon Sep 17 00:00:00 2001 From: Rainchus Date: Sat, 9 Mar 2024 12:01:32 -0600 Subject: [PATCH 06/14] Unhardcode a single for loop (#1180) * unhardcode 64 in pause_badges.c --- src/pause/pause_badges.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pause/pause_badges.c b/src/pause/pause_badges.c index 1d21ba2231..6554df0a0e 100644 --- a/src/pause/pause_badges.c +++ b/src/pause/pause_badges.c @@ -420,7 +420,7 @@ void pause_badges_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 width posY = pause_badges_get_pos_y(pageIndex, itemIndex); isNone = badgeID == BADGE_NONE_STANDIN; - for (j = 0; j < 64; equippedBadges++, j++) { + for (j = 0; j < ARRAY_COUNT(gPlayerData.equippedBadges); equippedBadges++, j++) { if (badgeID == *equippedBadges) { isEquipped = TRUE; break; From db9dbbec050b60111bb4fab7017d3a892196ff5c Mon Sep 17 00:00:00 2001 From: whosblumiere Date: Sat, 23 Mar 2024 22:19:17 -0400 Subject: [PATCH 07/14] rename formation_names.h to battle_names.h --- include/common.h | 2 +- src/battle/{formation_names.h => battle_names.h} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/battle/{formation_names.h => battle_names.h} (100%) diff --git a/include/common.h b/include/common.h index 5adf4ec031..ef66afce0a 100644 --- a/include/common.h +++ b/include/common.h @@ -13,7 +13,7 @@ #include "enums.h" #include "evt.h" #include "messages.h" -#include "battle/formation_names.h" +#include "battle/battle_names.h" #include "battle/stage_names.h" #include "battle/actor_types.h" diff --git a/src/battle/formation_names.h b/src/battle/battle_names.h similarity index 100% rename from src/battle/formation_names.h rename to src/battle/battle_names.h From 0540ea9fbc90f6c4967b73b32655ea1cb9d9bce5 Mon Sep 17 00:00:00 2001 From: Jacob Butler Date: Sun, 24 Mar 2024 00:32:37 -0500 Subject: [PATCH 08/14] Broken Fix Fixed Broke --- src/7BB60.c | 2 +- src/battle/battle.h | 2 ++ src/bss/engine1_pre_bss.c | 2 +- ver/us/splat.yaml | 1 - 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/7BB60.c b/src/7BB60.c index 6ebed683bc..fa90b1864a 100644 --- a/src/7BB60.c +++ b/src/7BB60.c @@ -4,7 +4,7 @@ #include "dx/debug_menu.h" CollisionStatus gCollisionStatus; -f32 D_8010C928; +f32 StepUpLastY; f32 JumpedOnSwitchX; f32 JumpedOnSwitchZ; f32 StepUpLastYaw; diff --git a/src/battle/battle.h b/src/battle/battle.h index ad61158ef7..7ad68d3943 100644 --- a/src/battle/battle.h +++ b/src/battle/battle.h @@ -259,6 +259,8 @@ extern Battle* gCurrentBattlePtr; extern ActorOffsets bActorOffsets[]; +#endif + void load_demo_battle(u32 index); Actor* create_actor(Formation formation); diff --git a/src/bss/engine1_pre_bss.c b/src/bss/engine1_pre_bss.c index 8cb7078904..d60597c14a 100644 --- a/src/bss/engine1_pre_bss.c +++ b/src/bss/engine1_pre_bss.c @@ -31,7 +31,7 @@ BSS s32 NpcHitQueryColliderID; BSS f32 JumpedOnSwitchZ; BSS s32 PlayerRunStateTime; BSS f32 StepUpLastYaw; -BSS s32 D_8010C988; +BSS s32 StepUpLastY; BSS s32 NpcHitQueryAheadCollider; BSS f32 PlayerNormalPitch; diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index 5c1b2ec3b6..4fe95fa39c 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -402,7 +402,6 @@ segments: - [auto, c, world/actions] - [auto, c, world/partners] - [auto, c, global_hud_scripts] - - [auto, hasm, bss2_2] - [auto, c, world/surfaces] - [auto, c, 8a160_len_700] - [auto, c, 8a860_len_3f30] From 9c028b332227c07aeb999606d3067acd728219c6 Mon Sep 17 00:00:00 2001 From: z64a Date: Sat, 18 May 2024 03:06:53 -0400 Subject: [PATCH 09/14] two things --- src/model.c | 2 +- src/world/partners.c | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/model.c b/src/model.c index 5ed34988e2..c5973cb871 100644 --- a/src/model.c +++ b/src/model.c @@ -1356,7 +1356,7 @@ BSS s32 D_80153378[2]; BSS u16 DepthCopyBuffer[16]; BSS RenderTask* RenderTaskLists[3]; BSS s32 RenderTaskListIdx; -BSS s32 RenderTaskCount; +BSS s32 RenderTaskCount[NUM_RENDER_TASK_LISTS]; TextureHandle TextureHandles[128]; diff --git a/src/world/partners.c b/src/world/partners.c index 942fe37058..743c455e44 100644 --- a/src/world/partners.c +++ b/src/world/partners.c @@ -506,22 +506,6 @@ PartnerAnimations gPartnerAnimations[] = { f32 D_800F84F8 = 0.0f; -s32 use_consumable(s32 invSlot) { - Evt* script; - - D_8010CD20 = invSlot; - invSlot = gPlayerData.invItems[invSlot]; - dma_copy(UseItemDmaArgs.dmaStart, UseItemDmaArgs.dmaEnd, world_use_item_VRAM); - script = start_script(UseItemDmaArgs.main, EVT_PRIORITY_1, 0); - script->varTable[10] = invSlot; - return script->id; -} - -void remove_consumable(void) { - gPlayerData.invItems[D_8010CD20] = ITEM_NONE; - sort_consumables(); -} - s32 func_800EA4B0(s32 collisionID) { s32 ret = TRUE; From 54d8e4ba759d3a90c40e8c077f8d93f84f04c5a0 Mon Sep 17 00:00:00 2001 From: z64a Date: Sat, 18 May 2024 03:11:26 -0400 Subject: [PATCH 10/14] builds --- include/entity.h | 2 +- src/world/actions.c | 20 -------------------- src/world/partners.c | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/entity.h b/include/entity.h index f1e8d4f13c..8257a900e7 100644 --- a/include/entity.h +++ b/include/entity.h @@ -362,7 +362,7 @@ typedef struct SpinningFlowerData { /* 0x14 */ f32 spinSpeed; /* 0x18 */ s32 unk_18; /* 0x1C */ char unk_1C[0x0C]; - /* 0x28 */ Vec3s pos; + /* 0x28 */ Vec3s goalPos; /* 0x30 */ Mtx unk_30; } SpinningFlowerData; // size = 0x70 diff --git a/src/world/actions.c b/src/world/actions.c index 4ed93b1500..047b33dbf5 100644 --- a/src/world/actions.c +++ b/src/world/actions.c @@ -117,23 +117,3 @@ Action PlayerActionsTable[] = { [ACTION_STATE_INVALID_25] { action_update_launch, ACTION_FILE(walk), FALSE }, [ACTION_STATE_USE_SPRING] { action_update_launch, ACTION_FILE(misc), TRUE }, }; - -extern UseItemStruct UseItemDmaArgs; - -BSS s32 D_8010CD20; - -s32 use_consumable(s32 invSlot) { - Evt* script; - - D_8010CD20 = invSlot; - invSlot = gPlayerData.invItems[invSlot]; - dma_copy(UseItemDmaArgs.dmaStart, UseItemDmaArgs.dmaEnd, world_use_item_VRAM); - script = start_script(UseItemDmaArgs.main, EVT_PRIORITY_1, 0); - script->varTable[10] = invSlot; - return script->id; -} - -void remove_consumable(void) { - gPlayerData.invItems[D_8010CD20] = ITEM_NONE; - sort_items(); -} diff --git a/src/world/partners.c b/src/world/partners.c index 743c455e44..8dd778e8fb 100644 --- a/src/world/partners.c +++ b/src/world/partners.c @@ -504,6 +504,26 @@ PartnerAnimations gPartnerAnimations[] = { }}, }; +extern UseItemStruct UseItemDmaArgs; + +BSS s32 D_8010CD20; + +s32 use_consumable(s32 invSlot) { + Evt* script; + + D_8010CD20 = invSlot; + invSlot = gPlayerData.invItems[invSlot]; + dma_copy(UseItemDmaArgs.dmaStart, UseItemDmaArgs.dmaEnd, world_use_item_VRAM); + script = start_script(UseItemDmaArgs.main, EVT_PRIORITY_1, 0); + script->varTable[10] = invSlot; + return script->id; +} + +void remove_consumable(void) { + gPlayerData.invItems[D_8010CD20] = ITEM_NONE; + sort_consumables(); +} + f32 D_800F84F8 = 0.0f; s32 func_800EA4B0(s32 collisionID) { From cf2c85b8f218b55b024138fc2aaa3618a41c4c6b Mon Sep 17 00:00:00 2001 From: z64a Date: Sat, 18 May 2024 14:02:03 -0400 Subject: [PATCH 11/14] builds --- include/PR/controller.h | 4 -- include/PR/osint.h | 4 -- include/common.h | 2 - include/model.h | 4 -- include/npc.h | 4 -- include/nu/nualsgi.h | 4 -- include/nu/nusys.h | 4 -- src/audio.h | 4 -- src/audio/2e230_len_2190.c | 10 +---- src/battle/battle.c | 27 +++++------- src/battle/battle.h | 4 -- src/battle/battle_bss.c | 25 ----------- src/bss/engine1_post_bss.c | 19 -------- src/bss/engine1_pre_bss.c | 38 ---------------- src/bss/engine2_post_bss.c | 39 ----------------- src/bss/engine2_pre_bss.c | 56 ------------------------ src/bss/main_post_bss.c | 88 ------------------------------------- src/bss/main_pre_bss.c | 89 -------------------------------------- ver/ique/splat.yaml | 7 --- ver/jp/splat.yaml | 7 --- ver/pal/splat.yaml | 4 -- ver/us/splat.yaml | 7 --- 22 files changed, 12 insertions(+), 438 deletions(-) delete mode 100644 src/battle/battle_bss.c delete mode 100644 src/bss/engine1_post_bss.c delete mode 100644 src/bss/engine1_pre_bss.c delete mode 100644 src/bss/engine2_post_bss.c delete mode 100644 src/bss/engine2_pre_bss.c delete mode 100644 src/bss/main_post_bss.c delete mode 100644 src/bss/main_pre_bss.c diff --git a/include/PR/controller.h b/include/PR/controller.h index a5ac113191..2bc266e8c9 100644 --- a/include/PR/controller.h +++ b/include/PR/controller.h @@ -218,8 +218,6 @@ u8 __osContAddressCrc(u16 addr); u8 __osContDataCrc(u8 *data); s32 __osPfsGetStatus(OSMesgQueue *queue, int channel); -#ifndef NO_EXTERN_VARIABLES - extern u8 __osContLastCmd; extern OSTimer __osEepromTimer; extern OSMesg __osEepromTimerMsg; @@ -229,8 +227,6 @@ extern OSPifRam __osContPifRam; extern OSPifRam __osPfsPifRam; extern u8 __osMaxControllers; -#endif - //some version of this almost certainly existed since there's plenty of times where it's used right before a return 0 #define ERRCK(fn) \ ret = fn; \ diff --git a/include/PR/osint.h b/include/PR/osint.h index 6ae86f48ed..e6ccd69da4 100644 --- a/include/PR/osint.h +++ b/include/PR/osint.h @@ -26,8 +26,6 @@ extern void __osTimerInterrupt(void); extern u32 __osProbeTLB(void *); extern int __osSpDeviceBusy(void); -#ifndef NO_EXTERN_VARIABLES - extern OSThread *__osRunningThread; extern OSThread *__osActiveQueue; extern OSThread *__osFaultedThread; @@ -43,8 +41,6 @@ extern u32 __osShutdown; extern __OSEventState __osEventStateTab[OS_NUM_EVENTS]; -#endif - //not sure if this should be here extern s32 osViClock; extern void __osTimerServicesInit(void); diff --git a/include/common.h b/include/common.h index ef66afce0a..620aa756d0 100644 --- a/include/common.h +++ b/include/common.h @@ -6,9 +6,7 @@ #include "types.h" #include "common_structs.h" #include "functions.h" -#ifndef NO_EXTERN_VARIABLES #include "variables.h" -#endif #include "macros.h" #include "enums.h" #include "evt.h" diff --git a/include/model.h b/include/model.h index 1213e426eb..201d53b422 100644 --- a/include/model.h +++ b/include/model.h @@ -186,13 +186,9 @@ typedef struct ShapeFile { typedef ModelTreeInfo ModelTreeInfoList[0x200]; -#ifndef NO_EXTERN_VARIABLES - extern ModelTreeInfoList* gCurrentModelTreeNodeInfo; extern ModelList* gCurrentModels; -#endif - void mdl_set_depth_tint_params(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd); void mdl_set_remap_tint_params(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); void mdl_get_remap_tint_params(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB); diff --git a/include/npc.h b/include/npc.h index 0c006c1c2a..d97c666f64 100644 --- a/include/npc.h +++ b/include/npc.h @@ -400,12 +400,8 @@ typedef struct EncounterStatus { /* 0xBF0 */ s16 recentMaps[2]; } EncounterStatus; // size = 0xBF4 -#ifndef NO_EXTERN_VARIABLES - extern EncounterStatus gCurrentEncounter; -#endif - s32 basic_ai_check_player_dist(EnemyDetectVolume* arg0, Enemy* arg1, f32 arg2, f32 arg3, s8 arg4); /// The default Npc::onUpdate and Npc::onRender callback. diff --git a/include/nu/nualsgi.h b/include/nu/nualsgi.h index 8604ebfc7d..d5f577058f 100644 --- a/include/nu/nualsgi.h +++ b/include/nu/nualsgi.h @@ -186,8 +186,6 @@ typedef struct st_SndState { typedef void (*NUAuPreNMIFunc)(NUScMsg,u32); /* PRENMI callback function */ typedef void (*NUAuMgrFunc)(void); /* Acmd callback function */ -#ifndef NO_EXTERN_VARIABLES - /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* extern variables */ @@ -246,8 +244,6 @@ extern u32 nuAuDebAcmdLenMax; /* Maximum length of the audio command list */ extern s16 nuAuFrameSampleSize; /* Number of samples created at one time */ extern s16 nuAuExtraSampleSize; /* Number of extra samples */ -#endif - /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* Global Function */ diff --git a/include/nu/nusys.h b/include/nu/nusys.h index 95711811ea..aa6b71e952 100644 --- a/include/nu/nusys.h +++ b/include/nu/nusys.h @@ -652,8 +652,6 @@ typedef struct st_DebConWindow { u16 text[NU_DEB_CON_TEXT_SIZE]; /* Character buffer*/ } NUDebConWindow; -#ifndef NO_EXTERN_VARIABLES - /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* extern variables */ @@ -754,8 +752,6 @@ extern u32 nuDebTaskPerfInterval; extern volatile u32 nuDebTaskPerfCnt; extern volatile u32 nuDebTaskPerfEnd; -#endif - /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* Global Function */ diff --git a/src/audio.h b/src/audio.h index 451fd378f8..33d1c94a11 100644 --- a/src/audio.h +++ b/src/audio.h @@ -1186,8 +1186,6 @@ typedef struct ALConfig { /* 0x14 */ ALHeap* heap; } ALConfig; // size = 0x18; -#ifndef NO_EXTERN_VARIABLES - extern volatile u8 AuSynUseStereo; extern u16 DummyInstrumentPredictor[32]; extern u8 DummyInstrumentBase[190]; @@ -1214,8 +1212,6 @@ extern AmbienceManager* gAuAmbienceManager; extern SoundManager* gSoundManager; extern BGMPlayer* gBGMPlayerA; -#endif - #include "audio/private.h" #endif diff --git a/src/audio/2e230_len_2190.c b/src/audio/2e230_len_2190.c index 122b531ea5..fcb26a700d 100644 --- a/src/audio/2e230_len_2190.c +++ b/src/audio/2e230_len_2190.c @@ -15,14 +15,6 @@ extern u8 EnvelopePressDefault[]; extern u8 EnvelopeReleaseDefault[]; extern f32 AlTuneScaling[]; -#ifdef SHIFT -#define SBN_ROM_OFFSET (s32) audio_ROM_START -#elif VERSION_JP -#define SBN_ROM_OFFSET 0xFC0000 -#else -#define SBN_ROM_OFFSET 0xF00000 -#endif - void func_80052E30(u8 index) { AuVoice* voice = &gSoundGlobals->voices[index]; @@ -101,7 +93,7 @@ void au_engine_init(s32 outputRate) { voice->priority = AU_PRIORITY_FREE; } - au_load_INIT(globals, SBN_ROM_OFFSET, alHeap); + au_load_INIT(globals, audio_ROM_START, alHeap); for (i = 0; i < ARRAY_COUNT(globals->banks); i++) { globals->banks[i] = alHeapAlloc(alHeap, 1, 0x840); diff --git a/src/battle/battle.c b/src/battle/battle.c index efb301d6c1..ac36f44fcc 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -6,22 +6,17 @@ #include "sprite.h" #include "game_modes.h" -extern s32 D_800DC060; -extern StageListRow* gCurrentStagePtr; -extern s32 gBattleState; -extern BattleStatus gBattleStatus; -extern s32 gLastDrawBattleState; -extern s32 D_800DC4D4; -extern s32 gDefeatedBattleSubstate; -extern s32 gBattleSubState; -extern s32 D_800DC4E0; -extern s32 gDefeatedBattleState; -extern s32 gCurrentBattleID; -extern s32 gCurrentStageID; -extern s32 D_800DC4F0; -extern Battle* gOverrideBattlePtr; -extern s32 D_800DC4F8; -extern Battle* gCurrentBattlePtr; +BSS StageListRow* gCurrentStagePtr; +BSS s32 gBattleState; +BSS BattleStatus gBattleStatus; +BSS s32 gLastDrawBattleState; +BSS s32 gDefeatedBattleSubstate; +BSS s32 gBattleSubState; +BSS s32 gDefeatedBattleState; +BSS s32 gCurrentBattleID; +BSS s32 gCurrentStageID; +BSS Battle* gOverrideBattlePtr; +BSS Battle* gCurrentBattlePtr; // standard battle area table entry #define BTL_AREA(id, jpName) { \ diff --git a/src/battle/battle.h b/src/battle/battle.h index 7ad68d3943..236f2dd9b1 100644 --- a/src/battle/battle.h +++ b/src/battle/battle.h @@ -253,14 +253,10 @@ typedef struct PlayerCelebrationAnimOptions { /* 0x04 */ s32 options[80]; } PlayerCelebrationAnimOptions; // size = 0x144 -#ifndef NO_EXTERN_VARIABLES - extern Battle* gCurrentBattlePtr; extern ActorOffsets bActorOffsets[]; -#endif - void load_demo_battle(u32 index); Actor* create_actor(Formation formation); diff --git a/src/battle/battle_bss.c b/src/battle/battle_bss.c deleted file mode 100644 index be125fb51d..0000000000 --- a/src/battle/battle_bss.c +++ /dev/null @@ -1,25 +0,0 @@ -#define NO_EXTERN_VARIABLES -#include "common.h" -#include "battle/battle.h" - -// -// battle.c bss symbols -// - -BSS s32 D_800DC060; -BSS StageListRow* gCurrentStagePtr; -BSS s32 gBattleState; -BSS s32 D_800DC06C; -BSS BattleStatus gBattleStatus; -BSS s32 gLastDrawBattleState; -BSS s32 D_800DC4D4; -BSS s32 gDefeatedBattleSubstate; -BSS s32 gBattleSubState; -BSS s32 D_800DC4E0; -BSS s32 gDefeatedBattleState; -BSS s32 gCurrentBattleID; -BSS s32 gCurrentStageID; -BSS s32 D_800DC4F0; -BSS Battle* gOverrideBattlePtr; -BSS s32 D_800DC4F8; -BSS Battle* gCurrentBattlePtr; diff --git a/src/bss/engine1_post_bss.c b/src/bss/engine1_post_bss.c deleted file mode 100644 index bbd6eb8011..0000000000 --- a/src/bss/engine1_post_bss.c +++ /dev/null @@ -1,19 +0,0 @@ -#define NO_EXTERN_VARIABLES -#include "common.h" -// DON'T DARE to put include headers here containing extern declarations... -// This will ruin the ordering of bss symbols below if you care about matching. - -#ifndef SHIFT - -BSS PartnerStatus gPartnerStatus; -BSS s32 gSpinHistoryPosY[6]; -BSS s32 gSpinHistoryPosX[6]; -BSS s32 gSpinHistoryPosZ[6]; -BSS StatusBar gStatusBar; -BSS PlayerStatus gPlayerStatus; -BSS PlayerSpinState gPlayerSpinState; -BSS s32 D_8010F284[3]; -BSS PlayerData gPlayerData; -BSS s16 gSpinHistoryPosAngle[5]; - -#endif diff --git a/src/bss/engine1_pre_bss.c b/src/bss/engine1_pre_bss.c deleted file mode 100644 index d60597c14a..0000000000 --- a/src/bss/engine1_pre_bss.c +++ /dev/null @@ -1,38 +0,0 @@ -#define NO_EXTERN_VARIABLES -#include "common.h" -// DON'T DARE to put include headers here containing extern declarations... -// This will ruin the ordering of bss symbols below if you care about matching. - -#ifndef SHIFT - -BSS UNK_FUN_PTR(PulseStoneNotificationCallback); -BSS void* D_8010C924; -BSS f32 D_8010C928; -BSS s32 D_8010C92C; -BSS Npc* wPartnerNpc; -BSS Entity* TweesterTouchingPlayer; -BSS f32 PlayerNormalYaw; -BSS UNK_FUN_PTR(ISpyNotificationCallback); -BSS UNK_FUN_PTR(TalkNotificationCallback); -BSS s32 gSpinHistoryBufferPos; -BSS s32 D_8010C948; -BSS s32 NpcHitQueryBehindRightY; -BSS s32 D_8010C950; -BSS Entity* TweesterTouchingPartner; -BSS UNK_FUN_PTR(InteractNotificationCallback); -BSS s32 PrevPlayerDirection; -BSS f32 JumpedOnSwitchX; -BSS s32 D_8010C964; -BSS s32 NpcHitQueryBehindCollider; -BSS s32 PeachDisguiseNpcIndex; -BSS s32 NpcHitQueryAheadY; -BSS s32 NpcHitQueryBehindLeftY; -BSS s32 NpcHitQueryColliderID; -BSS f32 JumpedOnSwitchZ; -BSS s32 PlayerRunStateTime; -BSS f32 StepUpLastYaw; -BSS s32 StepUpLastY; -BSS s32 NpcHitQueryAheadCollider; -BSS f32 PlayerNormalPitch; - -#endif diff --git a/src/bss/engine2_post_bss.c b/src/bss/engine2_post_bss.c deleted file mode 100644 index 6de7124c47..0000000000 --- a/src/bss/engine2_post_bss.c +++ /dev/null @@ -1,39 +0,0 @@ -#define NO_EXTERN_VARIABLES -#include "common.h" -#include "model.h" -#include "overlay.h" -// DON'T DARE to put include headers here containing extern declarations... -// This will ruin the ordering of bss symbols below if you care about matching. - -#ifndef SHIFT - -// from audio/ambience.c -typedef struct { - /* 0x0 */ s16 flags; - /* 0x2 */ s16 fadeState; - /* 0x4 */ s32 fadeTime; - /* 0x8 */ s32 soundID; - /* 0xC */ s32 unkC; -} AmbientSoundSettings; - -BSS MusicSettings gMusicSettings[2]; -BSS IMG_BIN D_80159B50[0x200]; -BSS Window gWindows[64]; -BSS CollisionStatus gCollisionStatus; -BSS HiddenPanelsData gCurrentHiddenPanels; -BSS s32 _PLS_NAME_ME[2]; -BSS TextureHandle TextureHandles[128]; -BSS ScreenOverlay ScreenOverlays[2]; -BSS AmbientSoundSettings AmbientSoundData; -BSS s32 CreateEntityVarArgBuffer[4]; -BSS PAL_BIN D_8015C7E0[0x10]; -#if VERSION_IQUE -BSS char D_8015C800[0x3C80]; -#elif VERSION_JP -BSS char D_8015C800[0x2880]; -#else -BSS char D_8015C800[0x7800]; -#endif -BSS DisplayContext D_80164000[2]; - -#endif diff --git a/src/bss/engine2_pre_bss.c b/src/bss/engine2_pre_bss.c deleted file mode 100644 index ed596a1162..0000000000 --- a/src/bss/engine2_pre_bss.c +++ /dev/null @@ -1,56 +0,0 @@ -#define NO_EXTERN_VARIABLES -#include "common.h" -#include "model.h" -#include "hud_element.h" -// DON'T DARE to put include headers here containing extern declarations... -// This will ruin the ordering of bss symbols below if you care about matching. - -#ifndef SHIFT - -BSS SpriteShadingProfile* gAuxSpriteShadingProfile; -BSS s32 gHudElementsNumber; -BSS ModelCustomGfxBuilderList* gCurrentCustomModelGfxBuildersPtr; -BSS s32 D_801512BC; -BSS s32 entity_numEntities; -BSS s32 gEntityHeapBase; -BSS HudCacheEntry* gHudElementCacheTableRaster; -BSS ModelList* gCurrentModels; -BSS HudCacheEntry* gHudElementCacheTablePalette; -BSS s32 gAnimCount; -BSS s32 gMsgBGScrollAmtX; -BSS s32 D_801512DC; -BSS ModelTransformGroupList* gCurrentTransformGroups; -BSS u16 gMsgGlobalWaveCounter; -BSS ModelCustomGfxList* gCurrentCustomModelGfxPtr; -BSS s32 gLastCreatedEntityIndex; -BSS u8* gBackgroundTintModePtr; -BSS MessageImageData* gMsgVarImages[1]; -BSS s32 ItemEntitiesCreated; -BSS ModelNode** gCurrentModelTreeRoot; -BSS s32 gEntityHeapBottom; -BSS s32 D_80151304; -BSS u16 gCurrentRoomDoorSounds; -BSS s32 gMsgBGScrollAmtY; -BSS s32 gEntityHideMode; -BSS u8* gHudElementCacheBuffer; -BSS s32 gEntityModelCount; -BSS u8* D_8015131C; -BSS s32 D_80151320; -BSS s32 entity_numShadows; -BSS SpriteShadingProfile* gSpriteShadingProfile; -BSS s32 isAreaSpecificEntityDataLoaded; -BSS s32 entity_updateCounter; -BSS s16 gTriggerCount; -BSS Gfx* D_80151338; -BSS s32* gHudElementCacheSize; -BSS u16 gCurrentDoorSounds; -BSS s32 D_80151344; -#if VERSION_JP -BSS s32 D_80151348[4]; -#elif VERSION_PAL || VERSION_IQUE -BSS s32 D_80151348[8]; -#else -BSS s32 D_80151348[12]; -#endif - -#endif diff --git a/src/bss/main_post_bss.c b/src/bss/main_post_bss.c deleted file mode 100644 index 2d1b7aed54..0000000000 --- a/src/bss/main_post_bss.c +++ /dev/null @@ -1,88 +0,0 @@ -#define NO_EXTERN_VARIABLES -#include "common.h" -#include "PR/osint.h" -#include "PR/controller.h" -#include "nu/nusys.h" -#include "npc.h" -#include "effects.h" -#include "audio.h" -// DON'T DARE to put include headers here containing extern declarations... -// This will ruin the ordering of bss symbols below if you care about matching. - -#ifndef SHIFT - -// -// main segment COMMON/.scommon symbols -// - -#if VERSION_IQUE -BSS OSIoMesg __osFlashMsg OSALIGNED(8); -#endif -BSS char wMapTexName[0x18]; -BSS OSThread __osThreadSave; -BSS OSMesgQueue nuContWaitMesgQ; -BSS OSPifRam __osContPifRam BBALIGNED(16); -BSS EncounterStatus gCurrentEncounter; -BSS OSPiHandle __Dom2SpeedParam OSALIGNED(8); -BSS OSContStatus nuContStatus[NU_CONT_MAXCONTROLLERS]; -BSS OSThread D_800B1B90; -BSS NUContRmbCtl nuContRmbCtl[NU_CONT_MAXCONTROLLERS]; -#if VERSION_IQUE -BSS u32 __osFlashID[4] OSALIGNED(8); -#endif -BSS OSContPad nuContData[NU_CONT_MAXCONTROLLERS]; -BSS Camera gCameras[4] ALIGNED(16); -BSS unsigned char D_800B32E0[0x800] ALIGNED(16); -BSS unsigned char D_800B3AE0[0x800] ALIGNED(16); -BSS CollisionData gCollisionData; -BSS OSMesgQueue nuGfxMesgQ; -BSS OSPiHandle __CartRomHandle OSALIGNED(8); -BSS OSMesgQueue __osPiAccessQueue OSALIGNED(8); -BSS EffectInstance* gEffectInstances[96] ALIGNED(8); -BSS OSPiHandle __Dom1SpeedParam OSALIGNED(8); -BSS u8 nuBootStack[0x2000] ALIGNED(8); -BSS u64 nuMainStack[NU_SC_STACK_SIZE / sizeof(u64)]; -BSS u8 nuYieldBuf[NU_GFX_YIELD_BUF_SIZE]; -BSS AuSynDriver auSynDriver; -BSS s32 D_800B91D0[NU_GFX_RDP_OUTPUTBUFF_SIZE / sizeof(u32)] ALIGNED(16); -#if VERSION_IQUE -BSS OSPiHandle __osFlashHandler OSALIGNED(8); -#endif -BSS CollisionData gZoneCollisionData ALIGNED(8); -#if VERSION_JP || VERSION_IQUE -BSS char wMapHitName[0x14]; -#else -BSS char wMapHitName[0x18]; -#endif -BSS OSMesgQueue nuSiMgrMesgQ; -BSS OSTimer __osBaseTimer; -BSS char wMapShapeName[0x18]; -BSS ALHeap nuAuHeap; -#if VERSION_IQUE -BSS OSMesgQueue __osFlashMessageQ OSALIGNED(8); -#endif -BSS OSTimer __osEepromTimer; -BSS NUScTask nuGfxTask[NU_GFX_TASK_NUM]; -BSS SaveGlobals gSaveGlobals; -BSS char wMapBgName[0x14]; -BSS __OSInode __osPfsInodeCache OSALIGNED(8); -#if !VERSION_IQUE -BSS u8 rspbootUcodeBuffer[0x100] ALIGNED(16); -BSS char D_800D9880[0x700]; -#endif -BSS __OSEventState __osEventStateTab[OS_NUM_EVENTS]; -BSS OSPifRam __osPfsPifRam BBALIGNED(16); -BSS u64 D_800DA040[0x400 / sizeof(u64)]; -BSS NUSched nusched; -BSS OSMesgQueue __osEepromTimerQ OSALIGNED(8); -BSS OSPfs nuContPfs[NU_CONT_MAXCONTROLLERS]; -BSS OSMesgQueue nuSiMesgQ; -BSS OSMesgQueue D_800DAC90; -BSS OSMesgQueue __osSiAccessQueue OSALIGNED(8); -#ifdef BBPLAYER -BSS u8 __osBbFlashBuffer[0x80]; -#endif -BSS SaveData gCurrentSaveFile; -BSS OSMesgQueue nuContDataMutexQ; - -#endif diff --git a/src/bss/main_pre_bss.c b/src/bss/main_pre_bss.c deleted file mode 100644 index c52eb8f715..0000000000 --- a/src/bss/main_pre_bss.c +++ /dev/null @@ -1,89 +0,0 @@ -#define NO_EXTERN_VARIABLES -#include "common.h" -#include "audio.h" -#include "model.h" -// DON'T DARE to put include headers here containing extern declarations... -// This will ruin the ordering of bss symbols below if you care about matching. - -#ifndef SHIFT - -// -// Main segment COMMON/.scommon symbols -// - -BSS u8 nuScPreNMIFlag; -BSS s32 D_8009A5B4; -BSS s32 D_8009A5B8; -BSS s32 D_8009A5BC; -#if VERSION_IQUE -BSS s32 __osFlashVersion; -#endif -BSS AuGlobals* gSoundGlobals; -BSS s32 D_8009A5C4; -BSS u32 __osBaseCounter; -BSS BGMPlayer* gBGMPlayerC; -BSS s32 gEncounterSubState; -#ifdef BBPLAYER -BSS u32 __osBbRCountWraps; -#endif -BSS void *CurrentSefCmdHandler; -BSS s32 timeFreezeMode; -#ifdef BBPLAYER -BSS u32 __osBbLastRCount; -#endif -BSS u16* nuGfxZBuffer; -BSS u32 nuContDataLockKey; -BSS u32 __osViIntrCount; -BSS AuCallback BeginSoundUpdateCallback; -BSS f32 D_8009A5EC; -BSS u32 nuGfxCfbCounter; -BSS ModelTreeInfoList* gCurrentModelTreeNodeInfo; -BSS u32 nuGfxDisplay; -BSS BGMPlayer* gBGMPlayerB; -BSS s32 gEncounterState; -BSS s16 gNpcCount; -BSS u8 __osMaxControllers; -#if VERSION_IQUE -BSS OSMesg __osFlashMsgBuf; -#endif -BSS OSTime __osCurrentTime; -BSS NUUcode* nuGfxUcode; -BSS u32 nuContNum; -#ifdef BBPLAYER -BSS u32 __osBbLastVCount; -#endif -BSS volatile u32 nuGfxTaskSpool; -BSS u8 __osContLastCmd; -BSS OSMesg __osEepromTimerMsg; -BSS s32 D_8009A624; -BSS AmbienceManager* gAuAmbienceManager; -BSS u32 __osTimerCounter; -BSS void (*nuIdleFunc)(void); -BSS s16 gCurrentCamID; -BSS OSPiHandle* nuPiCartHandle; -#ifdef BBPLAYER -BSS u32 __osBbVCountWraps; -#endif -BSS s8 D_8009A63C; -BSS SoundManager* gSoundManager; -BSS s32 D_8009A644; -BSS s32 D_8009A648; -BSS u16* nuGfxCfb_ptr; -BSS s32 gOverrideFlags; -BSS s8 HasPreBattleSongPushed; -BSS u16** nuGfxCfb; -BSS s32 D_8009A65C; -BSS u32 __osFinalrom; -BSS BGMPlayer* gBGMPlayerA; -BSS s16 gFirstStrikeMessagePos; -BSS Gfx* gMainGfxPos; -BSS s8 D_8009A670; -BSS DisplayContext* gDisplayContext; -BSS s32 D_8009A678; -BSS s32 D_8009A67C; -#if VERSION_IQUE -BSS s32 D_80099258[2]; -#endif -BSS u16* ResetFrameBufferArray; - -#endif diff --git a/ver/ique/splat.yaml b/ver/ique/splat.yaml index a7bd672348..30a7ab7c65 100644 --- a/ver/ique/splat.yaml +++ b/ver/ique/splat.yaml @@ -42,7 +42,6 @@ segments: vram: 0x80025C00 subsegments: - [auto, hasm, boot/entry_point] - - [auto, c, bss/main_pre_bss] - [auto, c, main_pre] - [auto, c, main] - [auto, c, main_loop] @@ -294,9 +293,7 @@ segments: - [auto, c, os/strcpy, gcc_272 -O1] - [auto, hasm, os/decode_yay0] - [0x49830, pm_effect_loads, effect_loads] - - [auto, c, bss/main_post_bss] - [auto, c, battle/battle] - - [auto, c, battle/battle_bss] - [0x4D140, bin, rspboot] - [0x4D210, bin, n_aspMain_text] - start: 0x4DE70 @@ -336,7 +333,6 @@ segments: start: 0x74570 vram: 0x800da8e0 subsegments: - - [auto, c, bss/engine1_pre_bss] - [auto, c, npc_collision] - [auto, c, 77480] - [auto, c, 7B440] @@ -351,7 +347,6 @@ segments: - [auto, c, 8a160_len_700] - [auto, c, 8a860_len_3f30] - [auto, c, draw_box] - - [auto, c, bss/engine1_post_bss] - start: 0x90570 type: .data name: global_hud_scripts @@ -771,7 +766,6 @@ segments: start: 0xa4990 vram: 0x8010dab0 subsegments: - - [auto, c, bss/engine2_pre_bss] - [auto, c, entity] - [auto, c, game_states] - [auto, c, model] @@ -794,7 +788,6 @@ segments: - [auto, c, sprite_shading] - [auto, c, audio/sfx] - [auto, c, audio/e0b30_len_b80] - - [auto, c, bss/engine2_post_bss] - start: 0xE1D60 type: .data name: screen_overlays diff --git a/ver/jp/splat.yaml b/ver/jp/splat.yaml index 56153f6110..d902b1c77a 100644 --- a/ver/jp/splat.yaml +++ b/ver/jp/splat.yaml @@ -46,7 +46,6 @@ segments: vram: 0x80025C00 subsegments: - [auto, hasm, boot/entry_point] - - [auto, c, bss/main_pre_bss] - [auto, c, is_debug, -g -fforce-addr] - [auto, c, main_pre] - [auto, c, main] @@ -301,9 +300,7 @@ segments: - [auto, hasm, os/decode_yay0] - [auto, c, os/osFlash] - [0x4AC70, pm_effect_loads, effect_loads] - - [auto, c, bss/main_post_bss] - [auto, c, battle/battle] - - [auto, c, battle/battle_bss] - [0x4E580, bin, n_aspMain_text] - start: 0x4F1E0 type: .data @@ -342,7 +339,6 @@ segments: start: 0x75990 vram: 0x800dc4e0 subsegments: - - [auto, c, bss/engine1_pre_bss] - [auto, c, npc_collision] - [auto, c, 77480] - [auto, c, 7B440] @@ -357,7 +353,6 @@ segments: - [auto, c, 8a160_len_700] - [auto, c, 8a860_len_3f30] - [auto, c, draw_box] - - [auto, c, bss/engine1_post_bss] - start: 0x91B40 type: .data name: global_hud_scripts @@ -785,7 +780,6 @@ segments: start: 0xa9770 vram: 0x801148e0 subsegments: - - [auto, c, bss/engine2_pre_bss] - [auto, c, entity] - [auto, c, game_states] - [auto, c, model] @@ -808,7 +802,6 @@ segments: - [auto, c, sprite_shading] - [auto, c, audio/sfx] - [auto, c, audio/e0b30_len_b80] - - [auto, c, bss/engine2_post_bss] - start: 0xE6620 type: .data name: screen_overlays diff --git a/ver/pal/splat.yaml b/ver/pal/splat.yaml index b7f312edaa..ff4c94ba77 100644 --- a/ver/pal/splat.yaml +++ b/ver/pal/splat.yaml @@ -40,7 +40,6 @@ segments: start: 0x71D80 vram: 0x800D8C70 subsegments: - - [auto, c, bss/engine1_pre_bss] - [auto, c, npc_collision] - [auto, c, 77480] - [auto, c, 7B440] @@ -55,7 +54,6 @@ segments: - [auto, c, 8a160_len_700] - [auto, c, 8a860_len_3f30] - [auto, c, draw_box] - - [auto, c, bss/engine1_post_bss] - start: 0x8DA40 type: .data name: global_hud_scripts @@ -545,7 +543,6 @@ segments: start: 0xA4520 vram: 0x8010E1D0 subsegments: - - [auto, c, bss/engine2_pre_bss] - [auto, c, entity] - [auto, c, game_states] - [auto, c, model] @@ -568,7 +565,6 @@ segments: - [auto, c, sprite_shading] - [auto, c, audio/sfx] - [auto, c, audio/e0b30_len_b80] - - [auto, c, bss/engine2_post_bss] - start: 0xE1610 type: .data name: screen_overlays diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index 4fe95fa39c..b4639d5af8 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -90,7 +90,6 @@ segments: vram_class: main subsegments: - [auto, hasm, boot/entry_point] - - [auto, c, bss/main_pre_bss] - [auto, c, is_debug, -g -fforce-addr] - [auto, c, main_pre] - [auto, c, main] @@ -346,9 +345,7 @@ segments: - [auto, hasm, os/decode_yay0] - [auto, c, os/osFlash] - [0x4AC90, pm_effect_loads, effect_loads] - - [auto, c, bss/main_post_bss] - [auto, c, battle/battle] - - [auto, c, battle/battle_bss] - [0x4E5A0, bin, n_aspMain_text] - start: 0x4F200 type: .data @@ -391,7 +388,6 @@ segments: start: 0x759B0 vram_class: engine1 subsegments: - - [auto, c, bss/engine1_pre_bss] - [auto, c, npc_collision] - [auto, c, 77480] - [auto, c, 7B440] @@ -406,7 +402,6 @@ segments: - [auto, c, 8a160_len_700] - [auto, c, 8a860_len_3f30] - [auto, c, draw_box] - - [auto, c, bss/engine1_post_bss] - start: 0x919B0 type: .data name: global_hud_scripts @@ -825,7 +820,6 @@ segments: start: 0xA5DD0 vram_class: engine2 subsegments: - - [auto, c, bss/engine2_pre_bss] - [auto, c, entity] - [auto, c, game_states] - [auto, c, model] @@ -848,7 +842,6 @@ segments: - [auto, c, sprite_shading] - [auto, c, audio/sfx] - [auto, c, audio/e0b30_len_b80] - - [auto, c, bss/engine2_post_bss] - start: 0xE2DF0 type: .data name: screen_overlays From a2a5dff58cb80478d52f37c392997a1d3c25a5c9 Mon Sep 17 00:00:00 2001 From: z64a Date: Sun, 19 May 2024 02:14:31 -0400 Subject: [PATCH 12/14] reversions --- include/common_structs.h | 7 -- include/functions.h | 4 +- include/nu/nualsgi.h | 7 +- include/nu/nusys.h | 1 + include/variables.h | 4 - src/7BB60.c | 4 +- src/animator.c | 7 +- src/audio/25f00_len_940.c | 3 - src/background.c | 4 - src/dx/versioning.c | 5 +- src/entity.c | 3 - src/evt/player_api.c | 3 - src/game_states.c | 1 - src/hud_element.c | 2 - src/imgfx.c | 13 ---- src/input.c | 1 - src/item_entity.c | 1 - src/item_table.yaml | 1 - src/model.c | 7 -- src/msg.c | 11 +-- src/state_file_select.c | 94 ++++++++++++------------ src/state_title_screen.c | 2 +- src/world/area_omo/omo_12/omo_12_3_npc.c | 5 -- src/world/partners.c | 21 ++++-- src/world/world.c | 5 -- 25 files changed, 78 insertions(+), 138 deletions(-) diff --git a/include/common_structs.h b/include/common_structs.h index b347022782..3400a77486 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -2511,13 +2511,6 @@ typedef struct PartnerDMAData { /* 0x10 */ s32 y; } PartnerDMAData; // size = 0x14 -typedef struct UseItemStruct { - /* 0x00 */ u8* dmaStart; - /* 0x04 */ u8* dmaEnd; - /* 0x08 */ EvtScript* main; - /* 0x0C */ s32 unk_0C; -} UseItemStruct; - typedef struct MsgVoice { /* 0x00 */ s32 voiceA; /* 0x04 */ s32 voiceB; diff --git a/include/functions.h b/include/functions.h index 5dc571f08b..9777ce95d6 100644 --- a/include/functions.h +++ b/include/functions.h @@ -414,9 +414,9 @@ s32 is_point_within_region(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 c b32 npc_raycast_down_around(s32, f32*, f32*, f32*, f32*, f32, f32); b32 npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth); -s32 npc_raycast_up(s32, f32*, f32*, f32*, f32*); +b32 npc_raycast_up(s32, f32*, f32*, f32*, f32*); HitID npc_raycast_up_corners(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth, f32 yaw, f32 radius); -s32 player_raycast_up_corners(PlayerStatus*, f32*, f32*, f32*, f32*, f32); +HitID player_raycast_up_corners(PlayerStatus*, f32*, f32*, f32*, f32*, f32); HitID player_raycast_below_cam_relative(PlayerStatus* playerStatus, f32* outX, f32* outY, f32* outZ, f32* outLength, f32* hitRx, f32* hitRz, f32* hitDirX, f32* hitDirZ); b32 npc_test_move_taller_with_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32); diff --git a/include/nu/nualsgi.h b/include/nu/nualsgi.h index d5f577058f..15b6f102ab 100644 --- a/include/nu/nualsgi.h +++ b/include/nu/nualsgi.h @@ -195,14 +195,11 @@ typedef void (*NUAuMgrFunc)(void); /* Acmd callback function */ /* audio variables */ /*--------------------------------------*/ -// NOTE: some variables have been commented out due to -// being declared static which affects bss reordering - extern u64* nuAuMgrStack; extern NUScTask nuAuTask; /* Audio task buffer*/ extern s16* nuAuBuffer_ptr[]; /* Audio buffer */ extern NUScClient nuAuClient; -//extern OSThread nuAuMgrThread; +extern OSThread nuAuMgrThread; extern u32 nuAuFrameCounter; /* Frame counter */ extern ALHeap nuAuHeap; /* Heap structure */ extern NUAuSeqPlayer nuAuSeqPlayer[]; @@ -223,7 +220,7 @@ extern OSMesgQueue nuAuMesgQ; /* Audio Manager queue */ extern ALGlobals nuAuGlobal; extern s16 nuAuDmaBufNum; extern s16 nuAuDmaBufSize; -//extern NUDMAState nuAuDmaState; +extern NUDMAState nuAuDmaState; extern NUDMABuffer* nuAuDmaBuf; extern Acmd* nuAuCmdListBuf; /* pointer of command list */ extern u32 nuAuAcmdLen; diff --git a/include/nu/nusys.h b/include/nu/nusys.h index aa6b71e952..54dea96f6f 100644 --- a/include/nu/nusys.h +++ b/include/nu/nusys.h @@ -752,6 +752,7 @@ extern u32 nuDebTaskPerfInterval; extern volatile u32 nuDebTaskPerfCnt; extern volatile u32 nuDebTaskPerfEnd; + /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* Global Function */ diff --git a/include/variables.h b/include/variables.h index 9f03615e74..c30049618e 100644 --- a/include/variables.h +++ b/include/variables.h @@ -50,15 +50,11 @@ extern Window gWindows[64]; extern s32 gEncounterState; extern s32 gOverrideFlags; -extern DisplayContext D_80164000[2]; - extern WindowStyle gWindowStyles[]; extern u16 gCurrentDoorSounds; extern u16 gCurrentRoomDoorSounds; -extern b8 D_8014C248; - extern UNK_FUN_PTR(TalkNotificationCallback); extern UNK_FUN_PTR(InteractNotificationCallback); extern UNK_FUN_PTR(ISpyNotificationCallback); diff --git a/src/7BB60.c b/src/7BB60.c index fa90b1864a..09b2042d27 100644 --- a/src/7BB60.c +++ b/src/7BB60.c @@ -4,10 +4,10 @@ #include "dx/debug_menu.h" CollisionStatus gCollisionStatus; -f32 StepUpLastY; f32 JumpedOnSwitchX; f32 JumpedOnSwitchZ; -f32 StepUpLastYaw; +f32 StepUpLastYaw; // never read, remove? +f32 StepUpLastY; // never read, remove? s16 FootstepSoundSelector = 0; diff --git a/src/animator.c b/src/animator.c index 5f58c25ea7..3582952095 100644 --- a/src/animator.c +++ b/src/animator.c @@ -24,7 +24,6 @@ BSS s32 gAnimModelFogA; BSS s32 gAnimModelFogStart; BSS s32 gAnimModelFogEnd; BSS s32 gAnimVtxSegment; -BSS s32 D_80153A64; BSS Matrix4f gAnimRotMtx; BSS Matrix4f gAnimScaleMtx; BSS Matrix4f gAnimTranslateMtx; @@ -448,7 +447,7 @@ void update_model_animator(s32 animatorID) { if (animator->flags & MODEL_ANIMATOR_FLAG_FREEZE_ANIMATION) { return; } - + animator->flags &= ~MODEL_ANIMATOR_FLAG_UPDATE_PENDING; animator->nextUpdateTime -= animator->timeScale; @@ -720,7 +719,7 @@ void render_animated_model(s32 animatorID, Mtx* rootTransform) { if (gGameStatusPtr->isBattle && !(animatorID & BATTLE_ID_BIT)) { return; } - + animatorID &= ~BATTLE_ID_BIT; animator = (*gCurrentAnimMeshListPtr)[animatorID]; @@ -1125,7 +1124,7 @@ void load_model_animator_tree(s32 index, StaticAnimatorNode** tree) { if (animator == NULL || animator->flags == 0) { return; } - + gAnimTreeRoot = tree; load_model_animator_node(*tree, animator, 0, nodeIDs); set_animator_tree_to_node_map(animator, nodeIDs, ARRAY_COUNT(animator->staticNodeIDs)); diff --git a/src/audio/25f00_len_940.c b/src/audio/25f00_len_940.c index 31f757584d..c1a668f74a 100644 --- a/src/audio/25f00_len_940.c +++ b/src/audio/25f00_len_940.c @@ -15,19 +15,16 @@ u8 volatile AuSynUseStereo = TRUE; BSS u16 AuInitialGlobalVolume; BSS OSThread nuAuMgrThread; -BSS char D_800A1108[0x408]; BSS u64 AuStack[NU_AU_STACK_SIZE / sizeof(u64)]; BSS Acmd* AlCmdListBuffers[3]; BSS NUScTask nuAuTasks[3]; BSS u8* D_800A3628[3]; BSS s32 AlFrameSize; BSS s32 AlMinFrameSize; -BSS s32 D_800A363C; BSS OSMesgQueue nuAuDmaMesgQ; BSS OSMesg nuAuDmaMesgBuf[50]; BSS OSIoMesg nuAuDmaIOMesgBuf[50]; BSS NUDMAState nuAuDmaState; -BSS s32 D_800A3BDC; BSS NUDMABuffer nuAuDmaBufList[50]; ALHeap nuAuHeap; diff --git a/src/background.c b/src/background.c index 374000a9bf..9df80d930a 100644 --- a/src/background.c +++ b/src/background.c @@ -10,10 +10,6 @@ f32 gBackroundWavePhase = 0.0f; BSS PAL_BIN gBackgroundPalette[256]; BSS f32 gBackroundLastScrollValue; -BSS s32 D_801595A4[3]; -#if !VERSION_PAL -BSS s32 D_801595AC; -#endif void load_map_bg(char* optAssetName) { if (optAssetName != NULL) { diff --git a/src/dx/versioning.c b/src/dx/versioning.c index 4e7fd4944a..6cb8d3dd37 100644 --- a/src/dx/versioning.c +++ b/src/dx/versioning.c @@ -35,6 +35,7 @@ void fio_serialize_state() { void fio_deserialize_state() { SaveData* saveData = &gCurrentSaveFile; + /* if (saveData->modName[0] == '\0') { // normally a mod should not be able to load a normal Paper Mario save // however, if you would like your mod to support this, remove this PANIC @@ -45,7 +46,9 @@ void fio_deserialize_state() { char error[0x40] = "Cannot load save from: "; strcat(error, saveData->modName); PANIC_MSG(error); - } else if (saveData->majorVersion != DX_MOD_VER_MAJOR) { + } else */ + + if (saveData->majorVersion != DX_MOD_VER_MAJOR) { // handle breaking changes between major versions here ver_deserialize_standard(saveData); } else { diff --git a/src/entity.c b/src/entity.c index 5aee4d73e1..b5137d333c 100644 --- a/src/entity.c +++ b/src/entity.c @@ -51,18 +51,15 @@ s32 entity_updateCounter; BSS EntityList gWorldEntityList; BSS EntityList gBattleEntityList; BSS EntityList* gCurrentEntityListPtr; -BSS s32 D_80151474; BSS ShadowList gWorldShadowList; BSS ShadowList gBattleShadowList; BSS ShadowList* gCurrentShadowListPtr; BSS s32 wEntityDataLoadedSize; BSS s32 bEntityDataLoadedSize; -BSS s32 D_80151664; BSS EntityBlueprint* wEntityBlueprint[MAX_ENTITIES + 2]; BSS EntityBlueprint* bEntityBlueprint[4]; -BSS s32 D_801516F8; BSS s32 D_801516FC; extern Addr BattleEntityHeapBottom; // todo ??? diff --git a/src/evt/player_api.c b/src/evt/player_api.c index 26dfdc262a..9ff67131a0 100644 --- a/src/evt/player_api.c +++ b/src/evt/player_api.c @@ -5,9 +5,6 @@ #include "world/surfaces.h" #include "sprite/player.h" -extern PlayerStatus gPlayerStatus; -extern PlayerData gPlayerData; - extern Npc playerNpcData; extern u16 PlayerImgFXFlags; extern s32 D_802DB5B4[3]; // unused diff --git a/src/game_states.c b/src/game_states.c index bb480eacf6..f4e127c8b4 100644 --- a/src/game_states.c +++ b/src/game_states.c @@ -2,7 +2,6 @@ #include "game_modes.h" BSS GameMode gMainGameMode[2]; -BSS s32 D_80151730[4]; // unused? or probably a part of GameMode? void mode_default_nop(void) { } diff --git a/src/hud_element.c b/src/hud_element.c index 5a0e810290..af1fa5ca5d 100644 --- a/src/hud_element.c +++ b/src/hud_element.c @@ -111,12 +111,10 @@ BSS HudElementList gHudElementsBattle; BSS HudElementList* gHudElements; BSS u8* gHudElementCacheBufferWorld; BSS s32 gHudElementCacheSizeWorld; -BSS s32 D_8015796C; BSS HudCacheEntry gHudElementCacheTableRasterWorld[192]; BSS HudCacheEntry gHudElementCacheTablePaletteWorld[192]; BSS u8* gHudElementCacheBufferBattle; BSS s32 gHudElementCacheSizeBattle; -BSS s32 D_80158578[2]; BSS HudCacheEntry gHudElementCacheTableRasterBattle[192]; BSS HudCacheEntry gHudElementCacheTablePaletteBattle[192]; BSS s32 D_80159180; diff --git a/src/imgfx.c b/src/imgfx.c index 56fa92d45e..8fd835414f 100644 --- a/src/imgfx.c +++ b/src/imgfx.c @@ -117,12 +117,6 @@ BSS ImgFXWorkingTexture ImgFXCurrentTexture; BSS Vtx* ImgFXVtxBuffers[2]; BSS Vtx* imgfx_vtxBuf; BSS ImgFXInstanceList* ImgFXInstances; -BSS s8 D_80156958[2]; -BSS s32 D_8015695C; -BSS s32 D_80156960[2]; -BSS s32 D_80156968[2]; -BSS s8 D_80156970; -BSS s32 D_80156974[3]; BSS ImgFXAnimHeader ImgFXAnimHeaders[MAX_IMGFX_INSTANCES]; BSS ImgFXCacheEntry ImgFXDataCache[8]; @@ -260,13 +254,6 @@ void imgfx_init(void) { imgfx_clear_instance_data(&(*ImgFXInstances)[i]); } - for (i = 0; i < ARRAY_COUNT(D_80156958); i++) { - D_80156958[i] = -1; - D_80156960[i] = 0; - D_80156968[i] = 0; - D_80156970 = 0; - } - for (i = 0; i < ARRAY_COUNT(ImgFXDataCache); i++) { ImgFXDataCache[i].data = NULL; ImgFXDataCache[i].staleCooldownTimer = 0; diff --git a/src/input.c b/src/input.c index 5d64310542..95515d4c47 100644 --- a/src/input.c +++ b/src/input.c @@ -6,7 +6,6 @@ BSS s16 D_8009A6A0; BSS s16 D_8009A6A2; BSS s16 D_8009A6A4; BSS s16 D_8009A6A6; -BSS s32 D_8009A6A8; // unused void func_800287F0(void) { gGameStatusPtr->curButtons[0] = 0; diff --git a/src/item_entity.c b/src/item_entity.c index 9b3297b94c..788f014688 100644 --- a/src/item_entity.c +++ b/src/item_entity.c @@ -43,7 +43,6 @@ BSS s16 isPickingUpItem; BSS s16 ItemSpawnWithinPlayerPickupDelay; #if !VERSION_JP BSS s16 D_801565A8; -BSS s32 D_801565AC; #endif BSS PopupMenu ItemPickupMenu; BSS s32 ItemPickupIconID; diff --git a/src/item_table.yaml b/src/item_table.yaml index 716c8d03e0..22de3581a9 100644 --- a/src/item_table.yaml +++ b/src/item_table.yaml @@ -1485,7 +1485,6 @@ potencyA: 0 potencyB: 0 - PeachKey: - category: KEY nameMsg: MSG_ItemName_PeachKey fullDescMsg: MSG_ItemFullDesc_PeachKey shortDescMsg: MSG_ItemShortDesc_PeachKey diff --git a/src/model.c b/src/model.c index 82d4bca058..777bf50286 100644 --- a/src/model.c +++ b/src/model.c @@ -1303,8 +1303,6 @@ s32 RenderTaskBasePriorities[] = { [RENDER_MODE_CLOUD_NO_ZB] = 700000, }; -b8 D_8014C248 = FALSE; // possibly a 'warm-up done' flag for boot. never read. - ModelCustomGfxBuilderList* gCurrentCustomModelGfxBuildersPtr; ModelNode** gCurrentModelTreeRoot; ModelTransformGroupList* gCurrentTransformGroups; @@ -1329,17 +1327,13 @@ BSS ModelLocalVertexCopyList* gCurrentModelLocalVtxBuffers; BSS ModelNode* wModelTreeRoot; BSS ModelNode* bModelTreeRoot; -BSS s32 D_8015221C; BSS ModelTreeInfoList wModelTreeNodeInfo; BSS ModelTreeInfoList bModelTreeNodeInfo; BSS s8 wBackgroundTintMode; BSS s8 bBackgroundTintMode; -BSS s8 D_80153222; -BSS s8 D_80153223; BSS s32 TreeIterPos; BSS FogSettings wFogSettings; -BSS s32 D_80153244; BSS FogSettings bFogSettings; BSS FogSettings* gFogSettings; BSS s32 texPannerMainU[MAX_TEX_PANNERS]; @@ -1352,7 +1346,6 @@ BSS u16 mtg_SearchModelID; BSS ModelNode* mtg_FoundModelNode; BSS u16 mtg_MinChild; BSS u16 mtg_MaxChild; -BSS s32 D_80153378[2]; BSS u16 DepthCopyBuffer[16]; BSS RenderTask* RenderTaskLists[3]; BSS s32 RenderTaskListIdx; diff --git a/src/msg.c b/src/msg.c index 445dba1cca..aaa9036abb 100644 --- a/src/msg.c +++ b/src/msg.c @@ -56,10 +56,10 @@ void* D_PAL_8014AE50[] = { s16 gNextMessageBuffer = 0; Vtx gRewindArrowQuad[] = { - { .v = { .ob = { 0xFFF0, 0x0009, 0x0000 }, .tc = { 0x0000, 0x0000 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}}, - { .v = { .ob = { 0x0010, 0x0009, 0x0000 }, .tc = { 0x0400, 0x0000 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}}, - { .v = { .ob = { 0xFFF0, 0xFFF7, 0x0000 }, .tc = { 0x0000, 0x0240 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}}, - { .v = { .ob = { 0x0010, 0xFFF7, 0x0000 }, .tc = { 0x0400, 0x0240 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}}, + {{{ -16, 9, 0 }, 0, { 0x000, 0x000 }, { 255, 255, 255, 255 }}}, + {{{ 16, 9, 0 }, 0, { 0x400, 0x000 }, { 255, 255, 255, 255 }}}, + {{{ -16, -9, 0 }, 0, { 0x000, 0x240 }, { 255, 255, 255, 255 }}}, + {{{ 16, -9, 0 }, 0, { 0x400, 0x240 }, { 255, 255, 255, 255 }}}, }; Gfx D_8014C2D8[] = { @@ -88,9 +88,6 @@ Gfx* D_80151338; static char gMessageBuffers[2][1024]; static MessagePrintState gMessagePrinters[3]; -#if VERSION_JP -static s32 D_80155C38; -#endif static u8 gMessageMsgVars[3][32]; static s16 D_80155C98; static Mtx gMessageWindowProjMatrix[2]; diff --git a/src/state_file_select.c b/src/state_file_select.c index 010c9d3bfb..935b46451d 100644 --- a/src/state_file_select.c +++ b/src/state_file_select.c @@ -44,19 +44,19 @@ extern ShapeFile gMapShapeData; BSS s8 D_800A0930; BSS s8 D_800A0931; -static s16 D_800A0932[1]; // TODO any possible workaround to make this visible? +static s16 D_800A0932; void state_init_language_select(void) { D_800A0931 = 0; - D_800A0932[0] = 0; + D_800A0932 = 0; disable_player_input(); set_time_freeze_mode(TIME_FREEZE_FULL); - set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]); + set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932); } void state_init_file_select(void) { D_800A0931 = 0; - D_800A0932[0] = 0; + D_800A0932 = 0; disable_player_input(); set_time_freeze_mode(TIME_FREEZE_FULL); general_heap_create(); @@ -98,15 +98,14 @@ void state_step_language_select(void) { update_encounters(); update_effects(); - if (D_800A0932[0] < 255) { - D_800A0932[0] += 20; + if (D_800A0932 < 255) { + D_800A0932 += 20; - if (D_800A0932[0] > 255) { - D_800A0932[0] = 255; + if (D_800A0932 > 255) { + D_800A0932 = 255; } - set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]); - if (D_800A0932[0] == 255) { - + set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932); + if (D_800A0932 == 255) { D_800A0931 = 1; } } else { @@ -169,32 +168,29 @@ void state_step_language_select(void) { } filemenu_update(); - D_800A0932[0] -= 20; - if (D_800A0932[0] < 0) { - D_800A0932[0] = 0; + D_800A0932 -= 20; + if (D_800A0932 < 0) { + D_800A0932 = 0; } - set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]); + set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932); break; } } void state_step_file_select(void) { - s32 temp = D_800A0931; // needed to match - switch (D_800A0931) { + case 0: + D_800A0931 = 1; + break; case 1: set_windows_visible(WINDOW_GROUP_FILE_MENU); - D_800A0930 = temp; + D_800A0930 = 1; D_800A0931 = 2; break; - case 0: - D_800A0931 = 1; - break; case 2: if (D_800A0930 >= 0) { D_800A0930--; - temp = D_800A0930; - if (temp == 0) { + if (D_800A0930 == 0) { D_800A0930 = -1; battle_heap_create(); nuPiReadRomOverlay(&D_8007798C); @@ -216,12 +212,12 @@ void state_drawUI_file_select(void) { } void state_init_exit_language_select(void) { - if (D_800A0932[0] > 0) { + if (D_800A0932 > 0) { D_800A0931 = 0; - set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]); + set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932); } else { D_800A0931 = 1; - set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]); + set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932); } D_800A0930 = 1; gOverrideFlags &= ~GLOBAL_OVERRIDES_40; @@ -229,7 +225,7 @@ void state_init_exit_language_select(void) { void state_init_exit_file_select(void) { D_800A0931 = 0; - D_800A0932[0] = 0; + D_800A0932 = 0; D_800A0930 = 0; if (func_80244BC4() == 0) { @@ -245,13 +241,13 @@ void state_init_exit_file_select(void) { void state_step_exit_language_select(void) { switch (D_800A0931) { case 0: - if (D_800A0932[0] != 0) { - D_800A0932[0] -= 20; - if (D_800A0932[0] < 0) { - D_800A0932[0] = 0; + if (D_800A0932 != 0) { + D_800A0932 -= 20; + if (D_800A0932 < 0) { + D_800A0932 = 0; } - set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]); - if (D_800A0932[0] == 0) { + set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932); + if (D_800A0932 == 0) { D_800A0931 = 1; } } else { @@ -259,13 +255,13 @@ void state_step_exit_language_select(void) { } break; case 1: - if (D_800A0932[0] != 255) { - D_800A0932[0] += 20; - if (D_800A0932[0] > 255) { - D_800A0932[0] = 255; + if (D_800A0932 != 255) { + D_800A0932 += 20; + if (D_800A0932 > 255) { + D_800A0932 = 255; } - set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]); - if (D_800A0932[0] == 255) { + set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932); + if (D_800A0932 == 255) { D_800A0931 = 2; } } else { @@ -340,11 +336,11 @@ void state_step_exit_language_select(void) { update_encounters(); update_effects(); - D_800A0932[0] -= 20; - if (D_800A0932[0] < 0) { - D_800A0932[0] = 0; + D_800A0932 -= 20; + if (D_800A0932 < 0) { + D_800A0932 = 0; } - set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]); + set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932); } break; case 3: @@ -353,14 +349,14 @@ void state_step_exit_language_select(void) { update_encounters(); update_effects(); - if (D_800A0932[0] == 0) { + if (D_800A0932 == 0) { D_800A0931 = 4; } else { - D_800A0932[0] -= 20; - if (D_800A0932[0] < 0) { - D_800A0932[0] = 0; + D_800A0932 -= 20; + if (D_800A0932 < 0) { + D_800A0932 = 0; } - set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]); + set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932); } break; case 4: @@ -398,7 +394,7 @@ void state_step_exit_file_select(void) { } break; case 1: - if (temp_s0 == 0 || update_exit_map_screen_overlay(D_800A0932) != 0) { + if (temp_s0 == 0 || update_exit_map_screen_overlay(&D_800A0932) != 0) { D_800A0931 = 2; } break; diff --git a/src/state_title_screen.c b/src/state_title_screen.c index f37ed2ad80..e47156697e 100644 --- a/src/state_title_screen.c +++ b/src/state_title_screen.c @@ -122,7 +122,7 @@ void state_init_title_screen(void) { gOverrideFlags = 0; timeFreezeMode = 0; - D_8014C248 = TRUE; + general_heap_create(); clear_printers(); sfx_set_reverb_mode(0); diff --git a/src/world/area_omo/omo_12/omo_12_3_npc.c b/src/world/area_omo/omo_12/omo_12_3_npc.c index bd947d5d97..1046881373 100644 --- a/src/world/area_omo/omo_12/omo_12_3_npc.c +++ b/src/world/area_omo/omo_12/omo_12_3_npc.c @@ -184,11 +184,6 @@ Vec3f N(WattLeftFlightPath)[] = { { -60.0, 30.0, 0.0 }, }; -BombTrigger N(BombPos_Lantern_Unused) = { - .pos = { 0.0f, 0.0f, 20.0f }, - .diameter = 0.0f -}; - EvtScript N(EVS_Scene_ReleaseWatt) = { Call(DisablePlayerInput, TRUE) Call(N(DisableCameraLeadingPlayer)) diff --git a/src/world/partners.c b/src/world/partners.c index 8dd778e8fb..76e99ce440 100644 --- a/src/world/partners.c +++ b/src/world/partners.c @@ -158,6 +158,13 @@ void _use_partner_ability(void); void partner_flying_follow_player(Npc*); void partner_move_to_goal(Npc*, s32); +typedef struct UseItemStruct { + /* 0x00 */ u8* dmaStart; + /* 0x04 */ u8* dmaEnd; + /* 0x08 */ EvtScript* main; + /* 0x0C */ s32 unk_0C; +} UseItemStruct; + // Partner icons HudScript* wPartnerHudScripts[] = { &HES_Partner0, &HES_Goombario, &HES_Kooper, &HES_Bombette, @@ -186,12 +193,7 @@ HudScript* SPStarHudScripts[] = { &HES_StatusStar1, &HES_StatusStar3, &HES_Statu }; s32 StatusBarSPIncrementOffsets[] = { -1, 1, 2, 4, 5, 7, 8, 0, 0, 0 }; -UseItemStruct UseItemDmaArgs = { - world_use_item_ROM_START, - world_use_item_ROM_END, - &EVS_World_UseItem, - 0 -}; + s32 D_800F8020 = 0; s32 wPartnerMoveGoalX = 0; s32 wPartnerMoveGoalZ = 0; @@ -504,7 +506,12 @@ PartnerAnimations gPartnerAnimations[] = { }}, }; -extern UseItemStruct UseItemDmaArgs; +UseItemStruct UseItemDmaArgs = { + world_use_item_ROM_START, + world_use_item_ROM_END, + &EVS_World_UseItem, + 0 +}; BSS s32 D_8010CD20; diff --git a/src/world/world.c b/src/world/world.c index 4f7841e9ba..bb1a113857 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -22,14 +22,9 @@ #define ASSET_TABLE_FIRST_ENTRY (ASSET_TABLE_ROM_START + ASSET_TABLE_HEADER_SIZE) BSS MapConfig* gMapConfig; -BSS s32 D_800A41E4; BSS MapSettings gMapSettings; -#if VERSION_JP || VERSION_IQUE -char wMapHitName[0x14]; -#else char wMapHitName[0x18]; -#endif char wMapShapeName[0x18]; char wMapTexName[0x18]; char wMapBgName[0x14]; From ba65975884a312bc7ab9d3ef61fb74c1fdf7a859 Mon Sep 17 00:00:00 2001 From: z64a Date: Sun, 19 May 2024 18:05:20 -0400 Subject: [PATCH 13/14] remove NOP fixes --- include/macros.h | 8 ---- src/audio/25f00_len_940.c | 2 - src/battle/16C8E0.c | 2 - src/heap.c | 6 +-- src/main.c | 4 -- src/os/nusys/nuboot.c | 2 - src/os/nusys/nucontmgr.c | 8 ---- src/os/nusys/nusched.c | 2 - src/world/area_kmr/kmr_02/kmr_02_3_npc.c | 2 - .../todo/ItemChoice_WaitForSelection.inc.c | 2 - src/world/script_api/shops.c | 46 +++++++++---------- 11 files changed, 24 insertions(+), 60 deletions(-) diff --git a/include/macros.h b/include/macros.h index 040a1220bc..ebd9694c7a 100644 --- a/include/macros.h +++ b/include/macros.h @@ -46,14 +46,6 @@ #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) -#if !defined(PERMUTER) && !defined(M2CTX) && defined(OLD_GCC) -#define NOP_FIX __asm__(".set nogpopt"); -#define NOP_UNFIX __asm__(".set gpopt"); -#else -#define NOP_FIX -#define NOP_UNFIX -#endif - #define PTR_LIST_END ((void*) -1) #define API_CALLABLE(name) ApiStatus name(Evt* script, b32 isInitialCall) diff --git a/src/audio/25f00_len_940.c b/src/audio/25f00_len_940.c index c1a668f74a..e0979c4be9 100644 --- a/src/audio/25f00_len_940.c +++ b/src/audio/25f00_len_940.c @@ -4,8 +4,6 @@ #include "audio.h" #include "dx/profiling.h" -NOP_FIX - u8 nuAuPreNMI = 0; NUAuPreNMIFunc nuAuPreNMIFunc = NULL; s32 nuAuDmaNext = 0; diff --git a/src/battle/16C8E0.c b/src/battle/16C8E0.c index 29ceeaf0c0..086638852c 100644 --- a/src/battle/16C8E0.c +++ b/src/battle/16C8E0.c @@ -937,8 +937,6 @@ void btl_draw_enemy_health_bars(void) { } } -NOP_FIX - void btl_update_starpoints_display(void) { BattleStatus* battleStatus = &gBattleStatus; s32 cond; diff --git a/src/heap.c b/src/heap.c index 7aa150a715..42c9ec1e75 100644 --- a/src/heap.c +++ b/src/heap.c @@ -32,10 +32,10 @@ s32 func_8002ACDC(void) { } void* heap_malloc(s32 size) { - if (!gGameStatusPtr->isBattle) { - return general_heap_malloc(size); - } else { + if (gGameStatusPtr->isBattle) { return _heap_malloc(&heap_battleHead, size); + } else { + return general_heap_malloc(size); } } diff --git a/src/main.c b/src/main.c index 5462eadac4..f90bba513c 100644 --- a/src/main.c +++ b/src/main.c @@ -203,10 +203,6 @@ void appendGfx_reset_tile_pattern(void) { gCurrentDisplayContextIndex ^= 1; } -#if VERSION_IQUE -NOP_FIX -#endif - void gfxPreNMI_Callback(void) { ResetGameState = RESET_STATE_INIT; nuContRmbForceStop(); diff --git a/src/os/nusys/nuboot.c b/src/os/nusys/nuboot.c index 8220035dbe..4824455de5 100644 --- a/src/os/nusys/nuboot.c +++ b/src/os/nusys/nuboot.c @@ -3,8 +3,6 @@ #include "functions.h" #include "variables.h" -NOP_FIX - u64 nuMainStack[NU_SC_STACK_SIZE / sizeof(u64)]; static OSThread IdleThread; // idle thread, id 1 static OSThread MainThread; // id 3 diff --git a/src/os/nusys/nucontmgr.c b/src/os/nusys/nucontmgr.c index 176cefea6b..96c6e69177 100644 --- a/src/os/nusys/nucontmgr.c +++ b/src/os/nusys/nucontmgr.c @@ -1,8 +1,6 @@ #include "common.h" #include "nu/nusys.h" -NOP_FIX - OSMesgQueue nuContWaitMesgQ; static OSMesg nuContWaitMesgBuf; OSMesgQueue nuContDataMutexQ; @@ -84,8 +82,6 @@ static inline void nuContDataOpen_inline(void) { osRecvMesg(&nuContDataMutexQ, NULL, OS_MESG_BLOCK); } -NOP_UNFIX - static inline s32 contReadData(OSContPad* pad, u32 lockflag) { s32 rtn; @@ -101,9 +97,7 @@ static inline s32 contReadData(OSContPad* pad, u32 lockflag) { } nuContDataClose_inline(); - NOP_FIX osContGetReadData(pad); - NOP_UNFIX nuContDataOpen_inline(); return rtn; @@ -148,8 +142,6 @@ static s32 contReadNW(NUSiCommonMesg* mesg) { return rtn; } -NOP_FIX - static s32 contQuery(NUSiCommonMesg* mesg) { s32 ret = osContStartQuery(&nuSiMesgQ); diff --git a/src/os/nusys/nusched.c b/src/os/nusys/nusched.c index 991bafa235..2a856d2169 100644 --- a/src/os/nusys/nusched.c +++ b/src/os/nusys/nusched.c @@ -1,8 +1,6 @@ #include "common.h" #include "nu/nusys.h" -NOP_FIX - NUSched nusched; NUScPreNMIFunc nuScPreNMIFunc = NULL; u8 nuScPreNMIFlag; diff --git a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c index 5b7d46ba08..df18228257 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c +++ b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c @@ -1324,7 +1324,6 @@ EvtScript N(EVS_NpcInteract_Toad) = { #include "world/common/todo/SyncStatusBar.inc.c" -NOP_FIX // TODO figure out BSS nop issue API_CALLABLE(N(func_8024295C_8B29CC)) { Bytecode* args = script->ptrReadPos; s32 targetColR = evt_get_variable(script, *args++); @@ -1356,7 +1355,6 @@ API_CALLABLE(N(func_8024295C_8B29CC)) { } return ApiStatus_BLOCK; } -NOP_UNFIX API_CALLABLE(N(func_80242BA8_8B2C18)) { *gBackgroundTintModePtr = ENV_TINT_SHROUD; diff --git a/src/world/common/todo/ItemChoice_WaitForSelection.inc.c b/src/world/common/todo/ItemChoice_WaitForSelection.inc.c index a115a925ee..c58b1ba3fd 100644 --- a/src/world/common/todo/ItemChoice_WaitForSelection.inc.c +++ b/src/world/common/todo/ItemChoice_WaitForSelection.inc.c @@ -1,6 +1,5 @@ #include "common.h" -NOP_FIX API_CALLABLE(N(ItemChoice_WaitForSelection)) { Bytecode* args = script->ptrReadPos; @@ -16,4 +15,3 @@ API_CALLABLE(N(ItemChoice_WaitForSelection)) { return ApiStatus_BLOCK; } -NOP_UNFIX diff --git a/src/world/script_api/shops.c b/src/world/script_api/shops.c index a034078efb..400b3d2276 100644 --- a/src/world/script_api/shops.c +++ b/src/world/script_api/shops.c @@ -8,6 +8,8 @@ extern u8 MessagePlural[]; extern u8 MessageSingular[]; extern HudScript HES_ItemCoin; +void create_shop_popup_menu(PopupMenu* popup); + s32 shop_get_sell_price(s32 itemID); API_CALLABLE(CanInteractWithShopItem); @@ -364,53 +366,47 @@ API_CALLABLE(ShowShopPurchaseDialog) { return ApiStatus_BLOCK; } -void create_shop_popup_menu(PopupMenu* popup); +enum { + ITEM_POPUP_SELL = 0, + ITEM_POPUP_CHECK = 1, + ITEM_POPUP_CLAIM = 2, +}; void shop_open_item_select_popup(s32 mode) { PopupMenu* menu = &gGameStatusPtr->mapShop->itemSelectMenu; + s16* itemArray; s32 numItemSlots; s32 popupType; s32 numEntries; - s32 itemID; s32 i; switch (mode) { - case 0: + case ITEM_POPUP_SELL: popupType = POPUP_MENU_SELL_ITEM; numItemSlots = ARRAY_COUNT(gPlayerData.invItems); + itemArray = gPlayerData.invItems; break; - case 1: + case ITEM_POPUP_CHECK: popupType = POPUP_MENU_CHECK_ITEM; numItemSlots = ARRAY_COUNT(gPlayerData.invItems); + itemArray = gPlayerData.invItems; break; + case ITEM_POPUP_CLAIM: default: popupType = POPUP_MENU_CLAIM_ITEM; numItemSlots = ARRAY_COUNT(gPlayerData.storedItems); + itemArray = gPlayerData.storedItems; break; } numEntries = 0; for (i = 0; i < numItemSlots; i++) { - ItemData* itemData; - - switch (mode) { - case 0: - case 1: - itemID = gPlayerData.invItems[i]; - if (itemID == ITEM_NONE) { - continue; - } - itemData = &gItemTable[itemID]; - break; - default: - itemID = gPlayerData.storedItems[i]; - if (itemID == ITEM_NONE) { - continue; - } - itemData = &gItemTable[itemID]; - break; + s32 itemID = itemArray[i]; + if (itemID == ITEM_NONE) { + continue; } + ItemData* itemData = &gItemTable[itemID]; menu->ptrIcon[numEntries] = gItemHudScripts[itemData->hudElemID].enabled; menu->userIndex[numEntries] = i; @@ -572,7 +568,7 @@ API_CALLABLE(ShowShopOwnerDialog) { break; case DIALOG_STATE_INIT_SELL_CHOICE: if (!does_script_exist(script->functionTemp[1])) { - shop_open_item_select_popup(0); + shop_open_item_select_popup(ITEM_POPUP_SELL); script->functionTemp[0] = DIALOG_STATE_AWAIT_SELL_CHOICE; } break; @@ -647,7 +643,7 @@ API_CALLABLE(ShowShopOwnerDialog) { break; case DIALOG_STATE_INIT_CHECK_CHOICE: if (does_script_exist(script->functionTemp[1]) == 0) { - shop_open_item_select_popup(1); + shop_open_item_select_popup(ITEM_POPUP_CHECK); script->functionTemp[0] = DIALOG_STATE_AWAIT_CHECK_CHOICE; } break; @@ -700,7 +696,7 @@ API_CALLABLE(ShowShopOwnerDialog) { break; case DIALOG_STATE_INIT_CLAIM_CHOICE: if (!does_script_exist(script->functionTemp[1])) { - shop_open_item_select_popup(2); + shop_open_item_select_popup(ITEM_POPUP_CLAIM); script->functionTemp[0] = DIALOG_STATE_AWAIT_CLAIM_CHOICE; } break; From 437f6dc2b832ce039b5e3e14b07a55a3d8018587 Mon Sep 17 00:00:00 2001 From: z64a Date: Mon, 20 May 2024 01:44:09 -0400 Subject: [PATCH 14/14] remove all M2CTX, PERMUTER, MATCHING_BSS, do while(0) --- include/common.h | 4 - include/include_asm.h | 2 +- include/macros.h | 23 -- include/script_api/macros.h | 16 - include/stdlib/stdarg.h | 2 - src/7E9D0.c | 25 +- src/audio/25f00_len_940.c | 47 ++- src/battle/190B20.c | 323 +++++++----------- src/battle/1A5830.c | 4 +- src/battle/actor_rendering.c | 247 ++++++-------- src/battle/area/kzn2/actor/lava_bud.c | 2 - src/battle/btl_states_actions.c | 172 +++++----- src/battle/btl_states_menus.c | 114 +++---- src/battle/dmg_player.c | 68 ++-- src/battle/move/jump/earthquake_jump.c | 2 - src/battle/partner/lakilester.c | 4 +- src/battle/partner/parakarry.c | 2 +- src/battle/partner/sushie.c | 2 +- src/battle/use_star_powers.c | 2 - src/effects/squirt.c | 1 - src/encounter.c | 27 +- src/entity.c | 1 - src/entity/default/BombableRock.c | 2 - src/evt/evt.c | 10 +- src/inspect_icon.c | 2 - src/inventory.c | 1 - src/item_entity.c | 199 ++++++----- src/msg.c | 38 +-- src/msg_draw.c | 1 - src/msg_img.c | 8 +- src/npc.c | 36 +- src/os/pfsisplug.c | 5 - src/state_pause.c | 8 +- src/world/action/hammer.c | 6 +- src/world/action/use_spinning_flower.c | 2 - src/world/area_dgb/dgb_01/dgb_01_7.c | 2 - src/world/area_nok/nok_02/npcs_crisis.inc.c | 24 +- src/world/area_omo/omo_07/omo_07_4_npc.c | 7 +- .../common/atomic/PushBlockGravity.inc.c | 4 +- src/world/common/enemy/ai/FlyingAI.inc.c | 46 ++- src/world/common/enemy/ai/HoppingAI.inc.c | 20 +- src/world/menus.c | 4 +- src/world/model_anim/kzn/0A.c | 2 - src/world/partner/lakilester.c | 2 - src/world/script_api/enter_exit.c | 16 +- src/world/script_api/push_blocks.c | 4 +- src/world/surfaces.c | 4 +- src/world_use_item.c | 2 - tools/build/configure.py | 19 -- tools/m2ctx.py | 74 ---- 50 files changed, 642 insertions(+), 996 deletions(-) delete mode 100755 tools/m2ctx.py diff --git a/include/common.h b/include/common.h index 620aa756d0..10688203e9 100644 --- a/include/common.h +++ b/include/common.h @@ -15,8 +15,4 @@ #include "battle/stage_names.h" #include "battle/actor_types.h" -#ifdef PERMUTER -extern int TEXEL0, TEXEL1, PRIMITIVE, PRIMITIVE_ALPHA; -#endif - #endif diff --git a/include/include_asm.h b/include/include_asm.h index 747cbf7022..e62bedad08 100644 --- a/include/include_asm.h +++ b/include/include_asm.h @@ -4,7 +4,7 @@ #define STRINGIFY_(x) #x #define STRINGIFY(x) STRINGIFY_(x) -#if !defined(SPLAT) && !defined(__CTX__) && !defined(PERMUTER) +#if !defined(SPLAT) && !defined(__CTX__) #ifndef INCLUDE_ASM #define INCLUDE_ASM_INTERNAL(TYPE, BASE_FOLDER, FOLDER, NAME, ARGS...) \ __asm__( \ diff --git a/include/macros.h b/include/macros.h index ebd9694c7a..3d3314dad6 100644 --- a/include/macros.h +++ b/include/macros.h @@ -4,27 +4,8 @@ #include "types.h" #include "include_asm.h" -#ifndef M2CTX - -#ifdef SHIFT -#define SHIFT_BSS __attribute__ ((section (".bss"))) -#else -#define SHIFT_BSS extern -#endif - -#ifdef SHIFT -#define MATCHING_BSS(size) -#else -#define MATCHING_BSS(size) static BSS u8 padding_bss[size]; -#endif - #define BSS __attribute__ ((nocommon, section (".bss"))) #define TRANSPARENT_UNION __attribute__ ((__transparent_union__)) -#else -#define SHIFT_BSS static -#define BSS static -#define TRANSPARENT_UNION -#endif #define ALIGNED(x) __attribute__((aligned(x))) @@ -523,10 +504,6 @@ #define VLA #endif -#ifdef M2CTX -#define VLA 0 -#endif - #if VERSION_PAL #define DT (50.0f/60.0f) #else diff --git a/include/script_api/macros.h b/include/script_api/macros.h index 91f570da5d..437f5667ee 100644 --- a/include/script_api/macros.h +++ b/include/script_api/macros.h @@ -200,26 +200,10 @@ /// } /// This macro expands to the given opcode and argv, with argc calculated automatically. -#ifndef PERMUTER -#ifndef M2CTX #define EVT_CMD(opcode, argv...) \ opcode, \ (sizeof((Bytecode[]){argv})/sizeof(Bytecode)), \ ##argv -#else -// This definition that passes in 0 for the number of args is used for pycparser since it can't handle varargs -#define EVT_CMD(opcode, argv...) \ - opcode, \ - 0, \ - ##argv -#endif -#else -// This definition that passes in 0 for the number of args is used for pycparser since it can't handle varargs -#define EVT_CMD(opcode, argv...) \ - opcode, \ - 0, \ - ##argv -#endif /// Signals the end of EVT script data. A script missing this will likely crash on load. #define End EVT_CMD(EVT_OP_END), diff --git a/include/stdlib/stdarg.h b/include/stdlib/stdarg.h index b87f88f8fa..a3f1f2d587 100644 --- a/include/stdlib/stdarg.h +++ b/include/stdlib/stdarg.h @@ -90,9 +90,7 @@ typedef void *__gnuc_va_list; (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG))) #undef va_end -#ifndef M2CTX void va_end (__gnuc_va_list); /* Defined in libgcc.a */ -#endif #define va_end(AP) ((void)0) /* We cast to void * and then to TYPE * because this avoids diff --git a/src/7E9D0.c b/src/7E9D0.c index 7e608ec520..e5416eca2b 100644 --- a/src/7E9D0.c +++ b/src/7E9D0.c @@ -12,21 +12,18 @@ #include "sprite/npc/WorldKoopatrol.h" #include "sprite/npc/HammerBros.h" -#ifdef SHIFT +//TODO memory layout? #define PLAYER_ACTION_VRAM_DEF texture_memory_VRAM_END -#else -#define PLAYER_ACTION_VRAM_DEF (void*) 0x802B6000 -#endif - -SHIFT_BSS void* LastLoadedActionOffset; -SHIFT_BSS s32 PeachDisguiseReapplyDelay; -SHIFT_BSS s32 D_8010C964; -SHIFT_BSS s32 gSpinHistoryBufferPos; -SHIFT_BSS s16 D_8010C9B0; -SHIFT_BSS s32 gSpinHistoryPosX[5]; -SHIFT_BSS s32 gSpinHistoryPosY[5]; -SHIFT_BSS s32 gSpinHistoryPosZ[5]; -SHIFT_BSS s16 gSpinHistoryPosAngle[5]; + +void* LastLoadedActionOffset; +s32 PeachDisguiseReapplyDelay; +s32 D_8010C964; +s32 gSpinHistoryBufferPos; +s16 D_8010C9B0; +s32 gSpinHistoryPosX[5]; +s32 gSpinHistoryPosY[5]; +s32 gSpinHistoryPosZ[5]; +s16 gSpinHistoryPosAngle[5]; s32 PrevPlayerCamRelativeYaw = 0; s32 D_800F7B44 = 0; // always zero, remove? diff --git a/src/audio/25f00_len_940.c b/src/audio/25f00_len_940.c index e0979c4be9..570e916d14 100644 --- a/src/audio/25f00_len_940.c +++ b/src/audio/25f00_len_940.c @@ -275,39 +275,34 @@ ALDMAproc nuAuDmaNew(NUDMAState** state) { void nuAuCleanDMABuffers(void) { NUDMAState* state = &nuAuDmaState; NUDMABuffer* dmaPtr = state->firstUsed; + NUDMABuffer* nextPtr; + u32* frameCounter; - // A bit odd, this - do { - NUDMAState* state = &nuAuDmaState; - NUDMABuffer* nextPtr; - u32* frameCounter; - - while (dmaPtr != NULL) { - nextPtr = (NUDMABuffer*)dmaPtr->node.next; + while (dmaPtr != NULL) { + nextPtr = (NUDMABuffer*)dmaPtr->node.next; - if (dmaPtr->frameCnt + 1 < nuAuFrameCounter) { - if (state->firstUsed == dmaPtr) { - state->firstUsed = nextPtr; - } + if (dmaPtr->frameCnt + 1 < nuAuFrameCounter) { + if (state->firstUsed == dmaPtr) { + state->firstUsed = nextPtr; + } - alUnlink(&dmaPtr->node); + alUnlink(&dmaPtr->node); - if (state->firstFree != 0) { - alLink(&dmaPtr->node, &state->firstFree->node); - } else { - state->firstFree = dmaPtr; - dmaPtr->node.next = 0; - dmaPtr->node.prev = 0; - } + if (state->firstFree != 0) { + alLink(&dmaPtr->node, &state->firstFree->node); + } else { + state->firstFree = dmaPtr; + dmaPtr->node.next = 0; + dmaPtr->node.prev = 0; } - - dmaPtr = nextPtr; } - nuAuDmaNext = 0; - frameCounter = &nuAuFrameCounter; - *frameCounter += 1; - } while (0); + dmaPtr = nextPtr; + } + + nuAuDmaNext = 0; + frameCounter = &nuAuFrameCounter; + *frameCounter += 1; } void nuAuPreNMIProc(NUScMsg mesg_type, u32 frameCounter) { diff --git a/src/battle/190B20.c b/src/battle/190B20.c index b2fa6f0587..1704bc3257 100644 --- a/src/battle/190B20.c +++ b/src/battle/190B20.c @@ -211,11 +211,7 @@ void create_target_list(Actor* actor, b32 targetHomePos) { } else if (targetDataList->sortPos.y < 100) { targetDataList->row = 2; } else { - do { - do { - targetDataList->row = 3; - } while (0); - } while (0); + targetDataList->row = 3; } // determine nearest target column @@ -226,9 +222,7 @@ void create_target_list(Actor* actor, b32 targetHomePos) { } else if (targetDataList->sortPos.x < 105) { targetDataList->column = 2; } else { - do { - targetDataList->column = 3; - } while (0); + targetDataList->column = 3; } // determine nearest target layer @@ -319,24 +313,18 @@ void create_target_list(Actor* actor, b32 targetHomePos) { if (target->actorID == ACTOR_PLAYER || target->actorID == ACTOR_PARTNER) { continue; } - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_JUMP_LIKE) && (targetPart->targetFlags & ACTOR_PART_TARGET_NO_JUMP)) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_SMASH_LIKE) && (targetPart->targetFlags & ACTOR_PART_TARGET_NO_SMASH)) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_TATTLE) && ((targetActor->flags & ACTOR_FLAG_NO_TATTLE) || (targetPart->flags & ACTOR_PART_FLAG_NO_TATTLE))) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); + if ((battleStatus->curTargetListFlags & TARGET_FLAG_JUMP_LIKE) && (targetPart->targetFlags & ACTOR_PART_TARGET_NO_JUMP)) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_SMASH_LIKE) && (targetPart->targetFlags & ACTOR_PART_TARGET_NO_SMASH)) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_TATTLE) && ((targetActor->flags & ACTOR_FLAG_NO_TATTLE) || (targetPart->flags & ACTOR_PART_FLAG_NO_TATTLE))) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } if ((battleStatus->curTargetListFlags & TARGET_FLAG_AIRLIFT) && (targetActor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { removeTarget = TRUE; goto SECOND_PASS_REMOVE; @@ -369,20 +357,18 @@ void create_target_list(Actor* actor, b32 targetHomePos) { // skip the current target if any are found s32 foundAbove = FALSE; - do { - for (j = 0; j < numTargets; j++) { - otherTarget = &targetDataList[j]; - if (target != otherTarget) { - if (target->layer == otherTarget->layer - && target->column == otherTarget->column - && target->row < otherTarget->row - ) { - foundAbove = TRUE; - break; - } + for (j = 0; j < numTargets; j++) { + otherTarget = &targetDataList[j]; + if (target != otherTarget) { + if (target->layer == otherTarget->layer + && target->column == otherTarget->column + && target->row < otherTarget->row + ) { + foundAbove = TRUE; + break; } } - } while (0); + } if (foundAbove) { removeTarget = TRUE; @@ -414,60 +400,42 @@ void create_target_list(Actor* actor, b32 targetHomePos) { } } - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_NOT_FLYING) && (targetActor->flags & ACTOR_FLAG_FLYING)) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_RIGHT) && target->row == sampleRow + 1) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_LEFT) && target->row == sampleRow - 1) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_BELOW) && target->column == sampleCol - 1) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_ABOVE) && target->column == sampleCol + 1) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_RIGHT) && target->row < sampleRow) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_LEFT) && target->row > sampleRow) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_BELOW) && target->column > sampleCol) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); - do { - if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_ABOVE) && target->column < sampleCol) { - removeTarget = TRUE; - goto SECOND_PASS_REMOVE; - } - } while (0); + if ((battleStatus->curTargetListFlags & TARGET_FLAG_NOT_FLYING) && (targetActor->flags & ACTOR_FLAG_FLYING)) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_RIGHT) && target->row == sampleRow + 1) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_LEFT) && target->row == sampleRow - 1) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_BELOW) && target->column == sampleCol - 1) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_ABOVE) && target->column == sampleCol + 1) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_RIGHT) && target->row < sampleRow) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_LEFT) && target->row > sampleRow) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_BELOW) && target->column > sampleCol) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } + if ((battleStatus->curTargetListFlags & TARGET_FLAG_DIR_ABOVE) && target->column < sampleCol) { + removeTarget = TRUE; + goto SECOND_PASS_REMOVE; + } // target passed all checks, do not remove removeTarget = FALSE; @@ -739,23 +707,21 @@ void btl_init_menu_boots(void) { battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK; // Jump badges - do { - for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) { - s16 badge = playerData->equippedBadges[i]; - - if (badge != ITEM_NONE) { - MoveData* moveTable = gMoveTable; - u8 moveID = gItemTable[badge].moveID; - - move = &moveTable[moveID]; - if (move->category == MOVE_TYPE_JUMP) { - battleStatus->submenuMoves[moveCount] = moveID; - battleStatus->submenuIcons[moveCount] = playerData->equippedBadges[i]; - moveCount++; - } + for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) { + s16 badge = playerData->equippedBadges[i]; + + if (badge != ITEM_NONE) { + MoveData* moveTable = gMoveTable; + u8 moveID = gItemTable[badge].moveID; + + move = &moveTable[moveID]; + if (move->category == MOVE_TYPE_JUMP) { + battleStatus->submenuMoves[moveCount] = moveID; + battleStatus->submenuIcons[moveCount] = playerData->equippedBadges[i]; + moveCount++; } } - } while (0); + } battleStatus->submenuMoveCount = moveCount; @@ -835,21 +801,19 @@ void btl_init_menu_hammer(void) { battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK; // Hammer badges - do { - for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) { - s16 badge = playerData->equippedBadges[i]; - if (badge != MOVE_NONE) { - MoveData* moveTable = gMoveTable; - u8 moveID = gItemTable[badge].moveID; - move = &moveTable[moveID]; - if (move->category == MOVE_TYPE_HAMMER) { - battleStatus->submenuMoves[moveCount] = moveID; - battleStatus->submenuIcons[moveCount] = playerData->equippedBadges[i]; - moveCount++; - } + for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) { + s16 badge = playerData->equippedBadges[i]; + if (badge != MOVE_NONE) { + MoveData* moveTable = gMoveTable; + u8 moveID = gItemTable[badge].moveID; + move = &moveTable[moveID]; + if (move->category == MOVE_TYPE_HAMMER) { + battleStatus->submenuMoves[moveCount] = moveID; + battleStatus->submenuIcons[moveCount] = playerData->equippedBadges[i]; + moveCount++; } } - } while (0); + } battleStatus->submenuMoveCount = moveCount; @@ -2398,17 +2362,15 @@ void show_damage_fx(Actor* actor, f32 x, f32 y, f32 z, s32 damage) { intensity = DAMAGE_INTENSITY_EXTREME; } - do { - if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) { - fx_ring_blast(0, x, y, z, 1.0f, 24); - } else if (battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) { - apply_shock_effect(actor); - } else if (battleStatus->curAttackElement & DAMAGE_TYPE_WATER) { - fx_water_splash(0, x, y, z, 1.0f, 24); - } else { - fx_firework(0, x, y, z, 1.0, intensity); - } - } while (0); // required to match + if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) { + fx_ring_blast(0, x, y, z, 1.0f, 24); + } else if (battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) { + apply_shock_effect(actor); + } else if (battleStatus->curAttackElement & DAMAGE_TYPE_WATER) { + fx_water_splash(0, x, y, z, 1.0f, 24); + } else { + fx_firework(0, x, y, z, 1.0, intensity); + } } // grossness @@ -2634,20 +2596,17 @@ s32 try_inflict_status(Actor* actor, s32 statusTypeKey, s32 statusKey) { } s32 inflict_status_set_duration(Actor* actor, s32 statusTypeKey, s32 statusDurationKey, s32 duration) { - s32 var0 = duration; // TODO required to match, look into s32 statusDuration = 0; if (actor->statusTable == NULL || lookup_status_chance(actor->statusTable, statusTypeKey) > 0) { - statusDuration = var0; + statusDuration = duration; } if (statusDuration > 0) { return inflict_status(actor, statusTypeKey, statusDuration); } else { - var0 = 0; + return 0; } - - return 0; } void set_part_pal_adjustment(ActorPart* part, s32 palAdjust) { @@ -2663,16 +2622,13 @@ void set_part_pal_adjustment(ActorPart* part, s32 palAdjust) { } void set_actor_pal_adjustment(Actor* actor, s32 palAdjust) { - ActorPart* partIt = &actor->partsTable[0]; - - while (partIt != NULL) { - if (!(partIt->flags & ACTOR_PART_FLAG_INVISIBLE) - && (partIt->idleAnimations != NULL) - && !(partIt->flags & ACTOR_PART_FLAG_NO_DECORATIONS) + for (ActorPart* part = actor->partsTable; part != NULL; part = part->nextPart) { + if (!(part->flags & ACTOR_PART_FLAG_INVISIBLE) + && (part->idleAnimations != NULL) + && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) ) { - set_part_pal_adjustment(partIt, palAdjust); + set_part_pal_adjustment(part, palAdjust); } - partIt = partIt->nextPart; } } @@ -2682,27 +2638,21 @@ void clear_part_pal_adjustment(ActorPart* part) { } } -// TODO: improve match void clear_actor_static_pal_adjustments(Actor* actor) { - ActorPart* part = actor->partsTable; - s8 e = ACTOR_PAL_ADJUST_BLEND_PALETTES_UNIFORM_INTERVALS; - s8 f = ACTOR_PAL_ADJUST_BLEND_PALETTES_VARYING_INTERVALS; - - while (part != NULL) { + for (ActorPart* part = actor->partsTable; part != NULL; part = part->nextPart) { DecorationTable* decorations = part->decorationTable; - do { - if (!(part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) - && !(part->flags & ACTOR_PART_FLAG_INVISIBLE) - && (part->idleAnimations != NULL) - && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) + if (!(part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) + && !(part->flags & ACTOR_PART_FLAG_INVISIBLE) + && (part->idleAnimations != NULL) + && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) + ) { + if (decorations->paletteAdjustment != ACTOR_PAL_ADJUST_BLEND_PALETTES_UNIFORM_INTERVALS + && decorations->paletteAdjustment != ACTOR_PAL_ADJUST_BLEND_PALETTES_VARYING_INTERVALS ) { - if (decorations->paletteAdjustment != e && decorations->paletteAdjustment != f) { - decorations->paletteAdjustment = ACTOR_PAL_ADJUST_NONE; - } + decorations->paletteAdjustment = ACTOR_PAL_ADJUST_NONE; } - } while (0); // required to match - part = part->nextPart; + } } } @@ -2719,9 +2669,7 @@ void set_part_glow_pal(ActorPart* part, s32 glowState) { } void set_actor_glow_pal(Actor* actor, s32 glowState) { - ActorPart* part; - - for (part = actor->partsTable; part != NULL; part = part->nextPart) { + for (ActorPart* part = actor->partsTable; part != NULL; part = part->nextPart) { if (!(part->flags & (ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION | ACTOR_PART_FLAG_INVISIBLE)) && (part->idleAnimations != NULL) && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) @@ -2738,19 +2686,15 @@ void clear_part_glow_pal(ActorPart* part) { } void clear_actor_glow_pal(Actor* actor) { - ActorPart* part; - - for (part = actor->partsTable; part != NULL; part = part->nextPart) { + for (ActorPart* part = actor->partsTable; part != NULL; part = part->nextPart) { DecorationTable* decorations = part->decorationTable; - do { - if (!(part->flags & (ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION | ACTOR_PART_FLAG_INVISIBLE)) - && part->idleAnimations != NULL - && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) - ) { - decorations->glowState = GLOW_PAL_OFF; - } - } while (0); // required to match + if (!(part->flags & (ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION | ACTOR_PART_FLAG_INVISIBLE)) + && part->idleAnimations != NULL + && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) + ) { + decorations->glowState = GLOW_PAL_OFF; + } } } @@ -2767,9 +2711,7 @@ void set_part_flash_mode(ActorPart* part, s32 flashState) { } void set_actor_flash_mode(Actor* actor, s32 flashState) { - ActorPart* part; - - for (part = actor->partsTable; part != NULL; part = part->nextPart) { + for (ActorPart* part = actor->partsTable; part != NULL; part = part->nextPart) { if (!(part->flags & (ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) && part->decorationTable != NULL && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) @@ -2787,19 +2729,15 @@ void clear_part_flash_mode(ActorPart* part) { } void clear_actor_flash_mode(Actor* actor) { - ActorPart* part; - - for (part = actor->partsTable; part != NULL; part = part->nextPart) { + for (ActorPart* part = actor->partsTable; part != NULL; part = part->nextPart) { DecorationTable* decorations = part->decorationTable; - do { - if (!(part->flags & (ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION | ACTOR_PART_FLAG_INVISIBLE)) && - (part->idleAnimations != NULL) && - !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS)) - { - decorations->flashState = 0; - } - } while (0); // TODO make match better + if (!(part->flags & (ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION | ACTOR_PART_FLAG_INVISIBLE)) + && (part->idleAnimations != NULL) + && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) + ) { + decorations->flashState = 0; + } } } @@ -2816,8 +2754,7 @@ void add_part_decoration(ActorPart* part, s32 decorationIndex, s32 decorationTyp } void add_actor_decoration(Actor* actor, s32 decorationIndex, s32 decorationType) { - ActorPart* part; - for (part = actor->partsTable; part != NULL; part = part->nextPart) { + for (ActorPart* part = actor->partsTable; part != NULL; part = part->nextPart) { if (!(part->flags & (ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) && part->idleAnimations && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) @@ -2832,11 +2769,9 @@ void remove_part_decoration(ActorPart* part, s32 decorationIndex) { } void remove_actor_decoration(Actor* actor, s32 decorationIndex) { - ActorPart* part; - - for (part = actor->partsTable; part != NULL; part = part->nextPart) { + for (ActorPart* part = actor->partsTable; part != NULL; part = part->nextPart) { if (!(part->flags & (ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) - && part->idleAnimations + && part->idleAnimations != NULL && !(part->flags & ACTOR_PART_FLAG_NO_DECORATIONS) ) { remove_part_decoration(part, decorationIndex); diff --git a/src/battle/1A5830.c b/src/battle/1A5830.c index 15724e120a..8cc2ff61c2 100644 --- a/src/battle/1A5830.c +++ b/src/battle/1A5830.c @@ -307,9 +307,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION) ) { - do { - play_hit_sound(attacker, state->goalPos.x, state->goalPos.y, state->goalPos.z, 3); - } while (0); // TODO required to match + play_hit_sound(attacker, state->goalPos.x, state->goalPos.y, state->goalPos.z, 3); dispatch_event_general(target, EVENT_EXPLODE_TRIGGER); return HIT_RESULT_BACKFIRE; } diff --git a/src/battle/actor_rendering.c b/src/battle/actor_rendering.c index 2cd4cb3594..d50ee08dca 100644 --- a/src/battle/actor_rendering.c +++ b/src/battle/actor_rendering.c @@ -916,13 +916,11 @@ void appendGfx_npc_actor(b32 isPartner, s32 actorIndex) { actor->size.x * actor->scalingFactor); } - do { - if (actor->debuff == STATUS_KEY_SHRINK) { - actor->scalingFactor += ((0.4 - actor->scalingFactor) / 6.0); - } else { - actor->scalingFactor += ((1.0 - actor->scalingFactor) / 6.0); - } - } while (0); // required to match + if (actor->debuff == STATUS_KEY_SHRINK) { + actor->scalingFactor += ((0.4 - actor->scalingFactor) / 6.0); + } else { + actor->scalingFactor += ((1.0 - actor->scalingFactor) / 6.0); + } if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { guTranslateF(mtxPivotOn, @@ -999,24 +997,20 @@ void appendGfx_npc_actor(b32 isPartner, s32 actorIndex) { part->flags &= ~ACTOR_PART_FLAG_TRANSPARENT; } - do { - lastAnim = part->curAnimation; - animChanged = FALSE; - palChanged = FALSE; - decorChanged = FALSE; - } while (0); // required to match + lastAnim = part->curAnimation; + animChanged = FALSE; + palChanged = FALSE; + decorChanged = FALSE; if (isPartner) { if (!(gBattleStatus.flags2 & (BS_FLAGS2_OVERRIDE_INACTIVE_PARTNER)) && (gBattleStatus.flags2 & BS_FLAGS2_PARTNER_TURN_USED) ) { - do { - if (actor->koStatus == 0) { - part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_INACTIVE); - spr_update_sprite(part->spriteInstanceID, part->curAnimation, part->animationRate); - animChanged = TRUE; - } - } while (0); // required to match + if (actor->koStatus == 0) { + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_INACTIVE); + spr_update_sprite(part->spriteInstanceID, part->curAnimation, part->animationRate); + animChanged = TRUE; + } set_actor_pal_adjustment(actor, ACTOR_PAL_ADJUST_PLAYER_DEBUFF); palChanged = TRUE; set_actor_glow_pal(actor, GLOW_PAL_OFF); @@ -1108,8 +1102,6 @@ void appendGfx_npc_actor(b32 isPartner, s32 actorIndex) { part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_STATIC); animChanged = TRUE; } - - do {} while (0); // required to match } if (!animChanged) { part->curAnimation = get_npc_anim_for_status(part->idleAnimations, 1); @@ -1121,11 +1113,9 @@ void appendGfx_npc_actor(b32 isPartner, s32 actorIndex) { animChanged = TRUE; } else { s32 temp = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); - do { - if (temp == get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_DAZE)) { - part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); - } - } while (0); // required to match + if (temp == get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_DAZE)) { + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); + } } } if (actor->debuff == STATUS_KEY_STOP) { @@ -1133,32 +1123,27 @@ void appendGfx_npc_actor(b32 isPartner, s32 actorIndex) { create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_STOP); } else if (!animChanged) { s32 temp = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); - do { - if (temp == get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_STOP)) { - part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); - } - } while (0); // required to match + if (temp == get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_STOP)) { + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); + } } } } if (!(gBattleStatus.flags1 & BS_FLAGS1_TATTLE_OPEN) && (actor->flags & ACTOR_FLAG_SHOW_STATUS_ICONS)) { - do { - if (actor->debuff == STATUS_KEY_POISON) { - create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_POISON); - } else if (actor->debuff == STATUS_KEY_DIZZY) { - create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_DIZZY); - } else if (actor->debuff == STATUS_KEY_SLEEP) { - create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_SLEEP); - } else if (actor->debuff == STATUS_KEY_PARALYZE) { - create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_PARALYZE); - } else if (actor->debuff == STATUS_KEY_SHRINK) { - create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_SHRINK); - } else if (actor->debuff == STATUS_KEY_FROZEN) { - create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_FROZEN); - } - } while (0); // required to match - + if (actor->debuff == STATUS_KEY_POISON) { + create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_POISON); + } else if (actor->debuff == STATUS_KEY_DIZZY) { + create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_DIZZY); + } else if (actor->debuff == STATUS_KEY_SLEEP) { + create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_SLEEP); + } else if (actor->debuff == STATUS_KEY_PARALYZE) { + create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_PARALYZE); + } else if (actor->debuff == STATUS_KEY_SHRINK) { + create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_SHRINK); + } else if (actor->debuff == STATUS_KEY_FROZEN) { + create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_FROZEN); + } if (actor->staticStatus == STATUS_KEY_STATIC) { create_status_static(actor->hudElementDataIndex, STATUS_KEY_STATIC); } @@ -1563,13 +1548,11 @@ void appendGfx_player_actor(void* arg0) { battleStatus->buffEffect->data.partnerBuff->visible = FALSE; } - do { - if (player->debuff == STATUS_KEY_SHRINK) { - player->scalingFactor += (0.4 - player->scalingFactor) / 6.0; - } else { - player->scalingFactor += (1.0 - player->scalingFactor) / 6.0; - } - } while (0); // required to match + if (player->debuff == STATUS_KEY_SHRINK) { + player->scalingFactor += (0.4 - player->scalingFactor) / 6.0; + } else { + player->scalingFactor += (1.0 - player->scalingFactor) / 6.0; + } if (player->flags & ACTOR_FLAG_SHOW_STATUS_ICONS) { if (battleStatus->hammerCharge > 0) { @@ -1590,18 +1573,14 @@ void appendGfx_player_actor(void* arg0) { } if ((player->flags & ACTOR_FLAG_SHOW_STATUS_ICONS) && !(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE)) { - if (playerData->curHP > PERIL_THRESHOLD) { + if (playerData->curHP <= PERIL_THRESHOLD) { + create_status_icon_peril(player->hudElementDataIndex); + remove_status_icon_danger(player->hudElementDataIndex); + } else if (playerData->curHP <= DANGER_THRESHOLD) { remove_status_icon_peril(player->hudElementDataIndex); - do { - if (playerData->curHP <= DANGER_THRESHOLD) { - create_status_icon_danger(player->hudElementDataIndex); - remove_status_icon_peril(player->hudElementDataIndex); - } else { - remove_status_icon_danger(player->hudElementDataIndex); - } - } while (0); // required to match + create_status_icon_danger(player->hudElementDataIndex); } else { - create_status_icon_peril(player->hudElementDataIndex); + remove_status_icon_peril(player->hudElementDataIndex); remove_status_icon_danger(player->hudElementDataIndex); } } else { @@ -1615,13 +1594,11 @@ void appendGfx_player_actor(void* arg0) { playerParts->flags &= ~ACTOR_PART_FLAG_TRANSPARENT; } - do { - animChanged = FALSE; - palChanged = FALSE; - decorChanged = FALSE; - cond4 = FALSE; - lastAnim = playerParts->curAnimation; - } while (0); // required to match + animChanged = FALSE; + palChanged = FALSE; + decorChanged = FALSE; + cond4 = FALSE; + lastAnim = playerParts->curAnimation; if ((((!(gBattleStatus.flags2 & BS_FLAGS2_OVERRIDE_INACTIVE_PLAYER) && (gBattleStatus.flags2 & BS_FLAGS2_PLAYER_TURN_USED)) @@ -1740,91 +1717,85 @@ void appendGfx_player_actor(void* arg0) { animChanged = TRUE; } else if (!animChanged) { s32 temp = get_player_anim_for_status(STATUS_KEY_NORMAL); - do { - if (temp == get_player_anim_for_status(STATUS_KEY_HUSTLE)) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); - } - } while (0); // required to match + if (temp == get_player_anim_for_status(STATUS_KEY_HUSTLE)) { + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); + } } - do { - if (player->debuff == STATUS_KEY_FROZEN) { + if (player->debuff == STATUS_KEY_FROZEN) { + if (!animChanged) { + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_FROZEN); + animChanged = TRUE; + } + } else if (player->debuff != STATUS_KEY_SHRINK) { + if (player->debuff == STATUS_KEY_POISON) { if (!animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_FROZEN); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_POISON); animChanged = TRUE; } - } else if (player->debuff != STATUS_KEY_SHRINK) { - if (player->debuff == STATUS_KEY_POISON) { - if (!animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_POISON); - animChanged = TRUE; - } - } else if (player->debuff == STATUS_KEY_DIZZY) { - if (!animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_DIZZY); - animChanged = TRUE; - } - } else if (player->debuff == STATUS_KEY_SLEEP) { - if (!animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_SLEEP); - animChanged = TRUE; - } - } else if (player->debuff == STATUS_KEY_PARALYZE) { - if (!animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_PARALYZE); - animChanged = TRUE; - } - } else { - if (player_team_is_ability_active(player, ABILITY_BERSERKER)) { - if (!animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_BERSERK); - animChanged = TRUE; - } - } + } else if (player->debuff == STATUS_KEY_DIZZY) { + if (!animChanged) { + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_DIZZY); + animChanged = TRUE; } - } - if (is_ability_active(ABILITY_ZAP_TAP)) { + } else if (player->debuff == STATUS_KEY_SLEEP) { if (!animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_STATIC); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_SLEEP); animChanged = TRUE; } - player->staticStatus = STATUS_KEY_STATIC; - player->staticDuration = 127; - } else if ((player->staticStatus == STATUS_KEY_STATIC) && !animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_STATIC); - animChanged = TRUE; - } - if ((player->transparentStatus == STATUS_KEY_TRANSPARENT) || (playerParts->flags & ACTOR_PART_FLAG_TRANSPARENT)) { + } else if (player->debuff == STATUS_KEY_PARALYZE) { if (!animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_TRANSPARENT); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_PARALYZE); animChanged = TRUE; } - create_status_transparent(player->hudElementDataIndex, STATUS_KEY_TRANSPARENT); + } else { + if (player_team_is_ability_active(player, ABILITY_BERSERKER)) { + if (!animChanged) { + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_BERSERK); + animChanged = TRUE; + } + } } + } + if (is_ability_active(ABILITY_ZAP_TAP)) { if (!animChanged) { - playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_STATIC); + animChanged = TRUE; + } + player->staticStatus = STATUS_KEY_STATIC; + player->staticDuration = 127; + } else if ((player->staticStatus == STATUS_KEY_STATIC) && !animChanged) { + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_STATIC); + animChanged = TRUE; + } + if ((player->transparentStatus == STATUS_KEY_TRANSPARENT) || (playerParts->flags & ACTOR_PART_FLAG_TRANSPARENT)) { + if (!animChanged) { + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_TRANSPARENT); + animChanged = TRUE; } - } while (0); // needed to match + create_status_transparent(player->hudElementDataIndex, STATUS_KEY_TRANSPARENT); + } + if (!animChanged) { + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); + } } if (!(gBattleStatus.flags1 & BS_FLAGS1_TATTLE_OPEN) && (player->flags & ACTOR_FLAG_SHOW_STATUS_ICONS)) { if (!cond4) { - do { - if (player->debuff == STATUS_KEY_POISON) { - create_status_debuff(player->hudElementDataIndex, STATUS_KEY_POISON); - } else if (player->debuff == STATUS_KEY_SLEEP) { - create_status_debuff(player->hudElementDataIndex, STATUS_KEY_SLEEP); - } else if (player->debuff == STATUS_KEY_PARALYZE) { - create_status_debuff(player->hudElementDataIndex, STATUS_KEY_PARALYZE); - } else if (player->debuff == STATUS_KEY_DIZZY) { - create_status_debuff(player->hudElementDataIndex, STATUS_KEY_DIZZY); - } else if (player->debuff == STATUS_KEY_SHRINK) { - create_status_debuff(player->hudElementDataIndex, STATUS_KEY_SHRINK); - } else if (player->debuff == STATUS_KEY_FROZEN) { - create_status_debuff(player->hudElementDataIndex, STATUS_KEY_FROZEN); - } - } while (0); // required to match - if (!cond4 && (is_ability_active(ABILITY_ZAP_TAP) || (player->staticStatus == STATUS_KEY_STATIC))) { + if (player->debuff == STATUS_KEY_POISON) { + create_status_debuff(player->hudElementDataIndex, STATUS_KEY_POISON); + } else if (player->debuff == STATUS_KEY_SLEEP) { + create_status_debuff(player->hudElementDataIndex, STATUS_KEY_SLEEP); + } else if (player->debuff == STATUS_KEY_PARALYZE) { + create_status_debuff(player->hudElementDataIndex, STATUS_KEY_PARALYZE); + } else if (player->debuff == STATUS_KEY_DIZZY) { + create_status_debuff(player->hudElementDataIndex, STATUS_KEY_DIZZY); + } else if (player->debuff == STATUS_KEY_SHRINK) { + create_status_debuff(player->hudElementDataIndex, STATUS_KEY_SHRINK); + } else if (player->debuff == STATUS_KEY_FROZEN) { + create_status_debuff(player->hudElementDataIndex, STATUS_KEY_FROZEN); + } + if (is_ability_active(ABILITY_ZAP_TAP) || (player->staticStatus == STATUS_KEY_STATIC)) { create_status_static(player->hudElementDataIndex, STATUS_KEY_STATIC); } } diff --git a/src/battle/area/kzn2/actor/lava_bud.c b/src/battle/area/kzn2/actor/lava_bud.c index 614dfeb4da..479accfd79 100644 --- a/src/battle/area/kzn2/actor/lava_bud.c +++ b/src/battle/area/kzn2/actor/lava_bud.c @@ -42,8 +42,6 @@ enum N(ActorParams) { static s32 N(unusedArray)[64]; -MATCHING_BSS(0x8A0); - BSS u8 Vine3Base[0x2000]; BSS u8 Vine2Base[0x3000]; BSS u8 Vine1Base[0x3000]; diff --git a/src/battle/btl_states_actions.c b/src/battle/btl_states_actions.c index a85fb0bb5f..871bb418f8 100644 --- a/src/battle/btl_states_actions.c +++ b/src/battle/btl_states_actions.c @@ -38,33 +38,23 @@ void btl_merlee_on_start_turn(void) { EncounterStatus* currentEncounter = &gCurrentEncounter; PlayerData* playerData = &gPlayerData; - do { - if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) - && battleStatus->nextMerleeSpellType != MERLEE_SPELL_EXP_BOOST - && battleStatus->nextMerleeSpellType != MERLEE_SPELL_COIN_BOOST - && playerData->merleeCastsLeft > 0 - ) { - if (playerData->merleeTurnCount <= 0) { - s32 temp = rand_int(100); - - if (currentEncounter->curEnemy != NULL) { - if (currentEncounter->curEnemy->flags & ACTOR_FLAG_NO_HEALTH_BAR) { - // 46/101 ≈ 45.5% - if (temp <= 45) { - playerData->merleeSpellType = MERLEE_SPELL_ATK_BOOST; - } else if (temp <= 90) { // 45/101 ≈ 44.6% - playerData->merleeSpellType = MERLEE_SPELL_DEF_BOOST; - } else { // 10/101 ≈ 9.9% - playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; - } - } else if (temp <= 30) { // 31/101 ≈ 30.7% + if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) + && battleStatus->nextMerleeSpellType != MERLEE_SPELL_EXP_BOOST + && battleStatus->nextMerleeSpellType != MERLEE_SPELL_COIN_BOOST + && playerData->merleeCastsLeft > 0 + ) { + if (playerData->merleeTurnCount <= 0) { + s32 temp = rand_int(100); + + if (currentEncounter->curEnemy != NULL) { + if (currentEncounter->curEnemy->flags & ACTOR_FLAG_NO_HEALTH_BAR) { + // 46/101 ≈ 45.5% + if (temp <= 45) { playerData->merleeSpellType = MERLEE_SPELL_ATK_BOOST; - } else if (temp <= 60) { // 30/101 ≈ 29.7% + } else if (temp <= 90) { // 45/101 ≈ 44.6% playerData->merleeSpellType = MERLEE_SPELL_DEF_BOOST; - } else if (temp <= 80) { // 20/101 ≈ 19.8% + } else { // 10/101 ≈ 9.9% playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; - } else { // 20/101 ≈ 19.8% - playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; } } else if (temp <= 30) { // 31/101 ≈ 30.7% playerData->merleeSpellType = MERLEE_SPELL_ATK_BOOST; @@ -75,20 +65,28 @@ void btl_merlee_on_start_turn(void) { } else { // 20/101 ≈ 19.8% playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; } + } else if (temp <= 30) { // 31/101 ≈ 30.7% + playerData->merleeSpellType = MERLEE_SPELL_ATK_BOOST; + } else if (temp <= 60) { // 30/101 ≈ 29.7% + playerData->merleeSpellType = MERLEE_SPELL_DEF_BOOST; + } else if (temp <= 80) { // 20/101 ≈ 19.8% + playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; + } else { // 20/101 ≈ 19.8% + playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; + } + + temp = rand_int(10) + 6; + playerData->merleeTurnCount = temp; + } - temp = rand_int(10) + 6; - playerData->merleeTurnCount = temp; - } - - if (playerData->merleeTurnCount >= 2) { - playerData->merleeTurnCount--; - } else { - playerData->merleeTurnCount = 0; - battleStatus->nextMerleeSpellType = playerData->merleeSpellType; - playerData->merleeCastsLeft--; - } + if (playerData->merleeTurnCount >= 2) { + playerData->merleeTurnCount--; + } else { + playerData->merleeTurnCount = 0; + battleStatus->nextMerleeSpellType = playerData->merleeSpellType; + playerData->merleeCastsLeft--; } - } while (0); // TODO: required to match + } } void btl_merlee_on_first_strike(void) { @@ -96,33 +94,23 @@ void btl_merlee_on_first_strike(void) { EncounterStatus* currentEncounter = &gCurrentEncounter; PlayerData* playerData = &gPlayerData; - do { - if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) - && battleStatus->nextMerleeSpellType != MERLEE_SPELL_EXP_BOOST - && battleStatus->nextMerleeSpellType != MERLEE_SPELL_COIN_BOOST - && playerData->merleeCastsLeft > 0) - { - if (playerData->merleeTurnCount <= 0) { - s32 temp = rand_int(100); - - if (currentEncounter->curEnemy != NULL) { - if (currentEncounter->curEnemy->flags & ACTOR_FLAG_NO_HEALTH_BAR) { - // 46/101 ≈ 45.5% - if (temp <= 45) { - playerData->merleeSpellType = MERLEE_SPELL_ATK_BOOST; - } else if (temp <= 90) { // 45/101 ≈ 44.6% - playerData->merleeSpellType = MERLEE_SPELL_DEF_BOOST; - } else { // 10/101 ≈ 9.9% - playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; - } - } else if (temp <= 30) { // 31/101 ≈ 30.7% + if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) + && battleStatus->nextMerleeSpellType != MERLEE_SPELL_EXP_BOOST + && battleStatus->nextMerleeSpellType != MERLEE_SPELL_COIN_BOOST + && playerData->merleeCastsLeft > 0) + { + if (playerData->merleeTurnCount <= 0) { + s32 temp = rand_int(100); + + if (currentEncounter->curEnemy != NULL) { + if (currentEncounter->curEnemy->flags & ACTOR_FLAG_NO_HEALTH_BAR) { + // 46/101 ≈ 45.5% + if (temp <= 45) { playerData->merleeSpellType = MERLEE_SPELL_ATK_BOOST; - } else if (temp <= 60) { // 30/101 ≈ 29.7% + } else if (temp <= 90) { // 45/101 ≈ 44.6% playerData->merleeSpellType = MERLEE_SPELL_DEF_BOOST; - } else if (temp <= 80) { // 20/101 ≈ 19.8% + } else { // 10/101 ≈ 9.9% playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; - } else { // 20/101 ≈ 19.8% - playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; } } else if (temp <= 30) { // 31/101 ≈ 30.7% playerData->merleeSpellType = MERLEE_SPELL_ATK_BOOST; @@ -133,32 +121,40 @@ void btl_merlee_on_first_strike(void) { } else { // 20/101 ≈ 19.8% playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; } - - if (playerData->merleeSpellType != MERLEE_SPELL_COIN_BOOST) { - // same outcome either way. has to be written like this, and the check does exist in the code. bug? - if (playerData->merleeTurnCount == -1) { - temp = rand_int(5) + 5; - } else { - temp = rand_int(5) + 5; - - } + } else if (temp <= 30) { // 31/101 ≈ 30.7% + playerData->merleeSpellType = MERLEE_SPELL_ATK_BOOST; + } else if (temp <= 60) { // 30/101 ≈ 29.7% + playerData->merleeSpellType = MERLEE_SPELL_DEF_BOOST; + } else if (temp <= 80) { // 20/101 ≈ 19.8% + playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; + } else { // 20/101 ≈ 19.8% + playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; + } + + if (playerData->merleeSpellType != MERLEE_SPELL_COIN_BOOST) { + // same outcome either way. has to be written like this, and the check does exist in the code. bug? + if (playerData->merleeTurnCount == -1) { + temp = rand_int(5) + 5; } else { - temp = rand_int(8) + 5; + temp = rand_int(5) + 5; + } - playerData->merleeTurnCount = temp; + } else { + temp = rand_int(8) + 5; } + playerData->merleeTurnCount = temp; + } - if (playerData->merleeSpellType == MERLEE_SPELL_EXP_BOOST || playerData->merleeSpellType == MERLEE_SPELL_COIN_BOOST) { - if (playerData->merleeTurnCount >= 2) { - playerData->merleeTurnCount--; - } else { - battleStatus->nextMerleeSpellType = playerData->merleeSpellType; - playerData->merleeTurnCount = 0; - playerData->merleeCastsLeft--; - } + if (playerData->merleeSpellType == MERLEE_SPELL_EXP_BOOST || playerData->merleeSpellType == MERLEE_SPELL_COIN_BOOST) { + if (playerData->merleeTurnCount >= 2) { + playerData->merleeTurnCount--; + } else { + battleStatus->nextMerleeSpellType = playerData->merleeSpellType; + playerData->merleeTurnCount = 0; + playerData->merleeCastsLeft--; } } - } while (0); // TODO: required to match + } } void btl_set_state(s32 battleState) { @@ -918,13 +914,11 @@ void btl_state_update_begin_player_turn(void) { if (player->transparentStatus != 0) { player->transparentDuration--; part->flags |= ACTOR_PART_FLAG_TRANSPARENT; - do { - if (player->transparentDuration <= 0) { - player->transparentStatus = 0; - part->flags &= ~ACTOR_PART_FLAG_TRANSPARENT; - remove_status_transparent(player->hudElementDataIndex); - } - } while (0); // TODO required to match + if (player->transparentDuration <= 0) { + player->transparentStatus = 0; + part->flags &= ~ACTOR_PART_FLAG_TRANSPARENT; + remove_status_transparent(player->hudElementDataIndex); + } } if (player->debuff != 0) { @@ -1573,9 +1567,7 @@ void btl_state_update_end_turn(void) { actor = battleStatus->enemyActors[i]; if (actor != NULL && actor->handleEventScript != NULL) { if (does_script_exist(actor->handleEventScriptID)) { - do { - cond = TRUE; - } while (0); // TODO required to match + cond = TRUE; } else { actor->handleEventScript = NULL; } diff --git a/src/battle/btl_states_menus.c b/src/battle/btl_states_menus.c index d315a51fc3..7247b21a8e 100644 --- a/src/battle/btl_states_menus.c +++ b/src/battle/btl_states_menus.c @@ -1092,26 +1092,24 @@ s32 btl_submenu_moves_update(void) { if (!BattleMenu_UsingSpiritsSubmenu) { for (i = 0; i < (BattleMenu_Moves_OptionCount - 1); i++) { for (j = i + 1; j < BattleMenu_Moves_OptionCount; j++) { - do { - s32 temp1 = BattleMenu_Moves_OptionIndexMap[i]; - s32 temp2 = BattleMenu_Moves_OptionIndexMap[j]; + s32 temp1 = BattleMenu_Moves_OptionIndexMap[i]; + s32 temp2 = BattleMenu_Moves_OptionIndexMap[j]; - if (BattleMenu_Moves_OptionSortPriority[temp1] < BattleMenu_Moves_OptionSortPriority[temp2]) { - continue; - } + if (BattleMenu_Moves_OptionSortPriority[temp1] < BattleMenu_Moves_OptionSortPriority[temp2]) { + continue; + } - if ( - BattleMenu_Moves_OptionSortPriority[temp1] != BattleMenu_Moves_OptionSortPriority[temp2] || - (battle_menu_moveOptionDisplayCosts[temp1] >= battle_menu_moveOptionDisplayCosts[temp2]) && - (battle_menu_moveOptionDisplayCosts[temp1] != battle_menu_moveOptionDisplayCosts[temp2] || - battle_menu_moveOptionBPCosts[temp1] >= battle_menu_moveOptionBPCosts[temp2]) - ) - { - s32 swapTmp = BattleMenu_Moves_OptionIndexMap[i]; - BattleMenu_Moves_OptionIndexMap[i] = BattleMenu_Moves_OptionIndexMap[j]; - BattleMenu_Moves_OptionIndexMap[j] = swapTmp; - } - } while (0); + if ( + BattleMenu_Moves_OptionSortPriority[temp1] != BattleMenu_Moves_OptionSortPriority[temp2] || + (battle_menu_moveOptionDisplayCosts[temp1] >= battle_menu_moveOptionDisplayCosts[temp2]) && + (battle_menu_moveOptionDisplayCosts[temp1] != battle_menu_moveOptionDisplayCosts[temp2] || + battle_menu_moveOptionBPCosts[temp1] >= battle_menu_moveOptionBPCosts[temp2]) + ) + { + s32 swapTmp = BattleMenu_Moves_OptionIndexMap[i]; + BattleMenu_Moves_OptionIndexMap[i] = BattleMenu_Moves_OptionIndexMap[j]; + BattleMenu_Moves_OptionIndexMap[j] = swapTmp; + } } } } @@ -2557,7 +2555,6 @@ void btl_state_update_player_menu(void) { battleStatus->submenuMoveCount = 0; } break; - do { // required to match case BTL_MENU_TYPE_SMASH: btl_init_menu_hammer(); if (battleStatus->submenuMoveCount == 1) { @@ -2604,54 +2601,47 @@ void btl_state_update_player_menu(void) { } starBeamLevel = playerData->starBeamLevel; if (starBeamLevel == 1) { - do { - moveData = &gMoveTable[MOVE_STAR_BEAM]; - battleStatus->submenuMoves[entryIdx] = MOVE_STAR_BEAM; - battleStatus->submenuIcons[entryIdx] = 0; - battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; - battleStatus->moveArgument = MOVE_REFRESH + i; - battleStatus->curTargetListFlags = moveData->flags; - create_current_pos_target_list(playerActor); - battleStatus->submenuStatus[entryIdx] = starBeamLevel; - if (playerActor->targetListLength == 0) { - battleStatus->submenuStatus[entryIdx] = -2; - } - if (playerData->starPower / SP_PER_BAR < moveData->costFP) { - battleStatus->submenuStatus[entryIdx] = 0; - } - if (gBattleStatus.flags2 & BS_FLAGS2_NO_TARGET_AVAILABLE) { - battleStatus->submenuStatus[entryIdx] = -1; - } - entryIdx++; - } while (0); + moveData = &gMoveTable[MOVE_STAR_BEAM]; + battleStatus->submenuMoves[entryIdx] = MOVE_STAR_BEAM; + battleStatus->submenuIcons[entryIdx] = 0; + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; + battleStatus->moveArgument = MOVE_REFRESH + i; + battleStatus->curTargetListFlags = moveData->flags; + create_current_pos_target_list(playerActor); + battleStatus->submenuStatus[entryIdx] = starBeamLevel; + if (playerActor->targetListLength == 0) { + battleStatus->submenuStatus[entryIdx] = -2; + } + if (playerData->starPower / SP_PER_BAR < moveData->costFP) { + battleStatus->submenuStatus[entryIdx] = 0; + } + if (gBattleStatus.flags2 & BS_FLAGS2_NO_TARGET_AVAILABLE) { + battleStatus->submenuStatus[entryIdx] = -1; + } + entryIdx++; } if (playerData->starBeamLevel == 2) { - do { - do { - moveData = &gMoveTable[MOVE_PEACH_BEAM]; - battleStatus->submenuMoves[entryIdx] = MOVE_PEACH_BEAM; - battleStatus->submenuIcons[entryIdx] = 0; - battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; - battleStatus->moveArgument = MOVE_REFRESH + i; - battleStatus->curTargetListFlags = moveData->flags; - create_current_pos_target_list(playerActor); - battleStatus->submenuStatus[entryIdx] = 1; - if (playerActor->targetListLength == 0) { - battleStatus->submenuStatus[entryIdx] = -2; - } - if (playerData->starPower / SP_PER_BAR < moveData->costFP) { - battleStatus->submenuStatus[entryIdx] = 0; - } - if (gBattleStatus.flags2 & BS_FLAGS2_NO_TARGET_AVAILABLE) { - battleStatus->submenuStatus[entryIdx] = -1; - } - entryIdx++; - } while (0); // TODO required to match - } while (0); // TODO required to match + moveData = &gMoveTable[MOVE_PEACH_BEAM]; + battleStatus->submenuMoves[entryIdx] = MOVE_PEACH_BEAM; + battleStatus->submenuIcons[entryIdx] = 0; + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; + battleStatus->moveArgument = MOVE_REFRESH + i; + battleStatus->curTargetListFlags = moveData->flags; + create_current_pos_target_list(playerActor); + battleStatus->submenuStatus[entryIdx] = 1; + if (playerActor->targetListLength == 0) { + battleStatus->submenuStatus[entryIdx] = -2; + } + if (playerData->starPower / SP_PER_BAR < moveData->costFP) { + battleStatus->submenuStatus[entryIdx] = 0; + } + if (gBattleStatus.flags2 & BS_FLAGS2_NO_TARGET_AVAILABLE) { + battleStatus->submenuStatus[entryIdx] = -1; + } + entryIdx++; } battleStatus->submenuMoveCount = entryIdx; break; - } while (0); // TODO required to match } currentSubmenu = battleStatus->curSubmenu; diff --git a/src/battle/dmg_player.c b/src/battle/dmg_player.c index 0634300a8e..86b1b65ef2 100644 --- a/src/battle/dmg_player.c +++ b/src/battle/dmg_player.c @@ -854,44 +854,42 @@ HitResult calc_player_damage_enemy(void) { } // try inflicting status effects - do { // TODO remove this do while - if (gBattleStatus.flags1 & BS_FLAGS1_TRIGGER_EVENTS - && battleStatus->lastAttackDamage >= 0 - && dispatchEvent != EVENT_DEATH - && dispatchEvent != EVENT_SPIN_SMASH_DEATH - && dispatchEvent != EVENT_EXPLODE_TRIGGER - && !(targetPart->targetFlags & ACTOR_PART_TARGET_NO_DAMAGE) - ) { - #define INFLICT_STATUS(STATUS_TYPE) \ - if ((battleStatus->curAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \ - try_inflict_status(target, STATUS_KEY_##STATUS_TYPE, STATUS_TURN_MOD_##STATUS_TYPE)) { \ - wasSpecialHit = TRUE; \ - wasStatusInflicted = TRUE; \ - } \ - - INFLICT_STATUS(SHRINK); - INFLICT_STATUS(POISON); - INFLICT_STATUS(STONE); - INFLICT_STATUS(SLEEP); - INFLICT_STATUS(STOP); - INFLICT_STATUS(STATIC); - INFLICT_STATUS(FEAR); - INFLICT_STATUS(PARALYZE); - INFLICT_STATUS(DIZZY); - - #undef INFLICT_STATUS - - if (wasStatusInflicted) { - if (dispatchEvent == EVENT_ZERO_DAMAGE) { - dispatchEvent = EVENT_HIT_COMBO; - } + if (gBattleStatus.flags1 & BS_FLAGS1_TRIGGER_EVENTS + && battleStatus->lastAttackDamage >= 0 + && dispatchEvent != EVENT_DEATH + && dispatchEvent != EVENT_SPIN_SMASH_DEATH + && dispatchEvent != EVENT_EXPLODE_TRIGGER + && !(targetPart->targetFlags & ACTOR_PART_TARGET_NO_DAMAGE) + ) { + #define INFLICT_STATUS(STATUS_TYPE) \ + if ((battleStatus->curAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \ + try_inflict_status(target, STATUS_KEY_##STATUS_TYPE, STATUS_TURN_MOD_##STATUS_TYPE)) { \ + wasSpecialHit = TRUE; \ + wasStatusInflicted = TRUE; \ + } \ + + INFLICT_STATUS(SHRINK); + INFLICT_STATUS(POISON); + INFLICT_STATUS(STONE); + INFLICT_STATUS(SLEEP); + INFLICT_STATUS(STOP); + INFLICT_STATUS(STATIC); + INFLICT_STATUS(FEAR); + INFLICT_STATUS(PARALYZE); + INFLICT_STATUS(DIZZY); + + #undef INFLICT_STATUS + + if (wasStatusInflicted) { + if (dispatchEvent == EVENT_ZERO_DAMAGE) { + dispatchEvent = EVENT_HIT_COMBO; + } - if (dispatchEvent == EVENT_IMMUNE) { - dispatchEvent = EVENT_HIT; - } + if (dispatchEvent == EVENT_IMMUNE) { + dispatchEvent = EVENT_HIT; } } - } while (0); + } battleStatus->wasStatusInflicted = wasStatusInflicted; dispatch_event_actor(target, dispatchEvent); diff --git a/src/battle/move/jump/earthquake_jump.c b/src/battle/move/jump/earthquake_jump.c index 359a01b73e..93bb0d6b28 100644 --- a/src/battle/move/jump/earthquake_jump.c +++ b/src/battle/move/jump/earthquake_jump.c @@ -13,8 +13,6 @@ API_CALLABLE(N(func_802A10E4_785C04)) { return ApiStatus_DONE2; } -MATCHING_BSS(0x3CC0); - s32 N(DifficultyTable)[] = { 11, 10, 9, 8, 7, 6, 5, 4 }; diff --git a/src/battle/partner/lakilester.c b/src/battle/partner/lakilester.c index b0d7fb7c2e..a3b261d93f 100644 --- a/src/battle/partner/lakilester.c +++ b/src/battle/partner/lakilester.c @@ -603,7 +603,7 @@ API_CALLABLE(N(SpinyFlipActionCommand)) { break; } - // show aim dot hud element in center of + // show aim dot hud element in center of switch (script->functionTemp[0]) { case SPINY_FLIP_DELAY: case SPINY_FLIP_AIMING: @@ -1795,5 +1795,3 @@ EvtScript N(EVS_Move_Hurricane) = { Return End }; - -MATCHING_BSS(0xCC0); diff --git a/src/battle/partner/parakarry.c b/src/battle/partner/parakarry.c index bb21a1b9c5..453469c8fa 100644 --- a/src/battle/partner/parakarry.c +++ b/src/battle/partner/parakarry.c @@ -526,7 +526,7 @@ API_CALLABLE(N(FlyAround)) { } else if (state->angle >= 90.0f && state->angle < 180.0f) { state->angle = 270.0f - (clamp_angle(state->angle + 180.0f) - 270.0f); } - } while (0); + } while (0); // TODO macro? if (script->functionTemp[3] != 0) { sfx_play_sound_at_position(SOUND_PARAKARRY_AIR_RAID_1, SOUND_SPACE_DEFAULT, state->curPos.x, state->curPos.y, state->curPos.z); diff --git a/src/battle/partner/sushie.c b/src/battle/partner/sushie.c index 3c37c2f9ab..4dd688a83d 100644 --- a/src/battle/partner/sushie.c +++ b/src/battle/partner/sushie.c @@ -256,7 +256,7 @@ API_CALLABLE(N(ProcessTidalWave)) { state->angle = 270.0f - (clamp_angle(state->angle + 180.0f) - 270.0f); state->bounceDivisor = rand_int(4) - 2; } - } while (0); + } while (0); // TODO macro? if (script->functionTemp[2] != 0) { sfx_play_sound_at_position(SOUND_TIDAL_WAVE_LEAP_A, SOUND_SPACE_DEFAULT, state->curPos.x, state->curPos.y, state->curPos.z); diff --git a/src/battle/use_star_powers.c b/src/battle/use_star_powers.c index 665a265792..7d038fe423 100644 --- a/src/battle/use_star_powers.c +++ b/src/battle/use_star_powers.c @@ -123,5 +123,3 @@ API_CALLABLE(LoadStarPowerScript) { script->varTable[0] = (s32) (&StarPowersTable[starPowerIdx])->mainScript; return ApiStatus_DONE2; } - -MATCHING_BSS(0x1390); diff --git a/src/effects/squirt.c b/src/effects/squirt.c index cda27ece7c..cbc39e91d6 100644 --- a/src/effects/squirt.c +++ b/src/effects/squirt.c @@ -209,7 +209,6 @@ void squirt_appendGfx(void* effect) { } else { var_f22 = ((f32) data->unk_1A8[i] * 0.5) + 1.0; if (var_f22 > 30.0f) { - do {} while (0); // TODO required to match var_f22 = 30.0f; } cnA = (D_E00B2BA0[i] * data->unk_1D8[i]) / 255; diff --git a/src/encounter.c b/src/encounter.c index 2d84107727..707dd2f459 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -506,11 +506,9 @@ void update_encounters_neutral(void) { f32 dx, dz; f32 angle1, angle2; - do { - if (currentEncounter->hitType == ENCOUNTER_TRIGGER_CONVERSATION) { - goto START_BATTLE; - } - } while (0); + if (currentEncounter->hitType == ENCOUNTER_TRIGGER_CONVERSATION) { + goto START_BATTLE; + } currentEncounter->songID = -1; currentEncounter->unk_18 = -1; @@ -668,16 +666,15 @@ void update_encounters_neutral(void) { ) { continue; } - do { - if (!(enemy->flags & ENEMY_FLAG_IGNORE_PARTNER) && partner_test_enemy_collision(npc)) { - currentEncounter->hitType = ENCOUNTER_TRIGGER_PARTNER; - enemy->encountered = ENCOUNTER_TRIGGER_PARTNER; - currentEncounter->curEncounter = encounter; - currentEncounter->curEnemy = enemy; - currentEncounter->firstStrikeType = FIRST_STRIKE_PLAYER; - goto START_BATTLE; - } - } while (0); + + if (!(enemy->flags & ENEMY_FLAG_IGNORE_PARTNER) && partner_test_enemy_collision(npc)) { + currentEncounter->hitType = ENCOUNTER_TRIGGER_PARTNER; + enemy->encountered = ENCOUNTER_TRIGGER_PARTNER; + currentEncounter->curEncounter = encounter; + currentEncounter->curEnemy = enemy; + currentEncounter->firstStrikeType = FIRST_STRIKE_PLAYER; + goto START_BATTLE; + } npcX = npc->pos.x; npcY = npc->pos.y; diff --git a/src/entity.c b/src/entity.c index b5137d333c..d290295156 100644 --- a/src/entity.c +++ b/src/entity.c @@ -976,7 +976,6 @@ s32 is_entity_data_loaded(Entity* entity, EntityBlueprint* blueprint, s32* loade break; } else { DmaEntry* bpDmaList = bp->dmaList; - do {} while (0); // TODO find better match entDmaList = blueprint->dmaList; if (bpDmaList == entDmaList) { if (blueprint->flags & ENTITY_FLAG_HAS_ANIMATED_MODEL) { diff --git a/src/entity/default/BombableRock.c b/src/entity/default/BombableRock.c index ca5cabe7f9..4231ff3942 100644 --- a/src/entity/default/BombableRock.c +++ b/src/entity/default/BombableRock.c @@ -272,5 +272,3 @@ EntityBlueprint Entity_BombableRockWide = { .entityType = ENTITY_TYPE_BOMBABLE_ROCK, .aabbSize = { 50, 50, 100 } }; - -MATCHING_BSS(0x100); diff --git a/src/evt/evt.c b/src/evt/evt.c index a5e0efe5b1..60a6e8e3e9 100644 --- a/src/evt/evt.c +++ b/src/evt/evt.c @@ -1296,15 +1296,11 @@ s32 evt_handle_print_debug_var(Evt* script) { sprintf(evtDebugPrintBuffer, "LF(%3d) [%d]", var, script->varFlags[var / 32] & (1 << flagBitPos)); } else if (var <= EVT_MAP_VAR_CUTOFF) { s32 mapVar; - s32 temp; - do { - var = EVT_INDEX_OF_MAP_VAR(var); - mapVar = gMapVars[var]; - temp = EVT_LIMIT; - } while (0); + var = EVT_INDEX_OF_MAP_VAR(var); + mapVar = gMapVars[var]; - if (mapVar <= temp) { + if (mapVar <= EVT_LIMIT) { sprintf(evtDebugPrintBuffer, "GW(%3d) [%08X]", mapVar); } else if (mapVar <= EVT_FIXED_CUTOFF) { sprintf(evtDebugPrintBuffer, "GW(%3d) [%4.2f]", var, evt_fixed_var_to_float(mapVar)); diff --git a/src/inspect_icon.c b/src/inspect_icon.c index 2152a49e00..c2bf391371 100644 --- a/src/inspect_icon.c +++ b/src/inspect_icon.c @@ -274,5 +274,3 @@ void interact_inspect_dismiss(void) { func_800EF3D4(0); partner_reset_tether_distance(); } - -MATCHING_BSS(0x30); diff --git a/src/inventory.c b/src/inventory.c index 742d3b3db9..79a39e53c7 100644 --- a/src/inventory.c +++ b/src/inventory.c @@ -1107,7 +1107,6 @@ void update_status_bar(void) { if (statusBar->spBlinking != BLINK_OFF) { if (!showStat) { s32 limit = statusBar->spBarsToBlink * 8; - do {} while (0); if (sp50 < limit) { while (TRUE) { i++; s1++; if (i >= limit) { break; } diff --git a/src/item_entity.c b/src/item_entity.c index 788f014688..c68f808800 100644 --- a/src/item_entity.c +++ b/src/item_entity.c @@ -826,82 +826,83 @@ void update_item_entities(void) { f32 x, y, z, hitDepth; s32 i; - if (!(gOverrideFlags & (GLOBAL_OVERRIDES_400 | GLOBAL_OVERRIDES_800))) { - for (i = 0; i < MAX_ITEM_ENTITIES; i++) { - item = gCurrentItemEntities[i]; + if (gOverrideFlags & (GLOBAL_OVERRIDES_400 | GLOBAL_OVERRIDES_800)) { + return; + } - if (item != NULL && item->flags != 0) { - if (item->itemID == ITEM_COIN) { - if (rand_int(100) > 90) { - sparkle_script_init(item, &SparkleScript_Coin); - CoinSparkleCenterX = rand_int(16) - 8; - CoinSparkleCenterY = rand_int(16) - 8; - CoinSparkleCenterZ = 5; - } - sparkle_script_update(item); + for (i = 0; i < MAX_ITEM_ENTITIES; i++) { + item = gCurrentItemEntities[i]; + + if (item != NULL && item->flags != 0) { + if (item->itemID == ITEM_COIN) { + if (rand_int(100) > 90) { + sparkle_script_init(item, &SparkleScript_Coin); + CoinSparkleCenterX = rand_int(16) - 8; + CoinSparkleCenterY = rand_int(16) - 8; + CoinSparkleCenterZ = 5; } + sparkle_script_update(item); + } + + item_entity_update(item); + + switch (item->spawnType) { + case ITEM_SPAWN_MODE_KEY: + update_item_entity_stationary(item); + break; + case ITEM_SPAWN_MODE_DECORATION: + case ITEM_SPAWN_MODE_INVISIBLE: + update_item_entity_no_pickup(item); + break; + case ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS: + case ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS: + case ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS: + case ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS: + case ITEM_SPAWN_MODE_TOSS_FADE1: + update_item_entity_collectable(item); + break; + case ITEM_SPAWN_AT_PLAYER: + update_item_entity_pickup(item); + break; + } - item_entity_update(item); + item = gCurrentItemEntities[i]; + if (item != NULL) { + s32 xs, ys, zs; switch (item->spawnType) { case ITEM_SPAWN_MODE_KEY: - update_item_entity_stationary(item); - break; - case ITEM_SPAWN_MODE_DECORATION: - case ITEM_SPAWN_MODE_INVISIBLE: - update_item_entity_no_pickup(item); - break; case ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS: case ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS: case ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS: - case ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS: - case ITEM_SPAWN_MODE_TOSS_FADE1: - update_item_entity_collectable(item); - break; case ITEM_SPAWN_AT_PLAYER: - update_item_entity_pickup(item); + xs = item->pos.x; + ys = item->pos.y; + zs = item->pos.z; + + if (xs != item->lastPos.x || ys != item->lastPos.y || zs != item->lastPos.z) { + Shadow* shadow = get_shadow_by_index(item->shadowIndex); + + x = item->pos.x; + y = item->pos.y + 12.0f; + z = item->pos.z; + hitDepth = 1000.0f; + npc_raycast_down_sides(COLLIDER_FLAG_IGNORE_NPC, &x, &y, &z, &hitDepth); + + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.x = gGameStatusPtr->playerGroundTraceAngles.x; + shadow->rot.y = 0.0f; + shadow->rot.z = gGameStatusPtr->playerGroundTraceAngles.z; + set_standard_shadow_scale(shadow, hitDepth * 0.5f); + } break; } - - item = gCurrentItemEntities[i]; - if (item != NULL) { - s32 xs, ys, zs; - - switch (item->spawnType) { - case ITEM_SPAWN_MODE_KEY: - case ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS: - case ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS: - case ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS: - case ITEM_SPAWN_AT_PLAYER: - xs = item->pos.x; - ys = item->pos.y; - zs = item->pos.z; - - if (xs != item->lastPos.x || ys != item->lastPos.y || zs != item->lastPos.z) { - Shadow* shadow = get_shadow_by_index(item->shadowIndex); - - x = item->pos.x; - y = item->pos.y + 12.0f; - z = item->pos.z; - hitDepth = 1000.0f; - npc_raycast_down_sides(COLLIDER_FLAG_IGNORE_NPC, &x, &y, &z, &hitDepth); - - shadow->pos.x = x; - shadow->pos.y = y; - shadow->pos.z = z; - shadow->rot.x = gGameStatusPtr->playerGroundTraceAngles.x; - shadow->rot.y = 0.0f; - shadow->rot.z = gGameStatusPtr->playerGroundTraceAngles.z; - set_standard_shadow_scale(shadow, hitDepth * 0.5f); - } - break; - } - item->lastPos.x = item->pos.x; - item->lastPos.y = item->pos.y; - item->lastPos.z = item->pos.z; - } + item->lastPos.x = item->pos.x; + item->lastPos.y = item->pos.y; + item->lastPos.z = item->pos.z; } - do {} while (0); // required to match } } } @@ -1082,38 +1083,34 @@ void draw_item_entities(void) { retTask = queue_render_task(rtPtr); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } - - do {} while (0); // required to match } } void draw_ui_item_entities(void) { - if (!(gOverrideFlags & (GLOBAL_OVERRIDES_PREV_400 | GLOBAL_OVERRIDES_PREV_800))) { - s32 i; + if (gOverrideFlags & (GLOBAL_OVERRIDES_PREV_400 | GLOBAL_OVERRIDES_PREV_800)) { + return; + } - for (i = 0; i < MAX_ITEM_ENTITIES; i++) { - ItemEntity* item = gCurrentItemEntities[i]; + for (s32 i = 0; i < MAX_ITEM_ENTITIES; i++) { + ItemEntity* item = gCurrentItemEntities[i]; - if (item != NULL && item->flags != 0) { - switch (item->spawnType) { - case ITEM_SPAWN_MODE_KEY: - draw_ui_item_entity_stationary(item); - break; - case ITEM_SPAWN_MODE_DECORATION: - case ITEM_SPAWN_MODE_INVISIBLE: - draw_ui_item_entity_no_pickup(item); - break; - case ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS: - case ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS: - case ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS: - case ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS: - case ITEM_SPAWN_MODE_TOSS_FADE1: - draw_ui_item_entity_collectable(item); - break; - } + if (item != NULL && item->flags != 0) { + switch (item->spawnType) { + case ITEM_SPAWN_MODE_KEY: + draw_ui_item_entity_stationary(item); + break; + case ITEM_SPAWN_MODE_DECORATION: + case ITEM_SPAWN_MODE_INVISIBLE: + draw_ui_item_entity_no_pickup(item); + break; + case ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS: + case ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS: + case ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS: + case ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS: + case ITEM_SPAWN_MODE_TOSS_FADE1: + draw_ui_item_entity_collectable(item); + break; } - - do {} while (0); // required to match } } } @@ -1435,23 +1432,19 @@ b32 test_item_player_collision(ItemEntity* item) { itemY = item->pos.y; itemZ = item->pos.z; - // check for player collision - do { - do { - itemPickupRadius = 13.5f; - } while (0); // required to match + itemPickupRadius = 13.5f; - dx = itemX - playerX; - dz = itemZ - playerZ; - dist = sqrtf(SQ(dx) + SQ(dz)); + // check for player collision + dx = itemX - playerX; + dz = itemZ - playerZ; + dist = sqrtf(SQ(dx) + SQ(dz)); - if (!(playerHalfRadius + itemPickupRadius <= dist) // XZ distance is close enough - && !(itemY + itemHitboxHeight < playerY) // item is not below player - && !(playerY + playerHalfHeight < itemY)) // player is not below item - { - hitDetected = TRUE; - } - } while (0); // required to match + if (!(playerHalfRadius + itemPickupRadius <= dist) // XZ distance is close enough + && !(itemY + itemHitboxHeight < playerY) // item is not below player + && !(playerY + playerHalfHeight < itemY)) // player is not below item + { + hitDetected = TRUE; + } // check for hammer collision if (playerStatus->actionState == ACTION_STATE_HAMMER && (playerStatus->flags & PS_FLAG_HAMMER_CHECK)) { diff --git a/src/msg.c b/src/msg.c index aaa9036abb..82683a9887 100644 --- a/src/msg.c +++ b/src/msg.c @@ -731,14 +731,12 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { printer->windowState = MSG_WINDOW_STATE_OPENING; break; case MSG_STYLE_CHOICE: - do { - printer->windowBasePos.x = *srcBuf++; - printer->windowBasePos.y = *srcBuf++; - printer->windowSize.x = *srcBuf++; - printer->windowSize.y = *srcBuf++; - printer->windowState = MSG_WINDOW_STATE_OPENING; - printer->stateFlags |= MSG_STATE_FLAG_800; - } while (0); + printer->windowBasePos.x = *srcBuf++; + printer->windowBasePos.y = *srcBuf++; + printer->windowSize.x = *srcBuf++; + printer->windowSize.y = *srcBuf++; + printer->windowState = MSG_WINDOW_STATE_OPENING; + printer->stateFlags |= MSG_STATE_FLAG_800; break; case MSG_STYLE_INSPECT: case MSG_STYLE_NARRATE: @@ -778,13 +776,11 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { printer->windowSize.y = *srcBuf++; // fallthrough case MSG_STYLE_SIGN: - do { - if (!s8) { - printer->windowState = MSG_WINDOW_STATE_OPENING; - printer->stateFlags |= MSG_STATE_FLAG_800; - printer->delayFlags |= MSG_DELAY_FLAG_1; - } - } while (0); + if (!s8) { + printer->windowState = MSG_WINDOW_STATE_OPENING; + printer->stateFlags |= MSG_STATE_FLAG_800; + printer->delayFlags |= MSG_DELAY_FLAG_1; + } break; case MSG_STYLE_POSTCARD: arg = *srcBuf++; @@ -813,13 +809,11 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { printer->windowSize.y = 40; #endif printer->stateFlags |= MSG_STATE_FLAG_8000; - do { - if (!s8) { - printer->stateFlags |= MSG_STATE_FLAG_8000 | MSG_STATE_FLAG_800; - printer->windowState = MSG_WINDOW_STATE_D; - printer->delayFlags |= MSG_DELAY_FLAG_1; - } - } while (0); + if (!s8) { + printer->stateFlags |= MSG_STATE_FLAG_8000 | MSG_STATE_FLAG_800; + printer->windowState = MSG_WINDOW_STATE_D; + printer->delayFlags |= MSG_DELAY_FLAG_1; + } break; case MSG_STYLE_EPILOGUE: printer->windowState = MSG_WINDOW_STATE_PRINTING; diff --git a/src/msg_draw.c b/src/msg_draw.c index 0ebe365977..b6bfb5b9ec 100644 --- a/src/msg_draw.c +++ b/src/msg_draw.c @@ -2064,7 +2064,6 @@ void msg_draw_frame(s32 posX, s32 posY, s32 sizeX, s32 sizeY, s32 style, s32 pal gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT); if (fading == 0 || bgAlpha != 0) { - do {} while (0); switch (style) { case MSG_STYLE_CHOICE: r = UNPACK_PAL_R(((u16*)ui_msg_palettes)[4]); diff --git a/src/msg_img.c b/src/msg_img.c index e78ba314ed..25f10d035c 100644 --- a/src/msg_img.c +++ b/src/msg_img.c @@ -90,11 +90,5 @@ BSS IMG_BIN MsgCharImgTitle[0x34F0] ALIGNED(16); BSS IMG_BIN MsgCharImgTitle[0xF60]; BSS IMG_BIN MsgCharImgNormal[0x5100]; BSS IMG_BIN MsgCharImgSubtitle[0xB88]; -BSS PAL_BIN D_802F4560[80][8] -#if !VERSION_IQUE -ALIGNED(16) +BSS PAL_BIN D_802F4560[80][8] ALIGNED(16); #endif -; -#endif - -MATCHING_BSS(0x6DA0); diff --git a/src/npc.c b/src/npc.c index a57735133b..78d8a13136 100644 --- a/src/npc.c +++ b/src/npc.c @@ -882,11 +882,10 @@ void appendGfx_npc(void* data) { || (npc->scale.y * npc->verticalStretch) * SPRITE_WORLD_SCALE_D != 1.0f || npc->scale.z * SPRITE_WORLD_SCALE_D != 1.0f ) { - do { - guScaleF(mtx2, npc->scale.x * SPRITE_WORLD_SCALE_D, - (npc->scale.y * npc->verticalStretch) * SPRITE_WORLD_SCALE_D, - npc->scale.z * SPRITE_WORLD_SCALE_D); - } while (0); // required to match (macro?) + guScaleF(mtx2, + SPRITE_WORLD_SCALE_D * npc->scale.x, + SPRITE_WORLD_SCALE_D * npc->scale.y * npc->verticalStretch, + SPRITE_WORLD_SCALE_D * npc->scale.z); guMtxCatF(mtx2, mtx1, mtx1); } @@ -914,12 +913,10 @@ void appendGfx_npc(void* data) { || (npc->scale.y * npc->verticalStretch) * SPRITE_WORLD_SCALE_D != 1.0f || npc->scale.z * SPRITE_WORLD_SCALE_D != 1.0f ) { - do { - guScaleF(mtx2, npc->scale.x * SPRITE_WORLD_SCALE_D, - (npc->scale.y * npc->verticalStretch) * SPRITE_WORLD_SCALE_D, - npc->scale.z * SPRITE_WORLD_SCALE_D); - } while (0); // required to match (macro?) - + guScaleF(mtx2, + SPRITE_WORLD_SCALE_D * npc->scale.x, + SPRITE_WORLD_SCALE_D * npc->scale.y * npc->verticalStretch, + SPRITE_WORLD_SCALE_D * npc->scale.z); guMtxCatF(mtx2, mtx1, mtx1); } if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { @@ -2430,16 +2427,13 @@ void kill_enemy(Enemy* enemy) { } } - do { - if (!(enemy->flags & ENEMY_FLAG_4) - && (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || (enemy == encounterStatus->curEnemy)) - && !(enemy->flags & ENEMY_FLAG_PASSIVE) - ) { - if (!(enemy->flags & ENEMY_FLAG_FLED)) { - COPY_set_defeated(encounterStatus->mapID, encounter->encounterID + i); - } - } - } while (0); // required to match + if (!(enemy->flags & ENEMY_FLAG_4) + && (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || (enemy == encounterStatus->curEnemy)) + && !(enemy->flags & ENEMY_FLAG_PASSIVE) + && !(enemy->flags & ENEMY_FLAG_FLED) + ) { + COPY_set_defeated(encounterStatus->mapID, encounter->encounterID + i); + } heap_free(enemy); } diff --git a/src/os/pfsisplug.c b/src/os/pfsisplug.c index 4abe345a88..611bd2c687 100644 --- a/src/os/pfsisplug.c +++ b/src/os/pfsisplug.c @@ -15,13 +15,8 @@ s32 osPfsIsPlug(OSMesgQueue* mq, u8* pattern) { u8 bitpattern; OSContStatus data[MAXCONTROLLERS]; int channel; -#ifdef BBPLAYER int crc_error_cnt = 3; u8 bits = 0; -#else - u8 bits = 0; - s32 crc_error_cnt = 3; -#endif __osSiGetAccess(); diff --git a/src/state_pause.c b/src/state_pause.c index 7a381fdee6..06787bf09b 100644 --- a/src/state_pause.c +++ b/src/state_pause.c @@ -39,10 +39,10 @@ NUPiOverlaySegment PauseOverlaySegment = { .bssEnd = pause_BSS_END, }; -SHIFT_BSS s8 StepPauseDelay; -SHIFT_BSS s8 StepPauseState; -SHIFT_BSS s16 StepPauseAlpha; // effectively unused, always zero -SHIFT_BSS s32 SavedReverbMode; +BSS s8 StepPauseDelay; +BSS s8 StepPauseState; +BSS s16 StepPauseAlpha; // effectively unused, always zero +BSS s32 SavedReverbMode; // TODO: these should be moved into player status u8 ReflectWallPrevAlpha = 254; diff --git a/src/world/action/hammer.c b/src/world/action/hammer.c index 1a17f93cf7..3617e02aa8 100644 --- a/src/world/action/hammer.c +++ b/src/world/action/hammer.c @@ -284,7 +284,7 @@ void action_update_hammer(void) { void func_802B6820_E256F0(void) { PlayerStatus* playerStatus = &gPlayerStatus; - CollisionStatus* collisionStatus; + CollisionStatus* collisionStatus = &gCollisionStatus; f32 yaw; f32 angle; f32 outSinTheta; @@ -299,10 +299,6 @@ void func_802B6820_E256F0(void) { s32 ret; s32 i; - do { - collisionStatus = &gCollisionStatus; - } while (0); // required to match; - yaw = func_800E5348(); if (action_hammer_is_swinging_away(playerStatus->trueAnimation)) { angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].curYaw); diff --git a/src/world/action/use_spinning_flower.c b/src/world/action/use_spinning_flower.c index fc770ec1d0..73707365dc 100644 --- a/src/world/action/use_spinning_flower.c +++ b/src/world/action/use_spinning_flower.c @@ -284,5 +284,3 @@ void action_update_use_spinning_flower(void) { break; } } - -MATCHING_BSS(0x100); diff --git a/src/world/area_dgb/dgb_01/dgb_01_7.c b/src/world/area_dgb/dgb_01/dgb_01_7.c index 2de16bd69b..787cdf468e 100644 --- a/src/world/area_dgb/dgb_01/dgb_01_7.c +++ b/src/world/area_dgb/dgb_01/dgb_01_7.c @@ -3580,5 +3580,3 @@ Mtx N(D_80253960_C111E0) = {{ }}; #include "smash_bridges_anim.inc.c" - -MATCHING_BSS(0x4930); diff --git a/src/world/area_nok/nok_02/npcs_crisis.inc.c b/src/world/area_nok/nok_02/npcs_crisis.inc.c index 228667c597..2c6c737aea 100644 --- a/src/world/area_nok/nok_02/npcs_crisis.inc.c +++ b/src/world/area_nok/nok_02/npcs_crisis.inc.c @@ -30,21 +30,17 @@ API_CALLABLE(N(IsPlayerOrKoopaNearby)) { script->varTable[2] = 0; } - do { - xDiff = fuzzyNpc->pos.x - playerStatus->pos.x; - zDiff = fuzzyNpc->pos.z - playerStatus->pos.z; - if ((SQ(xDiff) + SQ(zDiff) < SQ(80.0f)) && (script->varTable[2] >= 2)) { - do { - outVal = TRUE; - } while (0); // TODO required to match - } + xDiff = fuzzyNpc->pos.x - playerStatus->pos.x; + zDiff = fuzzyNpc->pos.z - playerStatus->pos.z; + if ((SQ(xDiff) + SQ(zDiff) < SQ(80.0f)) && (script->varTable[2] >= 2)) { + outVal = TRUE; + } - xDiff = fuzzyNpc->pos.x - koopaNpc->pos.x; - zDiff = fuzzyNpc->pos.z - koopaNpc->pos.z; - if (SQ(xDiff) + SQ(zDiff) < SQ(40.0f)) { - outVal = TRUE; - } - } while (0); // TODO required to match + xDiff = fuzzyNpc->pos.x - koopaNpc->pos.x; + zDiff = fuzzyNpc->pos.z - koopaNpc->pos.z; + if (SQ(xDiff) + SQ(zDiff) < SQ(40.0f)) { + outVal = TRUE; + } script->varTable[0] = outVal; return ApiStatus_DONE2; diff --git a/src/world/area_omo/omo_07/omo_07_4_npc.c b/src/world/area_omo/omo_07/omo_07_4_npc.c index a31c87c648..b15fad7eaa 100644 --- a/src/world/area_omo/omo_07/omo_07_4_npc.c +++ b/src/world/area_omo/omo_07/omo_07_4_npc.c @@ -41,15 +41,10 @@ enum { API_CALLABLE(N(SetShyGuyPoolState)) { Bytecode* args = script->ptrReadPos; - s32 base; s32 npcID; s32 value; - base = AF_OMO07_NpcPool0; - do { - npcID = evt_get_variable(script, *(args++)); - } while (0); // TODO required to match - npcID += base; + npcID = AF_OMO07_NpcPool0 + evt_get_variable(script, *args++); value = evt_get_variable(script, *args++); evt_set_variable(script, npcID, value); diff --git a/src/world/common/atomic/PushBlockGravity.inc.c b/src/world/common/atomic/PushBlockGravity.inc.c index 6f63baaab5..bef172d66b 100644 --- a/src/world/common/atomic/PushBlockGravity.inc.c +++ b/src/world/common/atomic/PushBlockGravity.inc.c @@ -19,9 +19,7 @@ s32 N(push_block_handle_fall)(Entity* block, Evt* source) { fx_smoke_burst(1, block->pos.x, block->pos.y, block->pos.z, 1.0f, 20); } - do { - source->functionTemp[0]++; - } while (0); // required to match + source->functionTemp[0]++; return source->functionTemp[0] == ARRAY_COUNT(N(PushBlockFallCurve)); } diff --git a/src/world/common/enemy/ai/FlyingAI.inc.c b/src/world/common/enemy/ai/FlyingAI.inc.c index 49bb475529..de27dbfe72 100644 --- a/src/world/common/enemy/ai/FlyingAI.inc.c +++ b/src/world/common/enemy/ai/FlyingAI.inc.c @@ -75,32 +75,28 @@ void N(FlyingAI_Wander)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo f64 test; f32 yTemp; - do { - if (npc->flags & NPC_FLAG_FLYING) { - yTemp = temp_f24; - test = vt4 + ((temp_f24 - vt4) * 0.09); - npc->pos.y = test; - } else { - posX = npc->pos.x; - posY = vt4; - posZ = npc->pos.z; - posW = 1000.0f; - npc_raycast_down_sides(npc->collisionChannel, &posX, &posY, &posZ, &posW); + if (npc->flags & NPC_FLAG_FLYING) { + yTemp = temp_f24; + test = vt4 + ((temp_f24 - vt4) * 0.09); + npc->pos.y = test; + } else { + posX = npc->pos.x; + posY = vt4; + posZ = npc->pos.z; + posW = 1000.0f; + npc_raycast_down_sides(npc->collisionChannel, &posX, &posY, &posZ, &posW); - yTemp = posY; - yTemp += vt3; - test = vt4 + ((yTemp - vt4) * 0.09); - npc->pos.y = test; - } + yTemp = posY; + yTemp += vt3; + test = vt4 + ((yTemp - vt4) * 0.09); + npc->pos.y = test; + } - if (fabsf(yTemp - npc->pos.y) < 1.0) { - npc->pos.y = yTemp; - enemy->varTable[0] &= ~0x10; - } - } while (0); // required to match + if (fabsf(yTemp - npc->pos.y) < 1.0) { + npc->pos.y = yTemp; + enemy->varTable[0] &= ~0x10; + } } else { - f32 vt1temp = vt1; // required to match - if (enemy->varTable[1] > 0) { f32 sinTemp = sin_deg(enemy->varTable[2]); s32 hit; @@ -116,9 +112,9 @@ void N(FlyingAI_Wander)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo } if (hit) { - npc->pos.y = posY + vt3 + (sinTemp * vt1temp); + npc->pos.y = posY + vt3 + (sinTemp * vt1); } else { - npc->pos.y = temp_f24 + (sinTemp * vt1temp); + npc->pos.y = temp_f24 + (sinTemp * vt1); } enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); diff --git a/src/world/common/enemy/ai/HoppingAI.inc.c b/src/world/common/enemy/ai/HoppingAI.inc.c index b28b00b7f3..25cfd37413 100644 --- a/src/world/common/enemy/ai/HoppingAI.inc.c +++ b/src/world/common/enemy/ai/HoppingAI.inc.c @@ -46,17 +46,15 @@ void N(HoppingAI_Hop)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolu if (aiSettings->playerSearchInterval >= 0) { if (script->functionTemp[1] <= 0) { - do { - script->functionTemp[1] = aiSettings->playerSearchInterval; - if (basic_ai_check_player_dist(territory, enemy, aiSettings->alertRadius, aiSettings->alertOffsetDist, 0) != 0) { - EffectInstance* emoteTemp; - fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); - ai_enemy_play_sound(npc, SOUND_AI_ALERT_A, SOUND_PARAM_MORE_QUIET); - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); - script->AI_TEMP_STATE = AI_STATE_CHASE_INIT; - return; - } - } while (0); // required to match + script->functionTemp[1] = aiSettings->playerSearchInterval; + if (basic_ai_check_player_dist(territory, enemy, aiSettings->alertRadius, aiSettings->alertOffsetDist, 0) != 0) { + EffectInstance* emoteTemp; + fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); + ai_enemy_play_sound(npc, SOUND_AI_ALERT_A, SOUND_PARAM_MORE_QUIET); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); + script->AI_TEMP_STATE = AI_STATE_CHASE_INIT; + return; + } } script->functionTemp[1]--; } diff --git a/src/world/menus.c b/src/world/menus.c index ddd446a985..e33093b6b8 100644 --- a/src/world/menus.c +++ b/src/world/menus.c @@ -362,9 +362,7 @@ void check_input_open_menus(void) { switch_to_partner(popup->userIndex[WorldPopupResult - 1]); break; case WORLD_MENU_USE_ITEM: - do { - use_consumable(popup->userIndex[WorldPopupResult - 1]); - } while (0); // todo required to match + use_consumable(popup->userIndex[WorldPopupResult - 1]); #ifndef VERSION_JP gOverrideFlags |= GLOBAL_OVERRIDES_CANT_PICK_UP_ITEMS; #endif diff --git a/src/world/model_anim/kzn/0A.c b/src/world/model_anim/kzn/0A.c index 3e0006637d..8a229837e6 100644 --- a/src/world/model_anim/kzn/0A.c +++ b/src/world/model_anim/kzn/0A.c @@ -1295,5 +1295,3 @@ AnimScript LavaPiranha_ModelScript_0A = { as_EndLoop as_End }; - -MATCHING_BSS(0x8FB0); diff --git a/src/world/partner/lakilester.c b/src/world/partner/lakilester.c index f9c9aa393e..5551324617 100644 --- a/src/world/partner/lakilester.c +++ b/src/world/partner/lakilester.c @@ -1211,5 +1211,3 @@ EvtScript EVS_WorldLakilester_EnterMap = { Return End }; - -MATCHING_BSS(0xB0); diff --git a/src/world/script_api/enter_exit.c b/src/world/script_api/enter_exit.c index 6354061a2a..558c6fc4d8 100644 --- a/src/world/script_api/enter_exit.c +++ b/src/world/script_api/enter_exit.c @@ -77,14 +77,12 @@ API_CALLABLE(EnterPlayerPostPipe) { playerStatus->pos.y = script->varTable[2] - 40; playerStatus->flags |= PS_FLAG_CAMERA_DOESNT_FOLLOW; } else { - do { - playerStatus->pos.y += 1.0f; - if (!(playerStatus->pos.y < script->varTable[2])) { - playerStatus->pos.y = script->varTable[2]; - playerStatus->flags &= ~PS_FLAG_CAMERA_DOESNT_FOLLOW; - ret = ApiStatus_DONE2; - } - } while (0); // todo required to match + playerStatus->pos.y += 1.0f; + if (!(playerStatus->pos.y < script->varTable[2])) { + playerStatus->pos.y = script->varTable[2]; + playerStatus->flags &= ~PS_FLAG_CAMERA_DOESNT_FOLLOW; + ret = ApiStatus_DONE2; + } } gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; @@ -468,5 +466,3 @@ EvtScript BaseEnterDoor = { Return End }; - -MATCHING_BSS(0x7AB0); diff --git a/src/world/script_api/push_blocks.c b/src/world/script_api/push_blocks.c index b9e12decc1..17dc61bf70 100644 --- a/src/world/script_api/push_blocks.c +++ b/src/world/script_api/push_blocks.c @@ -203,9 +203,7 @@ API_CALLABLE(FetchPushedBlockProperties) { cellZ = z2 + deltaZ; if (deltaX == 0 && deltaZ == 0) { - do { - script->varTable[9] = 2; - } while (0); + script->varTable[9] = 2; return ApiStatus_DONE2; } diff --git a/src/world/surfaces.c b/src/world/surfaces.c index 16d7e7a49c..f06f54dedb 100644 --- a/src/world/surfaces.c +++ b/src/world/surfaces.c @@ -8,8 +8,8 @@ void player_surface_spawn_snow_fx(void); void player_surface_spawn_hedges_fx(void); void player_surface_spawn_water_fx(void); -SHIFT_BSS s32 PrevTimeInAir; -SHIFT_BSS s32 LandedTimeInAir; +BSS s32 PrevTimeInAir; +BSS s32 LandedTimeInAir; s32 PrevSurfaceType = SURFACE_TYPE_DEFAULT; diff --git a/src/world_use_item.c b/src/world_use_item.c index 3b0a2b3bc5..f30640509f 100644 --- a/src/world_use_item.c +++ b/src/world_use_item.c @@ -204,5 +204,3 @@ EvtScript EVS_World_UseItem = { Return End }; - -MATCHING_BSS(0x2700); diff --git a/tools/build/configure.py b/tools/build/configure.py index 6002e6d3d6..6400193bde 100755 --- a/tools/build/configure.py +++ b/tools/build/configure.py @@ -328,25 +328,6 @@ def write_ninja_rules( ninja.rule("pm_sbn", command=f"$python {BUILD_TOOLS}/audio/sbn.py $out $asset_stack") - with Path("tools/permuter_settings.toml").open("w") as f: - f.write(f"compiler_command = \"{cc} {CPPFLAGS.replace('$version', 'pal')} {cflags} -DPERMUTER -fforce-addr\"\n") - f.write(f'assembler_command = "{cross}as -EB -march=vr4300 -mtune=vr4300 -Iinclude"\n') - f.write(f'compiler_type = "gcc"\n') - f.write( - """ -[preserve_macros] -"gs?[DS]P.*" = "void" -OVERRIDE_FLAG_CHECK = "int" -OS_K0_TO_PHYSICAL = "int" -"G_.*" = "int" -"TEXEL.*" = "int" -PRIMITIVE = "int" - -[decompme.compilers] -"tools/build/cc/gcc/gcc" = "gcc2.8.1" -""" - ) - def write_ninja_for_tools(ninja: ninja_syntax.Writer): ninja.rule( diff --git a/tools/m2ctx.py b/tools/m2ctx.py deleted file mode 100755 index 6ec2de3f4f..0000000000 --- a/tools/m2ctx.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import os -import sys -import subprocess -import tempfile - -script_dir = os.path.dirname(os.path.realpath(__file__)) -root_dir = os.path.abspath(os.path.join(script_dir, "..")) -src_dir = root_dir + "src/" - -# Project-specific -CPP_FLAGS = [ - "-Iinclude", - "-Isrc", - "-Iassets/pal", - "-Iver/pal/include", - "-Iver/pal/build/include", - "-D_LANGUAGE_C", - "-DF3DEX_GBI_2", - "-D_MIPS_SZLONG=32", - "-DSCRIPT(test...)={}" "-D__attribute__(test...)=", - "-D__asm__(test...)=", - "-ffreestanding", - "-DM2CTX", - "-DVERSION_PAL", -] - - -def import_c_file(in_file) -> str: - in_file = os.path.relpath(in_file, root_dir) - cpp_command = ["gcc", "-E", "-P", "-dM", *CPP_FLAGS, in_file] - cpp_command2 = ["gcc", "-E", "-P", *CPP_FLAGS, in_file] - - with tempfile.NamedTemporaryFile(suffix=".c") as tmp: - stock_macros = subprocess.check_output(["gcc", "-E", "-P", "-dM", tmp.name], cwd=root_dir, encoding="utf-8") - - out_text = "" - try: - out_text += subprocess.check_output(cpp_command, cwd=root_dir, encoding="utf-8") - out_text += subprocess.check_output(cpp_command2, cwd=root_dir, encoding="utf-8") - except subprocess.CalledProcessError: - print( - "Failed to preprocess input file, when running command:\n" + cpp_command, - file=sys.stderr, - ) - sys.exit(1) - - if not out_text: - print("Output is empty - aborting") - sys.exit(1) - - for line in stock_macros.strip().splitlines(): - out_text = out_text.replace(line + "\n", "") - return out_text - - -def main(): - parser = argparse.ArgumentParser(description="""Create a context file which can be used for mips_to_c""") - parser.add_argument( - "c_file", - help="""File from which to create context""", - ) - args = parser.parse_args() - - output = import_c_file(args.c_file) - - with open(os.path.join(root_dir, "ctx.c"), "w", encoding="UTF-8") as f: - f.write(output) - - -if __name__ == "__main__": - main()